Re: new committer: Xiulong Yuan

2022-06-16 Thread Xiulong Yuan
Thanks guys! Appreciate!

Jialin Qiao  于2022年6月17日周五 08:55写道:

> Hi,
>
> The Project Management Committee (PMC) for Apache IoTDB
> has invited Xiulong Yuan to become a committer and we are pleased
> to announce that he has accepted.
>
> Being a committer enables easier contribution to the
> project since there is no need to go via the patch
> submission process. This should enable better productivity.
>
> You could get the write-access of our repository by:
>
> (1) Update your github id in: id.apache.org , also an email (anything to
> your apache email will forward to this email).
> (2) Accept the invitation in github to be a member of the apache group.
> (3) Link your accounts via: git.apache.org (To lighten the third option
> MFA
> Status, you need to download Google Authenticator (Google 身份验证器) in your
> mobile)
> (4)Sign in github by Google Authenticator
> (5) Clone repository with ssh.
>
> Welcome, Xiulong!
>
> Yours,
> The Apache IoTDB PMC
>


Introduction to Apache IoTDB C# Client

2022-05-11 Thread Xiulong Yuan
Hi guys, I am Yuan Xiulong from China. I'm currently pursuing my master's
degree in School of Software, Tsinghua University. In April last year, my
mentor, Professor Liu Lin, suggested that I, Lu Zhan and Zeng Zheng should
develop a C# client for Apache IoTDB so that C# users can easily use Apache
IoTDB. After weeks of research and development, we open-sourced the client
and released it on NuGet
 in May of last
year[1]. Since its release, our C# client has received thousands of
downloads and also received a lot of feedback and improvement suggestions
from our community: such as providing a more user-friendly interface,
providing parallel request sending and processing
,
and supporting session abnormal reconnecting
[2]
(support from Lu Zhan), etc. At the same time, our C# client is also timely
updated to support the latest features of Apache IoTDB, such as aligned
time series insertion, SchemaTemplate manipulation interface support, and
Tablet structure that supports inserting null values
[3]
(support from Lu Zhan), etc. We even had a developer from Lithuania
involved in refactoring the code structure for us. In this blog, we will
give a basic introduction to the key features of our C# client, the
installation guide and examples.
Installation
For easier installation, we have prepared NuGet packages for C# users. You
can directly install the client through .NET CLI. The NuGet package is
linked as follows  [4]. Run
the following command on your command line to complete the installation of
the latest version of the client. At the same time, in order to support
better cross-platform, our client is developed and constructed based on
.NET SDK (supported by Zeng Zheng).

dotnet add package Apache.IoTDB

Features
SessionPool
Similar to the Java client of Apache IoTDB, we also provide an
implementation of SessionPool that supports parallel request sending and
processing. In scenarios where network requests take a long time or are
unstable, SessionPool can provide better performance than a single client.
Regarding SessionPool, we provide detailed implementation details and
performance tests in the document. For details, see the document link

[5] (support from Ma Wenxuan).
ByteBuffer
Data communication between the client and the server requires a lot of
serialization and deserialization operations according to the Apache IoTDB
serialization protocol. Simply using native C# serialization method will
bring severe memory allocation and free overhead. We provide ByteBuffer
which can estimateof the memory size of large tablets and use a smart
algorithm to expand the memory size to improve the performance of
serialization and deserialization during serializing large tablet.
Serialization and deserialization using the implemented ByteBuffer can
improve the performance by 30 times compared with C# native serialization.
See document

[6] for details.
Example
In this section, we provide code examples for the use of the C# client. All
interfaces exposed by the C# client are asynchronous interfaces. You start
with establishing a sessionpool by specifying the IP, port and size of the
pool. The size of the SessionPool represents the number of local
connections established with the server.

var session_pool = new SessionPool(host, port, pool_size);
await session_pool.Open(false);

After setting up the SessionPool, we can use it to create a timeseries:

status = await session_pool.CreateTimeSeries(

"root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE.TEST_CSHARP_CLIENT_TS1",
TSDataType.TEXT,
TSEncoding.PLAIN, Compressor.UNCOMPRESSED);

We can use SessionPool for row-by-row Record insertion. Since SessionPool
can support parallel sending, when sending a large number of Records,
SessionPool will provide better performance than a single client
connection.

var tasks = new List>();
for (var timestamp = 1; timestamp <= fetch_size * processed_size; timestamp++)
{
var rowRecord = new RowRecord(timestamp, values, measures);
var task = session_pool.InsertRecordAsync(
"root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE",
rowRecord);
tasks.Add(task);
}
Task.WaitAll(tasks.ToArray());

We can also use SessionPool to execute SQL statements and display the
results.

var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}",
test_group_name, test_devices[1])