diff --git a/.github/workflows/pre-commit-format.yml b/.github/workflows/pre-commit-format.yml index fe5d151..226cfd3 100644 --- a/.github/workflows/pre-commit-format.yml +++ b/.github/workflows/pre-commit-format.yml @@ -16,7 +16,7 @@ concurrency: jobs: formatting-checks: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 630051f..36009f6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: hooks: - id: dotnet-format name: dotnet format - entry: dotnet format --include + entry: bash -lc "dotnet restore && dotnet format --include --no-restore" language: system pass_filenames: true files: '\.(cs|vb|fs|sln|csproj|fsproj)$' diff --git a/samples/Apache.IoTDB.Samples/Program.cs b/samples/Apache.IoTDB.Samples/Program.cs index 3bdc715..29d3d45 100644 --- a/samples/Apache.IoTDB.Samples/Program.cs +++ b/samples/Apache.IoTDB.Samples/Program.cs @@ -50,9 +50,6 @@ public static async Task Main(string[] args) rootCommand.SetHandler(async (string single, List multi) => { - var utilsTest = new UtilsTest(); - utilsTest.TestParseEndPoint(); - SessionPoolTest sessionPoolTest; if (!string.IsNullOrEmpty(single) && (multi == null || multi.Count == 0)) diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedRecord.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedRecord.cs index cb4d8f6..3126d1f 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedRecord.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedRecord.cs @@ -100,8 +100,8 @@ public async Task TestInsertAlignedStringRecord() var res_cnt = 0; while (res.HasNext()) { - res.Next(); res_cnt++; + res.Next(); } Console.WriteLine(res_cnt + " " + fetchSize * processedSize); System.Diagnostics.Debug.Assert(res_cnt == fetchSize * processedSize); @@ -185,8 +185,10 @@ public async Task TestInsertAlignedRecords() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); + Console.WriteLine(rowRecords); + + System.Diagnostics.Debug.Assert(true); await res.Close(); Console.WriteLine(status); @@ -216,8 +218,8 @@ public async Task TestInsertAlignedRecords() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + Console.WriteLine(res.Next()); } await res.Close(); @@ -265,8 +267,7 @@ public async Task TestInsertAlignedStringRecords() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); @@ -299,7 +300,7 @@ public async Task TestInsertAlignedStringRecords() var res_count = 0; while (res.HasNext()) { - res.Next(); + Console.WriteLine(res.Next()); res_count += 1; } @@ -386,8 +387,7 @@ public async Task TestInsertAlignedRecordsOfOneDevice() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); rowRecords = new List() { }; @@ -409,8 +409,8 @@ public async Task TestInsertAlignedRecordsOfOneDevice() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); @@ -454,8 +454,7 @@ public async Task TestInsertAlignedStringRecordsOfOneDevice() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); // large data test @@ -483,8 +482,8 @@ public async Task TestInsertAlignedStringRecordsOfOneDevice() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedTablet.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedTablet.cs index 77050ad..0229cf8 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedTablet.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedTablet.cs @@ -54,8 +54,7 @@ public async Task TestInsertAlignedTablet() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); // large data test @@ -86,8 +85,8 @@ public async Task TestInsertAlignedTablet() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); @@ -149,8 +148,7 @@ public async Task TestInsertAlignedTablets() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); // large data test var tasks = new List>(); @@ -179,8 +177,8 @@ public async Task TestInsertAlignedTablets() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.Record.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.Record.cs index 4cf68f4..a09d796 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.Record.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.Record.cs @@ -113,8 +113,8 @@ public async Task TestInsertStringRecord() var res_cnt = 0; while (res.HasNext()) { - res.Next(); res_cnt++; + res.Next(); } Console.WriteLine(res_cnt + " " + fetchSize * processedSize); System.Diagnostics.Debug.Assert(res_cnt == fetchSize * processedSize); @@ -149,8 +149,7 @@ public async Task TestInsertStrRecord() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<2"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); @@ -173,8 +172,8 @@ public async Task TestInsertStrRecord() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); @@ -256,8 +255,7 @@ public async Task TestInsertRecords() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); Console.WriteLine(status); @@ -282,13 +280,15 @@ public async Task TestInsertRecords() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); - res.ShowTableNames(); + var record_count = fetchSize * processedSize; + + res.ShowTableNames(); var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); @@ -306,10 +306,10 @@ public async Task TestInsertRecords() break; } - Console.WriteLine($"{testDatabaseName}.{testDevice}.{row.Measurements[0]} {testMeasurements[3]}"); - System.Diagnostics.Debug.Assert($"{testDatabaseName}.{testDevice}.{testMeasurements[3]}" == row.Measurements[0]); - System.Diagnostics.Debug.Assert($"{testDatabaseName}.{testDevice}.{testMeasurements[1]}" == row.Measurements[1]); - System.Diagnostics.Debug.Assert($"{testDatabaseName}.{testDevice}.{testMeasurements[2]}" == row.Measurements[2]); + Console.WriteLine($"{testDatabaseName}.{testDevice}.{row.Measurements[1]} {testMeasurements[3]}"); + System.Diagnostics.Debug.Assert($"{testDatabaseName}.{testDevice}.{testMeasurements[3]}" == row.Measurements[1]); + System.Diagnostics.Debug.Assert($"{testDatabaseName}.{testDevice}.{testMeasurements[1]}" == row.Measurements[2]); + System.Diagnostics.Debug.Assert($"{testDatabaseName}.{testDevice}.{testMeasurements[2]}" == row.Measurements[3]); status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); @@ -351,8 +351,7 @@ public async Task TestInsertStringRecords() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); @@ -386,7 +385,7 @@ public async Task TestInsertStringRecords() var res_count = 0; while (res.HasNext()) { - res.Next(); + Console.WriteLine(res.Next()); res_count += 1; } @@ -468,8 +467,7 @@ public async Task TestInsertRecordsOfOneDevice() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); // large data test @@ -492,8 +490,8 @@ public async Task TestInsertRecordsOfOneDevice() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); @@ -543,8 +541,7 @@ public async Task TestInsertStringRecordsOfOneDevice() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); // large data test @@ -572,8 +569,8 @@ public async Task TestInsertStringRecordsOfOneDevice() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.Tablet.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.Tablet.cs index bf2ae17..b200b20 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.Tablet.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.Tablet.cs @@ -55,8 +55,7 @@ public async Task TestInsertTablet() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); // large data test @@ -86,8 +85,8 @@ public async Task TestInsertTablet() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); @@ -149,8 +148,7 @@ public async Task TestInsertTablets() // System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); // large data test @@ -180,8 +178,8 @@ public async Task TestInsertTablets() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.TestNetwork.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.TestNetwork.cs index 9f2a61c..fffd540 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.TestNetwork.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.TestNetwork.cs @@ -144,8 +144,7 @@ public async Task TestTestInsertRecords() // System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); @@ -174,8 +173,8 @@ public async Task TestTestInsertRecords() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); @@ -214,8 +213,7 @@ public async Task TestTestInsertTablet() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); // large data test @@ -245,8 +243,8 @@ public async Task TestTestInsertTablet() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); @@ -307,8 +305,7 @@ public async Task TestTestInsertTablets() // System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); // large data test @@ -338,8 +335,8 @@ public async Task TestTestInsertTablets() var res_count = 0; while (res.HasNext()) { - res.Next(); res_count += 1; + res.Next(); } await res.Close(); diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.Utils.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.Utils.cs new file mode 100644 index 0000000..94f1e85 --- /dev/null +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.Utils.cs @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +using System; +using System.Collections.Generic; +using Apache.IoTDB.DataStructure; + +namespace Apache.IoTDB.Samples +{ + public partial class SessionPoolTest + { + public static void PrintDataSetByObject(SessionDataSet sessionDataSet) + { + IReadOnlyList columns = sessionDataSet.GetColumnNames(); + + foreach (string columnName in columns) + { + Console.Write($"{columnName}\t"); + } + Console.WriteLine(); + + while (sessionDataSet.HasNext()) + { + for (int i = 0; i < columns.Count; i++) + { + string columnName = columns[i]; + Console.Write(sessionDataSet.GetObject(columnName)); + Console.Write("\t\t"); + } + Console.WriteLine(); + } + } + + public static void PrintDataSetByString(SessionDataSet sessionDataSet) + { + IReadOnlyList columns = sessionDataSet.GetColumnNames(); + + foreach (string columnName in columns) + { + Console.Write($"{columnName}\t"); + } + Console.WriteLine(); + + while (sessionDataSet.HasNext()) + { + for (int i = 0; i < columns.Count; i++) + { + string columnName = columns[i]; + Console.Write(sessionDataSet.GetString(columnName)); + Console.Write("\t\t"); + } + Console.WriteLine(); + } + } + + } +} diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs index 8b27c97..c561c96 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs @@ -224,7 +224,7 @@ public async Task TestGetTimeZone() await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); var time_zone = await session_pool.GetTimeZone(); - System.Diagnostics.Debug.Assert(time_zone == "UTC+08:00"); + System.Diagnostics.Debug.Assert(time_zone == "Asia/Shanghai"); await session_pool.Close(); Console.WriteLine("TestGetTimeZone Passed!"); } @@ -324,8 +324,7 @@ public async Task TestDeleteData() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); var ts_path_lst = new List() @@ -336,8 +335,7 @@ public async Task TestDeleteData() await session_pool.DeleteDataAsync(ts_path_lst, 2, 3); res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); status = await session_pool.DeleteDatabaseAsync(testDatabaseName); @@ -374,8 +372,8 @@ await session_pool.ExecuteNonQueryStatementAsync( "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, hardware) VALUES (7, true,'lz')"); var res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + + SessionPoolTest.PrintDataSetByString(res); await res.Close(); status = await session_pool.DeleteDatabaseAsync(testDatabaseName); @@ -452,33 +450,28 @@ await session_pool.ExecuteNonQueryStatementAsync( "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, hardware) VALUES (7, true,'lz')"); var res = await session_pool.ExecuteQueryStatementAsync("show timeseries root"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); Console.WriteLine("SHOW TIMESERIES ROOT sql passed!"); res = await session_pool.ExecuteQueryStatementAsync("show devices"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); Console.WriteLine("SHOW DEVICES sql passed!"); res = await session_pool.ExecuteQueryStatementAsync($"COUNT TIMESERIES {testDatabaseName}"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); Console.WriteLine("COUNT TIMESERIES root sql Passed"); res = await session_pool.ExecuteQueryStatementAsync("select * from root.ln.wf01 where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); Console.WriteLine("SELECT sql Passed"); res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); - res.ShowTableNames(); - while (res.HasNext()) Console.WriteLine(res.Next()); + SessionPoolTest.PrintDataSetByString(res); await res.Close(); status = await session_pool.DeleteDatabaseAsync(testDatabaseName); @@ -521,8 +514,8 @@ public async Task TestRawDataQuery() var count = 0; while (res.HasNext()) { - var record = res.Next(); count++; + res.Next(); } Console.WriteLine(count + " " + (fetchSize * processedSize - 10)); System.Diagnostics.Debug.Assert(count == fetchSize * processedSize - 10); @@ -568,8 +561,8 @@ public async Task TestLastDataQuery() var count = 0; while (res.HasNext()) { - var record = res.Next(); - Console.WriteLine(record); + Console.WriteLine(count); + res.Next(); count++; } Console.WriteLine(count + " " + (fetchSize * processedSize - 10)); @@ -621,13 +614,17 @@ public async Task TestMultiNodeDataFetch() // fetch data var paths = new List() { string.Format("{0}.{1}", device_id, testMeasurements[0]), string.Format("{0}.{1}", device_id, testMeasurements[1]) }; var res = await session_pool.ExecuteQueryStatementAsync("select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); - res.ShowTableNames(); - var count = 0; - while (res.HasNext()) + + IReadOnlyList columns = res.GetColumnNames(); + foreach (string columnName in columns) { - var record = res.Next(); - count++; + Console.Write($"{columnName}\t"); } + Console.WriteLine(); + + var count = 0; + while (res.HasNext()) count++; + Console.WriteLine(count + " " + (fetchSize * processedSize * 4 + 783)); System.Diagnostics.Debug.Assert(count == fetchSize * processedSize * 4 + 783); await res.Close(); diff --git a/samples/Apache.IoTDB.Samples/UtilsTest.cs b/samples/Apache.IoTDB.Samples/UtilsTest.cs deleted file mode 100644 index 0670cd6..0000000 --- a/samples/Apache.IoTDB.Samples/UtilsTest.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using System; -using System.Diagnostics; - -namespace Apache.IoTDB.Samples -{ - public class UtilsTest - { - private Utils _utilFunctions = new Utils(); - public void Test() - { - TestParseEndPoint(); - } - - public void TestParseEndPoint() - { - TestIPv4Address(); - TestIPv6Address(); - TestInvalidInputs(); - } - - private void TestIPv4Address() - { - string correctEndpointIPv4 = "192.168.1.1:8080"; - var endpoint = _utilFunctions.ParseTEndPointIpv4AndIpv6Url(correctEndpointIPv4); - Debug.Assert(endpoint.Ip == "192.168.1.1", "IPv4 address mismatch."); - Debug.Assert(endpoint.Port == 8080, "IPv4 port mismatch."); - Console.WriteLine("TestIPv4Address passed."); - } - - private void TestIPv6Address() - { - string correctEndpointIPv6 = "[2001:db8:85a3::8a2e:370:7334]:443"; - var endpoint = _utilFunctions.ParseTEndPointIpv4AndIpv6Url(correctEndpointIPv6); - Debug.Assert(endpoint.Ip == "2001:db8:85a3::8a2e:370:7334", "IPv6 address mismatch."); - Debug.Assert(endpoint.Port == 443, "IPv6 port mismatch."); - Console.WriteLine("TestIPv6Address passed."); - } - - private void TestInvalidInputs() - { - string noPort = "192.168.1.1"; - var endpointNoPort = _utilFunctions.ParseTEndPointIpv4AndIpv6Url(noPort); - Debug.Assert(string.IsNullOrEmpty(endpointNoPort.Ip) && endpointNoPort.Port == 0, "Failed to handle missing port."); - - string emptyInput = ""; - var endpointEmpty = _utilFunctions.ParseTEndPointIpv4AndIpv6Url(emptyInput); - Debug.Assert(string.IsNullOrEmpty(endpointEmpty.Ip) && endpointEmpty.Port == 0, "Failed to handle empty input."); - - string invalidFormat = "192.168.1.1:port"; - try - { - var endpointInvalid = _utilFunctions.ParseTEndPointIpv4AndIpv6Url(invalidFormat); - Debug.Fail("Should have thrown an exception due to invalid port."); - } - catch (FormatException) - { - // Expected exception - } - Console.WriteLine("TestInvalidInputs passed."); - } - } -} diff --git a/src/Apache.IoTDB.Data/IoTDBConnectionStringBuilder.cs b/src/Apache.IoTDB.Data/IoTDBConnectionStringBuilder.cs index c2cac87..74280c9 100644 --- a/src/Apache.IoTDB.Data/IoTDBConnectionStringBuilder.cs +++ b/src/Apache.IoTDB.Data/IoTDBConnectionStringBuilder.cs @@ -66,7 +66,7 @@ private enum Keywords private string _password = "root"; private bool _enableRpcCompression = false; private int _fetchSize = 1800; - private string _zoneId = "UTC+08:00"; + private string _zoneId = "Asia/Shanghai"; private int _port = 6667; private int _poolSize = 8; private int _timeOut = 10000; @@ -413,7 +413,7 @@ private void Reset(Keywords index) _poolSize = 8; return; case Keywords.ZoneId: - _zoneId = "UTC+08:00"; + _zoneId = "Asia/Shanghai"; return; case Keywords.TimeOut: _timeOut = 10000;//10sec. diff --git a/src/Apache.IoTDB.Data/IoTDBDataReader.cs b/src/Apache.IoTDB.Data/IoTDBDataReader.cs index 156844e..8f96841 100644 --- a/src/Apache.IoTDB.Data/IoTDBDataReader.cs +++ b/src/Apache.IoTDB.Data/IoTDBDataReader.cs @@ -41,7 +41,7 @@ public class IoTDBDataReader : DbDataReader private bool _hasRows; private readonly int _recordsAffected; private bool _closed; - private readonly List _metas; + private IReadOnlyList _metas; private bool _closeConnection; private int _fieldCount; @@ -55,11 +55,12 @@ internal IoTDBDataReader(IoTDBCommand IoTDBCommand, SessionDataSet dataSet, bool _IoTDB = IoTDBCommand.Connection._IoTDB; _command = IoTDBCommand; _closeConnection = closeConnection; - _fieldCount = dataSet.ColumnNames.Count; - _hasRows = dataSet.RowCount > 0; - _recordsAffected = dataSet.RowCount; + _fieldCount = dataSet.GetColumnNames().Count; + _hasRows = dataSet.RowCount() > 0; + _recordsAffected = dataSet.RowCount(); + _closed = _closeConnection; - _metas = dataSet.ColumnNames; + _metas = dataSet.GetColumnNames(); _dataSet = dataSet; } @@ -456,7 +457,7 @@ public override DataTable GetSchemaTable() { if (_dataSet.HasNext()) { - rowdata = _dataSet.GetRow(); + rowdata = _dataSet.Next(); } var schemaTable = new DataTable("SchemaTable"); if (_metas != null && rowdata != null) diff --git a/src/Apache.IoTDB/Client.cs b/src/Apache.IoTDB/Client.cs index 03238d2..943cfa1 100644 --- a/src/Apache.IoTDB/Client.cs +++ b/src/Apache.IoTDB/Client.cs @@ -37,5 +37,23 @@ public Client(IClientRPCService.Client client, long sessionId, long statementId, Transport = transport; EndPoint = endpoint; } + + static public TSDataType GetDataTypeByStr(string typeStr) + { + return typeStr switch + { + "BOOLEAN" => TSDataType.BOOLEAN, + "INT32" => TSDataType.INT32, + "INT64" => TSDataType.INT64, + "FLOAT" => TSDataType.FLOAT, + "DOUBLE" => TSDataType.DOUBLE, + "TEXT" => TSDataType.TEXT, + "STRING" => TSDataType.STRING, + "BLOB" => TSDataType.BLOB, + "TIMESTAMP" => TSDataType.TIMESTAMP, + "DATE" => TSDataType.DATE, + _ => TSDataType.NONE + }; + } } } diff --git a/src/Apache.IoTDB/DataStructure/ByteBuffer.cs b/src/Apache.IoTDB/DataStructure/ByteBuffer.cs index a3e1823..a66a7ac 100644 --- a/src/Apache.IoTDB/DataStructure/ByteBuffer.cs +++ b/src/Apache.IoTDB/DataStructure/ByteBuffer.cs @@ -146,6 +146,16 @@ public byte[] GetBuffer() return _buffer[.._writePos]; } + public byte[] GetBytesByLength(int length) + { + if (_readPos + length > _buffer.Length) + throw new ArgumentOutOfRangeException(nameof(length), + $"Requested length ({length}) with current read position ({_readPos}) exceeds buffer size ({_buffer.Length})."); + var strBuff = _buffer[_readPos..(_readPos + length)]; + _readPos += length; + return strBuff; + } + private void ExtendBuffer(int spaceNeed) { if (_writePos + spaceNeed >= _totalLength) diff --git a/src/Apache.IoTDB/DataStructure/Column.cs b/src/Apache.IoTDB/DataStructure/Column.cs new file mode 100644 index 0000000..52d816f --- /dev/null +++ b/src/Apache.IoTDB/DataStructure/Column.cs @@ -0,0 +1,324 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +using System; +using System.Linq; + +namespace Apache.IoTDB.DataStructure +{ + public enum ColumnEncoding : byte + { + ByteArray, + Int32Array, + Int64Array, + BinaryArray, + Rle + } + + public class Binary + { + public byte[] Data { get; } + + public Binary(byte[] data) + { + Data = data; + } + } + + public interface Column + { + TSDataType GetDataType(); + ColumnEncoding GetEncoding(); + bool GetBoolean(int position); + int GetInt(int position); + long GetLong(int position); + float GetFloat(int position); + double GetDouble(int position); + Binary GetBinary(int position); + object GetObject(int position); + + bool[] GetBooleans(); + int[] GetInts(); + long[] GetLongs(); + float[] GetFloats(); + double[] GetDoubles(); + Binary[] GetBinaries(); + object[] GetObjects(); + + bool MayHaveNull(); + bool IsNull(int position); + bool[] GetNulls(); + + int GetPositionCount(); + } + + public abstract class BaseColumn : Column + { + public virtual TSDataType GetDataType() => throw new NotSupportedException(); + public virtual ColumnEncoding GetEncoding() => throw new NotSupportedException(); + public virtual bool GetBoolean(int position) => throw new NotSupportedException("GetBoolean not supported"); + public virtual int GetInt(int position) => throw new NotSupportedException("GetInt not supported"); + public virtual long GetLong(int position) => throw new NotSupportedException("GetLong not supported"); + public virtual float GetFloat(int position) => throw new NotSupportedException("GetFloat not supported"); + public virtual double GetDouble(int position) => throw new NotSupportedException("GetDouble not supported"); + public virtual Binary GetBinary(int position) => throw new NotSupportedException("GetBinary not supported"); + public virtual object GetObject(int position) => throw new NotSupportedException("GetObject not supported"); + + public virtual bool[] GetBooleans() => throw new NotSupportedException("GetBooleans not supported"); + public virtual int[] GetInts() => throw new NotSupportedException("GetInts not supported"); + public virtual long[] GetLongs() => throw new NotSupportedException("GetLongs not supported"); + public virtual float[] GetFloats() => throw new NotSupportedException("GetFloats not supported"); + public virtual double[] GetDoubles() => throw new NotSupportedException("GetDoubles not supported"); + public virtual Binary[] GetBinaries() => throw new NotSupportedException("GetBinaries not supported"); + public virtual object[] GetObjects() => throw new NotSupportedException("GetObjects not supported"); + + public virtual bool MayHaveNull() => false; + public virtual bool IsNull(int position) => false; + public virtual bool[] GetNulls() => new bool[GetPositionCount()]; + public abstract int GetPositionCount(); + } + + public abstract class PrimitiveColumn : BaseColumn + { + protected readonly T[] _values; + protected readonly int _arrayOffset; + protected readonly int _positionCount; + protected readonly bool[] _valueIsNull; + + private readonly TSDataType _dataType; + private readonly ColumnEncoding _encoding; + + protected PrimitiveColumn( + TSDataType dataType, + ColumnEncoding encoding, + int arrayOffset, + int positionCount, + bool[] valueIsNull, + T[] values) + { + if (arrayOffset < 0) + throw new ArgumentException("arrayOffset is negative"); + if (positionCount < 0) + throw new ArgumentException("positionCount is negative"); + if (values == null || values.Length - arrayOffset < positionCount) + throw new ArgumentException("values array is too short"); + if (valueIsNull != null && valueIsNull.Length - arrayOffset < positionCount) + throw new ArgumentException("isNull array is too short"); + + _dataType = dataType; + _encoding = encoding; + _arrayOffset = arrayOffset; + _positionCount = positionCount; + _valueIsNull = valueIsNull; + _values = values; + } + + public override TSDataType GetDataType() => _dataType; + public override ColumnEncoding GetEncoding() => _encoding; + + public override bool MayHaveNull() => _valueIsNull != null; + public override bool IsNull(int position) => _valueIsNull?[position + _arrayOffset] ?? false; + public override bool[] GetNulls() + { + if (_valueIsNull == null) + return new bool[_positionCount]; + + return _valueIsNull.Skip(_arrayOffset).Take(_positionCount).ToArray(); + } + + public override int GetPositionCount() => _positionCount; + } + + public class TimeColumn : PrimitiveColumn + { + public TimeColumn(int arrayOffset, int positionCount, long[] values) + : base( + dataType: TSDataType.INT64, + encoding: ColumnEncoding.Int64Array, + arrayOffset: arrayOffset, + positionCount: positionCount, + valueIsNull: null, + values: values) + { } + + public override long GetLong(int position) => _values[position + _arrayOffset]; + public override long[] GetLongs() => _values.Skip(_arrayOffset).Take(_positionCount).ToArray(); + public override object GetObject(int position) => GetLong(position); + public override object[] GetObjects() => GetLongs().Cast().ToArray(); + + public long GetStartTime() => _values[_arrayOffset]; + public long GetEndTime() => _values[_arrayOffset + _positionCount - 1]; + public long[] GetTimes() => _values.Skip(_arrayOffset).Take(_positionCount).ToArray(); + } + + public class BinaryColumn : PrimitiveColumn + { + public BinaryColumn(int arrayOffset, int positionCount, bool[] valueIsNull, Binary[] values) + : base( + TSDataType.TEXT, + ColumnEncoding.BinaryArray, + arrayOffset: arrayOffset, + positionCount: positionCount, + valueIsNull: valueIsNull, + values: values) + { } + + public override Binary GetBinary(int position) => _values[position + _arrayOffset]; + public override Binary[] GetBinaries() => _values.Skip(_arrayOffset).Take(_positionCount).ToArray(); + public override object GetObject(int position) => GetBinary(position); + public override object[] GetObjects() => GetBinaries().Cast().ToArray(); + } + + public class IntColumn : PrimitiveColumn + { + public IntColumn(int arrayOffset, int positionCount, bool[] valueIsNull, int[] values) + : base( + TSDataType.INT32, + ColumnEncoding.Int32Array, + arrayOffset: arrayOffset, + positionCount: positionCount, + valueIsNull: valueIsNull, + values: values) + { } + + public override int GetInt(int position) => _values[position + _arrayOffset]; + public override int[] GetInts() => _values.Skip(_arrayOffset).Take(_positionCount).ToArray(); + public override object GetObject(int position) => GetInt(position); + public override object[] GetObjects() => GetInts().Cast().ToArray(); + } + + public class FloatColumn : PrimitiveColumn + { + public FloatColumn(int arrayOffset, int positionCount, bool[] valueIsNull, float[] values) + : base( + TSDataType.FLOAT, + ColumnEncoding.Int32Array, + arrayOffset: arrayOffset, + positionCount: positionCount, + valueIsNull: valueIsNull, + values: values) + { } + + public override float GetFloat(int position) => _values[position + _arrayOffset]; + public override float[] GetFloats() => _values.Skip(_arrayOffset).Take(_positionCount).ToArray(); + public override object GetObject(int position) => GetFloat(position); + public override object[] GetObjects() => GetFloats().Cast().ToArray(); + } + + public class LongColumn : PrimitiveColumn + { + public LongColumn(int arrayOffset, int positionCount, bool[] valueIsNull, long[] values) + : base( + TSDataType.INT64, + ColumnEncoding.Int64Array, + arrayOffset: arrayOffset, + positionCount: positionCount, + valueIsNull: valueIsNull, + values: values) + { } + + public override long GetLong(int position) => _values[position + _arrayOffset]; + public override long[] GetLongs() => _values.Skip(_arrayOffset).Take(_positionCount).ToArray(); + public override object GetObject(int position) => GetLong(position); + public override object[] GetObjects() => GetLongs().Cast().ToArray(); + } + + public class DoubleColumn : PrimitiveColumn + { + public DoubleColumn(int arrayOffset, int positionCount, bool[] valueIsNull, double[] values) + : base( + TSDataType.DOUBLE, + ColumnEncoding.Int64Array, + arrayOffset: arrayOffset, + positionCount: positionCount, + valueIsNull: valueIsNull, + values: values) + { } + + public override double GetDouble(int position) => _values[position + _arrayOffset]; + public override double[] GetDoubles() => _values.Skip(_arrayOffset).Take(_positionCount).ToArray(); + public override object GetObject(int position) => GetDouble(position); + public override object[] GetObjects() => GetDoubles().Cast().ToArray(); + } + + public class BooleanColumn : PrimitiveColumn + { + public BooleanColumn(int arrayOffset, int positionCount, bool[] valueIsNull, bool[] values) + : base( + TSDataType.BOOLEAN, + ColumnEncoding.ByteArray, + arrayOffset: arrayOffset, + positionCount: positionCount, + valueIsNull: valueIsNull, + values: values) + { } + + public override bool GetBoolean(int position) => _values[position + _arrayOffset]; + public override bool[] GetBooleans() => _values.Skip(_arrayOffset).Take(_positionCount).ToArray(); + public override object GetObject(int position) => GetBoolean(position); + public override object[] GetObjects() => GetBooleans().Cast().ToArray(); + } + + public class RunLengthEncodedColumn : BaseColumn + { + private readonly Column _value; + private readonly int _positionCount; + + public RunLengthEncodedColumn(Column value, int positionCount) + { + if (value == null) + throw new ArgumentNullException(nameof(value)); + if (value.GetPositionCount() != 1) + throw new ArgumentException("Expected value to contain a single position"); + if (positionCount < 0) + throw new ArgumentException("positionCount is negative"); + + // Unwrap nested RLE columns + _value = value is RunLengthEncodedColumn rle ? rle.Value : value; + _positionCount = positionCount; + } + + public Column Value => _value; + + public override TSDataType GetDataType() => _value.GetDataType(); + public override ColumnEncoding GetEncoding() => ColumnEncoding.Rle; + + public override bool GetBoolean(int position) => _value.GetBoolean(0); + public override int GetInt(int position) => _value.GetInt(0); + public override long GetLong(int position) => _value.GetLong(0); + public override float GetFloat(int position) => _value.GetFloat(0); + public override double GetDouble(int position) => _value.GetDouble(0); + public override Binary GetBinary(int position) => _value.GetBinary(0); + public override object GetObject(int position) => _value.GetObject(0); + + public override bool[] GetBooleans() => Enumerable.Repeat(_value.GetBoolean(0), _positionCount).ToArray(); + public override int[] GetInts() => Enumerable.Repeat(_value.GetInt(0), _positionCount).ToArray(); + public override long[] GetLongs() => Enumerable.Repeat(_value.GetLong(0), _positionCount).ToArray(); + public override float[] GetFloats() => Enumerable.Repeat(_value.GetFloat(0), _positionCount).ToArray(); + public override double[] GetDoubles() => Enumerable.Repeat(_value.GetDouble(0), _positionCount).ToArray(); + public override Binary[] GetBinaries() => Enumerable.Repeat(_value.GetBinary(0), _positionCount).ToArray(); + public override object[] GetObjects() => Enumerable.Repeat(_value.GetObject(0), _positionCount).ToArray(); + + public override bool MayHaveNull() => _value.MayHaveNull(); + public override bool IsNull(int position) => _value.IsNull(0); + public override bool[] GetNulls() => Enumerable.Repeat(_value.IsNull(0), _positionCount).ToArray(); + + public override int GetPositionCount() => _positionCount; + } +} diff --git a/src/Apache.IoTDB/DataStructure/ColumnDecoder.cs b/src/Apache.IoTDB/DataStructure/ColumnDecoder.cs new file mode 100644 index 0000000..f1267b5 --- /dev/null +++ b/src/Apache.IoTDB/DataStructure/ColumnDecoder.cs @@ -0,0 +1,220 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Apache.IoTDB.DataStructure +{ + public interface ColumnDecoder + { + Column ReadColumn(ByteBuffer reader, TSDataType dataType, int positionCount); + } + + public class BaseColumnDecoder + { + + private static Dictionary decoders = new Dictionary + { + { ColumnEncoding.Int32Array, new Int32ArrayColumnDecoder() }, + { ColumnEncoding.Int64Array, new Int64ArrayColumnDecoder() }, + { ColumnEncoding.ByteArray, new ByteArrayColumnDecoder() }, + { ColumnEncoding.BinaryArray, new BinaryArrayColumnDecoder() }, + { ColumnEncoding.Rle, new RunLengthColumnDecoder() } + }; + + public static ColumnDecoder GetDecoder(ColumnEncoding encoding) + { + if (decoders.TryGetValue(encoding, out var decoder)) + return decoder; + throw new ArgumentException($"Unsupported encoding: {encoding}"); + } + + public static ColumnEncoding DeserializeColumnEncoding(ByteBuffer reader) + { + return (ColumnEncoding)reader.GetByte(); + } + } + + public static class ColumnDeserializer + { + public static bool[] DeserializeNullIndicators(ByteBuffer reader, int positionCount) + { + byte b = reader.GetByte(); + bool mayHaveNull = b != 0; + if (!mayHaveNull) + return null; + return DeserializeBooleanArray(reader, positionCount); + } + + public static bool[] DeserializeBooleanArray(ByteBuffer reader, int size) + { + int packedSize = (size + 7) / 8; + byte[] packedBytes = reader.GetBytesByLength(packedSize); + if (packedBytes.Length < packedSize) + throw new InvalidDataException( + $"Boolean array decoding failed: expected {packedSize} bytes for {size} bits, but only received {packedBytes.Length} bytes from buffer." + ); + bool[] output = new bool[size]; + int currentByte = 0; + int fullGroups = size & ~0b111; + + for (int pos = 0; pos < fullGroups; pos += 8) + { + byte b = packedBytes[currentByte++]; + output[pos + 0] = (b & 0b10000000) != 0; + output[pos + 1] = (b & 0b01000000) != 0; + output[pos + 2] = (b & 0b00100000) != 0; + output[pos + 3] = (b & 0b00010000) != 0; + output[pos + 4] = (b & 0b00001000) != 0; + output[pos + 5] = (b & 0b00000100) != 0; + output[pos + 6] = (b & 0b00000010) != 0; + output[pos + 7] = (b & 0b00000001) != 0; + } + + if (size % 8 != 0) + { + byte b = packedBytes[packedSize - 1]; + byte mask = 0b10000000; + for (int pos = fullGroups; pos < size; pos++) + { + output[pos] = (b & mask) != 0; + mask >>= 1; + } + } + + return output; + } + } + + public class Int32ArrayColumnDecoder : ColumnDecoder + { + public Column ReadColumn(ByteBuffer reader, TSDataType dataType, int positionCount) + { + bool[] nullIndicators = ColumnDeserializer.DeserializeNullIndicators(reader, positionCount); + + switch (dataType) + { + case TSDataType.INT32: + case TSDataType.DATE: + int[] intValues = new int[positionCount]; + for (int i = 0; i < positionCount; i++) + { + if (nullIndicators != null && nullIndicators[i]) + continue; + intValues[i] = reader.GetInt(); + } + return new IntColumn(0, positionCount, nullIndicators, intValues); + case TSDataType.FLOAT: + float[] floatValues = new float[positionCount]; + for (int i = 0; i < positionCount; i++) + { + if (nullIndicators != null && nullIndicators[i]) + continue; + floatValues[i] = reader.GetFloat(); + } + return new FloatColumn(0, positionCount, nullIndicators, floatValues); + default: + throw new ArgumentException($"Invalid data type: {dataType}"); + } + } + } + + public class Int64ArrayColumnDecoder : ColumnDecoder + { + public Column ReadColumn(ByteBuffer reader, TSDataType dataType, int positionCount) + { + bool[] nullIndicators = ColumnDeserializer.DeserializeNullIndicators(reader, positionCount); + + switch (dataType) + { + case TSDataType.INT64: + case TSDataType.TIMESTAMP: + long[] longValues = new long[positionCount]; + for (int i = 0; i < positionCount; i++) + { + if (nullIndicators != null && nullIndicators[i]) + continue; + longValues[i] = reader.GetLong(); + } + return new LongColumn(0, positionCount, nullIndicators, longValues); + case TSDataType.DOUBLE: + double[] doubleValues = new double[positionCount]; + for (int i = 0; i < positionCount; i++) + { + if (nullIndicators != null && nullIndicators[i]) + continue; + doubleValues[i] = reader.GetDouble(); + } + return new DoubleColumn(0, positionCount, nullIndicators, doubleValues); + default: + throw new ArgumentException($"Invalid data type: {dataType}"); + } + } + } + + public class ByteArrayColumnDecoder : ColumnDecoder + { + public Column ReadColumn(ByteBuffer reader, TSDataType dataType, int positionCount) + { + if (dataType != TSDataType.BOOLEAN) + throw new ArgumentException($"Invalid data type: {dataType}"); + + bool[] nullIndicators = ColumnDeserializer.DeserializeNullIndicators(reader, positionCount); + bool[] values = ColumnDeserializer.DeserializeBooleanArray(reader, positionCount); + return new BooleanColumn(0, positionCount, nullIndicators, values); + } + } + + public class BinaryArrayColumnDecoder : ColumnDecoder + { + public Column ReadColumn(ByteBuffer reader, TSDataType dataType, int positionCount) + { + if (dataType != TSDataType.TEXT) + throw new ArgumentException($"Invalid data type: {dataType}"); + + bool[] nullIndicators = ColumnDeserializer.DeserializeNullIndicators(reader, positionCount); + Binary[] values = new Binary[positionCount]; + + for (int i = 0; i < positionCount; i++) + { + if (nullIndicators != null && nullIndicators[i]) + continue; + int length = reader.GetInt(); + byte[] value = reader.GetBytesByLength(length); + values[i] = new Binary(value); + } + + return new BinaryColumn(0, positionCount, nullIndicators, values); + } + } + + public class RunLengthColumnDecoder : ColumnDecoder + { + public Column ReadColumn(ByteBuffer reader, TSDataType dataType, int positionCount) + { + ColumnEncoding encoding = BaseColumnDecoder.DeserializeColumnEncoding(reader); + ColumnDecoder decoder = BaseColumnDecoder.GetDecoder(encoding); + Column column = decoder.ReadColumn(reader, dataType, 1); + return new RunLengthEncodedColumn(column, positionCount); + } + } +} diff --git a/src/Apache.IoTDB/DataStructure/RpcDataSet.cs b/src/Apache.IoTDB/DataStructure/RpcDataSet.cs new file mode 100644 index 0000000..5eeed48 --- /dev/null +++ b/src/Apache.IoTDB/DataStructure/RpcDataSet.cs @@ -0,0 +1,846 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Thrift; + +namespace Apache.IoTDB.DataStructure +{ + public class RpcDataSet : System.IDisposable + { + private const string TimestampColumnName = "Time"; + private const string DefaultTimeFormat = "yyyy-MM-dd HH:mm:ss.fff"; + + private readonly string _sql; + private bool _isClosed; + private readonly Client _client; + public readonly List _columnNameList = new List(); + public readonly List _columnTypeList = new List(); + private readonly Dictionary _columnOrdinalMap = new Dictionary(); + private readonly Dictionary _columnName2TsBlockColumnIndexMap = new Dictionary(); + private readonly List _columnIndex2TsBlockColumnIndexList = new List(); + private readonly TSDataType[] _dataTypeForTsBlockColumn; + private int _fetchSize; + private long _timeout; + private bool _hasCachedRecord; + private bool _lastReadWasNull; + + private int _columnSize; + private long _sessionId; + private long _queryId; + private long _statementId; + private long _time; + private bool _ignoreTimestamp; + private bool _moreData; + + private List _queryResult; + private TsBlock _curTsBlock; + private int _queryResultSize; + private int _queryResultIndex; + public int _tsBlockSize; + private int _tsBlockIndex; + private TimeZoneInfo _zoneId; + private int _timeFactor; + private string _timePrecision; + private bool disposedValue; + + public RpcDataSet(string sql, List columnNameList, List columnTypeList, + Dictionary columnNameIndex, bool ignoreTimestamp, bool moreData, long queryId, + long statementId, Client client, long sessionId, List queryResult, int fetchSize, + long timeout, string zoneId, List columnIndex2TsBlockColumnIndexList) + { + _sql = sql; + _client = client; + _fetchSize = fetchSize; + _timeout = timeout; + _moreData = moreData; + _columnSize = columnNameList.Count; + _sessionId = sessionId; + _queryId = queryId; + _statementId = statementId; + _ignoreTimestamp = ignoreTimestamp; + + int columnStartIndex = 1; + int resultSetColumnSize = columnNameList.Count; + int startIndexForColumnIndex2TsBlockColumnIndexList = 0; + + if (!_ignoreTimestamp) + { + _columnNameList.Add(TimestampColumnName); + _columnTypeList.Add("INT64"); + _columnName2TsBlockColumnIndexMap[TimestampColumnName] = -1; + _columnOrdinalMap[TimestampColumnName] = 1; + + if (columnIndex2TsBlockColumnIndexList != null) + { + columnIndex2TsBlockColumnIndexList.Insert(0, -1); + startIndexForColumnIndex2TsBlockColumnIndexList = 1; + } + columnStartIndex++; + resultSetColumnSize++; + } + + _columnNameList.AddRange(columnNameList); + _columnTypeList.AddRange(columnTypeList); + + if (columnIndex2TsBlockColumnIndexList == null) + { + columnIndex2TsBlockColumnIndexList = new List(); + if (!_ignoreTimestamp) + { + startIndexForColumnIndex2TsBlockColumnIndexList = 1; + columnIndex2TsBlockColumnIndexList.Add(-1); + } + for (int i = 0; i < columnNameList.Count; i++) + columnIndex2TsBlockColumnIndexList.Add(i); + } + + int tsBlockColumnSize = columnIndex2TsBlockColumnIndexList.Max() + 1; + _dataTypeForTsBlockColumn = new TSDataType[tsBlockColumnSize]; + + for (int i = 0; i < columnNameList.Count; i++) + { + int tsBlockColumnIndex = columnIndex2TsBlockColumnIndexList[startIndexForColumnIndex2TsBlockColumnIndexList + i]; + if (tsBlockColumnIndex != -1) + { + TSDataType columnType = Client.GetDataTypeByStr(columnTypeList[i]); + _dataTypeForTsBlockColumn[tsBlockColumnIndex] = columnType; + } + + if (!_columnName2TsBlockColumnIndexMap.ContainsKey(columnNameList[i])) + { + _columnOrdinalMap[columnNameList[i]] = i + columnStartIndex; + _columnName2TsBlockColumnIndexMap[columnNameList[i]] = tsBlockColumnIndex; + } + } + + _queryResult = queryResult; + _queryResultSize = queryResult?.Count ?? 0; + _queryResultIndex = 0; + _tsBlockSize = 0; + _tsBlockIndex = -1; + + _zoneId = TimeZoneInfo.FindSystemTimeZoneById(zoneId); + + if (columnIndex2TsBlockColumnIndexList.Count != _columnNameList.Count) + throw new ArgumentException("Column index list size mismatch"); + + _columnIndex2TsBlockColumnIndexList = columnIndex2TsBlockColumnIndexList; + } + + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) + { + try + { + this.Close().Wait(); + } + catch + { + } + } + disposedValue = true; + } + } + + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + + public async Task Close() + { + if (_isClosed) return; + + var closeRequest = new TSCloseOperationReq + { + SessionId = _sessionId, + StatementId = _statementId, + QueryId = _queryId + }; + + try + { + var status = await _client.ServiceClient.closeOperationAsync(closeRequest); + } + catch (TException e) + { + throw new TException("Operation Handle Close Failed", e); + } + _isClosed = true; + } + + public bool Next() + { + if (HasCachedBlock()) + { + _lastReadWasNull = false; + ConstructOneRow(); + return true; + } + + if (HasCachedByteBuffer()) + { + ConstructOneTsBlock(); + ConstructOneRow(); + return true; + } + + if (_moreData) + { + bool hasResultSet = FetchResults(); + if (hasResultSet && HasCachedByteBuffer()) + { + ConstructOneTsBlock(); + ConstructOneRow(); + return true; + } + } + + Close().Wait(); + return false; + } + + private bool FetchResults() + { + if (_isClosed) + throw new InvalidOperationException("Dataset closed"); + + var req = new TSFetchResultsReq + { + SessionId = _sessionId, + Statement = _sql, + FetchSize = _fetchSize, + QueryId = _queryId, + IsAlign = true, + Timeout = _timeout + }; + + try + { + var task = _client.ServiceClient.fetchResultsV2Async(req); + var resp = task.ConfigureAwait(false).GetAwaiter().GetResult(); + + if (!resp.HasResultSet) + { + Close().Wait(); + return false; + } + + // return _queryResult != null && _queryResultIndex < _queryResultSize; + _queryResult = resp.QueryResult; + _queryResultIndex = 0; + _queryResultSize = _queryResult?.Count ?? 0; + _tsBlockSize = 0; + _tsBlockIndex = -1; + return true; + } + catch (TException e) + { + throw new TException("Cannot fetch result from server, because of network connection", e); + } + } + + private bool HasCachedBlock() + { + return _curTsBlock != null && _tsBlockIndex < _tsBlockSize - 1; + } + + public bool HasCachedByteBuffer() + { + return _queryResult != null && _queryResultIndex < _queryResultSize; + } + + private void ConstructOneRow() + { + _tsBlockIndex++; + _hasCachedRecord = true; + _time = _curTsBlock.GetTimeByIndex(_tsBlockIndex); + } + + private void ConstructOneTsBlock() + { + _lastReadWasNull = false; + byte[] curTsBlockBytes = _queryResult[_queryResultIndex]; + + _queryResultIndex++; + _curTsBlock = TsBlock.Deserialize(new ByteBuffer(curTsBlockBytes)); + _tsBlockIndex = -1; + _tsBlockSize = _curTsBlock.PositionCount; + } + + public bool IsIgnoredTimestamp => _ignoreTimestamp; + + public bool IsNullByIndex(int columnIndex) + { + int index = GetTsBlockColumnIndexForColumnIndex(columnIndex); + return IsNull(index, _tsBlockIndex); + } + + public bool IsNullByColumnName(string columnName) + { + int index = GetTsBlockColumnIndexForColumnName(columnName); + return IsNull(index, _tsBlockIndex); + } + + private bool IsNull(int index, int rowNum) + { + return index >= 0 && _curTsBlock.GetColumn(index).IsNull(rowNum); + } + + public bool GetBooleanByIndex(int columnIndex) + { + int index = GetTsBlockColumnIndexForColumnIndex(columnIndex); + return GetBooleanByTsBlockColumnIndex(index); + } + + public bool GetBoolean(string columnName) + { + int index = GetTsBlockColumnIndexForColumnName(columnName); + return GetBooleanByTsBlockColumnIndex(index); + } + + private bool GetBooleanByTsBlockColumnIndex(int tsBlockColumnIndex) + { + CheckRecord(); + if (!IsNull(tsBlockColumnIndex, _tsBlockIndex)) + { + _lastReadWasNull = false; + return _curTsBlock.GetColumn(tsBlockColumnIndex).GetBoolean(_tsBlockIndex); + } + else + { + _lastReadWasNull = true; + return false; + } + } + + public double GetDoubleByIndex(int columnIndex) + { + int index = GetTsBlockColumnIndexForColumnIndex(columnIndex); + return GetDoubleByTsBlockColumnIndex(index); + } + + public double GetDouble(string columnName) + { + int index = GetTsBlockColumnIndexForColumnName(columnName); + return GetDoubleByTsBlockColumnIndex(index); + } + + private double GetDoubleByTsBlockColumnIndex(int tsBlockColumnIndex) + { + CheckRecord(); + if (!IsNull(tsBlockColumnIndex, _tsBlockIndex)) + { + _lastReadWasNull = false; + return _curTsBlock.GetColumn(tsBlockColumnIndex).GetDouble(_tsBlockIndex); + } + else + { + _lastReadWasNull = true; + return 0.0; + } + } + + public float GetFloatByIndex(int columnIndex) + { + int index = GetTsBlockColumnIndexForColumnIndex(columnIndex); + return GetFloatByTsBlockColumnIndex(index); + } + + public float GetFloat(string columnName) + { + int index = GetTsBlockColumnIndexForColumnName(columnName); + return GetFloatByTsBlockColumnIndex(index); + } + + private float GetFloatByTsBlockColumnIndex(int tsBlockColumnIndex) + { + CheckRecord(); + if (!IsNull(tsBlockColumnIndex, _tsBlockIndex)) + { + _lastReadWasNull = false; + return _curTsBlock.GetColumn(tsBlockColumnIndex).GetFloat(_tsBlockIndex); + } + else + { + _lastReadWasNull = true; + return 0.0f; + } + } + + public int GetIntByIndex(int columnIndex) + { + int index = GetTsBlockColumnIndexForColumnIndex(columnIndex); + return GetIntByTsBlockColumnIndex(index); + } + + public int GetInt(string columnName) + { + int index = GetTsBlockColumnIndexForColumnName(columnName); + return GetIntByTsBlockColumnIndex(index); + } + + private int GetIntByTsBlockColumnIndex(int tsBlockColumnIndex) + { + CheckRecord(); + if (!IsNull(tsBlockColumnIndex, _tsBlockIndex)) + { + _lastReadWasNull = false; + TSDataType dataType = _curTsBlock.GetColumn(tsBlockColumnIndex).GetDataType(); + if (dataType == TSDataType.INT64) + { + long v = _curTsBlock.GetColumn(tsBlockColumnIndex).GetLong(_tsBlockIndex); + return (int)v; + } + return _curTsBlock.GetColumn(tsBlockColumnIndex).GetInt(_tsBlockIndex); + } + else + { + _lastReadWasNull = true; + return 0; + } + } + + public long GetLongByIndex(int columnIndex) + { + int index = GetTsBlockColumnIndexForColumnIndex(columnIndex); + return GetLongByTsBlockColumnIndex(index); + } + + public long GetLong(string columnName) + { + int index = GetTsBlockColumnIndexForColumnName(columnName); + return GetLongByTsBlockColumnIndex(index); + } + + private long GetLongByTsBlockColumnIndex(int tsBlockColumnIndex) + { + CheckRecord(); + if (!IsNull(tsBlockColumnIndex, _tsBlockIndex)) + { + if (tsBlockColumnIndex == -1) return _curTsBlock.GetTimeByIndex(_tsBlockIndex); + _lastReadWasNull = false; + return _curTsBlock.GetColumn(tsBlockColumnIndex).GetLong(_tsBlockIndex); + } + else + { + _lastReadWasNull = true; + return 0L; + } + } + + public Binary GetBinaryByIndex(int columnIndex) + { + int index = GetTsBlockColumnIndexForColumnIndex(columnIndex); + return GetBinaryByTsBlockColumnIndex(index); + } + + public Binary GetBinary(string columnName) + { + int index = GetTsBlockColumnIndexForColumnName(columnName); + return GetBinaryByTsBlockColumnIndex(index); + } + + private Binary GetBinaryByTsBlockColumnIndex(int tsBlockColumnIndex) + { + CheckRecord(); + if (!IsNull(tsBlockColumnIndex, _tsBlockIndex)) + { + _lastReadWasNull = false; + return _curTsBlock.GetColumn(tsBlockColumnIndex).GetBinary(_tsBlockIndex); + } + else + { + _lastReadWasNull = true; + return null; + } + } + + public object GetObjectByIndex(int columnIndex) + { + int index = GetTsBlockColumnIndexForColumnIndex(columnIndex); + return GetObjectByTsBlockIndex(index); + } + + public object GetObject(string columnName) + { + int index = GetTsBlockColumnIndexForColumnName(columnName); + return GetObjectByTsBlockIndex(index); + } + + private object GetObjectByTsBlockIndex(int tsBlockColumnIndex) + { + CheckRecord(); + if (IsNull(tsBlockColumnIndex, _tsBlockIndex)) + { + _lastReadWasNull = true; + return null; + } + + _lastReadWasNull = false; + TSDataType dataType = GetDataTypeByTsBlockColumnIndex(tsBlockColumnIndex); + + switch (dataType) + { + case TSDataType.BOOLEAN: + case TSDataType.INT32: + case TSDataType.INT64: + case TSDataType.FLOAT: + case TSDataType.DOUBLE: + return _curTsBlock.GetColumn(tsBlockColumnIndex).GetObject(_tsBlockIndex); + + case TSDataType.TIMESTAMP: + long timestamp = tsBlockColumnIndex == -1 + ? _curTsBlock.GetTimeByIndex(_tsBlockIndex) + : _curTsBlock.GetColumn(tsBlockColumnIndex).GetLong(_tsBlockIndex); + return ConvertToTimestamp(timestamp, _timeFactor); + + case TSDataType.TEXT: + case TSDataType.STRING: + Binary binaryStr = _curTsBlock.GetColumn(tsBlockColumnIndex).GetBinary(_tsBlockIndex); + return binaryStr != null ? Encoding.UTF8.GetString(binaryStr.Data) : null; + + case TSDataType.BLOB: + return _curTsBlock.GetColumn(tsBlockColumnIndex).GetBinary(_tsBlockIndex); + + case TSDataType.DATE: + int value = _curTsBlock.GetColumn(tsBlockColumnIndex).GetInt(_tsBlockIndex); + return Int32ToDate(value); + + default: + return null; + } + } + + public string GetStringByIndex(int columnIndex) + { + int index = GetTsBlockColumnIndexForColumnIndex(columnIndex); + return GetStringByTsBlockColumnIndex(index); + } + + public string GetString(string columnName) + { + int index = GetTsBlockColumnIndexForColumnName(columnName); + return GetStringByTsBlockColumnIndex(index); + } + + private string GetStringByTsBlockColumnIndex(int tsBlockColumnIndex) + { + CheckRecord(); + + if (tsBlockColumnIndex == -1) + { + long timestamp = _curTsBlock.GetTimeByIndex(_tsBlockIndex); + return timestamp.ToString(); + } + + if (IsNull(tsBlockColumnIndex, _tsBlockIndex)) + { + _lastReadWasNull = true; + Console.WriteLine("null"); + return string.Empty; + } + + _lastReadWasNull = false; + return GetStringByTsBlockColumnIndexAndDataType( + tsBlockColumnIndex, + GetDataTypeByTsBlockColumnIndex(tsBlockColumnIndex)); + } + + private string GetStringByTsBlockColumnIndexAndDataType(int index, TSDataType tsDataType) + { + switch (tsDataType) + { + case TSDataType.BOOLEAN: + bool boolVal = _curTsBlock.GetColumn(index).GetBoolean(_tsBlockIndex); + return boolVal.ToString(); + + case TSDataType.INT32: + int intVal = _curTsBlock.GetColumn(index).GetInt(_tsBlockIndex); + return intVal.ToString(); + + case TSDataType.INT64: + long longVal = _curTsBlock.GetColumn(index).GetLong(_tsBlockIndex); + return longVal.ToString(); + + case TSDataType.TIMESTAMP: + long tsValue = _curTsBlock.GetColumn(index).GetLong(_tsBlockIndex); + return FormatDatetime(DefaultTimeFormat, _timePrecision, tsValue, _zoneId); + + case TSDataType.FLOAT: + float floatVal = _curTsBlock.GetColumn(index).GetFloat(_tsBlockIndex); + return floatVal.ToString("G9"); + + case TSDataType.DOUBLE: + double doubleVal = _curTsBlock.GetColumn(index).GetDouble(_tsBlockIndex); + return doubleVal.ToString("G17"); + + case TSDataType.TEXT: + case TSDataType.STRING: + Binary strBytes = _curTsBlock.GetColumn(index).GetBinary(_tsBlockIndex); + return strBytes != null ? Encoding.UTF8.GetString(strBytes.Data) : "0"; + + case TSDataType.BLOB: + Binary blobBytes = _curTsBlock.GetColumn(index).GetBinary(_tsBlockIndex); + return blobBytes.ToString().Replace("-", ""); + + case TSDataType.DATE: + int dateValue = _curTsBlock.GetColumn(index).GetInt(_tsBlockIndex); + DateTime date = Int32ToDate(dateValue); + return date.ToString("yyyy-MM-dd"); + + default: + return string.Empty; + } + } + + public RowRecord GetRow() + { + IReadOnlyList columns = _columnNameList; + int i = 0; + List fieldList = new List(); + long timestamp = 0; + foreach (string columnName in columns) + { + object localfield; + string typeStr = _columnTypeList[i]; + TSDataType dataType = Client.GetDataTypeByStr(typeStr); + + switch (dataType) + { + case TSDataType.BOOLEAN: + localfield = GetBoolean(columnName); + break; + case TSDataType.INT32: + localfield = GetInt(columnName); + break; + case TSDataType.INT64: + localfield = GetLong(columnName); + break; + case TSDataType.TIMESTAMP: + localfield = null; + timestamp = GetLong(columnName); + break; + case TSDataType.FLOAT: + localfield = GetFloat(columnName); + break; + case TSDataType.DOUBLE: + localfield = GetDouble(columnName); + break; + case TSDataType.TEXT: + case TSDataType.STRING: + case TSDataType.BLOB: + case TSDataType.DATE: + localfield = GetString(columnName); + break; + default: + string err_msg = "value format not supported"; + throw new TException(err_msg, null); + } + if (localfield != null) + fieldList.Add(localfield); + i += 1; + } + return new RowRecord(timestamp, fieldList, _columnNameList); + } + + public DateTime GetTimestampByIndex(int columnIndex) + { + int index = GetTsBlockColumnIndexForColumnIndex(columnIndex); + return GetTimestampByTsBlockColumnIndex(index); + } + + public DateTime GetTimestamp(string columnName) + { + int index = GetTsBlockColumnIndexForColumnName(columnName); + return GetTimestampByTsBlockColumnIndex(index); + } + + private DateTime GetTimestampByTsBlockColumnIndex(int tsBlockColumnIndex) + { + long value = GetLongByTsBlockColumnIndex(tsBlockColumnIndex); + return ConvertToTimestamp(value, _timeFactor); + } + + public DateTime GetDateByIndex(int columnIndex) + { + int index = GetTsBlockColumnIndexForColumnIndex(columnIndex); + return GetDateByTsBlockColumnIndex(index); + } + + public DateTime GetDate(string columnName) + { + int index = GetTsBlockColumnIndexForColumnName(columnName); + return GetDateByTsBlockColumnIndex(index); + } + + private DateTime GetDateByTsBlockColumnIndex(int tsBlockColumnIndex) + { + int value = GetIntByTsBlockColumnIndex(tsBlockColumnIndex); + return Int32ToDate(value); + } + + public TSDataType GetDataTypeByIndex(int columnIndex) + { + int index = GetTsBlockColumnIndexForColumnIndex(columnIndex); + return GetDataTypeByTsBlockColumnIndex(index); + } + + public TSDataType GetDataType(string columnName) + { + if (!_columnName2TsBlockColumnIndexMap.TryGetValue(columnName, out int index)) + throw new ArgumentException($"Column {columnName} not found"); + + return GetDataTypeByTsBlockColumnIndex(index); + } + + private TSDataType GetDataTypeByTsBlockColumnIndex(int tsBlockColumnIndex) + { + return tsBlockColumnIndex < 0 + ? TSDataType.TIMESTAMP + : _dataTypeForTsBlockColumn[tsBlockColumnIndex]; + } + + private DateTime ConvertToTimestamp(long value, double timeFactor) + { + long timestamp = (long)(value * timeFactor); + return DateTimeOffset.FromUnixTimeMilliseconds(timestamp).DateTime; + } + + public static DateTime Int32ToDate(int val) + { + int year = val / 10000; + int remaining = val % 10000; + int month = remaining / 100; + int day = remaining % 100; + + if (year < 1 || year > 9999) + throw new ArgumentOutOfRangeException( + paramName: nameof(val), + message: $"Invalid year value: {year}. Year must be between 1-9999" + ); + + if (month < 1 || month > 12) + throw new ArgumentOutOfRangeException( + paramName: nameof(val), + message: $"Invalid month value: {month}. Month must be between 1-12" + ); + + int daysInMonth = DateTime.DaysInMonth(year, month); + if (day < 1 || day > daysInMonth) + throw new ArgumentOutOfRangeException( + paramName: nameof(val), + message: $"Invalid day value: {day}. Day must be between 1-{daysInMonth} for {year}-{month}" + ); + + return new DateTime(year, month, day, 0, 0, 0, DateTimeKind.Utc); + } + + private string FormatDatetime(string format, string precision, long value, TimeZoneInfo zone) + { + DateTime dt = ConvertToTimestamp(value, 1); // 假设timeFactor=1 + DateTime convertedTime = TimeZoneInfo.ConvertTime(dt, zone); + return convertedTime.ToString(format); + } + + private int GetTsBlockColumnIndexForColumnName(string columnName) + { + if (!_columnName2TsBlockColumnIndexMap.TryGetValue(columnName, out int index)) + throw new ArgumentException($"Column {columnName} not found"); + return index; + } + + public int FindColumn(string columnName) + { + if (!_columnOrdinalMap.TryGetValue(columnName, out int ordinal)) + throw new ArgumentException($"Column {columnName} not found"); + return ordinal; + } + + public string FindColumnNameByIndex(int columnIndex) + { + if (columnIndex <= 0) + throw new ArgumentOutOfRangeException(nameof(columnIndex), "Column index should start from 1"); + + if (columnIndex > _columnNameList.Count) + throw new ArgumentOutOfRangeException(nameof(columnIndex), + $"Column index {columnIndex} out of range {_columnNameList.Count}"); + + return _columnNameList[columnIndex - 1]; + } + + private int GetTsBlockColumnIndexForColumnIndex(int columnIndex) + { + int adjustedIndex = columnIndex - 1; + if (adjustedIndex < 0 || adjustedIndex >= _columnIndex2TsBlockColumnIndexList.Count) + throw new ArgumentOutOfRangeException(nameof(columnIndex), + $"Index {adjustedIndex} out of range {_columnIndex2TsBlockColumnIndexList.Count}"); + + return _columnIndex2TsBlockColumnIndexList[adjustedIndex]; + } + + private void CheckRecord() + { + if (_queryResultIndex > _queryResultSize || + _tsBlockIndex >= _tsBlockSize || + _queryResult == null || + _curTsBlock == null) + { + throw new InvalidOperationException("No record remains"); + } + } + + public int GetValueColumnStartIndex() => _ignoreTimestamp ? 0 : 1; + + public int GetColumnSize() => _columnNameList.Count; + + public List GetColumnTypeList() => new List(_columnTypeList); + + public List GetColumnNameTypeList() => new List(_columnTypeList); + + public bool IsClosed() => _isClosed; + + public int FetchSize + { + get => _fetchSize; + set => _fetchSize = value; + } + + public bool HasCachedRecord + { + get => _hasCachedRecord; + set => _hasCachedRecord = value; + } + + public bool IsLastReadWasNull() => _lastReadWasNull; + + public long GetCurrentRowTime() => _time; + + public bool IsIgnoreTimestamp() => _ignoreTimestamp; + } +} diff --git a/src/Apache.IoTDB/DataStructure/SessionDataSet.cs b/src/Apache.IoTDB/DataStructure/SessionDataSet.cs index 3d606f4..3d08843 100644 --- a/src/Apache.IoTDB/DataStructure/SessionDataSet.cs +++ b/src/Apache.IoTDB/DataStructure/SessionDataSet.cs @@ -32,284 +32,91 @@ public class SessionDataSet : System.IDisposable private readonly string _sql; private readonly List _columnNames; private readonly Dictionary _columnNameIndexMap; - private readonly Dictionary _duplicateLocation; private readonly List _columnTypeLst; - private TSQueryDataSet _queryDataset; - private readonly byte[] _currentBitmap; - private readonly int _columnSize; - private List _valueBufferLst, _bitmapBufferLst; - private ByteBuffer _timeBuffer; - private readonly ConcurrentClientQueue _clientQueue; private Client _client; - private int _rowIndex; - private bool _hasCatchedResult; - private RowRecord _cachedRowRecord; private bool _isClosed = false; private bool disposedValue; + private RpcDataSet _rpcDataSet; + private string _zoneId; + private readonly ConcurrentClientQueue _clientQueue; private string TimestampStr => "Time"; private int StartIndex => 2; private int Flag => 0x80; private int DefaultTimeout => 10000; public int FetchSize { get; set; } - public int RowCount { get; set; } - public SessionDataSet(string sql, TSExecuteStatementResp resp, Client client, ConcurrentClientQueue clientQueue, long statementId) + public SessionDataSet( + string sql, List ColumnNameList, List ColumnTypeList, + Dictionary ColumnNameIndexMap, long QueryId, long statementId, Client client, List QueryResult, + bool IgnoreTimeStamp, bool MoreData, string zoneId, List ColumnIndex2TsBlockColumnIndexList, ConcurrentClientQueue clientQueue + ) { - _clientQueue = clientQueue; _client = client; _sql = sql; - _queryDataset = resp.QueryDataSet; - _queryId = resp.QueryId; + _queryId = QueryId; _statementId = statementId; - _columnSize = resp.Columns.Count; - _currentBitmap = new byte[_columnSize]; - _columnNames = new List(); - _timeBuffer = new ByteBuffer(_queryDataset.Time); - // column name -> column location - _columnNameIndexMap = new Dictionary(); - _columnTypeLst = new List(); - _duplicateLocation = new Dictionary(); - _valueBufferLst = new List(); - _bitmapBufferLst = new List(); - // some internal variable - _hasCatchedResult = false; - _rowIndex = 0; - RowCount = _queryDataset.Time.Length / sizeof(long); + _columnNameIndexMap = ColumnNameIndexMap; - _columnNames = resp.Columns; - _columnTypeLst = resp.DataTypeList; - - int deduplicateIdx = 0; - Dictionary columnToFirstIndexMap = new Dictionary(); - for (var i = 0; i < _columnSize; i++) - { - var columnName = _columnNames[i]; - if (_columnNameIndexMap.ContainsKey(columnName)) - { - _duplicateLocation[i] = columnToFirstIndexMap[columnName]; - } - else - { - columnToFirstIndexMap[columnName] = i; - if (resp.ColumnNameIndexMap != null) - { - int valueIndex = resp.ColumnNameIndexMap[columnName]; - _columnNameIndexMap[columnName] = valueIndex; - _valueBufferLst.Add(new ByteBuffer(_queryDataset.ValueList[valueIndex])); - _bitmapBufferLst.Add(new ByteBuffer(_queryDataset.BitmapList[valueIndex])); - } - else - { - _columnNameIndexMap[columnName] = deduplicateIdx; - _valueBufferLst.Add(new ByteBuffer(_queryDataset.ValueList[deduplicateIdx])); - _bitmapBufferLst.Add(new ByteBuffer(_queryDataset.BitmapList[deduplicateIdx])); - } - deduplicateIdx++; - } - } - } - public List ColumnNames => _columnNames; - - - private List GetColumnNames() - { - var lst = new List - { - "timestamp" - }; - lst.AddRange(_columnNames); - return lst; - } - - public void ShowTableNames() - { - var str = GetColumnNames() - .Aggregate("", (current, name) => current + (name + "\t\t")); - - Console.WriteLine(str); - } - - public bool HasNext() - { - if (_hasCatchedResult) - { - return true; - } - - // we have consumed all current data, fetch some more - if (!_timeBuffer.HasRemaining()) - { - if (!FetchResults()) - { - return false; - } - } + _columnNames = ColumnNameList; + _columnTypeLst = ColumnTypeList; + _zoneId = zoneId; + _clientQueue = clientQueue; - ConstructOneRow(); - _hasCatchedResult = true; - return true; + _rpcDataSet = new RpcDataSet( + _sql, _columnNames, _columnTypeLst, _columnNameIndexMap, IgnoreTimeStamp, + MoreData, _queryId, _statementId, _client, _client.SessionId, QueryResult, FetchSize, + DefaultTimeout, _zoneId, ColumnIndex2TsBlockColumnIndexList + ); } + public bool HasNext() => _rpcDataSet.Next(); + public RowRecord Next() => _rpcDataSet.GetRow(); + public bool IsNull(string columnName) => _rpcDataSet.IsNullByColumnName(columnName); + public bool IsNullByIndex(int columnIndex) => _rpcDataSet.IsNullByIndex(columnIndex); - public RowRecord Next() - { - if (!_hasCatchedResult) - { - if (!HasNext()) - { - return null; - } - } + public bool GetBooleanByIndex(int columnIndex) => _rpcDataSet.GetBooleanByIndex(columnIndex); + public bool GetBoolean(string columnName) => _rpcDataSet.GetBoolean(columnName); - _hasCatchedResult = false; - return _cachedRowRecord; - } - public RowRecord GetRow() - { - return _cachedRowRecord; - } + public double GetDoubleByIndex(int columnIndex) => _rpcDataSet.GetDoubleByIndex(columnIndex); + public double GetDouble(string columnName) => _rpcDataSet.GetDouble(columnName); - private TSDataType GetDataTypeFromStr(string str) - { - return str switch - { - "BOOLEAN" => TSDataType.BOOLEAN, - "INT32" => TSDataType.INT32, - "INT64" => TSDataType.INT64, - "FLOAT" => TSDataType.FLOAT, - "DOUBLE" => TSDataType.DOUBLE, - "TEXT" => TSDataType.TEXT, - "NULLTYPE" => TSDataType.NONE, - "TIMESTAMP" => TSDataType.TIMESTAMP, - "DATE" => TSDataType.DATE, - "BLOB" => TSDataType.BLOB, - "STRING" => TSDataType.STRING, - _ => TSDataType.STRING - }; - } + public float GetFloatByIndex(int columnIndex) => _rpcDataSet.GetFloatByIndex(columnIndex); + public float GetFloat(string columnName) => _rpcDataSet.GetFloat(columnName); - private void ConstructOneRow() - { - List fieldList = new List(); + public int GetIntByIndex(int columnIndex) => _rpcDataSet.GetIntByIndex(columnIndex); + public int GetInt(string columnName) => _rpcDataSet.GetInt(columnName); - for (int i = 0; i < _columnSize; i++) - { - if (_duplicateLocation.ContainsKey(i)) - { - var field = fieldList[_duplicateLocation[i]]; - fieldList.Add(field); - } - else - { - var columnValueBuffer = _valueBufferLst[i]; - var columnBitmapBuffer = _bitmapBufferLst[i]; + public long GetLongByIndex(int columnIndex) => _rpcDataSet.GetLongByIndex(columnIndex); + public long GetLong(string columnName) => _rpcDataSet.GetLong(columnName); - if (_rowIndex % 8 == 0) - { - _currentBitmap[i] = columnBitmapBuffer.GetByte(); - } + public object GetObjectByIndex(int columnIndex) => _rpcDataSet.GetObjectByIndex(columnIndex); + public object GetObject(string columnName) => _rpcDataSet.GetObject(columnName); - object localField; - if (!IsNull(i, _rowIndex)) - { - var columnDataType = GetDataTypeFromStr(_columnTypeLst[i]); + public string GetStringByIndex(int columnIndex) => _rpcDataSet.GetStringByIndex(columnIndex); + public string GetString(string columnName) => _rpcDataSet.GetString(columnName); + public DateTime GetTimestampByIndex(int columnIndex) => _rpcDataSet.GetTimestampByIndex(columnIndex); + public DateTime GetTimestamp(string columnName) => _rpcDataSet.GetTimestamp(columnName); - switch (columnDataType) - { - case TSDataType.BOOLEAN: - localField = columnValueBuffer.GetBool(); - break; - case TSDataType.INT32: - // case TSDataType.DATE: - localField = columnValueBuffer.GetInt(); - break; - case TSDataType.DATE: - localField = Utils.ParseIntToDate(columnValueBuffer.GetInt()); - break; - case TSDataType.INT64: - case TSDataType.TIMESTAMP: - localField = columnValueBuffer.GetLong(); - break; - case TSDataType.FLOAT: - localField = columnValueBuffer.GetFloat(); - break; - case TSDataType.DOUBLE: - localField = columnValueBuffer.GetDouble(); - break; - case TSDataType.TEXT: - case TSDataType.STRING: - // case TSDataType.BLOB: - localField = columnValueBuffer.GetStr(); - break; - case TSDataType.BLOB: - localField = columnValueBuffer.GetBinary(); - break; - // TODO - default: - string err_msg = "value format not supported"; - throw new TException(err_msg, null); - } + public DateTime GetDateByIndex(int columnIndex) => _rpcDataSet.GetDateByIndex(columnIndex); + public DateTime GetDate(string columnName) => _rpcDataSet.GetDate(columnName); - fieldList.Add(localField); - } - else - { - localField = null; - fieldList.Add(DBNull.Value); - } - } - } + public Binary GetBlobByIndex(int columnIndex) => _rpcDataSet.GetBinaryByIndex(columnIndex); + public Binary GetBlob(string columnName) => _rpcDataSet.GetBinary(columnName); - long timestamp = _timeBuffer.GetLong(); - _rowIndex += 1; - _cachedRowRecord = new RowRecord(timestamp, fieldList, _columnNames); - } + public int FindColumn(string columnName) => _rpcDataSet.FindColumn(columnName); - private bool IsNull(int loc, int row_index) - { - byte bitmap = _currentBitmap[loc]; - int shift = row_index % 8; - return ((Flag >> shift) & bitmap) == 0; - } + public IReadOnlyList GetColumnNames() => _rpcDataSet._columnNameList; + public IReadOnlyList GetColumnTypes() => _rpcDataSet._columnTypeList; - private bool FetchResults() + public int RowCount() => _rpcDataSet._tsBlockSize; + public void ShowTableNames() { - _rowIndex = 0; - var req = new TSFetchResultsReq(_client.SessionId, _sql, FetchSize, _queryId, true) - { - Timeout = DefaultTimeout - }; - try - { - var task = _client.ServiceClient.fetchResultsAsync(req); - - var resp = task.ConfigureAwait(false).GetAwaiter().GetResult(); - - if (resp.HasResultSet) - { - _queryDataset = resp.QueryDataSet; - // reset buffer - _timeBuffer = new ByteBuffer(resp.QueryDataSet.Time); - _valueBufferLst = new List(); - _bitmapBufferLst = new List(); - for (int index = 0; index < _queryDataset.ValueList.Count; index++) - { - string columnName = _columnNames[index]; - int valueIndex = _columnNameIndexMap[columnName]; - _valueBufferLst.Add(new ByteBuffer(_queryDataset.ValueList[valueIndex])); - _bitmapBufferLst.Add(new ByteBuffer(_queryDataset.BitmapList[valueIndex])); - } - - // reset row index - _rowIndex = 0; - } - - return resp.HasResultSet; - } - catch (TException e) + IReadOnlyList columns = GetColumnNames(); + foreach (string columnName in columns) { - throw new TException("Cannot fetch result from server, because of network connection", e); + Console.Write($"{columnName}\t"); } + Console.WriteLine(); } public async Task Close() @@ -332,6 +139,7 @@ public async Task Close() } finally { + await _rpcDataSet.Close(); _clientQueue.Add(_client); _client = null; } @@ -352,10 +160,6 @@ protected virtual void Dispose(bool disposing) { } } - _queryDataset = null; - _timeBuffer = null; - _valueBufferLst = null; - _bitmapBufferLst = null; disposedValue = true; } } diff --git a/src/Apache.IoTDB/DataStructure/TsBlock.cs b/src/Apache.IoTDB/DataStructure/TsBlock.cs new file mode 100644 index 0000000..14d598c --- /dev/null +++ b/src/Apache.IoTDB/DataStructure/TsBlock.cs @@ -0,0 +1,124 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Apache.IoTDB.DataStructure +{ + public class TsBlock + { + private readonly Column _timeColumn; + private readonly List _valueColumns; + private readonly int _positionCount; + + public TsBlock(int positionCount, Column timeColumn, params Column[] valueColumns) + { + _positionCount = positionCount; + _timeColumn = timeColumn; + _valueColumns = new List(valueColumns); + if (valueColumns == null) + throw new ArgumentNullException(nameof(valueColumns)); + if (timeColumn.GetPositionCount() != positionCount) + throw new ArgumentException( + $"input positionCount {positionCount} does not match timeColumn.positionCount {timeColumn.GetPositionCount()}" + ); + for (int i = 0; i < ValueColumnCount; i++) + { + if (valueColumns[i].GetPositionCount() != positionCount) + throw new ArgumentException( + $"input positionCount {positionCount} does not match valueColumn{i}.positionCount {valueColumns[i].GetPositionCount()}" + ); + } + } + + public static TsBlock Deserialize(ByteBuffer reader) + { + // Serialized tsblock: + // +-------------+---------------+---------+------------+-----------+----------+ + // | val col cnt | val col types | pos cnt | encodings | time col | val col | + // +-------------+---------------+---------+------------+-----------+----------+ + // | int32 | list[byte] | int32 | list[byte] | bytes | bytes | + // +-------------+---------------+---------+------------+-----------+----------+ + + // Read value column count + var valueColumnCount = reader.GetInt(); + + // Read value column data types + var valueColumnDataTypes = new TSDataType[valueColumnCount]; + for (int i = 0; i < valueColumnCount; i++) + { + valueColumnDataTypes[i] = DeserializeDataType(reader); + } + + // Read position count + var positionCount = reader.GetInt(); + + // Read column encodings + // Read time column encoding + ColumnEncoding timeColumnEncodings = DeserializeColumnEncoding(reader); + + // Read value column encodings + var valueColumnEncodings = new ColumnEncoding[valueColumnCount]; + for (int i = 1; i < valueColumnCount + 1; i++) + { + valueColumnEncodings[i - 1] = DeserializeColumnEncoding(reader); + } + + // Read time column + var timeColumnDecoder = BaseColumnDecoder.GetDecoder(timeColumnEncodings); + var timeColumn = timeColumnDecoder.ReadColumn(reader, TSDataType.INT64, positionCount); + + // Read value columns + var valueColumns = new Column[valueColumnCount]; + for (int i = 1; i < valueColumnCount + 1; i++) + { + var decoder = BaseColumnDecoder.GetDecoder(valueColumnEncodings[i - 1]); + valueColumns[i - 1] = decoder.ReadColumn(reader, valueColumnDataTypes[i - 1], positionCount); + } + + return new TsBlock(positionCount, timeColumn, valueColumns); + } + + private static TSDataType DeserializeDataType(ByteBuffer reader) + { + byte b = reader.GetByte(); + return (TSDataType)b; + } + + private static ColumnEncoding DeserializeColumnEncoding(ByteBuffer reader) + { + byte b = reader.GetByte(); + return (ColumnEncoding)b; + } + + public int PositionCount => _positionCount; + + public long GetStartTime() => _timeColumn.GetLong(0); + public long GetEndTime() => _timeColumn.GetLong(_positionCount - 1); + public bool IsEmpty => _positionCount == 0; + public long GetTimeByIndex(int index) => _timeColumn.GetLong(index); + public int ValueColumnCount => _valueColumns.Count; + public Column TimeColumn => _timeColumn; + public IReadOnlyList ValueColumns => _valueColumns; + public Column GetColumn(int columnIndex) => _valueColumns[columnIndex]; + } +} diff --git a/src/Apache.IoTDB/Rpc/Generated/IClientRPCService.cs b/src/Apache.IoTDB/Rpc/Generated/IClientRPCService.cs index c0a051d..3fbd3aa 100644 --- a/src/Apache.IoTDB/Rpc/Generated/IClientRPCService.cs +++ b/src/Apache.IoTDB/Rpc/Generated/IClientRPCService.cs @@ -42,6 +42,8 @@ public interface IAsync global::System.Threading.Tasks.Task executeLastDataQueryV2Async(TSLastDataQueryReq req, CancellationToken cancellationToken = default); + global::System.Threading.Tasks.Task executeFastLastDataQueryForOnePrefixPathAsync(TSFastLastDataQueryForOnePrefixPathReq req, CancellationToken cancellationToken = default); + global::System.Threading.Tasks.Task executeFastLastDataQueryForOneDeviceV2Async(TSFastLastDataQueryForOneDeviceReq req, CancellationToken cancellationToken = default); global::System.Threading.Tasks.Task executeAggregationQueryV2Async(TSAggregationQueryReq req, CancellationToken cancellationToken = default); @@ -328,6 +330,36 @@ public Client(TProtocol inputProtocol, TProtocol outputProtocol) : base(inputPro throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "executeLastDataQueryV2 failed: unknown result"); } + public async global::System.Threading.Tasks.Task executeFastLastDataQueryForOnePrefixPathAsync(TSFastLastDataQueryForOnePrefixPathReq req, CancellationToken cancellationToken = default) + { + await OutputProtocol.WriteMessageBeginAsync(new TMessage("executeFastLastDataQueryForOnePrefixPath", TMessageType.Call, SeqId), cancellationToken); + + var args = new InternalStructs.executeFastLastDataQueryForOnePrefixPathArgs() { + Req = req, + }; + + await args.WriteAsync(OutputProtocol, cancellationToken); + await OutputProtocol.WriteMessageEndAsync(cancellationToken); + await OutputProtocol.Transport.FlushAsync(cancellationToken); + + var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken); + if (msg.Type == TMessageType.Exception) + { + var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); + await InputProtocol.ReadMessageEndAsync(cancellationToken); + throw x; + } + + var result = new InternalStructs.executeFastLastDataQueryForOnePrefixPathResult(); + await result.ReadAsync(InputProtocol, cancellationToken); + await InputProtocol.ReadMessageEndAsync(cancellationToken); + if (result.__isset.success) + { + return result.Success; + } + throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "executeFastLastDataQueryForOnePrefixPath failed: unknown result"); + } + public async global::System.Threading.Tasks.Task executeFastLastDataQueryForOneDeviceV2Async(TSFastLastDataQueryForOneDeviceReq req, CancellationToken cancellationToken = default) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("executeFastLastDataQueryForOneDeviceV2", TMessageType.Call, SeqId), cancellationToken); @@ -2173,6 +2205,7 @@ public AsyncProcessor(IAsync iAsync, ILogger logger = default) processMap_["executeStatementV2"] = executeStatementV2_ProcessAsync; processMap_["executeRawDataQueryV2"] = executeRawDataQueryV2_ProcessAsync; processMap_["executeLastDataQueryV2"] = executeLastDataQueryV2_ProcessAsync; + processMap_["executeFastLastDataQueryForOnePrefixPath"] = executeFastLastDataQueryForOnePrefixPath_ProcessAsync; processMap_["executeFastLastDataQueryForOneDeviceV2"] = executeFastLastDataQueryForOneDeviceV2_ProcessAsync; processMap_["executeAggregationQueryV2"] = executeAggregationQueryV2_ProcessAsync; processMap_["executeGroupByQueryIntervalQuery"] = executeGroupByQueryIntervalQuery_ProcessAsync; @@ -2430,6 +2463,37 @@ public async Task ProcessAsync(TProtocol iprot, TProtocol oprot, Cancellat await oprot.Transport.FlushAsync(cancellationToken); } + public async global::System.Threading.Tasks.Task executeFastLastDataQueryForOnePrefixPath_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken) + { + var args = new InternalStructs.executeFastLastDataQueryForOnePrefixPathArgs(); + await args.ReadAsync(iprot, cancellationToken); + await iprot.ReadMessageEndAsync(cancellationToken); + var result = new InternalStructs.executeFastLastDataQueryForOnePrefixPathResult(); + try + { + result.Success = await _iAsync.executeFastLastDataQueryForOnePrefixPathAsync(args.Req, cancellationToken); + await oprot.WriteMessageBeginAsync(new TMessage("executeFastLastDataQueryForOnePrefixPath", TMessageType.Reply, seqid), cancellationToken); + await result.WriteAsync(oprot, cancellationToken); + } + catch (TTransportException) + { + throw; + } + catch (Exception ex) + { + var sErr = $"Error occurred in {GetType().FullName}: {ex.Message}"; + if(_logger != null) + _logger.LogError(ex, sErr); + else + Console.Error.WriteLine(sErr); + var x = new TApplicationException(TApplicationException.ExceptionType.InternalError," Internal error."); + await oprot.WriteMessageBeginAsync(new TMessage("executeFastLastDataQueryForOnePrefixPath", TMessageType.Exception, seqid), cancellationToken); + await x.WriteAsync(oprot, cancellationToken); + } + await oprot.WriteMessageEndAsync(cancellationToken); + await oprot.Transport.FlushAsync(cancellationToken); + } + public async global::System.Threading.Tasks.Task executeFastLastDataQueryForOneDeviceV2_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken) { var args = new InternalStructs.executeFastLastDataQueryForOneDeviceV2Args(); @@ -4445,10 +4509,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeQueryStatementV2_args("); - int tmp429 = 0; + int tmp438 = 0; if((Req != null) && __isset.req) { - if(0 < tmp429++) { sb.Append(", "); } + if(0 < tmp438++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -4581,10 +4645,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeQueryStatementV2_result("); - int tmp430 = 0; + int tmp439 = 0; if((Success != null) && __isset.success) { - if(0 < tmp430++) { sb.Append(", "); } + if(0 < tmp439++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -4713,10 +4777,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeUpdateStatementV2_args("); - int tmp431 = 0; + int tmp440 = 0; if((Req != null) && __isset.req) { - if(0 < tmp431++) { sb.Append(", "); } + if(0 < tmp440++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -4849,10 +4913,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeUpdateStatementV2_result("); - int tmp432 = 0; + int tmp441 = 0; if((Success != null) && __isset.success) { - if(0 < tmp432++) { sb.Append(", "); } + if(0 < tmp441++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -4981,10 +5045,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeStatementV2_args("); - int tmp433 = 0; + int tmp442 = 0; if((Req != null) && __isset.req) { - if(0 < tmp433++) { sb.Append(", "); } + if(0 < tmp442++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -5117,10 +5181,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeStatementV2_result("); - int tmp434 = 0; + int tmp443 = 0; if((Success != null) && __isset.success) { - if(0 < tmp434++) { sb.Append(", "); } + if(0 < tmp443++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -5249,10 +5313,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeRawDataQueryV2_args("); - int tmp435 = 0; + int tmp444 = 0; if((Req != null) && __isset.req) { - if(0 < tmp435++) { sb.Append(", "); } + if(0 < tmp444++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -5385,10 +5449,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeRawDataQueryV2_result("); - int tmp436 = 0; + int tmp445 = 0; if((Success != null) && __isset.success) { - if(0 < tmp436++) { sb.Append(", "); } + if(0 < tmp445++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -5517,10 +5581,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeLastDataQueryV2_args("); - int tmp437 = 0; + int tmp446 = 0; if((Req != null) && __isset.req) { - if(0 < tmp437++) { sb.Append(", "); } + if(0 < tmp446++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -5653,10 +5717,278 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeLastDataQueryV2_result("); - int tmp438 = 0; + int tmp447 = 0; if((Success != null) && __isset.success) { - if(0 < tmp438++) { sb.Append(", "); } + if(0 < tmp447++) { sb.Append(", "); } + sb.Append("Success: "); + Success.ToString(sb); + } + sb.Append(')'); + return sb.ToString(); + } + } + + + public partial class executeFastLastDataQueryForOnePrefixPathArgs : TBase + { + private TSFastLastDataQueryForOnePrefixPathReq _req; + + public TSFastLastDataQueryForOnePrefixPathReq Req + { + get + { + return _req; + } + set + { + __isset.req = true; + this._req = value; + } + } + + + public Isset __isset; + public struct Isset + { + public bool req; + } + + public executeFastLastDataQueryForOnePrefixPathArgs() + { + } + + public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) + { + iprot.IncrementRecursionDepth(); + try + { + TField field; + await iprot.ReadStructBeginAsync(cancellationToken); + while (true) + { + field = await iprot.ReadFieldBeginAsync(cancellationToken); + if (field.Type == TType.Stop) + { + break; + } + + switch (field.ID) + { + case 1: + if (field.Type == TType.Struct) + { + Req = new TSFastLastDataQueryForOnePrefixPathReq(); + await Req.ReadAsync(iprot, cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + default: + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + break; + } + + await iprot.ReadFieldEndAsync(cancellationToken); + } + + await iprot.ReadStructEndAsync(cancellationToken); + } + finally + { + iprot.DecrementRecursionDepth(); + } + } + + public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) + { + oprot.IncrementRecursionDepth(); + try + { + var struc = new TStruct("executeFastLastDataQueryForOnePrefixPath_args"); + await oprot.WriteStructBeginAsync(struc, cancellationToken); + var field = new TField(); + if((Req != null) && __isset.req) + { + field.Name = "req"; + field.Type = TType.Struct; + field.ID = 1; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await Req.WriteAsync(oprot, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } + await oprot.WriteFieldStopAsync(cancellationToken); + await oprot.WriteStructEndAsync(cancellationToken); + } + finally + { + oprot.DecrementRecursionDepth(); + } + } + + public override bool Equals(object that) + { + if (!(that is executeFastLastDataQueryForOnePrefixPathArgs other)) return false; + if (ReferenceEquals(this, other)) return true; + return ((__isset.req == other.__isset.req) && ((!__isset.req) || (System.Object.Equals(Req, other.Req)))); + } + + public override int GetHashCode() { + int hashcode = 157; + unchecked { + if((Req != null) && __isset.req) + { + hashcode = (hashcode * 397) + Req.GetHashCode(); + } + } + return hashcode; + } + + public override string ToString() + { + var sb = new StringBuilder("executeFastLastDataQueryForOnePrefixPath_args("); + int tmp448 = 0; + if((Req != null) && __isset.req) + { + if(0 < tmp448++) { sb.Append(", "); } + sb.Append("Req: "); + Req.ToString(sb); + } + sb.Append(')'); + return sb.ToString(); + } + } + + + public partial class executeFastLastDataQueryForOnePrefixPathResult : TBase + { + private TSExecuteStatementResp _success; + + public TSExecuteStatementResp Success + { + get + { + return _success; + } + set + { + __isset.success = true; + this._success = value; + } + } + + + public Isset __isset; + public struct Isset + { + public bool success; + } + + public executeFastLastDataQueryForOnePrefixPathResult() + { + } + + public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) + { + iprot.IncrementRecursionDepth(); + try + { + TField field; + await iprot.ReadStructBeginAsync(cancellationToken); + while (true) + { + field = await iprot.ReadFieldBeginAsync(cancellationToken); + if (field.Type == TType.Stop) + { + break; + } + + switch (field.ID) + { + case 0: + if (field.Type == TType.Struct) + { + Success = new TSExecuteStatementResp(); + await Success.ReadAsync(iprot, cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + default: + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + break; + } + + await iprot.ReadFieldEndAsync(cancellationToken); + } + + await iprot.ReadStructEndAsync(cancellationToken); + } + finally + { + iprot.DecrementRecursionDepth(); + } + } + + public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) + { + oprot.IncrementRecursionDepth(); + try + { + var struc = new TStruct("executeFastLastDataQueryForOnePrefixPath_result"); + await oprot.WriteStructBeginAsync(struc, cancellationToken); + var field = new TField(); + + if(this.__isset.success) + { + if (Success != null) + { + field.Name = "Success"; + field.Type = TType.Struct; + field.ID = 0; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await Success.WriteAsync(oprot, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } + } + await oprot.WriteFieldStopAsync(cancellationToken); + await oprot.WriteStructEndAsync(cancellationToken); + } + finally + { + oprot.DecrementRecursionDepth(); + } + } + + public override bool Equals(object that) + { + if (!(that is executeFastLastDataQueryForOnePrefixPathResult other)) return false; + if (ReferenceEquals(this, other)) return true; + return ((__isset.success == other.__isset.success) && ((!__isset.success) || (System.Object.Equals(Success, other.Success)))); + } + + public override int GetHashCode() { + int hashcode = 157; + unchecked { + if((Success != null) && __isset.success) + { + hashcode = (hashcode * 397) + Success.GetHashCode(); + } + } + return hashcode; + } + + public override string ToString() + { + var sb = new StringBuilder("executeFastLastDataQueryForOnePrefixPath_result("); + int tmp449 = 0; + if((Success != null) && __isset.success) + { + if(0 < tmp449++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -5785,10 +6117,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeFastLastDataQueryForOneDeviceV2_args("); - int tmp439 = 0; + int tmp450 = 0; if((Req != null) && __isset.req) { - if(0 < tmp439++) { sb.Append(", "); } + if(0 < tmp450++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -5921,10 +6253,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeFastLastDataQueryForOneDeviceV2_result("); - int tmp440 = 0; + int tmp451 = 0; if((Success != null) && __isset.success) { - if(0 < tmp440++) { sb.Append(", "); } + if(0 < tmp451++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -6053,10 +6385,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeAggregationQueryV2_args("); - int tmp441 = 0; + int tmp452 = 0; if((Req != null) && __isset.req) { - if(0 < tmp441++) { sb.Append(", "); } + if(0 < tmp452++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -6189,10 +6521,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeAggregationQueryV2_result("); - int tmp442 = 0; + int tmp453 = 0; if((Success != null) && __isset.success) { - if(0 < tmp442++) { sb.Append(", "); } + if(0 < tmp453++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -6321,10 +6653,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeGroupByQueryIntervalQuery_args("); - int tmp443 = 0; + int tmp454 = 0; if((Req != null) && __isset.req) { - if(0 < tmp443++) { sb.Append(", "); } + if(0 < tmp454++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -6457,10 +6789,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeGroupByQueryIntervalQuery_result("); - int tmp444 = 0; + int tmp455 = 0; if((Success != null) && __isset.success) { - if(0 < tmp444++) { sb.Append(", "); } + if(0 < tmp455++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -6589,10 +6921,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchResultsV2_args("); - int tmp445 = 0; + int tmp456 = 0; if((Req != null) && __isset.req) { - if(0 < tmp445++) { sb.Append(", "); } + if(0 < tmp456++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -6725,10 +7057,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchResultsV2_result("); - int tmp446 = 0; + int tmp457 = 0; if((Success != null) && __isset.success) { - if(0 < tmp446++) { sb.Append(", "); } + if(0 < tmp457++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -6857,10 +7189,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("openSession_args("); - int tmp447 = 0; + int tmp458 = 0; if((Req != null) && __isset.req) { - if(0 < tmp447++) { sb.Append(", "); } + if(0 < tmp458++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -6993,10 +7325,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("openSession_result("); - int tmp448 = 0; + int tmp459 = 0; if((Success != null) && __isset.success) { - if(0 < tmp448++) { sb.Append(", "); } + if(0 < tmp459++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -7125,10 +7457,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("closeSession_args("); - int tmp449 = 0; + int tmp460 = 0; if((Req != null) && __isset.req) { - if(0 < tmp449++) { sb.Append(", "); } + if(0 < tmp460++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -7261,10 +7593,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("closeSession_result("); - int tmp450 = 0; + int tmp461 = 0; if((Success != null) && __isset.success) { - if(0 < tmp450++) { sb.Append(", "); } + if(0 < tmp461++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -7393,10 +7725,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeStatement_args("); - int tmp451 = 0; + int tmp462 = 0; if((Req != null) && __isset.req) { - if(0 < tmp451++) { sb.Append(", "); } + if(0 < tmp462++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -7529,10 +7861,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeStatement_result("); - int tmp452 = 0; + int tmp463 = 0; if((Success != null) && __isset.success) { - if(0 < tmp452++) { sb.Append(", "); } + if(0 < tmp463++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -7661,10 +7993,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeBatchStatement_args("); - int tmp453 = 0; + int tmp464 = 0; if((Req != null) && __isset.req) { - if(0 < tmp453++) { sb.Append(", "); } + if(0 < tmp464++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -7797,10 +8129,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeBatchStatement_result("); - int tmp454 = 0; + int tmp465 = 0; if((Success != null) && __isset.success) { - if(0 < tmp454++) { sb.Append(", "); } + if(0 < tmp465++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -7929,10 +8261,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeQueryStatement_args("); - int tmp455 = 0; + int tmp466 = 0; if((Req != null) && __isset.req) { - if(0 < tmp455++) { sb.Append(", "); } + if(0 < tmp466++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -8065,10 +8397,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeQueryStatement_result("); - int tmp456 = 0; + int tmp467 = 0; if((Success != null) && __isset.success) { - if(0 < tmp456++) { sb.Append(", "); } + if(0 < tmp467++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -8197,10 +8529,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeUpdateStatement_args("); - int tmp457 = 0; + int tmp468 = 0; if((Req != null) && __isset.req) { - if(0 < tmp457++) { sb.Append(", "); } + if(0 < tmp468++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -8333,10 +8665,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeUpdateStatement_result("); - int tmp458 = 0; + int tmp469 = 0; if((Success != null) && __isset.success) { - if(0 < tmp458++) { sb.Append(", "); } + if(0 < tmp469++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -8465,10 +8797,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchResults_args("); - int tmp459 = 0; + int tmp470 = 0; if((Req != null) && __isset.req) { - if(0 < tmp459++) { sb.Append(", "); } + if(0 < tmp470++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -8601,10 +8933,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchResults_result("); - int tmp460 = 0; + int tmp471 = 0; if((Success != null) && __isset.success) { - if(0 < tmp460++) { sb.Append(", "); } + if(0 < tmp471++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -8733,10 +9065,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchMetadata_args("); - int tmp461 = 0; + int tmp472 = 0; if((Req != null) && __isset.req) { - if(0 < tmp461++) { sb.Append(", "); } + if(0 < tmp472++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -8869,10 +9201,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchMetadata_result("); - int tmp462 = 0; + int tmp473 = 0; if((Success != null) && __isset.success) { - if(0 < tmp462++) { sb.Append(", "); } + if(0 < tmp473++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -9001,10 +9333,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("cancelOperation_args("); - int tmp463 = 0; + int tmp474 = 0; if((Req != null) && __isset.req) { - if(0 < tmp463++) { sb.Append(", "); } + if(0 < tmp474++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -9137,10 +9469,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("cancelOperation_result("); - int tmp464 = 0; + int tmp475 = 0; if((Success != null) && __isset.success) { - if(0 < tmp464++) { sb.Append(", "); } + if(0 < tmp475++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -9269,10 +9601,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("closeOperation_args("); - int tmp465 = 0; + int tmp476 = 0; if((Req != null) && __isset.req) { - if(0 < tmp465++) { sb.Append(", "); } + if(0 < tmp476++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -9405,10 +9737,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("closeOperation_result("); - int tmp466 = 0; + int tmp477 = 0; if((Success != null) && __isset.success) { - if(0 < tmp466++) { sb.Append(", "); } + if(0 < tmp477++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -9536,10 +9868,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("getTimeZone_args("); - int tmp467 = 0; + int tmp478 = 0; if(__isset.sessionId) { - if(0 < tmp467++) { sb.Append(", "); } + if(0 < tmp478++) { sb.Append(", "); } sb.Append("SessionId: "); SessionId.ToString(sb); } @@ -9672,10 +10004,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("getTimeZone_result("); - int tmp468 = 0; + int tmp479 = 0; if((Success != null) && __isset.success) { - if(0 < tmp468++) { sb.Append(", "); } + if(0 < tmp479++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -9804,10 +10136,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("setTimeZone_args("); - int tmp469 = 0; + int tmp480 = 0; if((Req != null) && __isset.req) { - if(0 < tmp469++) { sb.Append(", "); } + if(0 < tmp480++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -9940,10 +10272,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("setTimeZone_result("); - int tmp470 = 0; + int tmp481 = 0; if((Success != null) && __isset.success) { - if(0 < tmp470++) { sb.Append(", "); } + if(0 < tmp481++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -10155,10 +10487,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("getProperties_result("); - int tmp472 = 0; + int tmp483 = 0; if((Success != null) && __isset.success) { - if(0 < tmp472++) { sb.Append(", "); } + if(0 < tmp483++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -10325,16 +10657,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("setStorageGroup_args("); - int tmp473 = 0; + int tmp484 = 0; if(__isset.sessionId) { - if(0 < tmp473++) { sb.Append(", "); } + if(0 < tmp484++) { sb.Append(", "); } sb.Append("SessionId: "); SessionId.ToString(sb); } if((StorageGroup != null) && __isset.storageGroup) { - if(0 < tmp473++) { sb.Append(", "); } + if(0 < tmp484++) { sb.Append(", "); } sb.Append("StorageGroup: "); StorageGroup.ToString(sb); } @@ -10467,10 +10799,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("setStorageGroup_result("); - int tmp474 = 0; + int tmp485 = 0; if((Success != null) && __isset.success) { - if(0 < tmp474++) { sb.Append(", "); } + if(0 < tmp485++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -10599,10 +10931,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createTimeseries_args("); - int tmp475 = 0; + int tmp486 = 0; if((Req != null) && __isset.req) { - if(0 < tmp475++) { sb.Append(", "); } + if(0 < tmp486++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -10735,10 +11067,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createTimeseries_result("); - int tmp476 = 0; + int tmp487 = 0; if((Success != null) && __isset.success) { - if(0 < tmp476++) { sb.Append(", "); } + if(0 < tmp487++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -10867,10 +11199,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createAlignedTimeseries_args("); - int tmp477 = 0; + int tmp488 = 0; if((Req != null) && __isset.req) { - if(0 < tmp477++) { sb.Append(", "); } + if(0 < tmp488++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -11003,10 +11335,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createAlignedTimeseries_result("); - int tmp478 = 0; + int tmp489 = 0; if((Success != null) && __isset.success) { - if(0 < tmp478++) { sb.Append(", "); } + if(0 < tmp489++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -11135,10 +11467,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createMultiTimeseries_args("); - int tmp479 = 0; + int tmp490 = 0; if((Req != null) && __isset.req) { - if(0 < tmp479++) { sb.Append(", "); } + if(0 < tmp490++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -11271,10 +11603,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createMultiTimeseries_result("); - int tmp480 = 0; + int tmp491 = 0; if((Success != null) && __isset.success) { - if(0 < tmp480++) { sb.Append(", "); } + if(0 < tmp491++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -11358,13 +11690,13 @@ public deleteTimeseriesArgs() if (field.Type == TType.List) { { - TList _list481 = await iprot.ReadListBeginAsync(cancellationToken); - Path = new List(_list481.Count); - for(int _i482 = 0; _i482 < _list481.Count; ++_i482) + TList _list492 = await iprot.ReadListBeginAsync(cancellationToken); + Path = new List(_list492.Count); + for(int _i493 = 0; _i493 < _list492.Count; ++_i493) { - string _elem483; - _elem483 = await iprot.ReadStringAsync(cancellationToken); - Path.Add(_elem483); + string _elem494; + _elem494 = await iprot.ReadStringAsync(cancellationToken); + Path.Add(_elem494); } await iprot.ReadListEndAsync(cancellationToken); } @@ -11415,9 +11747,9 @@ public deleteTimeseriesArgs() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Path.Count), cancellationToken); - foreach (string _iter484 in Path) + foreach (string _iter495 in Path) { - await oprot.WriteStringAsync(_iter484, cancellationToken); + await oprot.WriteStringAsync(_iter495, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -11458,16 +11790,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("deleteTimeseries_args("); - int tmp485 = 0; + int tmp496 = 0; if(__isset.sessionId) { - if(0 < tmp485++) { sb.Append(", "); } + if(0 < tmp496++) { sb.Append(", "); } sb.Append("SessionId: "); SessionId.ToString(sb); } if((Path != null) && __isset.path) { - if(0 < tmp485++) { sb.Append(", "); } + if(0 < tmp496++) { sb.Append(", "); } sb.Append("Path: "); Path.ToString(sb); } @@ -11600,10 +11932,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("deleteTimeseries_result("); - int tmp486 = 0; + int tmp497 = 0; if((Success != null) && __isset.success) { - if(0 < tmp486++) { sb.Append(", "); } + if(0 < tmp497++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -11687,13 +12019,13 @@ public deleteStorageGroupsArgs() if (field.Type == TType.List) { { - TList _list487 = await iprot.ReadListBeginAsync(cancellationToken); - StorageGroup = new List(_list487.Count); - for(int _i488 = 0; _i488 < _list487.Count; ++_i488) + TList _list498 = await iprot.ReadListBeginAsync(cancellationToken); + StorageGroup = new List(_list498.Count); + for(int _i499 = 0; _i499 < _list498.Count; ++_i499) { - string _elem489; - _elem489 = await iprot.ReadStringAsync(cancellationToken); - StorageGroup.Add(_elem489); + string _elem500; + _elem500 = await iprot.ReadStringAsync(cancellationToken); + StorageGroup.Add(_elem500); } await iprot.ReadListEndAsync(cancellationToken); } @@ -11744,9 +12076,9 @@ public deleteStorageGroupsArgs() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, StorageGroup.Count), cancellationToken); - foreach (string _iter490 in StorageGroup) + foreach (string _iter501 in StorageGroup) { - await oprot.WriteStringAsync(_iter490, cancellationToken); + await oprot.WriteStringAsync(_iter501, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -11787,16 +12119,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("deleteStorageGroups_args("); - int tmp491 = 0; + int tmp502 = 0; if(__isset.sessionId) { - if(0 < tmp491++) { sb.Append(", "); } + if(0 < tmp502++) { sb.Append(", "); } sb.Append("SessionId: "); SessionId.ToString(sb); } if((StorageGroup != null) && __isset.storageGroup) { - if(0 < tmp491++) { sb.Append(", "); } + if(0 < tmp502++) { sb.Append(", "); } sb.Append("StorageGroup: "); StorageGroup.ToString(sb); } @@ -11929,10 +12261,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("deleteStorageGroups_result("); - int tmp492 = 0; + int tmp503 = 0; if((Success != null) && __isset.success) { - if(0 < tmp492++) { sb.Append(", "); } + if(0 < tmp503++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -12061,10 +12393,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertRecord_args("); - int tmp493 = 0; + int tmp504 = 0; if((Req != null) && __isset.req) { - if(0 < tmp493++) { sb.Append(", "); } + if(0 < tmp504++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -12197,10 +12529,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertRecord_result("); - int tmp494 = 0; + int tmp505 = 0; if((Success != null) && __isset.success) { - if(0 < tmp494++) { sb.Append(", "); } + if(0 < tmp505++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -12329,10 +12661,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertStringRecord_args("); - int tmp495 = 0; + int tmp506 = 0; if((Req != null) && __isset.req) { - if(0 < tmp495++) { sb.Append(", "); } + if(0 < tmp506++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -12465,10 +12797,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertStringRecord_result("); - int tmp496 = 0; + int tmp507 = 0; if((Success != null) && __isset.success) { - if(0 < tmp496++) { sb.Append(", "); } + if(0 < tmp507++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -12597,10 +12929,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertTablet_args("); - int tmp497 = 0; + int tmp508 = 0; if((Req != null) && __isset.req) { - if(0 < tmp497++) { sb.Append(", "); } + if(0 < tmp508++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -12733,10 +13065,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertTablet_result("); - int tmp498 = 0; + int tmp509 = 0; if((Success != null) && __isset.success) { - if(0 < tmp498++) { sb.Append(", "); } + if(0 < tmp509++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -12865,10 +13197,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertTablets_args("); - int tmp499 = 0; + int tmp510 = 0; if((Req != null) && __isset.req) { - if(0 < tmp499++) { sb.Append(", "); } + if(0 < tmp510++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -13001,10 +13333,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertTablets_result("); - int tmp500 = 0; + int tmp511 = 0; if((Success != null) && __isset.success) { - if(0 < tmp500++) { sb.Append(", "); } + if(0 < tmp511++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -13133,10 +13465,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertRecords_args("); - int tmp501 = 0; + int tmp512 = 0; if((Req != null) && __isset.req) { - if(0 < tmp501++) { sb.Append(", "); } + if(0 < tmp512++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -13269,10 +13601,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertRecords_result("); - int tmp502 = 0; + int tmp513 = 0; if((Success != null) && __isset.success) { - if(0 < tmp502++) { sb.Append(", "); } + if(0 < tmp513++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -13401,10 +13733,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertRecordsOfOneDevice_args("); - int tmp503 = 0; + int tmp514 = 0; if((Req != null) && __isset.req) { - if(0 < tmp503++) { sb.Append(", "); } + if(0 < tmp514++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -13537,10 +13869,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertRecordsOfOneDevice_result("); - int tmp504 = 0; + int tmp515 = 0; if((Success != null) && __isset.success) { - if(0 < tmp504++) { sb.Append(", "); } + if(0 < tmp515++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -13669,10 +14001,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertStringRecordsOfOneDevice_args("); - int tmp505 = 0; + int tmp516 = 0; if((Req != null) && __isset.req) { - if(0 < tmp505++) { sb.Append(", "); } + if(0 < tmp516++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -13805,10 +14137,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertStringRecordsOfOneDevice_result("); - int tmp506 = 0; + int tmp517 = 0; if((Success != null) && __isset.success) { - if(0 < tmp506++) { sb.Append(", "); } + if(0 < tmp517++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -13937,10 +14269,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertStringRecords_args("); - int tmp507 = 0; + int tmp518 = 0; if((Req != null) && __isset.req) { - if(0 < tmp507++) { sb.Append(", "); } + if(0 < tmp518++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -14073,10 +14405,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertStringRecords_result("); - int tmp508 = 0; + int tmp519 = 0; if((Success != null) && __isset.success) { - if(0 < tmp508++) { sb.Append(", "); } + if(0 < tmp519++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -14205,10 +14537,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertTablet_args("); - int tmp509 = 0; + int tmp520 = 0; if((Req != null) && __isset.req) { - if(0 < tmp509++) { sb.Append(", "); } + if(0 < tmp520++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -14341,10 +14673,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertTablet_result("); - int tmp510 = 0; + int tmp521 = 0; if((Success != null) && __isset.success) { - if(0 < tmp510++) { sb.Append(", "); } + if(0 < tmp521++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -14473,10 +14805,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertTablets_args("); - int tmp511 = 0; + int tmp522 = 0; if((Req != null) && __isset.req) { - if(0 < tmp511++) { sb.Append(", "); } + if(0 < tmp522++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -14609,10 +14941,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertTablets_result("); - int tmp512 = 0; + int tmp523 = 0; if((Success != null) && __isset.success) { - if(0 < tmp512++) { sb.Append(", "); } + if(0 < tmp523++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -14741,10 +15073,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertRecord_args("); - int tmp513 = 0; + int tmp524 = 0; if((Req != null) && __isset.req) { - if(0 < tmp513++) { sb.Append(", "); } + if(0 < tmp524++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -14877,10 +15209,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertRecord_result("); - int tmp514 = 0; + int tmp525 = 0; if((Success != null) && __isset.success) { - if(0 < tmp514++) { sb.Append(", "); } + if(0 < tmp525++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -15009,10 +15341,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertStringRecord_args("); - int tmp515 = 0; + int tmp526 = 0; if((Req != null) && __isset.req) { - if(0 < tmp515++) { sb.Append(", "); } + if(0 < tmp526++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -15145,10 +15477,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertStringRecord_result("); - int tmp516 = 0; + int tmp527 = 0; if((Success != null) && __isset.success) { - if(0 < tmp516++) { sb.Append(", "); } + if(0 < tmp527++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -15277,10 +15609,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertRecords_args("); - int tmp517 = 0; + int tmp528 = 0; if((Req != null) && __isset.req) { - if(0 < tmp517++) { sb.Append(", "); } + if(0 < tmp528++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -15413,10 +15745,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertRecords_result("); - int tmp518 = 0; + int tmp529 = 0; if((Success != null) && __isset.success) { - if(0 < tmp518++) { sb.Append(", "); } + if(0 < tmp529++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -15545,10 +15877,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertRecordsOfOneDevice_args("); - int tmp519 = 0; + int tmp530 = 0; if((Req != null) && __isset.req) { - if(0 < tmp519++) { sb.Append(", "); } + if(0 < tmp530++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -15681,10 +16013,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertRecordsOfOneDevice_result("); - int tmp520 = 0; + int tmp531 = 0; if((Success != null) && __isset.success) { - if(0 < tmp520++) { sb.Append(", "); } + if(0 < tmp531++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -15813,10 +16145,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertStringRecords_args("); - int tmp521 = 0; + int tmp532 = 0; if((Req != null) && __isset.req) { - if(0 < tmp521++) { sb.Append(", "); } + if(0 < tmp532++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -15949,10 +16281,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertStringRecords_result("); - int tmp522 = 0; + int tmp533 = 0; if((Success != null) && __isset.success) { - if(0 < tmp522++) { sb.Append(", "); } + if(0 < tmp533++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -16081,10 +16413,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("deleteData_args("); - int tmp523 = 0; + int tmp534 = 0; if((Req != null) && __isset.req) { - if(0 < tmp523++) { sb.Append(", "); } + if(0 < tmp534++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -16217,10 +16549,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("deleteData_result("); - int tmp524 = 0; + int tmp535 = 0; if((Success != null) && __isset.success) { - if(0 < tmp524++) { sb.Append(", "); } + if(0 < tmp535++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -16349,10 +16681,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeRawDataQuery_args("); - int tmp525 = 0; + int tmp536 = 0; if((Req != null) && __isset.req) { - if(0 < tmp525++) { sb.Append(", "); } + if(0 < tmp536++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -16485,10 +16817,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeRawDataQuery_result("); - int tmp526 = 0; + int tmp537 = 0; if((Success != null) && __isset.success) { - if(0 < tmp526++) { sb.Append(", "); } + if(0 < tmp537++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -16617,10 +16949,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeLastDataQuery_args("); - int tmp527 = 0; + int tmp538 = 0; if((Req != null) && __isset.req) { - if(0 < tmp527++) { sb.Append(", "); } + if(0 < tmp538++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -16753,10 +17085,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeLastDataQuery_result("); - int tmp528 = 0; + int tmp539 = 0; if((Success != null) && __isset.success) { - if(0 < tmp528++) { sb.Append(", "); } + if(0 < tmp539++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -16885,10 +17217,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeAggregationQuery_args("); - int tmp529 = 0; + int tmp540 = 0; if((Req != null) && __isset.req) { - if(0 < tmp529++) { sb.Append(", "); } + if(0 < tmp540++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -17021,10 +17353,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeAggregationQuery_result("); - int tmp530 = 0; + int tmp541 = 0; if((Success != null) && __isset.success) { - if(0 < tmp530++) { sb.Append(", "); } + if(0 < tmp541++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -17152,10 +17484,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("requestStatementId_args("); - int tmp531 = 0; + int tmp542 = 0; if(__isset.sessionId) { - if(0 < tmp531++) { sb.Append(", "); } + if(0 < tmp542++) { sb.Append(", "); } sb.Append("SessionId: "); SessionId.ToString(sb); } @@ -17284,10 +17616,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("requestStatementId_result("); - int tmp532 = 0; + int tmp543 = 0; if(__isset.success) { - if(0 < tmp532++) { sb.Append(", "); } + if(0 < tmp543++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -17416,10 +17748,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createSchemaTemplate_args("); - int tmp533 = 0; + int tmp544 = 0; if((Req != null) && __isset.req) { - if(0 < tmp533++) { sb.Append(", "); } + if(0 < tmp544++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -17552,10 +17884,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createSchemaTemplate_result("); - int tmp534 = 0; + int tmp545 = 0; if((Success != null) && __isset.success) { - if(0 < tmp534++) { sb.Append(", "); } + if(0 < tmp545++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -17684,10 +18016,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("appendSchemaTemplate_args("); - int tmp535 = 0; + int tmp546 = 0; if((Req != null) && __isset.req) { - if(0 < tmp535++) { sb.Append(", "); } + if(0 < tmp546++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -17820,10 +18152,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("appendSchemaTemplate_result("); - int tmp536 = 0; + int tmp547 = 0; if((Success != null) && __isset.success) { - if(0 < tmp536++) { sb.Append(", "); } + if(0 < tmp547++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -17952,10 +18284,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("pruneSchemaTemplate_args("); - int tmp537 = 0; + int tmp548 = 0; if((Req != null) && __isset.req) { - if(0 < tmp537++) { sb.Append(", "); } + if(0 < tmp548++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -18088,10 +18420,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("pruneSchemaTemplate_result("); - int tmp538 = 0; + int tmp549 = 0; if((Success != null) && __isset.success) { - if(0 < tmp538++) { sb.Append(", "); } + if(0 < tmp549++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -18220,10 +18552,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("querySchemaTemplate_args("); - int tmp539 = 0; + int tmp550 = 0; if((Req != null) && __isset.req) { - if(0 < tmp539++) { sb.Append(", "); } + if(0 < tmp550++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -18356,10 +18688,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("querySchemaTemplate_result("); - int tmp540 = 0; + int tmp551 = 0; if((Success != null) && __isset.success) { - if(0 < tmp540++) { sb.Append(", "); } + if(0 < tmp551++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -18571,10 +18903,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("showConfigurationTemplate_result("); - int tmp542 = 0; + int tmp553 = 0; if((Success != null) && __isset.success) { - if(0 < tmp542++) { sb.Append(", "); } + if(0 < tmp553++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -18702,10 +19034,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("showConfiguration_args("); - int tmp543 = 0; + int tmp554 = 0; if(__isset.nodeId) { - if(0 < tmp543++) { sb.Append(", "); } + if(0 < tmp554++) { sb.Append(", "); } sb.Append("NodeId: "); NodeId.ToString(sb); } @@ -18838,10 +19170,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("showConfiguration_result("); - int tmp544 = 0; + int tmp555 = 0; if((Success != null) && __isset.success) { - if(0 < tmp544++) { sb.Append(", "); } + if(0 < tmp555++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -18970,10 +19302,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("setSchemaTemplate_args("); - int tmp545 = 0; + int tmp556 = 0; if((Req != null) && __isset.req) { - if(0 < tmp545++) { sb.Append(", "); } + if(0 < tmp556++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -19106,10 +19438,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("setSchemaTemplate_result("); - int tmp546 = 0; + int tmp557 = 0; if((Success != null) && __isset.success) { - if(0 < tmp546++) { sb.Append(", "); } + if(0 < tmp557++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -19238,10 +19570,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("unsetSchemaTemplate_args("); - int tmp547 = 0; + int tmp558 = 0; if((Req != null) && __isset.req) { - if(0 < tmp547++) { sb.Append(", "); } + if(0 < tmp558++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -19374,10 +19706,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("unsetSchemaTemplate_result("); - int tmp548 = 0; + int tmp559 = 0; if((Success != null) && __isset.success) { - if(0 < tmp548++) { sb.Append(", "); } + if(0 < tmp559++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -19506,10 +19838,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("dropSchemaTemplate_args("); - int tmp549 = 0; + int tmp560 = 0; if((Req != null) && __isset.req) { - if(0 < tmp549++) { sb.Append(", "); } + if(0 < tmp560++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -19642,10 +19974,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("dropSchemaTemplate_result("); - int tmp550 = 0; + int tmp561 = 0; if((Success != null) && __isset.success) { - if(0 < tmp550++) { sb.Append(", "); } + if(0 < tmp561++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -19774,10 +20106,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createTimeseriesUsingSchemaTemplate_args("); - int tmp551 = 0; + int tmp562 = 0; if((Req != null) && __isset.req) { - if(0 < tmp551++) { sb.Append(", "); } + if(0 < tmp562++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -19910,10 +20242,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createTimeseriesUsingSchemaTemplate_result("); - int tmp552 = 0; + int tmp563 = 0; if((Success != null) && __isset.success) { - if(0 < tmp552++) { sb.Append(", "); } + if(0 < tmp563++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -20042,10 +20374,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("handshake_args("); - int tmp553 = 0; + int tmp564 = 0; if((Info != null) && __isset.info) { - if(0 < tmp553++) { sb.Append(", "); } + if(0 < tmp564++) { sb.Append(", "); } sb.Append("Info: "); Info.ToString(sb); } @@ -20178,10 +20510,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("handshake_result("); - int tmp554 = 0; + int tmp565 = 0; if((Success != null) && __isset.success) { - if(0 < tmp554++) { sb.Append(", "); } + if(0 < tmp565++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -20309,10 +20641,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("sendPipeData_args("); - int tmp555 = 0; + int tmp566 = 0; if((Buff != null) && __isset.buff) { - if(0 < tmp555++) { sb.Append(", "); } + if(0 < tmp566++) { sb.Append(", "); } sb.Append("Buff: "); Buff.ToString(sb); } @@ -20445,10 +20777,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("sendPipeData_result("); - int tmp556 = 0; + int tmp567 = 0; if((Success != null) && __isset.success) { - if(0 < tmp556++) { sb.Append(", "); } + if(0 < tmp567++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -20616,16 +20948,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("sendFile_args("); - int tmp557 = 0; + int tmp568 = 0; if((MetaInfo != null) && __isset.metaInfo) { - if(0 < tmp557++) { sb.Append(", "); } + if(0 < tmp568++) { sb.Append(", "); } sb.Append("MetaInfo: "); MetaInfo.ToString(sb); } if((Buff != null) && __isset.buff) { - if(0 < tmp557++) { sb.Append(", "); } + if(0 < tmp568++) { sb.Append(", "); } sb.Append("Buff: "); Buff.ToString(sb); } @@ -20758,10 +21090,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("sendFile_result("); - int tmp558 = 0; + int tmp569 = 0; if((Success != null) && __isset.success) { - if(0 < tmp558++) { sb.Append(", "); } + if(0 < tmp569++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -20890,10 +21222,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("pipeTransfer_args("); - int tmp559 = 0; + int tmp570 = 0; if((Req != null) && __isset.req) { - if(0 < tmp559++) { sb.Append(", "); } + if(0 < tmp570++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -21026,10 +21358,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("pipeTransfer_result("); - int tmp560 = 0; + int tmp571 = 0; if((Success != null) && __isset.success) { - if(0 < tmp560++) { sb.Append(", "); } + if(0 < tmp571++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -21158,10 +21490,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("pipeSubscribe_args("); - int tmp561 = 0; + int tmp572 = 0; if((Req != null) && __isset.req) { - if(0 < tmp561++) { sb.Append(", "); } + if(0 < tmp572++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -21294,10 +21626,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("pipeSubscribe_result("); - int tmp562 = 0; + int tmp573 = 0; if((Success != null) && __isset.success) { - if(0 < tmp562++) { sb.Append(", "); } + if(0 < tmp573++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -21509,10 +21841,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("getBackupConfiguration_result("); - int tmp564 = 0; + int tmp575 = 0; if((Success != null) && __isset.success) { - if(0 < tmp564++) { sb.Append(", "); } + if(0 < tmp575++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -21724,10 +22056,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchAllConnectionsInfo_result("); - int tmp566 = 0; + int tmp577 = 0; if((Success != null) && __isset.success) { - if(0 < tmp566++) { sb.Append(", "); } + if(0 < tmp577++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -21939,10 +22271,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testConnectionEmptyRPC_result("); - int tmp568 = 0; + int tmp579 = 0; if((Success != null) && __isset.success) { - if(0 < tmp568++) { sb.Append(", "); } + if(0 < tmp579++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } diff --git a/src/Apache.IoTDB/Rpc/Generated/ServerProperties.cs b/src/Apache.IoTDB/Rpc/Generated/ServerProperties.cs index dcfe488..c5d3a49 100644 --- a/src/Apache.IoTDB/Rpc/Generated/ServerProperties.cs +++ b/src/Apache.IoTDB/Rpc/Generated/ServerProperties.cs @@ -165,13 +165,13 @@ public ServerProperties(string version, List supportedTimeAggregationOpe if (field.Type == TType.List) { { - TList _list374 = await iprot.ReadListBeginAsync(cancellationToken); - SupportedTimeAggregationOperations = new List(_list374.Count); - for(int _i375 = 0; _i375 < _list374.Count; ++_i375) + TList _list383 = await iprot.ReadListBeginAsync(cancellationToken); + SupportedTimeAggregationOperations = new List(_list383.Count); + for(int _i384 = 0; _i384 < _list383.Count; ++_i384) { - string _elem376; - _elem376 = await iprot.ReadStringAsync(cancellationToken); - SupportedTimeAggregationOperations.Add(_elem376); + string _elem385; + _elem385 = await iprot.ReadStringAsync(cancellationToken); + SupportedTimeAggregationOperations.Add(_elem385); } await iprot.ReadListEndAsync(cancellationToken); } @@ -296,9 +296,9 @@ public ServerProperties(string version, List supportedTimeAggregationOpe await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, SupportedTimeAggregationOperations.Count), cancellationToken); - foreach (string _iter377 in SupportedTimeAggregationOperations) + foreach (string _iter386 in SupportedTimeAggregationOperations) { - await oprot.WriteStringAsync(_iter377, cancellationToken); + await oprot.WriteStringAsync(_iter386, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TAggregationType.cs b/src/Apache.IoTDB/Rpc/Generated/TAggregationType.cs index b2af6d7..a8619cd 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TAggregationType.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TAggregationType.cs @@ -39,4 +39,7 @@ public enum TAggregationType LAST_BY = 26, MIN = 27, MAX = 28, + COUNT_ALL = 29, + APPROX_COUNT_DISTINCT = 30, + APPROX_MOST_FREQUENT = 31, } diff --git a/src/Apache.IoTDB/Rpc/Generated/TCreateTimeseriesUsingSchemaTemplateReq.cs b/src/Apache.IoTDB/Rpc/Generated/TCreateTimeseriesUsingSchemaTemplateReq.cs index c5b2d41..5f98b7a 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TCreateTimeseriesUsingSchemaTemplateReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TCreateTimeseriesUsingSchemaTemplateReq.cs @@ -80,13 +80,13 @@ public TCreateTimeseriesUsingSchemaTemplateReq(long sessionId, List devi if (field.Type == TType.List) { { - TList _list407 = await iprot.ReadListBeginAsync(cancellationToken); - DevicePathList = new List(_list407.Count); - for(int _i408 = 0; _i408 < _list407.Count; ++_i408) + TList _list416 = await iprot.ReadListBeginAsync(cancellationToken); + DevicePathList = new List(_list416.Count); + for(int _i417 = 0; _i417 < _list416.Count; ++_i417) { - string _elem409; - _elem409 = await iprot.ReadStringAsync(cancellationToken); - DevicePathList.Add(_elem409); + string _elem418; + _elem418 = await iprot.ReadStringAsync(cancellationToken); + DevicePathList.Add(_elem418); } await iprot.ReadListEndAsync(cancellationToken); } @@ -143,9 +143,9 @@ public TCreateTimeseriesUsingSchemaTemplateReq(long sessionId, List devi await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, DevicePathList.Count), cancellationToken); - foreach (string _iter410 in DevicePathList) + foreach (string _iter419 in DevicePathList) { - await oprot.WriteStringAsync(_iter410, cancellationToken); + await oprot.WriteStringAsync(_iter419, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TFilesResp.cs b/src/Apache.IoTDB/Rpc/Generated/TFilesResp.cs index 6337dce..4e1abe6 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TFilesResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TFilesResp.cs @@ -81,14 +81,14 @@ public TFilesResp(TSStatus status, List files) : this() if (field.Type == TType.List) { { - TList _list48 = await iprot.ReadListBeginAsync(cancellationToken); - Files = new List(_list48.Count); - for(int _i49 = 0; _i49 < _list48.Count; ++_i49) + TList _list52 = await iprot.ReadListBeginAsync(cancellationToken); + Files = new List(_list52.Count); + for(int _i53 = 0; _i53 < _list52.Count; ++_i53) { - TFile _elem50; - _elem50 = new TFile(); - await _elem50.ReadAsync(iprot, cancellationToken); - Files.Add(_elem50); + TFile _elem54; + _elem54 = new TFile(); + await _elem54.ReadAsync(iprot, cancellationToken); + Files.Add(_elem54); } await iprot.ReadListEndAsync(cancellationToken); } @@ -148,9 +148,9 @@ public TFilesResp(TSStatus status, List files) : this() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Struct, Files.Count), cancellationToken); - foreach (TFile _iter51 in Files) + foreach (TFile _iter55 in Files) { - await _iter51.WriteAsync(oprot, cancellationToken); + await _iter55.WriteAsync(oprot, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TFlushReq.cs b/src/Apache.IoTDB/Rpc/Generated/TFlushReq.cs index 79860a3..7091dad 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TFlushReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TFlushReq.cs @@ -33,6 +33,7 @@ public partial class TFlushReq : TBase { private string _isSeq; private List _storageGroups; + private List _regionIds; public string IsSeq { @@ -60,12 +61,26 @@ public List StorageGroups } } + public List RegionIds + { + get + { + return _regionIds; + } + set + { + __isset.regionIds = true; + this._regionIds = value; + } + } + public Isset __isset; public struct Isset { public bool isSeq; public bool storageGroups; + public bool regionIds; } public TFlushReq() @@ -119,6 +134,26 @@ public TFlushReq() await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; + case 3: + if (field.Type == TType.List) + { + { + TList _list23 = await iprot.ReadListBeginAsync(cancellationToken); + RegionIds = new List(_list23.Count); + for(int _i24 = 0; _i24 < _list23.Count; ++_i24) + { + string _elem25; + _elem25 = await iprot.ReadStringAsync(cancellationToken); + RegionIds.Add(_elem25); + } + await iprot.ReadListEndAsync(cancellationToken); + } + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; @@ -160,9 +195,25 @@ public TFlushReq() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, StorageGroups.Count), cancellationToken); - foreach (string _iter23 in StorageGroups) + foreach (string _iter26 in StorageGroups) + { + await oprot.WriteStringAsync(_iter26, cancellationToken); + } + await oprot.WriteListEndAsync(cancellationToken); + } + await oprot.WriteFieldEndAsync(cancellationToken); + } + if((RegionIds != null) && __isset.regionIds) + { + field.Name = "regionIds"; + field.Type = TType.List; + field.ID = 3; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + { + await oprot.WriteListBeginAsync(new TList(TType.String, RegionIds.Count), cancellationToken); + foreach (string _iter27 in RegionIds) { - await oprot.WriteStringAsync(_iter23, cancellationToken); + await oprot.WriteStringAsync(_iter27, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -182,7 +233,8 @@ public override bool Equals(object that) if (!(that is TFlushReq other)) return false; if (ReferenceEquals(this, other)) return true; return ((__isset.isSeq == other.__isset.isSeq) && ((!__isset.isSeq) || (System.Object.Equals(IsSeq, other.IsSeq)))) - && ((__isset.storageGroups == other.__isset.storageGroups) && ((!__isset.storageGroups) || (TCollections.Equals(StorageGroups, other.StorageGroups)))); + && ((__isset.storageGroups == other.__isset.storageGroups) && ((!__isset.storageGroups) || (TCollections.Equals(StorageGroups, other.StorageGroups)))) + && ((__isset.regionIds == other.__isset.regionIds) && ((!__isset.regionIds) || (TCollections.Equals(RegionIds, other.RegionIds)))); } public override int GetHashCode() { @@ -196,6 +248,10 @@ public override int GetHashCode() { { hashcode = (hashcode * 397) + TCollections.GetHashCode(StorageGroups); } + if((RegionIds != null) && __isset.regionIds) + { + hashcode = (hashcode * 397) + TCollections.GetHashCode(RegionIds); + } } return hashcode; } @@ -203,19 +259,25 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("TFlushReq("); - int tmp24 = 0; + int tmp28 = 0; if((IsSeq != null) && __isset.isSeq) { - if(0 < tmp24++) { sb.Append(", "); } + if(0 < tmp28++) { sb.Append(", "); } sb.Append("IsSeq: "); IsSeq.ToString(sb); } if((StorageGroups != null) && __isset.storageGroups) { - if(0 < tmp24++) { sb.Append(", "); } + if(0 < tmp28++) { sb.Append(", "); } sb.Append("StorageGroups: "); StorageGroups.ToString(sb); } + if((RegionIds != null) && __isset.regionIds) + { + if(0 < tmp28++) { sb.Append(", "); } + sb.Append("RegionIds: "); + RegionIds.ToString(sb); + } sb.Append(')'); return sb.ToString(); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TNodeLocations.cs b/src/Apache.IoTDB/Rpc/Generated/TNodeLocations.cs index a00dd53..868782b 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TNodeLocations.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TNodeLocations.cs @@ -93,14 +93,14 @@ public TNodeLocations() if (field.Type == TType.List) { { - TList _list77 = await iprot.ReadListBeginAsync(cancellationToken); - ConfigNodeLocations = new List(_list77.Count); - for(int _i78 = 0; _i78 < _list77.Count; ++_i78) + TList _list98 = await iprot.ReadListBeginAsync(cancellationToken); + ConfigNodeLocations = new List(_list98.Count); + for(int _i99 = 0; _i99 < _list98.Count; ++_i99) { - TConfigNodeLocation _elem79; - _elem79 = new TConfigNodeLocation(); - await _elem79.ReadAsync(iprot, cancellationToken); - ConfigNodeLocations.Add(_elem79); + TConfigNodeLocation _elem100; + _elem100 = new TConfigNodeLocation(); + await _elem100.ReadAsync(iprot, cancellationToken); + ConfigNodeLocations.Add(_elem100); } await iprot.ReadListEndAsync(cancellationToken); } @@ -114,14 +114,14 @@ public TNodeLocations() if (field.Type == TType.List) { { - TList _list80 = await iprot.ReadListBeginAsync(cancellationToken); - DataNodeLocations = new List(_list80.Count); - for(int _i81 = 0; _i81 < _list80.Count; ++_i81) + TList _list101 = await iprot.ReadListBeginAsync(cancellationToken); + DataNodeLocations = new List(_list101.Count); + for(int _i102 = 0; _i102 < _list101.Count; ++_i102) { - TDataNodeLocation _elem82; - _elem82 = new TDataNodeLocation(); - await _elem82.ReadAsync(iprot, cancellationToken); - DataNodeLocations.Add(_elem82); + TDataNodeLocation _elem103; + _elem103 = new TDataNodeLocation(); + await _elem103.ReadAsync(iprot, cancellationToken); + DataNodeLocations.Add(_elem103); } await iprot.ReadListEndAsync(cancellationToken); } @@ -163,9 +163,9 @@ public TNodeLocations() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Struct, ConfigNodeLocations.Count), cancellationToken); - foreach (TConfigNodeLocation _iter83 in ConfigNodeLocations) + foreach (TConfigNodeLocation _iter104 in ConfigNodeLocations) { - await _iter83.WriteAsync(oprot, cancellationToken); + await _iter104.WriteAsync(oprot, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -179,9 +179,9 @@ public TNodeLocations() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Struct, DataNodeLocations.Count), cancellationToken); - foreach (TDataNodeLocation _iter84 in DataNodeLocations) + foreach (TDataNodeLocation _iter105 in DataNodeLocations) { - await _iter84.WriteAsync(oprot, cancellationToken); + await _iter105.WriteAsync(oprot, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -222,16 +222,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("TNodeLocations("); - int tmp85 = 0; + int tmp106 = 0; if((ConfigNodeLocations != null) && __isset.configNodeLocations) { - if(0 < tmp85++) { sb.Append(", "); } + if(0 < tmp106++) { sb.Append(", "); } sb.Append("ConfigNodeLocations: "); ConfigNodeLocations.ToString(sb); } if((DataNodeLocations != null) && __isset.dataNodeLocations) { - if(0 < tmp85++) { sb.Append(", "); } + if(0 < tmp106++) { sb.Append(", "); } sb.Append("DataNodeLocations: "); DataNodeLocations.ToString(sb); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TPipeHeartbeatResp.cs b/src/Apache.IoTDB/Rpc/Generated/TPipeHeartbeatResp.cs new file mode 100644 index 0000000..501e3a3 --- /dev/null +++ b/src/Apache.IoTDB/Rpc/Generated/TPipeHeartbeatResp.cs @@ -0,0 +1,357 @@ +/** + * Autogenerated by Thrift Compiler (0.14.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Thrift; +using Thrift.Collections; + +using Thrift.Protocol; +using Thrift.Protocol.Entities; +using Thrift.Protocol.Utilities; +using Thrift.Transport; +using Thrift.Transport.Client; +using Thrift.Transport.Server; +using Thrift.Processor; + + +#pragma warning disable IDE0079 // remove unnecessary pragmas +#pragma warning disable IDE1006 // parts of the code use IDL spelling + + +public partial class TPipeHeartbeatResp : TBase +{ + private List _pipeCompletedList; + private List _pipeRemainingEventCountList; + private List _pipeRemainingTimeList; + + public List PipeMetaList { get; set; } + + public List PipeCompletedList + { + get + { + return _pipeCompletedList; + } + set + { + __isset.pipeCompletedList = true; + this._pipeCompletedList = value; + } + } + + public List PipeRemainingEventCountList + { + get + { + return _pipeRemainingEventCountList; + } + set + { + __isset.pipeRemainingEventCountList = true; + this._pipeRemainingEventCountList = value; + } + } + + public List PipeRemainingTimeList + { + get + { + return _pipeRemainingTimeList; + } + set + { + __isset.pipeRemainingTimeList = true; + this._pipeRemainingTimeList = value; + } + } + + + public Isset __isset; + public struct Isset + { + public bool pipeCompletedList; + public bool pipeRemainingEventCountList; + public bool pipeRemainingTimeList; + } + + public TPipeHeartbeatResp() + { + } + + public TPipeHeartbeatResp(List pipeMetaList) : this() + { + this.PipeMetaList = pipeMetaList; + } + + public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) + { + iprot.IncrementRecursionDepth(); + try + { + bool isset_pipeMetaList = false; + TField field; + await iprot.ReadStructBeginAsync(cancellationToken); + while (true) + { + field = await iprot.ReadFieldBeginAsync(cancellationToken); + if (field.Type == TType.Stop) + { + break; + } + + switch (field.ID) + { + case 1: + if (field.Type == TType.List) + { + { + TList _list71 = await iprot.ReadListBeginAsync(cancellationToken); + PipeMetaList = new List(_list71.Count); + for(int _i72 = 0; _i72 < _list71.Count; ++_i72) + { + byte[] _elem73; + _elem73 = await iprot.ReadBinaryAsync(cancellationToken); + PipeMetaList.Add(_elem73); + } + await iprot.ReadListEndAsync(cancellationToken); + } + isset_pipeMetaList = true; + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 2: + if (field.Type == TType.List) + { + { + TList _list74 = await iprot.ReadListBeginAsync(cancellationToken); + PipeCompletedList = new List(_list74.Count); + for(int _i75 = 0; _i75 < _list74.Count; ++_i75) + { + bool _elem76; + _elem76 = await iprot.ReadBoolAsync(cancellationToken); + PipeCompletedList.Add(_elem76); + } + await iprot.ReadListEndAsync(cancellationToken); + } + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 3: + if (field.Type == TType.List) + { + { + TList _list77 = await iprot.ReadListBeginAsync(cancellationToken); + PipeRemainingEventCountList = new List(_list77.Count); + for(int _i78 = 0; _i78 < _list77.Count; ++_i78) + { + long _elem79; + _elem79 = await iprot.ReadI64Async(cancellationToken); + PipeRemainingEventCountList.Add(_elem79); + } + await iprot.ReadListEndAsync(cancellationToken); + } + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 4: + if (field.Type == TType.List) + { + { + TList _list80 = await iprot.ReadListBeginAsync(cancellationToken); + PipeRemainingTimeList = new List(_list80.Count); + for(int _i81 = 0; _i81 < _list80.Count; ++_i81) + { + double _elem82; + _elem82 = await iprot.ReadDoubleAsync(cancellationToken); + PipeRemainingTimeList.Add(_elem82); + } + await iprot.ReadListEndAsync(cancellationToken); + } + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + default: + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + break; + } + + await iprot.ReadFieldEndAsync(cancellationToken); + } + + await iprot.ReadStructEndAsync(cancellationToken); + if (!isset_pipeMetaList) + { + throw new TProtocolException(TProtocolException.INVALID_DATA); + } + } + finally + { + iprot.DecrementRecursionDepth(); + } + } + + public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) + { + oprot.IncrementRecursionDepth(); + try + { + var struc = new TStruct("TPipeHeartbeatResp"); + await oprot.WriteStructBeginAsync(struc, cancellationToken); + var field = new TField(); + if((PipeMetaList != null)) + { + field.Name = "pipeMetaList"; + field.Type = TType.List; + field.ID = 1; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + { + await oprot.WriteListBeginAsync(new TList(TType.String, PipeMetaList.Count), cancellationToken); + foreach (byte[] _iter83 in PipeMetaList) + { + await oprot.WriteBinaryAsync(_iter83, cancellationToken); + } + await oprot.WriteListEndAsync(cancellationToken); + } + await oprot.WriteFieldEndAsync(cancellationToken); + } + if((PipeCompletedList != null) && __isset.pipeCompletedList) + { + field.Name = "pipeCompletedList"; + field.Type = TType.List; + field.ID = 2; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + { + await oprot.WriteListBeginAsync(new TList(TType.Bool, PipeCompletedList.Count), cancellationToken); + foreach (bool _iter84 in PipeCompletedList) + { + await oprot.WriteBoolAsync(_iter84, cancellationToken); + } + await oprot.WriteListEndAsync(cancellationToken); + } + await oprot.WriteFieldEndAsync(cancellationToken); + } + if((PipeRemainingEventCountList != null) && __isset.pipeRemainingEventCountList) + { + field.Name = "pipeRemainingEventCountList"; + field.Type = TType.List; + field.ID = 3; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + { + await oprot.WriteListBeginAsync(new TList(TType.I64, PipeRemainingEventCountList.Count), cancellationToken); + foreach (long _iter85 in PipeRemainingEventCountList) + { + await oprot.WriteI64Async(_iter85, cancellationToken); + } + await oprot.WriteListEndAsync(cancellationToken); + } + await oprot.WriteFieldEndAsync(cancellationToken); + } + if((PipeRemainingTimeList != null) && __isset.pipeRemainingTimeList) + { + field.Name = "pipeRemainingTimeList"; + field.Type = TType.List; + field.ID = 4; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + { + await oprot.WriteListBeginAsync(new TList(TType.Double, PipeRemainingTimeList.Count), cancellationToken); + foreach (double _iter86 in PipeRemainingTimeList) + { + await oprot.WriteDoubleAsync(_iter86, cancellationToken); + } + await oprot.WriteListEndAsync(cancellationToken); + } + await oprot.WriteFieldEndAsync(cancellationToken); + } + await oprot.WriteFieldStopAsync(cancellationToken); + await oprot.WriteStructEndAsync(cancellationToken); + } + finally + { + oprot.DecrementRecursionDepth(); + } + } + + public override bool Equals(object that) + { + if (!(that is TPipeHeartbeatResp other)) return false; + if (ReferenceEquals(this, other)) return true; + return TCollections.Equals(PipeMetaList, other.PipeMetaList) + && ((__isset.pipeCompletedList == other.__isset.pipeCompletedList) && ((!__isset.pipeCompletedList) || (TCollections.Equals(PipeCompletedList, other.PipeCompletedList)))) + && ((__isset.pipeRemainingEventCountList == other.__isset.pipeRemainingEventCountList) && ((!__isset.pipeRemainingEventCountList) || (TCollections.Equals(PipeRemainingEventCountList, other.PipeRemainingEventCountList)))) + && ((__isset.pipeRemainingTimeList == other.__isset.pipeRemainingTimeList) && ((!__isset.pipeRemainingTimeList) || (TCollections.Equals(PipeRemainingTimeList, other.PipeRemainingTimeList)))); + } + + public override int GetHashCode() { + int hashcode = 157; + unchecked { + if((PipeMetaList != null)) + { + hashcode = (hashcode * 397) + TCollections.GetHashCode(PipeMetaList); + } + if((PipeCompletedList != null) && __isset.pipeCompletedList) + { + hashcode = (hashcode * 397) + TCollections.GetHashCode(PipeCompletedList); + } + if((PipeRemainingEventCountList != null) && __isset.pipeRemainingEventCountList) + { + hashcode = (hashcode * 397) + TCollections.GetHashCode(PipeRemainingEventCountList); + } + if((PipeRemainingTimeList != null) && __isset.pipeRemainingTimeList) + { + hashcode = (hashcode * 397) + TCollections.GetHashCode(PipeRemainingTimeList); + } + } + return hashcode; + } + + public override string ToString() + { + var sb = new StringBuilder("TPipeHeartbeatResp("); + if((PipeMetaList != null)) + { + sb.Append(", PipeMetaList: "); + PipeMetaList.ToString(sb); + } + if((PipeCompletedList != null) && __isset.pipeCompletedList) + { + sb.Append(", PipeCompletedList: "); + PipeCompletedList.ToString(sb); + } + if((PipeRemainingEventCountList != null) && __isset.pipeRemainingEventCountList) + { + sb.Append(", PipeRemainingEventCountList: "); + PipeRemainingEventCountList.ToString(sb); + } + if((PipeRemainingTimeList != null) && __isset.pipeRemainingTimeList) + { + sb.Append(", PipeRemainingTimeList: "); + PipeRemainingTimeList.ToString(sb); + } + sb.Append(')'); + return sb.ToString(); + } +} + diff --git a/src/Apache.IoTDB/Rpc/Generated/TPipeSubscribeResp.cs b/src/Apache.IoTDB/Rpc/Generated/TPipeSubscribeResp.cs index e44ac85..f8e48e9 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TPipeSubscribeResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TPipeSubscribeResp.cs @@ -128,13 +128,13 @@ public TPipeSubscribeResp(TSStatus status, sbyte version, short type) : this() if (field.Type == TType.List) { { - TList _list417 = await iprot.ReadListBeginAsync(cancellationToken); - Body = new List(_list417.Count); - for(int _i418 = 0; _i418 < _list417.Count; ++_i418) + TList _list426 = await iprot.ReadListBeginAsync(cancellationToken); + Body = new List(_list426.Count); + for(int _i427 = 0; _i427 < _list426.Count; ++_i427) { - byte[] _elem419; - _elem419 = await iprot.ReadBinaryAsync(cancellationToken); - Body.Add(_elem419); + byte[] _elem428; + _elem428 = await iprot.ReadBinaryAsync(cancellationToken); + Body.Add(_elem428); } await iprot.ReadListEndAsync(cancellationToken); } @@ -209,9 +209,9 @@ public TPipeSubscribeResp(TSStatus status, sbyte version, short type) : this() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Body.Count), cancellationToken); - foreach (byte[] _iter420 in Body) + foreach (byte[] _iter429 in Body) { - await oprot.WriteBinaryAsync(_iter420, cancellationToken); + await oprot.WriteBinaryAsync(_iter429, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSAggregationQueryReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSAggregationQueryReq.cs index c6b14e0..815ae49 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSAggregationQueryReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSAggregationQueryReq.cs @@ -210,13 +210,13 @@ public TSAggregationQueryReq(long sessionId, long statementId, List path if (field.Type == TType.List) { { - TList _list316 = await iprot.ReadListBeginAsync(cancellationToken); - Paths = new List(_list316.Count); - for(int _i317 = 0; _i317 < _list316.Count; ++_i317) + TList _list325 = await iprot.ReadListBeginAsync(cancellationToken); + Paths = new List(_list325.Count); + for(int _i326 = 0; _i326 < _list325.Count; ++_i326) { - string _elem318; - _elem318 = await iprot.ReadStringAsync(cancellationToken); - Paths.Add(_elem318); + string _elem327; + _elem327 = await iprot.ReadStringAsync(cancellationToken); + Paths.Add(_elem327); } await iprot.ReadListEndAsync(cancellationToken); } @@ -231,13 +231,13 @@ public TSAggregationQueryReq(long sessionId, long statementId, List path if (field.Type == TType.List) { { - TList _list319 = await iprot.ReadListBeginAsync(cancellationToken); - Aggregations = new List(_list319.Count); - for(int _i320 = 0; _i320 < _list319.Count; ++_i320) + TList _list328 = await iprot.ReadListBeginAsync(cancellationToken); + Aggregations = new List(_list328.Count); + for(int _i329 = 0; _i329 < _list328.Count; ++_i329) { - TAggregationType _elem321; - _elem321 = (TAggregationType)await iprot.ReadI32Async(cancellationToken); - Aggregations.Add(_elem321); + TAggregationType _elem330; + _elem330 = (TAggregationType)await iprot.ReadI32Async(cancellationToken); + Aggregations.Add(_elem330); } await iprot.ReadListEndAsync(cancellationToken); } @@ -378,9 +378,9 @@ public TSAggregationQueryReq(long sessionId, long statementId, List path await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken); - foreach (string _iter322 in Paths) + foreach (string _iter331 in Paths) { - await oprot.WriteStringAsync(_iter322, cancellationToken); + await oprot.WriteStringAsync(_iter331, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -394,9 +394,9 @@ public TSAggregationQueryReq(long sessionId, long statementId, List path await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Aggregations.Count), cancellationToken); - foreach (TAggregationType _iter323 in Aggregations) + foreach (TAggregationType _iter332 in Aggregations) { - await oprot.WriteI32Async((int)_iter323, cancellationToken); + await oprot.WriteI32Async((int)_iter332, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSAppendSchemaTemplateReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSAppendSchemaTemplateReq.cs index 8fac227..f9c02ac 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSAppendSchemaTemplateReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSAppendSchemaTemplateReq.cs @@ -122,13 +122,13 @@ public TSAppendSchemaTemplateReq(long sessionId, string name, bool isAligned, Li if (field.Type == TType.List) { { - TList _list381 = await iprot.ReadListBeginAsync(cancellationToken); - Measurements = new List(_list381.Count); - for(int _i382 = 0; _i382 < _list381.Count; ++_i382) + TList _list390 = await iprot.ReadListBeginAsync(cancellationToken); + Measurements = new List(_list390.Count); + for(int _i391 = 0; _i391 < _list390.Count; ++_i391) { - string _elem383; - _elem383 = await iprot.ReadStringAsync(cancellationToken); - Measurements.Add(_elem383); + string _elem392; + _elem392 = await iprot.ReadStringAsync(cancellationToken); + Measurements.Add(_elem392); } await iprot.ReadListEndAsync(cancellationToken); } @@ -143,13 +143,13 @@ public TSAppendSchemaTemplateReq(long sessionId, string name, bool isAligned, Li if (field.Type == TType.List) { { - TList _list384 = await iprot.ReadListBeginAsync(cancellationToken); - DataTypes = new List(_list384.Count); - for(int _i385 = 0; _i385 < _list384.Count; ++_i385) + TList _list393 = await iprot.ReadListBeginAsync(cancellationToken); + DataTypes = new List(_list393.Count); + for(int _i394 = 0; _i394 < _list393.Count; ++_i394) { - int _elem386; - _elem386 = await iprot.ReadI32Async(cancellationToken); - DataTypes.Add(_elem386); + int _elem395; + _elem395 = await iprot.ReadI32Async(cancellationToken); + DataTypes.Add(_elem395); } await iprot.ReadListEndAsync(cancellationToken); } @@ -164,13 +164,13 @@ public TSAppendSchemaTemplateReq(long sessionId, string name, bool isAligned, Li if (field.Type == TType.List) { { - TList _list387 = await iprot.ReadListBeginAsync(cancellationToken); - Encodings = new List(_list387.Count); - for(int _i388 = 0; _i388 < _list387.Count; ++_i388) + TList _list396 = await iprot.ReadListBeginAsync(cancellationToken); + Encodings = new List(_list396.Count); + for(int _i397 = 0; _i397 < _list396.Count; ++_i397) { - int _elem389; - _elem389 = await iprot.ReadI32Async(cancellationToken); - Encodings.Add(_elem389); + int _elem398; + _elem398 = await iprot.ReadI32Async(cancellationToken); + Encodings.Add(_elem398); } await iprot.ReadListEndAsync(cancellationToken); } @@ -185,13 +185,13 @@ public TSAppendSchemaTemplateReq(long sessionId, string name, bool isAligned, Li if (field.Type == TType.List) { { - TList _list390 = await iprot.ReadListBeginAsync(cancellationToken); - Compressors = new List(_list390.Count); - for(int _i391 = 0; _i391 < _list390.Count; ++_i391) + TList _list399 = await iprot.ReadListBeginAsync(cancellationToken); + Compressors = new List(_list399.Count); + for(int _i400 = 0; _i400 < _list399.Count; ++_i400) { - int _elem392; - _elem392 = await iprot.ReadI32Async(cancellationToken); - Compressors.Add(_elem392); + int _elem401; + _elem401 = await iprot.ReadI32Async(cancellationToken); + Compressors.Add(_elem401); } await iprot.ReadListEndAsync(cancellationToken); } @@ -283,9 +283,9 @@ public TSAppendSchemaTemplateReq(long sessionId, string name, bool isAligned, Li await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Measurements.Count), cancellationToken); - foreach (string _iter393 in Measurements) + foreach (string _iter402 in Measurements) { - await oprot.WriteStringAsync(_iter393, cancellationToken); + await oprot.WriteStringAsync(_iter402, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -299,9 +299,9 @@ public TSAppendSchemaTemplateReq(long sessionId, string name, bool isAligned, Li await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, DataTypes.Count), cancellationToken); - foreach (int _iter394 in DataTypes) + foreach (int _iter403 in DataTypes) { - await oprot.WriteI32Async(_iter394, cancellationToken); + await oprot.WriteI32Async(_iter403, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -315,9 +315,9 @@ public TSAppendSchemaTemplateReq(long sessionId, string name, bool isAligned, Li await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Encodings.Count), cancellationToken); - foreach (int _iter395 in Encodings) + foreach (int _iter404 in Encodings) { - await oprot.WriteI32Async(_iter395, cancellationToken); + await oprot.WriteI32Async(_iter404, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -331,9 +331,9 @@ public TSAppendSchemaTemplateReq(long sessionId, string name, bool isAligned, Li await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Compressors.Count), cancellationToken); - foreach (int _iter396 in Compressors) + foreach (int _iter405 in Compressors) { - await oprot.WriteI32Async(_iter396, cancellationToken); + await oprot.WriteI32Async(_iter405, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSConnectionInfoResp.cs b/src/Apache.IoTDB/Rpc/Generated/TSConnectionInfoResp.cs index 4e5869f..ae3b47a 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSConnectionInfoResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSConnectionInfoResp.cs @@ -65,14 +65,14 @@ public TSConnectionInfoResp(List connectionInfoList) : this() if (field.Type == TType.List) { { - TList _list424 = await iprot.ReadListBeginAsync(cancellationToken); - ConnectionInfoList = new List(_list424.Count); - for(int _i425 = 0; _i425 < _list424.Count; ++_i425) + TList _list433 = await iprot.ReadListBeginAsync(cancellationToken); + ConnectionInfoList = new List(_list433.Count); + for(int _i434 = 0; _i434 < _list433.Count; ++_i434) { - TSConnectionInfo _elem426; - _elem426 = new TSConnectionInfo(); - await _elem426.ReadAsync(iprot, cancellationToken); - ConnectionInfoList.Add(_elem426); + TSConnectionInfo _elem435; + _elem435 = new TSConnectionInfo(); + await _elem435.ReadAsync(iprot, cancellationToken); + ConnectionInfoList.Add(_elem435); } await iprot.ReadListEndAsync(cancellationToken); } @@ -119,9 +119,9 @@ public TSConnectionInfoResp(List connectionInfoList) : this() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Struct, ConnectionInfoList.Count), cancellationToken); - foreach (TSConnectionInfo _iter427 in ConnectionInfoList) + foreach (TSConnectionInfo _iter436 in ConnectionInfoList) { - await _iter427.WriteAsync(oprot, cancellationToken); + await _iter436.WriteAsync(oprot, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSCreateAlignedTimeseriesReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSCreateAlignedTimeseriesReq.cs index 94a9316..869abf2 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSCreateAlignedTimeseriesReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSCreateAlignedTimeseriesReq.cs @@ -158,13 +158,13 @@ public TSCreateAlignedTimeseriesReq(long sessionId, string prefixPath, List(_list262.Count); - for(int _i263 = 0; _i263 < _list262.Count; ++_i263) + TList _list266 = await iprot.ReadListBeginAsync(cancellationToken); + Measurements = new List(_list266.Count); + for(int _i267 = 0; _i267 < _list266.Count; ++_i267) { - string _elem264; - _elem264 = await iprot.ReadStringAsync(cancellationToken); - Measurements.Add(_elem264); + string _elem268; + _elem268 = await iprot.ReadStringAsync(cancellationToken); + Measurements.Add(_elem268); } await iprot.ReadListEndAsync(cancellationToken); } @@ -179,13 +179,13 @@ public TSCreateAlignedTimeseriesReq(long sessionId, string prefixPath, List(_list265.Count); - for(int _i266 = 0; _i266 < _list265.Count; ++_i266) + TList _list269 = await iprot.ReadListBeginAsync(cancellationToken); + DataTypes = new List(_list269.Count); + for(int _i270 = 0; _i270 < _list269.Count; ++_i270) { - int _elem267; - _elem267 = await iprot.ReadI32Async(cancellationToken); - DataTypes.Add(_elem267); + int _elem271; + _elem271 = await iprot.ReadI32Async(cancellationToken); + DataTypes.Add(_elem271); } await iprot.ReadListEndAsync(cancellationToken); } @@ -200,13 +200,13 @@ public TSCreateAlignedTimeseriesReq(long sessionId, string prefixPath, List(_list268.Count); - for(int _i269 = 0; _i269 < _list268.Count; ++_i269) + TList _list272 = await iprot.ReadListBeginAsync(cancellationToken); + Encodings = new List(_list272.Count); + for(int _i273 = 0; _i273 < _list272.Count; ++_i273) { - int _elem270; - _elem270 = await iprot.ReadI32Async(cancellationToken); - Encodings.Add(_elem270); + int _elem274; + _elem274 = await iprot.ReadI32Async(cancellationToken); + Encodings.Add(_elem274); } await iprot.ReadListEndAsync(cancellationToken); } @@ -221,13 +221,13 @@ public TSCreateAlignedTimeseriesReq(long sessionId, string prefixPath, List(_list271.Count); - for(int _i272 = 0; _i272 < _list271.Count; ++_i272) + TList _list275 = await iprot.ReadListBeginAsync(cancellationToken); + Compressors = new List(_list275.Count); + for(int _i276 = 0; _i276 < _list275.Count; ++_i276) { - int _elem273; - _elem273 = await iprot.ReadI32Async(cancellationToken); - Compressors.Add(_elem273); + int _elem277; + _elem277 = await iprot.ReadI32Async(cancellationToken); + Compressors.Add(_elem277); } await iprot.ReadListEndAsync(cancellationToken); } @@ -242,13 +242,13 @@ public TSCreateAlignedTimeseriesReq(long sessionId, string prefixPath, List(_list274.Count); - for(int _i275 = 0; _i275 < _list274.Count; ++_i275) + TList _list278 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementAlias = new List(_list278.Count); + for(int _i279 = 0; _i279 < _list278.Count; ++_i279) { - string _elem276; - _elem276 = await iprot.ReadStringAsync(cancellationToken); - MeasurementAlias.Add(_elem276); + string _elem280; + _elem280 = await iprot.ReadStringAsync(cancellationToken); + MeasurementAlias.Add(_elem280); } await iprot.ReadListEndAsync(cancellationToken); } @@ -262,25 +262,25 @@ public TSCreateAlignedTimeseriesReq(long sessionId, string prefixPath, List>(_list277.Count); - for(int _i278 = 0; _i278 < _list277.Count; ++_i278) + TList _list281 = await iprot.ReadListBeginAsync(cancellationToken); + TagsList = new List>(_list281.Count); + for(int _i282 = 0; _i282 < _list281.Count; ++_i282) { - Dictionary _elem279; + Dictionary _elem283; { - TMap _map280 = await iprot.ReadMapBeginAsync(cancellationToken); - _elem279 = new Dictionary(_map280.Count); - for(int _i281 = 0; _i281 < _map280.Count; ++_i281) + TMap _map284 = await iprot.ReadMapBeginAsync(cancellationToken); + _elem283 = new Dictionary(_map284.Count); + for(int _i285 = 0; _i285 < _map284.Count; ++_i285) { - string _key282; - string _val283; - _key282 = await iprot.ReadStringAsync(cancellationToken); - _val283 = await iprot.ReadStringAsync(cancellationToken); - _elem279[_key282] = _val283; + string _key286; + string _val287; + _key286 = await iprot.ReadStringAsync(cancellationToken); + _val287 = await iprot.ReadStringAsync(cancellationToken); + _elem283[_key286] = _val287; } await iprot.ReadMapEndAsync(cancellationToken); } - TagsList.Add(_elem279); + TagsList.Add(_elem283); } await iprot.ReadListEndAsync(cancellationToken); } @@ -294,25 +294,25 @@ public TSCreateAlignedTimeseriesReq(long sessionId, string prefixPath, List>(_list284.Count); - for(int _i285 = 0; _i285 < _list284.Count; ++_i285) + TList _list288 = await iprot.ReadListBeginAsync(cancellationToken); + AttributesList = new List>(_list288.Count); + for(int _i289 = 0; _i289 < _list288.Count; ++_i289) { - Dictionary _elem286; + Dictionary _elem290; { - TMap _map287 = await iprot.ReadMapBeginAsync(cancellationToken); - _elem286 = new Dictionary(_map287.Count); - for(int _i288 = 0; _i288 < _map287.Count; ++_i288) + TMap _map291 = await iprot.ReadMapBeginAsync(cancellationToken); + _elem290 = new Dictionary(_map291.Count); + for(int _i292 = 0; _i292 < _map291.Count; ++_i292) { - string _key289; - string _val290; - _key289 = await iprot.ReadStringAsync(cancellationToken); - _val290 = await iprot.ReadStringAsync(cancellationToken); - _elem286[_key289] = _val290; + string _key293; + string _val294; + _key293 = await iprot.ReadStringAsync(cancellationToken); + _val294 = await iprot.ReadStringAsync(cancellationToken); + _elem290[_key293] = _val294; } await iprot.ReadMapEndAsync(cancellationToken); } - AttributesList.Add(_elem286); + AttributesList.Add(_elem290); } await iprot.ReadListEndAsync(cancellationToken); } @@ -393,9 +393,9 @@ public TSCreateAlignedTimeseriesReq(long sessionId, string prefixPath, List _iter296 in TagsList) + foreach (Dictionary _iter300 in TagsList) { { - await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter296.Count), cancellationToken); - foreach (string _iter297 in _iter296.Keys) + await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter300.Count), cancellationToken); + foreach (string _iter301 in _iter300.Keys) { - await oprot.WriteStringAsync(_iter297, cancellationToken); - await oprot.WriteStringAsync(_iter296[_iter297], cancellationToken); + await oprot.WriteStringAsync(_iter301, cancellationToken); + await oprot.WriteStringAsync(_iter300[_iter301], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -497,14 +497,14 @@ public TSCreateAlignedTimeseriesReq(long sessionId, string prefixPath, List _iter298 in AttributesList) + foreach (Dictionary _iter302 in AttributesList) { { - await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter298.Count), cancellationToken); - foreach (string _iter299 in _iter298.Keys) + await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter302.Count), cancellationToken); + foreach (string _iter303 in _iter302.Keys) { - await oprot.WriteStringAsync(_iter299, cancellationToken); - await oprot.WriteStringAsync(_iter298[_iter299], cancellationToken); + await oprot.WriteStringAsync(_iter303, cancellationToken); + await oprot.WriteStringAsync(_iter302[_iter303], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSCreateMultiTimeseriesReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSCreateMultiTimeseriesReq.cs index c917a7e..f1e427c 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSCreateMultiTimeseriesReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSCreateMultiTimeseriesReq.cs @@ -158,13 +158,13 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List if (field.Type == TType.List) { { - TList _list326 = await iprot.ReadListBeginAsync(cancellationToken); - Paths = new List(_list326.Count); - for(int _i327 = 0; _i327 < _list326.Count; ++_i327) + TList _list335 = await iprot.ReadListBeginAsync(cancellationToken); + Paths = new List(_list335.Count); + for(int _i336 = 0; _i336 < _list335.Count; ++_i336) { - string _elem328; - _elem328 = await iprot.ReadStringAsync(cancellationToken); - Paths.Add(_elem328); + string _elem337; + _elem337 = await iprot.ReadStringAsync(cancellationToken); + Paths.Add(_elem337); } await iprot.ReadListEndAsync(cancellationToken); } @@ -179,13 +179,13 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List if (field.Type == TType.List) { { - TList _list329 = await iprot.ReadListBeginAsync(cancellationToken); - DataTypes = new List(_list329.Count); - for(int _i330 = 0; _i330 < _list329.Count; ++_i330) + TList _list338 = await iprot.ReadListBeginAsync(cancellationToken); + DataTypes = new List(_list338.Count); + for(int _i339 = 0; _i339 < _list338.Count; ++_i339) { - int _elem331; - _elem331 = await iprot.ReadI32Async(cancellationToken); - DataTypes.Add(_elem331); + int _elem340; + _elem340 = await iprot.ReadI32Async(cancellationToken); + DataTypes.Add(_elem340); } await iprot.ReadListEndAsync(cancellationToken); } @@ -200,13 +200,13 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List if (field.Type == TType.List) { { - TList _list332 = await iprot.ReadListBeginAsync(cancellationToken); - Encodings = new List(_list332.Count); - for(int _i333 = 0; _i333 < _list332.Count; ++_i333) + TList _list341 = await iprot.ReadListBeginAsync(cancellationToken); + Encodings = new List(_list341.Count); + for(int _i342 = 0; _i342 < _list341.Count; ++_i342) { - int _elem334; - _elem334 = await iprot.ReadI32Async(cancellationToken); - Encodings.Add(_elem334); + int _elem343; + _elem343 = await iprot.ReadI32Async(cancellationToken); + Encodings.Add(_elem343); } await iprot.ReadListEndAsync(cancellationToken); } @@ -221,13 +221,13 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List if (field.Type == TType.List) { { - TList _list335 = await iprot.ReadListBeginAsync(cancellationToken); - Compressors = new List(_list335.Count); - for(int _i336 = 0; _i336 < _list335.Count; ++_i336) + TList _list344 = await iprot.ReadListBeginAsync(cancellationToken); + Compressors = new List(_list344.Count); + for(int _i345 = 0; _i345 < _list344.Count; ++_i345) { - int _elem337; - _elem337 = await iprot.ReadI32Async(cancellationToken); - Compressors.Add(_elem337); + int _elem346; + _elem346 = await iprot.ReadI32Async(cancellationToken); + Compressors.Add(_elem346); } await iprot.ReadListEndAsync(cancellationToken); } @@ -242,25 +242,25 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List if (field.Type == TType.List) { { - TList _list338 = await iprot.ReadListBeginAsync(cancellationToken); - PropsList = new List>(_list338.Count); - for(int _i339 = 0; _i339 < _list338.Count; ++_i339) + TList _list347 = await iprot.ReadListBeginAsync(cancellationToken); + PropsList = new List>(_list347.Count); + for(int _i348 = 0; _i348 < _list347.Count; ++_i348) { - Dictionary _elem340; + Dictionary _elem349; { - TMap _map341 = await iprot.ReadMapBeginAsync(cancellationToken); - _elem340 = new Dictionary(_map341.Count); - for(int _i342 = 0; _i342 < _map341.Count; ++_i342) + TMap _map350 = await iprot.ReadMapBeginAsync(cancellationToken); + _elem349 = new Dictionary(_map350.Count); + for(int _i351 = 0; _i351 < _map350.Count; ++_i351) { - string _key343; - string _val344; - _key343 = await iprot.ReadStringAsync(cancellationToken); - _val344 = await iprot.ReadStringAsync(cancellationToken); - _elem340[_key343] = _val344; + string _key352; + string _val353; + _key352 = await iprot.ReadStringAsync(cancellationToken); + _val353 = await iprot.ReadStringAsync(cancellationToken); + _elem349[_key352] = _val353; } await iprot.ReadMapEndAsync(cancellationToken); } - PropsList.Add(_elem340); + PropsList.Add(_elem349); } await iprot.ReadListEndAsync(cancellationToken); } @@ -274,25 +274,25 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List if (field.Type == TType.List) { { - TList _list345 = await iprot.ReadListBeginAsync(cancellationToken); - TagsList = new List>(_list345.Count); - for(int _i346 = 0; _i346 < _list345.Count; ++_i346) + TList _list354 = await iprot.ReadListBeginAsync(cancellationToken); + TagsList = new List>(_list354.Count); + for(int _i355 = 0; _i355 < _list354.Count; ++_i355) { - Dictionary _elem347; + Dictionary _elem356; { - TMap _map348 = await iprot.ReadMapBeginAsync(cancellationToken); - _elem347 = new Dictionary(_map348.Count); - for(int _i349 = 0; _i349 < _map348.Count; ++_i349) + TMap _map357 = await iprot.ReadMapBeginAsync(cancellationToken); + _elem356 = new Dictionary(_map357.Count); + for(int _i358 = 0; _i358 < _map357.Count; ++_i358) { - string _key350; - string _val351; - _key350 = await iprot.ReadStringAsync(cancellationToken); - _val351 = await iprot.ReadStringAsync(cancellationToken); - _elem347[_key350] = _val351; + string _key359; + string _val360; + _key359 = await iprot.ReadStringAsync(cancellationToken); + _val360 = await iprot.ReadStringAsync(cancellationToken); + _elem356[_key359] = _val360; } await iprot.ReadMapEndAsync(cancellationToken); } - TagsList.Add(_elem347); + TagsList.Add(_elem356); } await iprot.ReadListEndAsync(cancellationToken); } @@ -306,25 +306,25 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List if (field.Type == TType.List) { { - TList _list352 = await iprot.ReadListBeginAsync(cancellationToken); - AttributesList = new List>(_list352.Count); - for(int _i353 = 0; _i353 < _list352.Count; ++_i353) + TList _list361 = await iprot.ReadListBeginAsync(cancellationToken); + AttributesList = new List>(_list361.Count); + for(int _i362 = 0; _i362 < _list361.Count; ++_i362) { - Dictionary _elem354; + Dictionary _elem363; { - TMap _map355 = await iprot.ReadMapBeginAsync(cancellationToken); - _elem354 = new Dictionary(_map355.Count); - for(int _i356 = 0; _i356 < _map355.Count; ++_i356) + TMap _map364 = await iprot.ReadMapBeginAsync(cancellationToken); + _elem363 = new Dictionary(_map364.Count); + for(int _i365 = 0; _i365 < _map364.Count; ++_i365) { - string _key357; - string _val358; - _key357 = await iprot.ReadStringAsync(cancellationToken); - _val358 = await iprot.ReadStringAsync(cancellationToken); - _elem354[_key357] = _val358; + string _key366; + string _val367; + _key366 = await iprot.ReadStringAsync(cancellationToken); + _val367 = await iprot.ReadStringAsync(cancellationToken); + _elem363[_key366] = _val367; } await iprot.ReadMapEndAsync(cancellationToken); } - AttributesList.Add(_elem354); + AttributesList.Add(_elem363); } await iprot.ReadListEndAsync(cancellationToken); } @@ -338,13 +338,13 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List if (field.Type == TType.List) { { - TList _list359 = await iprot.ReadListBeginAsync(cancellationToken); - MeasurementAliasList = new List(_list359.Count); - for(int _i360 = 0; _i360 < _list359.Count; ++_i360) + TList _list368 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementAliasList = new List(_list368.Count); + for(int _i369 = 0; _i369 < _list368.Count; ++_i369) { - string _elem361; - _elem361 = await iprot.ReadStringAsync(cancellationToken); - MeasurementAliasList.Add(_elem361); + string _elem370; + _elem370 = await iprot.ReadStringAsync(cancellationToken); + MeasurementAliasList.Add(_elem370); } await iprot.ReadListEndAsync(cancellationToken); } @@ -412,9 +412,9 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken); - foreach (string _iter362 in Paths) + foreach (string _iter371 in Paths) { - await oprot.WriteStringAsync(_iter362, cancellationToken); + await oprot.WriteStringAsync(_iter371, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -428,9 +428,9 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, DataTypes.Count), cancellationToken); - foreach (int _iter363 in DataTypes) + foreach (int _iter372 in DataTypes) { - await oprot.WriteI32Async(_iter363, cancellationToken); + await oprot.WriteI32Async(_iter372, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -444,9 +444,9 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Encodings.Count), cancellationToken); - foreach (int _iter364 in Encodings) + foreach (int _iter373 in Encodings) { - await oprot.WriteI32Async(_iter364, cancellationToken); + await oprot.WriteI32Async(_iter373, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -460,9 +460,9 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Compressors.Count), cancellationToken); - foreach (int _iter365 in Compressors) + foreach (int _iter374 in Compressors) { - await oprot.WriteI32Async(_iter365, cancellationToken); + await oprot.WriteI32Async(_iter374, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -476,14 +476,14 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Map, PropsList.Count), cancellationToken); - foreach (Dictionary _iter366 in PropsList) + foreach (Dictionary _iter375 in PropsList) { { - await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter366.Count), cancellationToken); - foreach (string _iter367 in _iter366.Keys) + await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter375.Count), cancellationToken); + foreach (string _iter376 in _iter375.Keys) { - await oprot.WriteStringAsync(_iter367, cancellationToken); - await oprot.WriteStringAsync(_iter366[_iter367], cancellationToken); + await oprot.WriteStringAsync(_iter376, cancellationToken); + await oprot.WriteStringAsync(_iter375[_iter376], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -500,14 +500,14 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Map, TagsList.Count), cancellationToken); - foreach (Dictionary _iter368 in TagsList) + foreach (Dictionary _iter377 in TagsList) { { - await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter368.Count), cancellationToken); - foreach (string _iter369 in _iter368.Keys) + await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter377.Count), cancellationToken); + foreach (string _iter378 in _iter377.Keys) { - await oprot.WriteStringAsync(_iter369, cancellationToken); - await oprot.WriteStringAsync(_iter368[_iter369], cancellationToken); + await oprot.WriteStringAsync(_iter378, cancellationToken); + await oprot.WriteStringAsync(_iter377[_iter378], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -524,14 +524,14 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Map, AttributesList.Count), cancellationToken); - foreach (Dictionary _iter370 in AttributesList) + foreach (Dictionary _iter379 in AttributesList) { { - await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter370.Count), cancellationToken); - foreach (string _iter371 in _iter370.Keys) + await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter379.Count), cancellationToken); + foreach (string _iter380 in _iter379.Keys) { - await oprot.WriteStringAsync(_iter371, cancellationToken); - await oprot.WriteStringAsync(_iter370[_iter371], cancellationToken); + await oprot.WriteStringAsync(_iter380, cancellationToken); + await oprot.WriteStringAsync(_iter379[_iter380], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -548,9 +548,9 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, MeasurementAliasList.Count), cancellationToken); - foreach (string _iter372 in MeasurementAliasList) + foreach (string _iter381 in MeasurementAliasList) { - await oprot.WriteStringAsync(_iter372, cancellationToken); + await oprot.WriteStringAsync(_iter381, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSCreateTimeseriesReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSCreateTimeseriesReq.cs index 5dedcfd..a83f025 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSCreateTimeseriesReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSCreateTimeseriesReq.cs @@ -202,15 +202,15 @@ public TSCreateTimeseriesReq(long sessionId, string path, int dataType, int enco if (field.Type == TType.Map) { { - TMap _map246 = await iprot.ReadMapBeginAsync(cancellationToken); - Props = new Dictionary(_map246.Count); - for(int _i247 = 0; _i247 < _map246.Count; ++_i247) + TMap _map250 = await iprot.ReadMapBeginAsync(cancellationToken); + Props = new Dictionary(_map250.Count); + for(int _i251 = 0; _i251 < _map250.Count; ++_i251) { - string _key248; - string _val249; - _key248 = await iprot.ReadStringAsync(cancellationToken); - _val249 = await iprot.ReadStringAsync(cancellationToken); - Props[_key248] = _val249; + string _key252; + string _val253; + _key252 = await iprot.ReadStringAsync(cancellationToken); + _val253 = await iprot.ReadStringAsync(cancellationToken); + Props[_key252] = _val253; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -224,15 +224,15 @@ public TSCreateTimeseriesReq(long sessionId, string path, int dataType, int enco if (field.Type == TType.Map) { { - TMap _map250 = await iprot.ReadMapBeginAsync(cancellationToken); - Tags = new Dictionary(_map250.Count); - for(int _i251 = 0; _i251 < _map250.Count; ++_i251) + TMap _map254 = await iprot.ReadMapBeginAsync(cancellationToken); + Tags = new Dictionary(_map254.Count); + for(int _i255 = 0; _i255 < _map254.Count; ++_i255) { - string _key252; - string _val253; - _key252 = await iprot.ReadStringAsync(cancellationToken); - _val253 = await iprot.ReadStringAsync(cancellationToken); - Tags[_key252] = _val253; + string _key256; + string _val257; + _key256 = await iprot.ReadStringAsync(cancellationToken); + _val257 = await iprot.ReadStringAsync(cancellationToken); + Tags[_key256] = _val257; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -246,15 +246,15 @@ public TSCreateTimeseriesReq(long sessionId, string path, int dataType, int enco if (field.Type == TType.Map) { { - TMap _map254 = await iprot.ReadMapBeginAsync(cancellationToken); - Attributes = new Dictionary(_map254.Count); - for(int _i255 = 0; _i255 < _map254.Count; ++_i255) + TMap _map258 = await iprot.ReadMapBeginAsync(cancellationToken); + Attributes = new Dictionary(_map258.Count); + for(int _i259 = 0; _i259 < _map258.Count; ++_i259) { - string _key256; - string _val257; - _key256 = await iprot.ReadStringAsync(cancellationToken); - _val257 = await iprot.ReadStringAsync(cancellationToken); - Attributes[_key256] = _val257; + string _key260; + string _val261; + _key260 = await iprot.ReadStringAsync(cancellationToken); + _val261 = await iprot.ReadStringAsync(cancellationToken); + Attributes[_key260] = _val261; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -359,10 +359,10 @@ public TSCreateTimeseriesReq(long sessionId, string path, int dataType, int enco await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, Props.Count), cancellationToken); - foreach (string _iter258 in Props.Keys) + foreach (string _iter262 in Props.Keys) { - await oprot.WriteStringAsync(_iter258, cancellationToken); - await oprot.WriteStringAsync(Props[_iter258], cancellationToken); + await oprot.WriteStringAsync(_iter262, cancellationToken); + await oprot.WriteStringAsync(Props[_iter262], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -376,10 +376,10 @@ public TSCreateTimeseriesReq(long sessionId, string path, int dataType, int enco await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, Tags.Count), cancellationToken); - foreach (string _iter259 in Tags.Keys) + foreach (string _iter263 in Tags.Keys) { - await oprot.WriteStringAsync(_iter259, cancellationToken); - await oprot.WriteStringAsync(Tags[_iter259], cancellationToken); + await oprot.WriteStringAsync(_iter263, cancellationToken); + await oprot.WriteStringAsync(Tags[_iter263], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -393,10 +393,10 @@ public TSCreateTimeseriesReq(long sessionId, string path, int dataType, int enco await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, Attributes.Count), cancellationToken); - foreach (string _iter260 in Attributes.Keys) + foreach (string _iter264 in Attributes.Keys) { - await oprot.WriteStringAsync(_iter260, cancellationToken); - await oprot.WriteStringAsync(Attributes[_iter260], cancellationToken); + await oprot.WriteStringAsync(_iter264, cancellationToken); + await oprot.WriteStringAsync(Attributes[_iter264], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSDeleteDataReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSDeleteDataReq.cs index 249c98c..1896890 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSDeleteDataReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSDeleteDataReq.cs @@ -88,13 +88,13 @@ public TSDeleteDataReq(long sessionId, List paths, long startTime, long if (field.Type == TType.List) { { - TList _list241 = await iprot.ReadListBeginAsync(cancellationToken); - Paths = new List(_list241.Count); - for(int _i242 = 0; _i242 < _list241.Count; ++_i242) + TList _list245 = await iprot.ReadListBeginAsync(cancellationToken); + Paths = new List(_list245.Count); + for(int _i246 = 0; _i246 < _list245.Count; ++_i246) { - string _elem243; - _elem243 = await iprot.ReadStringAsync(cancellationToken); - Paths.Add(_elem243); + string _elem247; + _elem247 = await iprot.ReadStringAsync(cancellationToken); + Paths.Add(_elem247); } await iprot.ReadListEndAsync(cancellationToken); } @@ -181,9 +181,9 @@ public TSDeleteDataReq(long sessionId, List paths, long startTime, long await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken); - foreach (string _iter244 in Paths) + foreach (string _iter248 in Paths) { - await oprot.WriteStringAsync(_iter244, cancellationToken); + await oprot.WriteStringAsync(_iter248, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSFastLastDataQueryForOneDeviceReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSFastLastDataQueryForOneDeviceReq.cs index 3ae1472..7952d98 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSFastLastDataQueryForOneDeviceReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSFastLastDataQueryForOneDeviceReq.cs @@ -195,13 +195,13 @@ public TSFastLastDataQueryForOneDeviceReq(long sessionId, string db, string devi if (field.Type == TType.List) { { - TList _list311 = await iprot.ReadListBeginAsync(cancellationToken); - Sensors = new List(_list311.Count); - for(int _i312 = 0; _i312 < _list311.Count; ++_i312) + TList _list320 = await iprot.ReadListBeginAsync(cancellationToken); + Sensors = new List(_list320.Count); + for(int _i321 = 0; _i321 < _list320.Count; ++_i321) { - string _elem313; - _elem313 = await iprot.ReadStringAsync(cancellationToken); - Sensors.Add(_elem313); + string _elem322; + _elem322 = await iprot.ReadStringAsync(cancellationToken); + Sensors.Add(_elem322); } await iprot.ReadListEndAsync(cancellationToken); } @@ -349,9 +349,9 @@ public TSFastLastDataQueryForOneDeviceReq(long sessionId, string db, string devi await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Sensors.Count), cancellationToken); - foreach (string _iter314 in Sensors) + foreach (string _iter323 in Sensors) { - await oprot.WriteStringAsync(_iter314, cancellationToken); + await oprot.WriteStringAsync(_iter323, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSFastLastDataQueryForOnePrefixPathReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSFastLastDataQueryForOnePrefixPathReq.cs new file mode 100644 index 0000000..4114268 --- /dev/null +++ b/src/Apache.IoTDB/Rpc/Generated/TSFastLastDataQueryForOnePrefixPathReq.cs @@ -0,0 +1,408 @@ +/** + * Autogenerated by Thrift Compiler (0.14.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Thrift; +using Thrift.Collections; + +using Thrift.Protocol; +using Thrift.Protocol.Entities; +using Thrift.Protocol.Utilities; +using Thrift.Transport; +using Thrift.Transport.Client; +using Thrift.Transport.Server; +using Thrift.Processor; + + +#pragma warning disable IDE0079 // remove unnecessary pragmas +#pragma warning disable IDE1006 // parts of the code use IDL spelling + + +public partial class TSFastLastDataQueryForOnePrefixPathReq : TBase +{ + private int _fetchSize; + private bool _enableRedirectQuery; + private bool _jdbcQuery; + private long _timeout; + + public long SessionId { get; set; } + + public List Prefixes { get; set; } + + public int FetchSize + { + get + { + return _fetchSize; + } + set + { + __isset.fetchSize = true; + this._fetchSize = value; + } + } + + public long StatementId { get; set; } + + public bool EnableRedirectQuery + { + get + { + return _enableRedirectQuery; + } + set + { + __isset.enableRedirectQuery = true; + this._enableRedirectQuery = value; + } + } + + public bool JdbcQuery + { + get + { + return _jdbcQuery; + } + set + { + __isset.jdbcQuery = true; + this._jdbcQuery = value; + } + } + + public long Timeout + { + get + { + return _timeout; + } + set + { + __isset.timeout = true; + this._timeout = value; + } + } + + + public Isset __isset; + public struct Isset + { + public bool fetchSize; + public bool enableRedirectQuery; + public bool jdbcQuery; + public bool timeout; + } + + public TSFastLastDataQueryForOnePrefixPathReq() + { + } + + public TSFastLastDataQueryForOnePrefixPathReq(long sessionId, List prefixes, long statementId) : this() + { + this.SessionId = sessionId; + this.Prefixes = prefixes; + this.StatementId = statementId; + } + + public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) + { + iprot.IncrementRecursionDepth(); + try + { + bool isset_sessionId = false; + bool isset_prefixes = false; + bool isset_statementId = false; + TField field; + await iprot.ReadStructBeginAsync(cancellationToken); + while (true) + { + field = await iprot.ReadFieldBeginAsync(cancellationToken); + if (field.Type == TType.Stop) + { + break; + } + + switch (field.ID) + { + case 1: + if (field.Type == TType.I64) + { + SessionId = await iprot.ReadI64Async(cancellationToken); + isset_sessionId = true; + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 2: + if (field.Type == TType.List) + { + { + TList _list315 = await iprot.ReadListBeginAsync(cancellationToken); + Prefixes = new List(_list315.Count); + for(int _i316 = 0; _i316 < _list315.Count; ++_i316) + { + string _elem317; + _elem317 = await iprot.ReadStringAsync(cancellationToken); + Prefixes.Add(_elem317); + } + await iprot.ReadListEndAsync(cancellationToken); + } + isset_prefixes = true; + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 3: + if (field.Type == TType.I32) + { + FetchSize = await iprot.ReadI32Async(cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 4: + if (field.Type == TType.I64) + { + StatementId = await iprot.ReadI64Async(cancellationToken); + isset_statementId = true; + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 5: + if (field.Type == TType.Bool) + { + EnableRedirectQuery = await iprot.ReadBoolAsync(cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 6: + if (field.Type == TType.Bool) + { + JdbcQuery = await iprot.ReadBoolAsync(cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 7: + if (field.Type == TType.I64) + { + Timeout = await iprot.ReadI64Async(cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + default: + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + break; + } + + await iprot.ReadFieldEndAsync(cancellationToken); + } + + await iprot.ReadStructEndAsync(cancellationToken); + if (!isset_sessionId) + { + throw new TProtocolException(TProtocolException.INVALID_DATA); + } + if (!isset_prefixes) + { + throw new TProtocolException(TProtocolException.INVALID_DATA); + } + if (!isset_statementId) + { + throw new TProtocolException(TProtocolException.INVALID_DATA); + } + } + finally + { + iprot.DecrementRecursionDepth(); + } + } + + public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) + { + oprot.IncrementRecursionDepth(); + try + { + var struc = new TStruct("TSFastLastDataQueryForOnePrefixPathReq"); + await oprot.WriteStructBeginAsync(struc, cancellationToken); + var field = new TField(); + field.Name = "sessionId"; + field.Type = TType.I64; + field.ID = 1; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteI64Async(SessionId, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + if((Prefixes != null)) + { + field.Name = "prefixes"; + field.Type = TType.List; + field.ID = 2; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + { + await oprot.WriteListBeginAsync(new TList(TType.String, Prefixes.Count), cancellationToken); + foreach (string _iter318 in Prefixes) + { + await oprot.WriteStringAsync(_iter318, cancellationToken); + } + await oprot.WriteListEndAsync(cancellationToken); + } + await oprot.WriteFieldEndAsync(cancellationToken); + } + if(__isset.fetchSize) + { + field.Name = "fetchSize"; + field.Type = TType.I32; + field.ID = 3; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteI32Async(FetchSize, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } + field.Name = "statementId"; + field.Type = TType.I64; + field.ID = 4; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteI64Async(StatementId, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + if(__isset.enableRedirectQuery) + { + field.Name = "enableRedirectQuery"; + field.Type = TType.Bool; + field.ID = 5; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteBoolAsync(EnableRedirectQuery, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } + if(__isset.jdbcQuery) + { + field.Name = "jdbcQuery"; + field.Type = TType.Bool; + field.ID = 6; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteBoolAsync(JdbcQuery, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } + if(__isset.timeout) + { + field.Name = "timeout"; + field.Type = TType.I64; + field.ID = 7; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteI64Async(Timeout, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } + await oprot.WriteFieldStopAsync(cancellationToken); + await oprot.WriteStructEndAsync(cancellationToken); + } + finally + { + oprot.DecrementRecursionDepth(); + } + } + + public override bool Equals(object that) + { + if (!(that is TSFastLastDataQueryForOnePrefixPathReq other)) return false; + if (ReferenceEquals(this, other)) return true; + return System.Object.Equals(SessionId, other.SessionId) + && TCollections.Equals(Prefixes, other.Prefixes) + && ((__isset.fetchSize == other.__isset.fetchSize) && ((!__isset.fetchSize) || (System.Object.Equals(FetchSize, other.FetchSize)))) + && System.Object.Equals(StatementId, other.StatementId) + && ((__isset.enableRedirectQuery == other.__isset.enableRedirectQuery) && ((!__isset.enableRedirectQuery) || (System.Object.Equals(EnableRedirectQuery, other.EnableRedirectQuery)))) + && ((__isset.jdbcQuery == other.__isset.jdbcQuery) && ((!__isset.jdbcQuery) || (System.Object.Equals(JdbcQuery, other.JdbcQuery)))) + && ((__isset.timeout == other.__isset.timeout) && ((!__isset.timeout) || (System.Object.Equals(Timeout, other.Timeout)))); + } + + public override int GetHashCode() { + int hashcode = 157; + unchecked { + hashcode = (hashcode * 397) + SessionId.GetHashCode(); + if((Prefixes != null)) + { + hashcode = (hashcode * 397) + TCollections.GetHashCode(Prefixes); + } + if(__isset.fetchSize) + { + hashcode = (hashcode * 397) + FetchSize.GetHashCode(); + } + hashcode = (hashcode * 397) + StatementId.GetHashCode(); + if(__isset.enableRedirectQuery) + { + hashcode = (hashcode * 397) + EnableRedirectQuery.GetHashCode(); + } + if(__isset.jdbcQuery) + { + hashcode = (hashcode * 397) + JdbcQuery.GetHashCode(); + } + if(__isset.timeout) + { + hashcode = (hashcode * 397) + Timeout.GetHashCode(); + } + } + return hashcode; + } + + public override string ToString() + { + var sb = new StringBuilder("TSFastLastDataQueryForOnePrefixPathReq("); + sb.Append(", SessionId: "); + SessionId.ToString(sb); + if((Prefixes != null)) + { + sb.Append(", Prefixes: "); + Prefixes.ToString(sb); + } + if(__isset.fetchSize) + { + sb.Append(", FetchSize: "); + FetchSize.ToString(sb); + } + sb.Append(", StatementId: "); + StatementId.ToString(sb); + if(__isset.enableRedirectQuery) + { + sb.Append(", EnableRedirectQuery: "); + EnableRedirectQuery.ToString(sb); + } + if(__isset.jdbcQuery) + { + sb.Append(", JdbcQuery: "); + JdbcQuery.ToString(sb); + } + if(__isset.timeout) + { + sb.Append(", Timeout: "); + Timeout.ToString(sb); + } + sb.Append(')'); + return sb.ToString(); + } +} + diff --git a/src/Apache.IoTDB/Rpc/Generated/TSFetchResultsReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSFetchResultsReq.cs index 828f47d..55da0c9 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSFetchResultsReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSFetchResultsReq.cs @@ -32,6 +32,7 @@ public partial class TSFetchResultsReq : TBase { private long _timeout; + private long _statementId; public long SessionId { get; set; } @@ -56,11 +57,25 @@ public long Timeout } } + public long StatementId + { + get + { + return _statementId; + } + set + { + __isset.statementId = true; + this._statementId = value; + } + } + public Isset __isset; public struct Isset { public bool timeout; + public bool statementId; } public TSFetchResultsReq() @@ -163,6 +178,16 @@ public TSFetchResultsReq(long sessionId, string statement, int fetchSize, long q await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; + case 7: + if (field.Type == TType.I64) + { + StatementId = await iprot.ReadI64Async(cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; @@ -249,6 +274,15 @@ public TSFetchResultsReq(long sessionId, string statement, int fetchSize, long q await oprot.WriteI64Async(Timeout, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } + if(__isset.statementId) + { + field.Name = "statementId"; + field.Type = TType.I64; + field.ID = 7; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteI64Async(StatementId, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } @@ -267,7 +301,8 @@ public override bool Equals(object that) && System.Object.Equals(FetchSize, other.FetchSize) && System.Object.Equals(QueryId, other.QueryId) && System.Object.Equals(IsAlign, other.IsAlign) - && ((__isset.timeout == other.__isset.timeout) && ((!__isset.timeout) || (System.Object.Equals(Timeout, other.Timeout)))); + && ((__isset.timeout == other.__isset.timeout) && ((!__isset.timeout) || (System.Object.Equals(Timeout, other.Timeout)))) + && ((__isset.statementId == other.__isset.statementId) && ((!__isset.statementId) || (System.Object.Equals(StatementId, other.StatementId)))); } public override int GetHashCode() { @@ -285,6 +320,10 @@ public override int GetHashCode() { { hashcode = (hashcode * 397) + Timeout.GetHashCode(); } + if(__isset.statementId) + { + hashcode = (hashcode * 397) + StatementId.GetHashCode(); + } } return hashcode; } @@ -310,6 +349,11 @@ public override string ToString() sb.Append(", Timeout: "); Timeout.ToString(sb); } + if(__isset.statementId) + { + sb.Append(", StatementId: "); + StatementId.ToString(sb); + } sb.Append(')'); return sb.ToString(); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSGroupByQueryIntervalReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSGroupByQueryIntervalReq.cs index 5f43094..9e4a9dd 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSGroupByQueryIntervalReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSGroupByQueryIntervalReq.cs @@ -37,6 +37,7 @@ public partial class TSGroupByQueryIntervalReq : TBase private long _interval; private int _fetchSize; private long _timeout; + private bool _isAligned; public long SessionId { get; set; } @@ -132,6 +133,19 @@ public long Timeout } } + public bool IsAligned + { + get + { + return _isAligned; + } + set + { + __isset.isAligned = true; + this._isAligned = value; + } + } + public Isset __isset; public struct Isset @@ -142,6 +156,7 @@ public struct Isset public bool interval; public bool fetchSize; public bool timeout; + public bool isAligned; } public TSGroupByQueryIntervalReq() @@ -307,6 +322,16 @@ public TSGroupByQueryIntervalReq(long sessionId, long statementId, string device await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; + case 13: + if (field.Type == TType.Bool) + { + IsAligned = await iprot.ReadBoolAsync(cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; @@ -451,6 +476,15 @@ public TSGroupByQueryIntervalReq(long sessionId, long statementId, string device await oprot.WriteI64Async(Timeout, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } + if(__isset.isAligned) + { + field.Name = "isAligned"; + field.Type = TType.Bool; + field.ID = 13; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteBoolAsync(IsAligned, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } @@ -475,7 +509,8 @@ public override bool Equals(object that) && ((__isset.endTime == other.__isset.endTime) && ((!__isset.endTime) || (System.Object.Equals(EndTime, other.EndTime)))) && ((__isset.interval == other.__isset.interval) && ((!__isset.interval) || (System.Object.Equals(Interval, other.Interval)))) && ((__isset.fetchSize == other.__isset.fetchSize) && ((!__isset.fetchSize) || (System.Object.Equals(FetchSize, other.FetchSize)))) - && ((__isset.timeout == other.__isset.timeout) && ((!__isset.timeout) || (System.Object.Equals(Timeout, other.Timeout)))); + && ((__isset.timeout == other.__isset.timeout) && ((!__isset.timeout) || (System.Object.Equals(Timeout, other.Timeout)))) + && ((__isset.isAligned == other.__isset.isAligned) && ((!__isset.isAligned) || (System.Object.Equals(IsAligned, other.IsAligned)))); } public override int GetHashCode() { @@ -517,6 +552,10 @@ public override int GetHashCode() { { hashcode = (hashcode * 397) + Timeout.GetHashCode(); } + if(__isset.isAligned) + { + hashcode = (hashcode * 397) + IsAligned.GetHashCode(); + } } return hashcode; } @@ -572,6 +611,11 @@ public override string ToString() sb.Append(", Timeout: "); Timeout.ToString(sb); } + if(__isset.isAligned) + { + sb.Append(", IsAligned: "); + IsAligned.ToString(sb); + } sb.Append(')'); return sb.ToString(); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordsOfOneDeviceReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordsOfOneDeviceReq.cs index 9633c5a..4943835 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordsOfOneDeviceReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordsOfOneDeviceReq.cs @@ -124,23 +124,23 @@ public TSInsertRecordsOfOneDeviceReq(long sessionId, string prefixPath, List>(_list178.Count); - for(int _i179 = 0; _i179 < _list178.Count; ++_i179) + TList _list182 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementsList = new List>(_list182.Count); + for(int _i183 = 0; _i183 < _list182.Count; ++_i183) { - List _elem180; + List _elem184; { - TList _list181 = await iprot.ReadListBeginAsync(cancellationToken); - _elem180 = new List(_list181.Count); - for(int _i182 = 0; _i182 < _list181.Count; ++_i182) + TList _list185 = await iprot.ReadListBeginAsync(cancellationToken); + _elem184 = new List(_list185.Count); + for(int _i186 = 0; _i186 < _list185.Count; ++_i186) { - string _elem183; - _elem183 = await iprot.ReadStringAsync(cancellationToken); - _elem180.Add(_elem183); + string _elem187; + _elem187 = await iprot.ReadStringAsync(cancellationToken); + _elem184.Add(_elem187); } await iprot.ReadListEndAsync(cancellationToken); } - MeasurementsList.Add(_elem180); + MeasurementsList.Add(_elem184); } await iprot.ReadListEndAsync(cancellationToken); } @@ -155,13 +155,13 @@ public TSInsertRecordsOfOneDeviceReq(long sessionId, string prefixPath, List(_list184.Count); - for(int _i185 = 0; _i185 < _list184.Count; ++_i185) + TList _list188 = await iprot.ReadListBeginAsync(cancellationToken); + ValuesList = new List(_list188.Count); + for(int _i189 = 0; _i189 < _list188.Count; ++_i189) { - byte[] _elem186; - _elem186 = await iprot.ReadBinaryAsync(cancellationToken); - ValuesList.Add(_elem186); + byte[] _elem190; + _elem190 = await iprot.ReadBinaryAsync(cancellationToken); + ValuesList.Add(_elem190); } await iprot.ReadListEndAsync(cancellationToken); } @@ -176,13 +176,13 @@ public TSInsertRecordsOfOneDeviceReq(long sessionId, string prefixPath, List(_list187.Count); - for(int _i188 = 0; _i188 < _list187.Count; ++_i188) + TList _list191 = await iprot.ReadListBeginAsync(cancellationToken); + Timestamps = new List(_list191.Count); + for(int _i192 = 0; _i192 < _list191.Count; ++_i192) { - long _elem189; - _elem189 = await iprot.ReadI64Async(cancellationToken); - Timestamps.Add(_elem189); + long _elem193; + _elem193 = await iprot.ReadI64Async(cancellationToken); + Timestamps.Add(_elem193); } await iprot.ReadListEndAsync(cancellationToken); } @@ -270,13 +270,13 @@ public TSInsertRecordsOfOneDeviceReq(long sessionId, string prefixPath, List _iter190 in MeasurementsList) + foreach (List _iter194 in MeasurementsList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter190.Count), cancellationToken); - foreach (string _iter191 in _iter190) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter194.Count), cancellationToken); + foreach (string _iter195 in _iter194) { - await oprot.WriteStringAsync(_iter191, cancellationToken); + await oprot.WriteStringAsync(_iter195, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -293,9 +293,9 @@ public TSInsertRecordsOfOneDeviceReq(long sessionId, string prefixPath, List prefixPaths, List(_list157.Count); - for(int _i158 = 0; _i158 < _list157.Count; ++_i158) + TList _list161 = await iprot.ReadListBeginAsync(cancellationToken); + PrefixPaths = new List(_list161.Count); + for(int _i162 = 0; _i162 < _list161.Count; ++_i162) { - string _elem159; - _elem159 = await iprot.ReadStringAsync(cancellationToken); - PrefixPaths.Add(_elem159); + string _elem163; + _elem163 = await iprot.ReadStringAsync(cancellationToken); + PrefixPaths.Add(_elem163); } await iprot.ReadListEndAsync(cancellationToken); } @@ -134,23 +134,23 @@ public TSInsertRecordsReq(long sessionId, List prefixPaths, List>(_list160.Count); - for(int _i161 = 0; _i161 < _list160.Count; ++_i161) + TList _list164 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementsList = new List>(_list164.Count); + for(int _i165 = 0; _i165 < _list164.Count; ++_i165) { - List _elem162; + List _elem166; { - TList _list163 = await iprot.ReadListBeginAsync(cancellationToken); - _elem162 = new List(_list163.Count); - for(int _i164 = 0; _i164 < _list163.Count; ++_i164) + TList _list167 = await iprot.ReadListBeginAsync(cancellationToken); + _elem166 = new List(_list167.Count); + for(int _i168 = 0; _i168 < _list167.Count; ++_i168) { - string _elem165; - _elem165 = await iprot.ReadStringAsync(cancellationToken); - _elem162.Add(_elem165); + string _elem169; + _elem169 = await iprot.ReadStringAsync(cancellationToken); + _elem166.Add(_elem169); } await iprot.ReadListEndAsync(cancellationToken); } - MeasurementsList.Add(_elem162); + MeasurementsList.Add(_elem166); } await iprot.ReadListEndAsync(cancellationToken); } @@ -165,13 +165,13 @@ public TSInsertRecordsReq(long sessionId, List prefixPaths, List(_list166.Count); - for(int _i167 = 0; _i167 < _list166.Count; ++_i167) + TList _list170 = await iprot.ReadListBeginAsync(cancellationToken); + ValuesList = new List(_list170.Count); + for(int _i171 = 0; _i171 < _list170.Count; ++_i171) { - byte[] _elem168; - _elem168 = await iprot.ReadBinaryAsync(cancellationToken); - ValuesList.Add(_elem168); + byte[] _elem172; + _elem172 = await iprot.ReadBinaryAsync(cancellationToken); + ValuesList.Add(_elem172); } await iprot.ReadListEndAsync(cancellationToken); } @@ -186,13 +186,13 @@ public TSInsertRecordsReq(long sessionId, List prefixPaths, List(_list169.Count); - for(int _i170 = 0; _i170 < _list169.Count; ++_i170) + TList _list173 = await iprot.ReadListBeginAsync(cancellationToken); + Timestamps = new List(_list173.Count); + for(int _i174 = 0; _i174 < _list173.Count; ++_i174) { - long _elem171; - _elem171 = await iprot.ReadI64Async(cancellationToken); - Timestamps.Add(_elem171); + long _elem175; + _elem175 = await iprot.ReadI64Async(cancellationToken); + Timestamps.Add(_elem175); } await iprot.ReadListEndAsync(cancellationToken); } @@ -271,9 +271,9 @@ public TSInsertRecordsReq(long sessionId, List prefixPaths, List prefixPaths, List _iter173 in MeasurementsList) + foreach (List _iter177 in MeasurementsList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter173.Count), cancellationToken); - foreach (string _iter174 in _iter173) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter177.Count), cancellationToken); + foreach (string _iter178 in _iter177) { - await oprot.WriteStringAsync(_iter174, cancellationToken); + await oprot.WriteStringAsync(_iter178, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -310,9 +310,9 @@ public TSInsertRecordsReq(long sessionId, List prefixPaths, List prefixPaths, List>(_list195.Count); - for(int _i196 = 0; _i196 < _list195.Count; ++_i196) + TList _list199 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementsList = new List>(_list199.Count); + for(int _i200 = 0; _i200 < _list199.Count; ++_i200) { - List _elem197; + List _elem201; { - TList _list198 = await iprot.ReadListBeginAsync(cancellationToken); - _elem197 = new List(_list198.Count); - for(int _i199 = 0; _i199 < _list198.Count; ++_i199) + TList _list202 = await iprot.ReadListBeginAsync(cancellationToken); + _elem201 = new List(_list202.Count); + for(int _i203 = 0; _i203 < _list202.Count; ++_i203) { - string _elem200; - _elem200 = await iprot.ReadStringAsync(cancellationToken); - _elem197.Add(_elem200); + string _elem204; + _elem204 = await iprot.ReadStringAsync(cancellationToken); + _elem201.Add(_elem204); } await iprot.ReadListEndAsync(cancellationToken); } - MeasurementsList.Add(_elem197); + MeasurementsList.Add(_elem201); } await iprot.ReadListEndAsync(cancellationToken); } @@ -155,23 +155,23 @@ public TSInsertStringRecordsOfOneDeviceReq(long sessionId, string prefixPath, Li if (field.Type == TType.List) { { - TList _list201 = await iprot.ReadListBeginAsync(cancellationToken); - ValuesList = new List>(_list201.Count); - for(int _i202 = 0; _i202 < _list201.Count; ++_i202) + TList _list205 = await iprot.ReadListBeginAsync(cancellationToken); + ValuesList = new List>(_list205.Count); + for(int _i206 = 0; _i206 < _list205.Count; ++_i206) { - List _elem203; + List _elem207; { - TList _list204 = await iprot.ReadListBeginAsync(cancellationToken); - _elem203 = new List(_list204.Count); - for(int _i205 = 0; _i205 < _list204.Count; ++_i205) + TList _list208 = await iprot.ReadListBeginAsync(cancellationToken); + _elem207 = new List(_list208.Count); + for(int _i209 = 0; _i209 < _list208.Count; ++_i209) { - string _elem206; - _elem206 = await iprot.ReadStringAsync(cancellationToken); - _elem203.Add(_elem206); + string _elem210; + _elem210 = await iprot.ReadStringAsync(cancellationToken); + _elem207.Add(_elem210); } await iprot.ReadListEndAsync(cancellationToken); } - ValuesList.Add(_elem203); + ValuesList.Add(_elem207); } await iprot.ReadListEndAsync(cancellationToken); } @@ -186,13 +186,13 @@ public TSInsertStringRecordsOfOneDeviceReq(long sessionId, string prefixPath, Li if (field.Type == TType.List) { { - TList _list207 = await iprot.ReadListBeginAsync(cancellationToken); - Timestamps = new List(_list207.Count); - for(int _i208 = 0; _i208 < _list207.Count; ++_i208) + TList _list211 = await iprot.ReadListBeginAsync(cancellationToken); + Timestamps = new List(_list211.Count); + for(int _i212 = 0; _i212 < _list211.Count; ++_i212) { - long _elem209; - _elem209 = await iprot.ReadI64Async(cancellationToken); - Timestamps.Add(_elem209); + long _elem213; + _elem213 = await iprot.ReadI64Async(cancellationToken); + Timestamps.Add(_elem213); } await iprot.ReadListEndAsync(cancellationToken); } @@ -280,13 +280,13 @@ public TSInsertStringRecordsOfOneDeviceReq(long sessionId, string prefixPath, Li await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.List, MeasurementsList.Count), cancellationToken); - foreach (List _iter210 in MeasurementsList) + foreach (List _iter214 in MeasurementsList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter210.Count), cancellationToken); - foreach (string _iter211 in _iter210) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter214.Count), cancellationToken); + foreach (string _iter215 in _iter214) { - await oprot.WriteStringAsync(_iter211, cancellationToken); + await oprot.WriteStringAsync(_iter215, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -303,13 +303,13 @@ public TSInsertStringRecordsOfOneDeviceReq(long sessionId, string prefixPath, Li await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.List, ValuesList.Count), cancellationToken); - foreach (List _iter212 in ValuesList) + foreach (List _iter216 in ValuesList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter212.Count), cancellationToken); - foreach (string _iter213 in _iter212) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter216.Count), cancellationToken); + foreach (string _iter217 in _iter216) { - await oprot.WriteStringAsync(_iter213, cancellationToken); + await oprot.WriteStringAsync(_iter217, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -326,9 +326,9 @@ public TSInsertStringRecordsOfOneDeviceReq(long sessionId, string prefixPath, Li await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I64, Timestamps.Count), cancellationToken); - foreach (long _iter214 in Timestamps) + foreach (long _iter218 in Timestamps) { - await oprot.WriteI64Async(_iter214, cancellationToken); + await oprot.WriteI64Async(_iter218, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordsReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordsReq.cs index 1fca025..21be3e4 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordsReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordsReq.cs @@ -113,13 +113,13 @@ public TSInsertStringRecordsReq(long sessionId, List prefixPaths, List(_list216.Count); - for(int _i217 = 0; _i217 < _list216.Count; ++_i217) + TList _list220 = await iprot.ReadListBeginAsync(cancellationToken); + PrefixPaths = new List(_list220.Count); + for(int _i221 = 0; _i221 < _list220.Count; ++_i221) { - string _elem218; - _elem218 = await iprot.ReadStringAsync(cancellationToken); - PrefixPaths.Add(_elem218); + string _elem222; + _elem222 = await iprot.ReadStringAsync(cancellationToken); + PrefixPaths.Add(_elem222); } await iprot.ReadListEndAsync(cancellationToken); } @@ -134,23 +134,23 @@ public TSInsertStringRecordsReq(long sessionId, List prefixPaths, List>(_list219.Count); - for(int _i220 = 0; _i220 < _list219.Count; ++_i220) + TList _list223 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementsList = new List>(_list223.Count); + for(int _i224 = 0; _i224 < _list223.Count; ++_i224) { - List _elem221; + List _elem225; { - TList _list222 = await iprot.ReadListBeginAsync(cancellationToken); - _elem221 = new List(_list222.Count); - for(int _i223 = 0; _i223 < _list222.Count; ++_i223) + TList _list226 = await iprot.ReadListBeginAsync(cancellationToken); + _elem225 = new List(_list226.Count); + for(int _i227 = 0; _i227 < _list226.Count; ++_i227) { - string _elem224; - _elem224 = await iprot.ReadStringAsync(cancellationToken); - _elem221.Add(_elem224); + string _elem228; + _elem228 = await iprot.ReadStringAsync(cancellationToken); + _elem225.Add(_elem228); } await iprot.ReadListEndAsync(cancellationToken); } - MeasurementsList.Add(_elem221); + MeasurementsList.Add(_elem225); } await iprot.ReadListEndAsync(cancellationToken); } @@ -165,23 +165,23 @@ public TSInsertStringRecordsReq(long sessionId, List prefixPaths, List>(_list225.Count); - for(int _i226 = 0; _i226 < _list225.Count; ++_i226) + TList _list229 = await iprot.ReadListBeginAsync(cancellationToken); + ValuesList = new List>(_list229.Count); + for(int _i230 = 0; _i230 < _list229.Count; ++_i230) { - List _elem227; + List _elem231; { - TList _list228 = await iprot.ReadListBeginAsync(cancellationToken); - _elem227 = new List(_list228.Count); - for(int _i229 = 0; _i229 < _list228.Count; ++_i229) + TList _list232 = await iprot.ReadListBeginAsync(cancellationToken); + _elem231 = new List(_list232.Count); + for(int _i233 = 0; _i233 < _list232.Count; ++_i233) { - string _elem230; - _elem230 = await iprot.ReadStringAsync(cancellationToken); - _elem227.Add(_elem230); + string _elem234; + _elem234 = await iprot.ReadStringAsync(cancellationToken); + _elem231.Add(_elem234); } await iprot.ReadListEndAsync(cancellationToken); } - ValuesList.Add(_elem227); + ValuesList.Add(_elem231); } await iprot.ReadListEndAsync(cancellationToken); } @@ -196,13 +196,13 @@ public TSInsertStringRecordsReq(long sessionId, List prefixPaths, List(_list231.Count); - for(int _i232 = 0; _i232 < _list231.Count; ++_i232) + TList _list235 = await iprot.ReadListBeginAsync(cancellationToken); + Timestamps = new List(_list235.Count); + for(int _i236 = 0; _i236 < _list235.Count; ++_i236) { - long _elem233; - _elem233 = await iprot.ReadI64Async(cancellationToken); - Timestamps.Add(_elem233); + long _elem237; + _elem237 = await iprot.ReadI64Async(cancellationToken); + Timestamps.Add(_elem237); } await iprot.ReadListEndAsync(cancellationToken); } @@ -281,9 +281,9 @@ public TSInsertStringRecordsReq(long sessionId, List prefixPaths, List prefixPaths, List _iter235 in MeasurementsList) + foreach (List _iter239 in MeasurementsList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter235.Count), cancellationToken); - foreach (string _iter236 in _iter235) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter239.Count), cancellationToken); + foreach (string _iter240 in _iter239) { - await oprot.WriteStringAsync(_iter236, cancellationToken); + await oprot.WriteStringAsync(_iter240, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -320,13 +320,13 @@ public TSInsertStringRecordsReq(long sessionId, List prefixPaths, List _iter237 in ValuesList) + foreach (List _iter241 in ValuesList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter237.Count), cancellationToken); - foreach (string _iter238 in _iter237) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter241.Count), cancellationToken); + foreach (string _iter242 in _iter241) { - await oprot.WriteStringAsync(_iter238, cancellationToken); + await oprot.WriteStringAsync(_iter242, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -343,9 +343,9 @@ public TSInsertStringRecordsReq(long sessionId, List prefixPaths, List _columnCategories; + private bool _isCompressed; + private List _encodingTypes; + private sbyte _compressType; public long SessionId { get; set; } @@ -88,6 +91,45 @@ public List ColumnCategories } } + public bool IsCompressed + { + get + { + return _isCompressed; + } + set + { + __isset.isCompressed = true; + this._isCompressed = value; + } + } + + public List EncodingTypes + { + get + { + return _encodingTypes; + } + set + { + __isset.encodingTypes = true; + this._encodingTypes = value; + } + } + + public sbyte CompressType + { + get + { + return _compressType; + } + set + { + __isset.compressType = true; + this._compressType = value; + } + } + public Isset __isset; public struct Isset @@ -95,6 +137,9 @@ public struct Isset public bool isAligned; public bool writeToTable; public bool columnCategories; + public bool isCompressed; + public bool encodingTypes; + public bool compressType; } public TSInsertTabletReq() @@ -273,6 +318,46 @@ public TSInsertTabletReq(long sessionId, string prefixPath, List measure await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; + case 11: + if (field.Type == TType.Bool) + { + IsCompressed = await iprot.ReadBoolAsync(cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 12: + if (field.Type == TType.List) + { + { + TList _list120 = await iprot.ReadListBeginAsync(cancellationToken); + EncodingTypes = new List(_list120.Count); + for(int _i121 = 0; _i121 < _list120.Count; ++_i121) + { + sbyte _elem122; + _elem122 = await iprot.ReadByteAsync(cancellationToken); + EncodingTypes.Add(_elem122); + } + await iprot.ReadListEndAsync(cancellationToken); + } + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 13: + if (field.Type == TType.Byte) + { + CompressType = await iprot.ReadByteAsync(cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; @@ -348,9 +433,9 @@ public TSInsertTabletReq(long sessionId, string prefixPath, List measure await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Measurements.Count), cancellationToken); - foreach (string _iter120 in Measurements) + foreach (string _iter123 in Measurements) { - await oprot.WriteStringAsync(_iter120, cancellationToken); + await oprot.WriteStringAsync(_iter123, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -382,9 +467,9 @@ public TSInsertTabletReq(long sessionId, string prefixPath, List measure await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Types.Count), cancellationToken); - foreach (int _iter121 in Types) + foreach (int _iter124 in Types) { - await oprot.WriteI32Async(_iter121, cancellationToken); + await oprot.WriteI32Async(_iter124, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -422,14 +507,48 @@ public TSInsertTabletReq(long sessionId, string prefixPath, List measure await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Byte, ColumnCategories.Count), cancellationToken); - foreach (sbyte _iter122 in ColumnCategories) + foreach (sbyte _iter125 in ColumnCategories) { - await oprot.WriteByteAsync(_iter122, cancellationToken); + await oprot.WriteByteAsync(_iter125, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } await oprot.WriteFieldEndAsync(cancellationToken); } + if(__isset.isCompressed) + { + field.Name = "isCompressed"; + field.Type = TType.Bool; + field.ID = 11; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteBoolAsync(IsCompressed, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } + if((EncodingTypes != null) && __isset.encodingTypes) + { + field.Name = "encodingTypes"; + field.Type = TType.List; + field.ID = 12; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + { + await oprot.WriteListBeginAsync(new TList(TType.Byte, EncodingTypes.Count), cancellationToken); + foreach (sbyte _iter126 in EncodingTypes) + { + await oprot.WriteByteAsync(_iter126, cancellationToken); + } + await oprot.WriteListEndAsync(cancellationToken); + } + await oprot.WriteFieldEndAsync(cancellationToken); + } + if(__isset.compressType) + { + field.Name = "compressType"; + field.Type = TType.Byte; + field.ID = 13; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteByteAsync(CompressType, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } @@ -452,7 +571,10 @@ public override bool Equals(object that) && System.Object.Equals(Size, other.Size) && ((__isset.isAligned == other.__isset.isAligned) && ((!__isset.isAligned) || (System.Object.Equals(IsAligned, other.IsAligned)))) && ((__isset.writeToTable == other.__isset.writeToTable) && ((!__isset.writeToTable) || (System.Object.Equals(WriteToTable, other.WriteToTable)))) - && ((__isset.columnCategories == other.__isset.columnCategories) && ((!__isset.columnCategories) || (TCollections.Equals(ColumnCategories, other.ColumnCategories)))); + && ((__isset.columnCategories == other.__isset.columnCategories) && ((!__isset.columnCategories) || (TCollections.Equals(ColumnCategories, other.ColumnCategories)))) + && ((__isset.isCompressed == other.__isset.isCompressed) && ((!__isset.isCompressed) || (System.Object.Equals(IsCompressed, other.IsCompressed)))) + && ((__isset.encodingTypes == other.__isset.encodingTypes) && ((!__isset.encodingTypes) || (TCollections.Equals(EncodingTypes, other.EncodingTypes)))) + && ((__isset.compressType == other.__isset.compressType) && ((!__isset.compressType) || (System.Object.Equals(CompressType, other.CompressType)))); } public override int GetHashCode() { @@ -492,6 +614,18 @@ public override int GetHashCode() { { hashcode = (hashcode * 397) + TCollections.GetHashCode(ColumnCategories); } + if(__isset.isCompressed) + { + hashcode = (hashcode * 397) + IsCompressed.GetHashCode(); + } + if((EncodingTypes != null) && __isset.encodingTypes) + { + hashcode = (hashcode * 397) + TCollections.GetHashCode(EncodingTypes); + } + if(__isset.compressType) + { + hashcode = (hashcode * 397) + CompressType.GetHashCode(); + } } return hashcode; } @@ -543,6 +677,21 @@ public override string ToString() sb.Append(", ColumnCategories: "); ColumnCategories.ToString(sb); } + if(__isset.isCompressed) + { + sb.Append(", IsCompressed: "); + IsCompressed.ToString(sb); + } + if((EncodingTypes != null) && __isset.encodingTypes) + { + sb.Append(", EncodingTypes: "); + EncodingTypes.ToString(sb); + } + if(__isset.compressType) + { + sb.Append(", CompressType: "); + CompressType.ToString(sb); + } sb.Append(')'); return sb.ToString(); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSInsertTabletsReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSInsertTabletsReq.cs index 4673f35..837e405 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSInsertTabletsReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSInsertTabletsReq.cs @@ -121,13 +121,13 @@ public TSInsertTabletsReq(long sessionId, List prefixPaths, List(_list124.Count); - for(int _i125 = 0; _i125 < _list124.Count; ++_i125) + TList _list128 = await iprot.ReadListBeginAsync(cancellationToken); + PrefixPaths = new List(_list128.Count); + for(int _i129 = 0; _i129 < _list128.Count; ++_i129) { - string _elem126; - _elem126 = await iprot.ReadStringAsync(cancellationToken); - PrefixPaths.Add(_elem126); + string _elem130; + _elem130 = await iprot.ReadStringAsync(cancellationToken); + PrefixPaths.Add(_elem130); } await iprot.ReadListEndAsync(cancellationToken); } @@ -142,23 +142,23 @@ public TSInsertTabletsReq(long sessionId, List prefixPaths, List>(_list127.Count); - for(int _i128 = 0; _i128 < _list127.Count; ++_i128) + TList _list131 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementsList = new List>(_list131.Count); + for(int _i132 = 0; _i132 < _list131.Count; ++_i132) { - List _elem129; + List _elem133; { - TList _list130 = await iprot.ReadListBeginAsync(cancellationToken); - _elem129 = new List(_list130.Count); - for(int _i131 = 0; _i131 < _list130.Count; ++_i131) + TList _list134 = await iprot.ReadListBeginAsync(cancellationToken); + _elem133 = new List(_list134.Count); + for(int _i135 = 0; _i135 < _list134.Count; ++_i135) { - string _elem132; - _elem132 = await iprot.ReadStringAsync(cancellationToken); - _elem129.Add(_elem132); + string _elem136; + _elem136 = await iprot.ReadStringAsync(cancellationToken); + _elem133.Add(_elem136); } await iprot.ReadListEndAsync(cancellationToken); } - MeasurementsList.Add(_elem129); + MeasurementsList.Add(_elem133); } await iprot.ReadListEndAsync(cancellationToken); } @@ -173,13 +173,13 @@ public TSInsertTabletsReq(long sessionId, List prefixPaths, List(_list133.Count); - for(int _i134 = 0; _i134 < _list133.Count; ++_i134) + TList _list137 = await iprot.ReadListBeginAsync(cancellationToken); + ValuesList = new List(_list137.Count); + for(int _i138 = 0; _i138 < _list137.Count; ++_i138) { - byte[] _elem135; - _elem135 = await iprot.ReadBinaryAsync(cancellationToken); - ValuesList.Add(_elem135); + byte[] _elem139; + _elem139 = await iprot.ReadBinaryAsync(cancellationToken); + ValuesList.Add(_elem139); } await iprot.ReadListEndAsync(cancellationToken); } @@ -194,13 +194,13 @@ public TSInsertTabletsReq(long sessionId, List prefixPaths, List(_list136.Count); - for(int _i137 = 0; _i137 < _list136.Count; ++_i137) + TList _list140 = await iprot.ReadListBeginAsync(cancellationToken); + TimestampsList = new List(_list140.Count); + for(int _i141 = 0; _i141 < _list140.Count; ++_i141) { - byte[] _elem138; - _elem138 = await iprot.ReadBinaryAsync(cancellationToken); - TimestampsList.Add(_elem138); + byte[] _elem142; + _elem142 = await iprot.ReadBinaryAsync(cancellationToken); + TimestampsList.Add(_elem142); } await iprot.ReadListEndAsync(cancellationToken); } @@ -215,23 +215,23 @@ public TSInsertTabletsReq(long sessionId, List prefixPaths, List>(_list139.Count); - for(int _i140 = 0; _i140 < _list139.Count; ++_i140) + TList _list143 = await iprot.ReadListBeginAsync(cancellationToken); + TypesList = new List>(_list143.Count); + for(int _i144 = 0; _i144 < _list143.Count; ++_i144) { - List _elem141; + List _elem145; { - TList _list142 = await iprot.ReadListBeginAsync(cancellationToken); - _elem141 = new List(_list142.Count); - for(int _i143 = 0; _i143 < _list142.Count; ++_i143) + TList _list146 = await iprot.ReadListBeginAsync(cancellationToken); + _elem145 = new List(_list146.Count); + for(int _i147 = 0; _i147 < _list146.Count; ++_i147) { - int _elem144; - _elem144 = await iprot.ReadI32Async(cancellationToken); - _elem141.Add(_elem144); + int _elem148; + _elem148 = await iprot.ReadI32Async(cancellationToken); + _elem145.Add(_elem148); } await iprot.ReadListEndAsync(cancellationToken); } - TypesList.Add(_elem141); + TypesList.Add(_elem145); } await iprot.ReadListEndAsync(cancellationToken); } @@ -246,13 +246,13 @@ public TSInsertTabletsReq(long sessionId, List prefixPaths, List(_list145.Count); - for(int _i146 = 0; _i146 < _list145.Count; ++_i146) + TList _list149 = await iprot.ReadListBeginAsync(cancellationToken); + SizeList = new List(_list149.Count); + for(int _i150 = 0; _i150 < _list149.Count; ++_i150) { - int _elem147; - _elem147 = await iprot.ReadI32Async(cancellationToken); - SizeList.Add(_elem147); + int _elem151; + _elem151 = await iprot.ReadI32Async(cancellationToken); + SizeList.Add(_elem151); } await iprot.ReadListEndAsync(cancellationToken); } @@ -339,9 +339,9 @@ public TSInsertTabletsReq(long sessionId, List prefixPaths, List prefixPaths, List _iter149 in MeasurementsList) + foreach (List _iter153 in MeasurementsList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter149.Count), cancellationToken); - foreach (string _iter150 in _iter149) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter153.Count), cancellationToken); + foreach (string _iter154 in _iter153) { - await oprot.WriteStringAsync(_iter150, cancellationToken); + await oprot.WriteStringAsync(_iter154, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -378,9 +378,9 @@ public TSInsertTabletsReq(long sessionId, List prefixPaths, List prefixPaths, List prefixPaths, List _iter153 in TypesList) + foreach (List _iter157 in TypesList) { { - await oprot.WriteListBeginAsync(new TList(TType.I32, _iter153.Count), cancellationToken); - foreach (int _iter154 in _iter153) + await oprot.WriteListBeginAsync(new TList(TType.I32, _iter157.Count), cancellationToken); + foreach (int _iter158 in _iter157) { - await oprot.WriteI32Async(_iter154, cancellationToken); + await oprot.WriteI32Async(_iter158, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -433,9 +433,9 @@ public TSInsertTabletsReq(long sessionId, List prefixPaths, List paths, long time, long st if (field.Type == TType.List) { { - TList _list306 = await iprot.ReadListBeginAsync(cancellationToken); - Paths = new List(_list306.Count); - for(int _i307 = 0; _i307 < _list306.Count; ++_i307) + TList _list310 = await iprot.ReadListBeginAsync(cancellationToken); + Paths = new List(_list310.Count); + for(int _i311 = 0; _i311 < _list310.Count; ++_i311) { - string _elem308; - _elem308 = await iprot.ReadStringAsync(cancellationToken); - Paths.Add(_elem308); + string _elem312; + _elem312 = await iprot.ReadStringAsync(cancellationToken); + Paths.Add(_elem312); } await iprot.ReadListEndAsync(cancellationToken); } @@ -312,9 +312,9 @@ public TSLastDataQueryReq(long sessionId, List paths, long time, long st await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken); - foreach (string _iter309 in Paths) + foreach (string _iter313 in Paths) { - await oprot.WriteStringAsync(_iter309, cancellationToken); + await oprot.WriteStringAsync(_iter313, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSQueryTemplateResp.cs b/src/Apache.IoTDB/Rpc/Generated/TSQueryTemplateResp.cs index f7d1c78..2c567b4 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSQueryTemplateResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSQueryTemplateResp.cs @@ -163,13 +163,13 @@ public TSQueryTemplateResp(TSStatus status, int queryType) : this() if (field.Type == TType.List) { { - TList _list400 = await iprot.ReadListBeginAsync(cancellationToken); - Measurements = new List(_list400.Count); - for(int _i401 = 0; _i401 < _list400.Count; ++_i401) + TList _list409 = await iprot.ReadListBeginAsync(cancellationToken); + Measurements = new List(_list409.Count); + for(int _i410 = 0; _i410 < _list409.Count; ++_i410) { - string _elem402; - _elem402 = await iprot.ReadStringAsync(cancellationToken); - Measurements.Add(_elem402); + string _elem411; + _elem411 = await iprot.ReadStringAsync(cancellationToken); + Measurements.Add(_elem411); } await iprot.ReadListEndAsync(cancellationToken); } @@ -252,9 +252,9 @@ public TSQueryTemplateResp(TSStatus status, int queryType) : this() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Measurements.Count), cancellationToken); - foreach (string _iter403 in Measurements) + foreach (string _iter412 in Measurements) { - await oprot.WriteStringAsync(_iter403, cancellationToken); + await oprot.WriteStringAsync(_iter412, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSRawDataQueryReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSRawDataQueryReq.cs index df69c53..e6ffe52 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSRawDataQueryReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSRawDataQueryReq.cs @@ -173,13 +173,13 @@ public TSRawDataQueryReq(long sessionId, List paths, long startTime, lon if (field.Type == TType.List) { { - TList _list301 = await iprot.ReadListBeginAsync(cancellationToken); - Paths = new List(_list301.Count); - for(int _i302 = 0; _i302 < _list301.Count; ++_i302) + TList _list305 = await iprot.ReadListBeginAsync(cancellationToken); + Paths = new List(_list305.Count); + for(int _i306 = 0; _i306 < _list305.Count; ++_i306) { - string _elem303; - _elem303 = await iprot.ReadStringAsync(cancellationToken); - Paths.Add(_elem303); + string _elem307; + _elem307 = await iprot.ReadStringAsync(cancellationToken); + Paths.Add(_elem307); } await iprot.ReadListEndAsync(cancellationToken); } @@ -331,9 +331,9 @@ public TSRawDataQueryReq(long sessionId, List paths, long startTime, lon await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken); - foreach (string _iter304 in Paths) + foreach (string _iter308 in Paths) { - await oprot.WriteStringAsync(_iter304, cancellationToken); + await oprot.WriteStringAsync(_iter308, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSender.cs b/src/Apache.IoTDB/Rpc/Generated/TSender.cs index c530a44..f370683 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSender.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSender.cs @@ -188,16 +188,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("TSender("); - int tmp70 = 0; + int tmp91 = 0; if((DataNodeLocation != null) && __isset.dataNodeLocation) { - if(0 < tmp70++) { sb.Append(", "); } + if(0 < tmp91++) { sb.Append(", "); } sb.Append("DataNodeLocation: "); DataNodeLocation.ToString(sb); } if((ConfigNodeLocation != null) && __isset.configNodeLocation) { - if(0 < tmp70++) { sb.Append(", "); } + if(0 < tmp91++) { sb.Append(", "); } sb.Append("ConfigNodeLocation: "); ConfigNodeLocation.ToString(sb); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TServiceProvider.cs b/src/Apache.IoTDB/Rpc/Generated/TServiceProvider.cs index 3480593..b190aa5 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TServiceProvider.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TServiceProvider.cs @@ -40,14 +40,17 @@ public partial class TServiceProvider : TBase /// public TServiceType ServiceType { get; set; } + public int NodeId { get; set; } + public TServiceProvider() { } - public TServiceProvider(TEndPoint endPoint, TServiceType serviceType) : this() + public TServiceProvider(TEndPoint endPoint, TServiceType serviceType, int nodeId) : this() { this.EndPoint = endPoint; this.ServiceType = serviceType; + this.NodeId = nodeId; } public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) @@ -57,6 +60,7 @@ public TServiceProvider(TEndPoint endPoint, TServiceType serviceType) : this() { bool isset_endPoint = false; bool isset_serviceType = false; + bool isset_nodeId = false; TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) @@ -92,6 +96,17 @@ public TServiceProvider(TEndPoint endPoint, TServiceType serviceType) : this() await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; + case 3: + if (field.Type == TType.I32) + { + NodeId = await iprot.ReadI32Async(cancellationToken); + isset_nodeId = true; + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; @@ -109,6 +124,10 @@ public TServiceProvider(TEndPoint endPoint, TServiceType serviceType) : this() { throw new TProtocolException(TProtocolException.INVALID_DATA); } + if (!isset_nodeId) + { + throw new TProtocolException(TProtocolException.INVALID_DATA); + } } finally { @@ -139,6 +158,12 @@ public TServiceProvider(TEndPoint endPoint, TServiceType serviceType) : this() await oprot.WriteFieldBeginAsync(field, cancellationToken); await oprot.WriteI32Async((int)ServiceType, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); + field.Name = "nodeId"; + field.Type = TType.I32; + field.ID = 3; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteI32Async(NodeId, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } @@ -153,7 +178,8 @@ public override bool Equals(object that) if (!(that is TServiceProvider other)) return false; if (ReferenceEquals(this, other)) return true; return System.Object.Equals(EndPoint, other.EndPoint) - && System.Object.Equals(ServiceType, other.ServiceType); + && System.Object.Equals(ServiceType, other.ServiceType) + && System.Object.Equals(NodeId, other.NodeId); } public override int GetHashCode() { @@ -164,6 +190,7 @@ public override int GetHashCode() { hashcode = (hashcode * 397) + EndPoint.GetHashCode(); } hashcode = (hashcode * 397) + ServiceType.GetHashCode(); + hashcode = (hashcode * 397) + NodeId.GetHashCode(); } return hashcode; } @@ -178,6 +205,8 @@ public override string ToString() } sb.Append(", ServiceType: "); ServiceType.ToString(sb); + sb.Append(", NodeId: "); + NodeId.ToString(sb); sb.Append(')'); return sb.ToString(); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSetConfigurationReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSetConfigurationReq.cs index a152b1c..4302ff1 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSetConfigurationReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSetConfigurationReq.cs @@ -69,15 +69,15 @@ public TSetConfigurationReq(Dictionary configs, int nodeId) : th if (field.Type == TType.Map) { { - TMap _map31 = await iprot.ReadMapBeginAsync(cancellationToken); - Configs = new Dictionary(_map31.Count); - for(int _i32 = 0; _i32 < _map31.Count; ++_i32) + TMap _map35 = await iprot.ReadMapBeginAsync(cancellationToken); + Configs = new Dictionary(_map35.Count); + for(int _i36 = 0; _i36 < _map35.Count; ++_i36) { - string _key33; - string _val34; - _key33 = await iprot.ReadStringAsync(cancellationToken); - _val34 = await iprot.ReadStringAsync(cancellationToken); - Configs[_key33] = _val34; + string _key37; + string _val38; + _key37 = await iprot.ReadStringAsync(cancellationToken); + _val38 = await iprot.ReadStringAsync(cancellationToken); + Configs[_key37] = _val38; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -139,10 +139,10 @@ public TSetConfigurationReq(Dictionary configs, int nodeId) : th await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, Configs.Count), cancellationToken); - foreach (string _iter35 in Configs.Keys) + foreach (string _iter39 in Configs.Keys) { - await oprot.WriteStringAsync(_iter35, cancellationToken); - await oprot.WriteStringAsync(Configs[_iter35], cancellationToken); + await oprot.WriteStringAsync(_iter39, cancellationToken); + await oprot.WriteStringAsync(Configs[_iter39], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSetSpaceQuotaReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSetSpaceQuotaReq.cs index e9a23e9..aae497f 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSetSpaceQuotaReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSetSpaceQuotaReq.cs @@ -69,13 +69,13 @@ public TSetSpaceQuotaReq(List database, TSpaceQuota spaceLimit) : this() if (field.Type == TType.List) { { - TList _list61 = await iprot.ReadListBeginAsync(cancellationToken); - Database = new List(_list61.Count); - for(int _i62 = 0; _i62 < _list61.Count; ++_i62) + TList _list65 = await iprot.ReadListBeginAsync(cancellationToken); + Database = new List(_list65.Count); + for(int _i66 = 0; _i66 < _list65.Count; ++_i66) { - string _elem63; - _elem63 = await iprot.ReadStringAsync(cancellationToken); - Database.Add(_elem63); + string _elem67; + _elem67 = await iprot.ReadStringAsync(cancellationToken); + Database.Add(_elem67); } await iprot.ReadListEndAsync(cancellationToken); } @@ -138,9 +138,9 @@ public TSetSpaceQuotaReq(List database, TSpaceQuota spaceLimit) : this() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Database.Count), cancellationToken); - foreach (string _iter64 in Database) + foreach (string _iter68 in Database) { - await oprot.WriteStringAsync(_iter64, cancellationToken); + await oprot.WriteStringAsync(_iter68, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSetTTLReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSetTTLReq.cs index b2ad1ae..907ba23 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSetTTLReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSetTTLReq.cs @@ -73,13 +73,13 @@ public TSetTTLReq(List pathPattern, long TTL, bool isDataBase) : this() if (field.Type == TType.List) { { - TList _list37 = await iprot.ReadListBeginAsync(cancellationToken); - PathPattern = new List(_list37.Count); - for(int _i38 = 0; _i38 < _list37.Count; ++_i38) + TList _list41 = await iprot.ReadListBeginAsync(cancellationToken); + PathPattern = new List(_list41.Count); + for(int _i42 = 0; _i42 < _list41.Count; ++_i42) { - string _elem39; - _elem39 = await iprot.ReadStringAsync(cancellationToken); - PathPattern.Add(_elem39); + string _elem43; + _elem43 = await iprot.ReadStringAsync(cancellationToken); + PathPattern.Add(_elem43); } await iprot.ReadListEndAsync(cancellationToken); } @@ -156,9 +156,9 @@ public TSetTTLReq(List pathPattern, long TTL, bool isDataBase) : this() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, PathPattern.Count), cancellationToken); - foreach (string _iter40 in PathPattern) + foreach (string _iter44 in PathPattern) { - await oprot.WriteStringAsync(_iter40, cancellationToken); + await oprot.WriteStringAsync(_iter44, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSettleReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSettleReq.cs index f2d9138..c3d5f81 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSettleReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSettleReq.cs @@ -65,13 +65,13 @@ public TSettleReq(List paths) : this() if (field.Type == TType.List) { { - TList _list25 = await iprot.ReadListBeginAsync(cancellationToken); - Paths = new List(_list25.Count); - for(int _i26 = 0; _i26 < _list25.Count; ++_i26) + TList _list29 = await iprot.ReadListBeginAsync(cancellationToken); + Paths = new List(_list29.Count); + for(int _i30 = 0; _i30 < _list29.Count; ++_i30) { - string _elem27; - _elem27 = await iprot.ReadStringAsync(cancellationToken); - Paths.Add(_elem27); + string _elem31; + _elem31 = await iprot.ReadStringAsync(cancellationToken); + Paths.Add(_elem31); } await iprot.ReadListEndAsync(cancellationToken); } @@ -118,9 +118,9 @@ public TSettleReq(List paths) : this() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken); - foreach (string _iter28 in Paths) + foreach (string _iter32 in Paths) { - await oprot.WriteStringAsync(_iter28, cancellationToken); + await oprot.WriteStringAsync(_iter32, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TShowTTLReq.cs b/src/Apache.IoTDB/Rpc/Generated/TShowTTLReq.cs index d99929a..5d22cec 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TShowTTLReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TShowTTLReq.cs @@ -65,13 +65,13 @@ public TShowTTLReq(List pathPattern) : this() if (field.Type == TType.List) { { - TList _list42 = await iprot.ReadListBeginAsync(cancellationToken); - PathPattern = new List(_list42.Count); - for(int _i43 = 0; _i43 < _list42.Count; ++_i43) + TList _list46 = await iprot.ReadListBeginAsync(cancellationToken); + PathPattern = new List(_list46.Count); + for(int _i47 = 0; _i47 < _list46.Count; ++_i47) { - string _elem44; - _elem44 = await iprot.ReadStringAsync(cancellationToken); - PathPattern.Add(_elem44); + string _elem48; + _elem48 = await iprot.ReadStringAsync(cancellationToken); + PathPattern.Add(_elem48); } await iprot.ReadListEndAsync(cancellationToken); } @@ -118,9 +118,9 @@ public TShowTTLReq(List pathPattern) : this() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, PathPattern.Count), cancellationToken); - foreach (string _iter45 in PathPattern) + foreach (string _iter49 in PathPattern) { - await oprot.WriteStringAsync(_iter45, cancellationToken); + await oprot.WriteStringAsync(_iter49, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSpaceQuota.cs b/src/Apache.IoTDB/Rpc/Generated/TSpaceQuota.cs index 4f48520..bbcd2ed 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSpaceQuota.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSpaceQuota.cs @@ -225,22 +225,22 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("TSpaceQuota("); - int tmp53 = 0; + int tmp57 = 0; if(__isset.diskSize) { - if(0 < tmp53++) { sb.Append(", "); } + if(0 < tmp57++) { sb.Append(", "); } sb.Append("DiskSize: "); DiskSize.ToString(sb); } if(__isset.deviceNum) { - if(0 < tmp53++) { sb.Append(", "); } + if(0 < tmp57++) { sb.Append(", "); } sb.Append("DeviceNum: "); DeviceNum.ToString(sb); } if(__isset.timeserieNum) { - if(0 < tmp53++) { sb.Append(", "); } + if(0 < tmp57++) { sb.Append(", "); } sb.Append("TimeserieNum: "); TimeserieNum.ToString(sb); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TTestConnectionResp.cs b/src/Apache.IoTDB/Rpc/Generated/TTestConnectionResp.cs index f6b74eb..ee615dd 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TTestConnectionResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TTestConnectionResp.cs @@ -81,14 +81,14 @@ public TTestConnectionResp(TSStatus status, List resultLi if (field.Type == TType.List) { { - TList _list72 = await iprot.ReadListBeginAsync(cancellationToken); - ResultList = new List(_list72.Count); - for(int _i73 = 0; _i73 < _list72.Count; ++_i73) + TList _list93 = await iprot.ReadListBeginAsync(cancellationToken); + ResultList = new List(_list93.Count); + for(int _i94 = 0; _i94 < _list93.Count; ++_i94) { - TTestConnectionResult _elem74; - _elem74 = new TTestConnectionResult(); - await _elem74.ReadAsync(iprot, cancellationToken); - ResultList.Add(_elem74); + TTestConnectionResult _elem95; + _elem95 = new TTestConnectionResult(); + await _elem95.ReadAsync(iprot, cancellationToken); + ResultList.Add(_elem95); } await iprot.ReadListEndAsync(cancellationToken); } @@ -148,9 +148,9 @@ public TTestConnectionResp(TSStatus status, List resultLi await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Struct, ResultList.Count), cancellationToken); - foreach (TTestConnectionResult _iter75 in ResultList) + foreach (TTestConnectionResult _iter96 in ResultList) { - await _iter75.WriteAsync(oprot, cancellationToken); + await _iter96.WriteAsync(oprot, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TThrottleQuota.cs b/src/Apache.IoTDB/Rpc/Generated/TThrottleQuota.cs index 16b958b..3556cd6 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TThrottleQuota.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TThrottleQuota.cs @@ -108,16 +108,16 @@ public TThrottleQuota() if (field.Type == TType.Map) { { - TMap _map55 = await iprot.ReadMapBeginAsync(cancellationToken); - ThrottleLimit = new Dictionary(_map55.Count); - for(int _i56 = 0; _i56 < _map55.Count; ++_i56) + TMap _map59 = await iprot.ReadMapBeginAsync(cancellationToken); + ThrottleLimit = new Dictionary(_map59.Count); + for(int _i60 = 0; _i60 < _map59.Count; ++_i60) { - ThrottleType _key57; - TTimedQuota _val58; - _key57 = (ThrottleType)await iprot.ReadI32Async(cancellationToken); - _val58 = new TTimedQuota(); - await _val58.ReadAsync(iprot, cancellationToken); - ThrottleLimit[_key57] = _val58; + ThrottleType _key61; + TTimedQuota _val62; + _key61 = (ThrottleType)await iprot.ReadI32Async(cancellationToken); + _val62 = new TTimedQuota(); + await _val62.ReadAsync(iprot, cancellationToken); + ThrottleLimit[_key61] = _val62; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -179,10 +179,10 @@ public TThrottleQuota() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.I32, TType.Struct, ThrottleLimit.Count), cancellationToken); - foreach (ThrottleType _iter59 in ThrottleLimit.Keys) + foreach (ThrottleType _iter63 in ThrottleLimit.Keys) { - await oprot.WriteI32Async((int)_iter59, cancellationToken); - await ThrottleLimit[_iter59].WriteAsync(oprot, cancellationToken); + await oprot.WriteI32Async((int)_iter63, cancellationToken); + await ThrottleLimit[_iter63].WriteAsync(oprot, cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -246,22 +246,22 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("TThrottleQuota("); - int tmp60 = 0; + int tmp64 = 0; if((ThrottleLimit != null) && __isset.throttleLimit) { - if(0 < tmp60++) { sb.Append(", "); } + if(0 < tmp64++) { sb.Append(", "); } sb.Append("ThrottleLimit: "); ThrottleLimit.ToString(sb); } if(__isset.memLimit) { - if(0 < tmp60++) { sb.Append(", "); } + if(0 < tmp64++) { sb.Append(", "); } sb.Append("MemLimit: "); MemLimit.ToString(sb); } if(__isset.cpuLimit) { - if(0 < tmp60++) { sb.Append(", "); } + if(0 < tmp64++) { sb.Append(", "); } sb.Append("CpuLimit: "); CpuLimit.ToString(sb); } diff --git a/src/Apache.IoTDB/Rpc/Generated/common.Extensions.cs b/src/Apache.IoTDB/Rpc/Generated/common.Extensions.cs index 4fd2bad..5ef4386 100644 --- a/src/Apache.IoTDB/Rpc/Generated/common.Extensions.cs +++ b/src/Apache.IoTDB/Rpc/Generated/common.Extensions.cs @@ -127,6 +127,66 @@ public static int GetHashCode(this List instance) } + public static bool Equals(this List instance, object that) + { + if (!(that is List other)) return false; + if (ReferenceEquals(instance, other)) return true; + + return TCollections.Equals(instance, other); + } + + + public static int GetHashCode(this List instance) + { + return TCollections.GetHashCode(instance); + } + + + public static bool Equals(this List instance, object that) + { + if (!(that is List other)) return false; + if (ReferenceEquals(instance, other)) return true; + + return TCollections.Equals(instance, other); + } + + + public static int GetHashCode(this List instance) + { + return TCollections.GetHashCode(instance); + } + + + public static bool Equals(this List instance, object that) + { + if (!(that is List other)) return false; + if (ReferenceEquals(instance, other)) return true; + + return TCollections.Equals(instance, other); + } + + + public static int GetHashCode(this List instance) + { + return TCollections.GetHashCode(instance); + } + + + public static bool Equals(this List instance, object that) + { + if (!(that is List other)) return false; + if (ReferenceEquals(instance, other)) return true; + + return TCollections.Equals(instance, other); + } + + + public static int GetHashCode(this List instance) + { + return TCollections.GetHashCode(instance); + } + + public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; diff --git a/src/Apache.IoTDB/Rpc/client.thrift b/src/Apache.IoTDB/Rpc/client.thrift new file mode 100644 index 0000000..3ea4ac3 --- /dev/null +++ b/src/Apache.IoTDB/Rpc/client.thrift @@ -0,0 +1,690 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +include "common.thrift" +namespace java org.apache.iotdb.service.rpc.thrift +namespace py iotdb.thrift.rpc +namespace go rpc + +struct TSQueryDataSet{ + // ByteBuffer for time column + 1: required binary time + // ByteBuffer for each column values + 2: required list valueList + // Bitmap for each column to indicate whether it is a null value + 3: required list bitmapList +} + +struct TSQueryNonAlignDataSet{ + // ByteBuffer for each time column + 1: required list timeList + // ByteBuffer for each column values + 2: required list valueList +} + +struct TSTracingInfo{ + 1: required list activityList + 2: required list elapsedTimeList + 3: optional i32 seriesPathNum + 4: optional i32 seqFileNum + 5: optional i32 unSeqFileNum + 6: optional i32 sequenceChunkNum + 7: optional i64 sequenceChunkPointNum + 8: optional i32 unsequenceChunkNum + 9: optional i64 unsequenceChunkPointNum + 10: optional i32 totalPageNum + 11: optional i32 overlappedPageNum +} + +struct TSExecuteStatementResp { + 1: required common.TSStatus status + 2: optional i64 queryId + // Column names in select statement of SQL + 3: optional list columns + 4: optional string operationType + 5: optional bool ignoreTimeStamp + // Data type list of columns in select statement of SQL + 6: optional list dataTypeList + 7: optional TSQueryDataSet queryDataSet + // for disable align statements, queryDataSet is null and nonAlignQueryDataSet is not null + 8: optional TSQueryNonAlignDataSet nonAlignQueryDataSet + 9: optional map columnNameIndexMap + 10: optional list sgColumns + 11: optional list aliasColumns + 12: optional TSTracingInfo tracingInfo + 13: optional list queryResult + 14: optional bool moreData + // only be set while executing use XXX successfully + 15: optional string database + 16: optional bool tableModel + 17: optional list columnIndex2TsBlockColumnIndexList +} + +enum TSProtocolVersion { + IOTDB_SERVICE_PROTOCOL_V1, + IOTDB_SERVICE_PROTOCOL_V2,//V2 is the first version that we can check version compatibility + IOTDB_SERVICE_PROTOCOL_V3,//V3 is incompatible with V2 +} + +struct TSOpenSessionResp { + 1: required common.TSStatus status + + // The protocol version that the server is using. + 2: required TSProtocolVersion serverProtocolVersion = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V1 + + // Session id + 3: optional i64 sessionId + + // The configuration settings for this session. + 4: optional map configuration +} + +// OpenSession() +// Open a session (connection) on the server against which operations may be executed. +struct TSOpenSessionReq { + 1: required TSProtocolVersion client_protocol = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3 + 2: required string zoneId + 3: required string username + 4: optional string password + 5: optional map configuration +} + +// CloseSession() +// Closes the specified session and frees any resources currently allocated to that session. +// Any open operations in that session will be canceled. +struct TSCloseSessionReq { + 1: required i64 sessionId +} + +// ExecuteStatement() +// +// Execute a statement. +// The returned OperationHandle can be used to check on the status of the statement, and to fetch results once the +// statement has finished executing. +struct TSExecuteStatementReq { + // The session to execute the statement against + 1: required i64 sessionId + + // The statement to be executed (DML, DDL, SET, etc) + 2: required string statement + + // statementId + 3: required i64 statementId + + 4: optional i32 fetchSize + + 5: optional i64 timeout + + 6: optional bool enableRedirectQuery; + + 7: optional bool jdbcQuery; +} + +struct TSExecuteBatchStatementReq{ + // The session to execute the statement against + 1: required i64 sessionId + + // The statements to be executed (DML, DDL, SET, etc) + 2: required list statements +} + +struct TSGetOperationStatusReq { + 1: required i64 sessionId + // Session to run this request against + 2: required i64 queryId +} + +// CancelOperation() +// +// Cancels processing on the specified operation handle and frees any resources which were allocated. +struct TSCancelOperationReq { + 1: required i64 sessionId + // Operation to cancel + 2: required i64 queryId +} + +// CloseOperation() +struct TSCloseOperationReq { + 1: required i64 sessionId + 2: optional i64 queryId + 3: optional i64 statementId +} + +struct TSFetchResultsReq{ + 1: required i64 sessionId + 2: required string statement + 3: required i32 fetchSize + 4: required i64 queryId + 5: required bool isAlign + 6: optional i64 timeout + 7: optional i64 statementId +} + +struct TSFetchResultsResp{ + 1: required common.TSStatus status + 2: required bool hasResultSet + 3: required bool isAlign + 4: optional TSQueryDataSet queryDataSet + 5: optional TSQueryNonAlignDataSet nonAlignQueryDataSet + 6: optional list queryResult + 7: optional bool moreData +} + +struct TSFetchMetadataResp{ + 1: required common.TSStatus status + 2: optional string metadataInJson + 3: optional list columnsList + 4: optional string dataType +} + +struct TSFetchMetadataReq{ + 1: required i64 sessionId + 2: required string type + 3: optional string columnPath +} + +struct TSGetTimeZoneResp { + 1: required common.TSStatus status + 2: required string timeZone +} + +struct TSSetTimeZoneReq { + 1: required i64 sessionId + 2: required string timeZone +} + +// for session +struct TSInsertRecordReq { + 1: required i64 sessionId + 2: required string prefixPath + 3: required list measurements + 4: required binary values + 5: required i64 timestamp + 6: optional bool isAligned + 7: optional bool isWriteToTable + 8: optional list columnCategoryies +} + +struct TSInsertStringRecordReq { + 1: required i64 sessionId + 2: required string prefixPath + 3: required list measurements + 4: required list values + 5: required i64 timestamp + 6: optional bool isAligned + 7: optional i64 timeout +} + +struct TSInsertTabletReq { + 1: required i64 sessionId + 2: required string prefixPath + 3: required list measurements + 4: required binary values + 5: required binary timestamps + 6: required list types + 7: required i32 size + 8: optional bool isAligned + 9: optional bool writeToTable + 10: optional list columnCategories + 11: optional bool isCompressed + 12: optional list encodingTypes + 13: optional byte compressType +} + +struct TSInsertTabletsReq { + 1: required i64 sessionId + 2: required list prefixPaths + 3: required list> measurementsList + 4: required list valuesList + 5: required list timestampsList + 6: required list> typesList + 7: required list sizeList + 8: optional bool isAligned +} + +struct TSInsertRecordsReq { + 1: required i64 sessionId + 2: required list prefixPaths + 3: required list> measurementsList + 4: required list valuesList + 5: required list timestamps + 6: optional bool isAligned +} + +struct TSInsertRecordsOfOneDeviceReq { + 1: required i64 sessionId + 2: required string prefixPath + 3: required list> measurementsList + 4: required list valuesList + 5: required list timestamps + 6: optional bool isAligned +} + +struct TSInsertStringRecordsOfOneDeviceReq { + 1: required i64 sessionId + 2: required string prefixPath + 3: required list> measurementsList + 4: required list> valuesList + 5: required list timestamps + 6: optional bool isAligned +} + +struct TSInsertStringRecordsReq { + 1: required i64 sessionId + 2: required list prefixPaths + 3: required list> measurementsList + 4: required list> valuesList + 5: required list timestamps + 6: optional bool isAligned +} + +struct TSDeleteDataReq { + 1: required i64 sessionId + 2: required list paths + 3: required i64 startTime + 4: required i64 endTime +} + +struct TSCreateTimeseriesReq { + 1: required i64 sessionId + 2: required string path + 3: required i32 dataType + 4: required i32 encoding + 5: required i32 compressor + 6: optional map props + 7: optional map tags + 8: optional map attributes + 9: optional string measurementAlias +} + +struct TSCreateAlignedTimeseriesReq { + 1: required i64 sessionId + 2: required string prefixPath + 3: required list measurements + 4: required list dataTypes + 5: required list encodings + 6: required list compressors + 7: optional list measurementAlias + 8: optional list> tagsList + 9: optional list> attributesList +} + +struct TSRawDataQueryReq { + 1: required i64 sessionId + 2: required list paths + 3: optional i32 fetchSize + 4: required i64 startTime + 5: required i64 endTime + 6: required i64 statementId + 7: optional bool enableRedirectQuery + 8: optional bool jdbcQuery + 9: optional i64 timeout + 10: optional bool legalPathNodes +} + +struct TSLastDataQueryReq { + 1: required i64 sessionId + 2: required list paths + 3: optional i32 fetchSize + 4: required i64 time + 5: required i64 statementId + 6: optional bool enableRedirectQuery + 7: optional bool jdbcQuery + 8: optional i64 timeout + 9: optional bool legalPathNodes +} + +struct TSFastLastDataQueryForOnePrefixPathReq { + 1: required i64 sessionId + 2: required list prefixes + 3: optional i32 fetchSize + 4: required i64 statementId + 5: optional bool enableRedirectQuery + 6: optional bool jdbcQuery + 7: optional i64 timeout +} + +struct TSFastLastDataQueryForOneDeviceReq { + 1: required i64 sessionId + 2: required string db + 3: required string deviceId + 4: required list sensors + 5: optional i32 fetchSize + 6: required i64 statementId + 7: optional bool enableRedirectQuery + 8: optional bool jdbcQuery + 9: optional i64 timeout + 10: optional bool legalPathNodes +} + +struct TSAggregationQueryReq { + 1: required i64 sessionId + 2: required i64 statementId + 3: required list paths + 4: required list aggregations + 5: optional i64 startTime + 6: optional i64 endTime + 7: optional i64 interval + 8: optional i64 slidingStep + 9: optional i32 fetchSize + 10: optional i64 timeout + 11: optional bool legalPathNodes +} + +struct TSGroupByQueryIntervalReq { + 1: required i64 sessionId + 2: required i64 statementId + 3: required string device + 4: required string measurement + 5: required i32 dataType + 6: required common.TAggregationType aggregationType + 7: optional string database + 8: optional i64 startTime + 9: optional i64 endTime + 10: optional i64 interval + 11: optional i32 fetchSize + 12: optional i64 timeout + 13: optional bool isAligned +} + +struct TSCreateMultiTimeseriesReq { + 1: required i64 sessionId + 2: required list paths + 3: required list dataTypes + 4: required list encodings + 5: required list compressors + 6: optional list> propsList + 7: optional list> tagsList + 8: optional list> attributesList + 9: optional list measurementAliasList +} + +struct ServerProperties { + 1: required string version; + 2: required list supportedTimeAggregationOperations; + 3: required string timestampPrecision; + 4: i32 maxConcurrentClientNum; + 5: optional i32 thriftMaxFrameSize; + 6: optional bool isReadOnly; + 7: optional string buildInfo; + 8: optional string logo; +} + +struct TSSetSchemaTemplateReq { + 1: required i64 sessionId + 2: required string templateName + 3: required string prefixPath +} + +struct TSCreateSchemaTemplateReq { + 1: required i64 sessionId + 2: required string name + 3: required binary serializedTemplate +} + +struct TSAppendSchemaTemplateReq { + 1: required i64 sessionId + 2: required string name + 3: required bool isAligned + 4: required list measurements + 5: required list dataTypes + 6: required list encodings + 7: required list compressors +} + +struct TSPruneSchemaTemplateReq { + 1: required i64 sessionId + 2: required string name + 3: required string path +} + +struct TSQueryTemplateReq { + 1: required i64 sessionId + 2: required string name + 3: required i32 queryType + 4: optional string measurement +} + +struct TSQueryTemplateResp { + 1: required common.TSStatus status + 2: required i32 queryType + 3: optional bool result + 4: optional i32 count + 5: optional list measurements +} + +struct TSUnsetSchemaTemplateReq { + 1: required i64 sessionId + 2: required string prefixPath + 3: required string templateName +} + +struct TSDropSchemaTemplateReq { + 1: required i64 sessionId + 2: required string templateName +} + +struct TCreateTimeseriesUsingSchemaTemplateReq{ + 1: required i64 sessionId + 2: required list devicePathList +} + +// The sender and receiver need to check some info to confirm validity +struct TSyncIdentityInfo{ + // Sender needs to tell receiver its identity. + 1:required string pipeName + 2:required i64 createTime + // The version of sender and receiver need to be the same. + 3:required string version + 4:required string database +} + +struct TSyncTransportMetaInfo{ + // The name of the file in sending. + 1:required string fileName + // The start index of the file slice in sending. + 2:required i64 startIndex +} + +struct TPipeTransferReq { + 1:required i8 version + 2:required i16 type + 3:required binary body +} + +struct TPipeTransferResp { + 1:required common.TSStatus status + 2:optional binary body +} + +struct TPipeSubscribeReq { + 1:required i8 version + 2:required i16 type + 3:optional binary body +} + +struct TPipeSubscribeResp { + 1:required common.TSStatus status + 2:required i8 version + 3:required i16 type + 4:optional list body +} + +struct TSBackupConfigurationResp { + 1: required common.TSStatus status + 2: optional bool enableOperationSync + 3: optional string secondaryAddress + 4: optional i32 secondaryPort +} + +enum TSConnectionType { + THRIFT_BASED + MQTT_BASED + INTERNAL + REST_BASED +} + +struct TSConnectionInfo { + 1: required string userName + 2: required i64 logInTime + 3: required string connectionId // ip:port for thrift-based service and clientId for mqtt-based service + 4: required TSConnectionType type +} + +struct TSConnectionInfoResp { + 1: required list connectionInfoList +} + +service IClientRPCService { + + TSExecuteStatementResp executeQueryStatementV2(1:TSExecuteStatementReq req); + + TSExecuteStatementResp executeUpdateStatementV2(1:TSExecuteStatementReq req); + + TSExecuteStatementResp executeStatementV2(1:TSExecuteStatementReq req); + + TSExecuteStatementResp executeRawDataQueryV2(1:TSRawDataQueryReq req); + + TSExecuteStatementResp executeLastDataQueryV2(1:TSLastDataQueryReq req); + + TSExecuteStatementResp executeFastLastDataQueryForOnePrefixPath(1:TSFastLastDataQueryForOnePrefixPathReq req); + + TSExecuteStatementResp executeFastLastDataQueryForOneDeviceV2(1:TSFastLastDataQueryForOneDeviceReq req); + + TSExecuteStatementResp executeAggregationQueryV2(1:TSAggregationQueryReq req); + + TSExecuteStatementResp executeGroupByQueryIntervalQuery(1:TSGroupByQueryIntervalReq req); + + TSFetchResultsResp fetchResultsV2(1:TSFetchResultsReq req); + + TSOpenSessionResp openSession(1:TSOpenSessionReq req); + + common.TSStatus closeSession(1:TSCloseSessionReq req); + + TSExecuteStatementResp executeStatement(1:TSExecuteStatementReq req); + + common.TSStatus executeBatchStatement(1:TSExecuteBatchStatementReq req); + + TSExecuteStatementResp executeQueryStatement(1:TSExecuteStatementReq req); + + TSExecuteStatementResp executeUpdateStatement(1:TSExecuteStatementReq req); + + TSFetchResultsResp fetchResults(1:TSFetchResultsReq req); + + TSFetchMetadataResp fetchMetadata(1:TSFetchMetadataReq req); + + common.TSStatus cancelOperation(1:TSCancelOperationReq req); + + common.TSStatus closeOperation(1:TSCloseOperationReq req); + + TSGetTimeZoneResp getTimeZone(1:i64 sessionId); + + common.TSStatus setTimeZone(1:TSSetTimeZoneReq req); + + ServerProperties getProperties(); + + common.TSStatus setStorageGroup(1:i64 sessionId, 2:string storageGroup); + + common.TSStatus createTimeseries(1:TSCreateTimeseriesReq req); + + common.TSStatus createAlignedTimeseries(1:TSCreateAlignedTimeseriesReq req); + + common.TSStatus createMultiTimeseries(1:TSCreateMultiTimeseriesReq req); + + common.TSStatus deleteTimeseries(1:i64 sessionId, 2:list path) + + common.TSStatus deleteStorageGroups(1:i64 sessionId, 2:list storageGroup); + + common.TSStatus insertRecord(1:TSInsertRecordReq req); + + common.TSStatus insertStringRecord(1:TSInsertStringRecordReq req); + + common.TSStatus insertTablet(1:TSInsertTabletReq req); + + common.TSStatus insertTablets(1:TSInsertTabletsReq req); + + common.TSStatus insertRecords(1:TSInsertRecordsReq req); + + common.TSStatus insertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req); + + common.TSStatus insertStringRecordsOfOneDevice(1:TSInsertStringRecordsOfOneDeviceReq req); + + common.TSStatus insertStringRecords(1:TSInsertStringRecordsReq req); + + common.TSStatus testInsertTablet(1:TSInsertTabletReq req); + + common.TSStatus testInsertTablets(1:TSInsertTabletsReq req); + + common.TSStatus testInsertRecord(1:TSInsertRecordReq req); + + common.TSStatus testInsertStringRecord(1:TSInsertStringRecordReq req); + + common.TSStatus testInsertRecords(1:TSInsertRecordsReq req); + + common.TSStatus testInsertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req); + + common.TSStatus testInsertStringRecords(1:TSInsertStringRecordsReq req); + + common.TSStatus deleteData(1:TSDeleteDataReq req); + + TSExecuteStatementResp executeRawDataQuery(1:TSRawDataQueryReq req); + + TSExecuteStatementResp executeLastDataQuery(1:TSLastDataQueryReq req); + + TSExecuteStatementResp executeAggregationQuery(1:TSAggregationQueryReq req); + + i64 requestStatementId(1:i64 sessionId); + + common.TSStatus createSchemaTemplate(1:TSCreateSchemaTemplateReq req); + + common.TSStatus appendSchemaTemplate(1:TSAppendSchemaTemplateReq req); + + common.TSStatus pruneSchemaTemplate(1:TSPruneSchemaTemplateReq req); + + TSQueryTemplateResp querySchemaTemplate(1:TSQueryTemplateReq req); + + common.TShowConfigurationTemplateResp showConfigurationTemplate(); + + common.TShowConfigurationResp showConfiguration(1:i32 nodeId); + + common.TSStatus setSchemaTemplate(1:TSSetSchemaTemplateReq req); + + common.TSStatus unsetSchemaTemplate(1:TSUnsetSchemaTemplateReq req); + + common.TSStatus dropSchemaTemplate(1:TSDropSchemaTemplateReq req); + + common.TSStatus createTimeseriesUsingSchemaTemplate(1:TCreateTimeseriesUsingSchemaTemplateReq req); + + common.TSStatus handshake(TSyncIdentityInfo info); + + common.TSStatus sendPipeData(1:binary buff); + + common.TSStatus sendFile(1:TSyncTransportMetaInfo metaInfo, 2:binary buff); + + TPipeTransferResp pipeTransfer(TPipeTransferReq req); + + TPipeSubscribeResp pipeSubscribe(TPipeSubscribeReq req); + + TSBackupConfigurationResp getBackupConfiguration(); + + TSConnectionInfoResp fetchAllConnectionsInfo(); + + /** For other node's call */ + common.TSStatus testConnectionEmptyRPC() +} \ No newline at end of file diff --git a/src/Apache.IoTDB/Rpc/common.thrift b/src/Apache.IoTDB/Rpc/common.thrift new file mode 100644 index 0000000..3287f35 --- /dev/null +++ b/src/Apache.IoTDB/Rpc/common.thrift @@ -0,0 +1,328 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +namespace java org.apache.iotdb.common.rpc.thrift +namespace py iotdb.thrift.common +namespace go common + +// Define a set of ip:port address +struct TEndPoint { + 1: required string ip + 2: required i32 port +} + +// The return status code and message in each response. +struct TSStatus { + 1: required i32 code + 2: optional string message + 3: optional list subStatus + 4: optional TEndPoint redirectNode + 5: optional bool needRetry +} + +enum TConsensusGroupType { + ConfigRegion, + DataRegion, + SchemaRegion +} + +struct TConsensusGroupId { + 1: required TConsensusGroupType type + 2: required i32 id +} + +struct TSeriesPartitionSlot { + 1: required i32 slotId +} + +struct TTimePartitionSlot { + 1: required i64 startTime +} + +struct TRegionReplicaSet { + 1: required TConsensusGroupId regionId + 2: required list dataNodeLocations +} + +struct TNodeResource { + 1: required i32 cpuCoreNum + 2: required i64 maxMemory +} + +struct TConfigNodeLocation { + 1: required i32 configNodeId + 2: required TEndPoint internalEndPoint + 3: required TEndPoint consensusEndPoint +} + +struct TDataNodeLocation { + 1: required i32 dataNodeId + // TEndPoint for DataNode's client rpc + 2: required TEndPoint clientRpcEndPoint + // TEndPoint for DataNode's cluster internal rpc + 3: required TEndPoint internalEndPoint + // TEndPoint for exchange data between DataNodes + 4: required TEndPoint mPPDataExchangeEndPoint + // TEndPoint for DataNode's dataRegion consensus protocol + 5: required TEndPoint dataRegionConsensusEndPoint + // TEndPoint for DataNode's schemaRegion consensus protocol + 6: required TEndPoint schemaRegionConsensusEndPoint +} + +struct TAINodeLocation{ + 1: required i32 aiNodeId + 2: required TEndPoint internalEndPoint +} + +struct TDataNodeConfiguration { + 1: required TDataNodeLocation location + 2: required TNodeResource resource +} + +struct TAINodeConfiguration{ + 1: required TAINodeLocation location + 2: required TNodeResource resource +} + +enum TRegionMigrateFailedType { + AddPeerFailed, + RemovePeerFailed, + RemoveConsensusGroupFailed, + DeleteRegionFailed, + CreateRegionFailed, + Disconnect, +} + +enum TRegionMaintainTaskStatus { + TASK_NOT_EXIST, + PROCESSING, + SUCCESS, + FAIL, +} + +struct TFlushReq { + 1: optional string isSeq + 2: optional list storageGroups + 3: optional list regionIds +} + +struct TSettleReq { + 1: required list paths +} + +// for node management +struct TSchemaNode { + 1: required string nodeName + 2: required byte nodeType +} + +struct TSetConfigurationReq { + 1: required map configs + 2: required i32 nodeId +} + +// for TTL +struct TSetTTLReq { + 1: required list pathPattern + 2: required i64 TTL + 3: required bool isDataBase +} + +struct TShowTTLReq { + 1: required list pathPattern +} + +// for File +struct TFile { + 1: required string fileName + 2: required binary file +} + +struct TFilesResp { + 1: required TSStatus status + 2: required list files +} + +// quota +struct TSpaceQuota { + 1: optional i64 diskSize + 2: optional i64 deviceNum + 3: optional i64 timeserieNum +} + +enum ThrottleType { + REQUEST_NUMBER, + REQUEST_SIZE, + WRITE_NUMBER, + WRITE_SIZE, + READ_NUMBER, + READ_SIZE +} + +struct TTimedQuota { + 1: required i64 timeUnit + 2: required i64 softLimit +} + +struct TThrottleQuota { + 1: optional map throttleLimit + 2: optional i64 memLimit + 3: optional i32 cpuLimit +} + +struct TSetSpaceQuotaReq { + 1: required list database + 2: required TSpaceQuota spaceLimit +} + +struct TSetThrottleQuotaReq { + 1: required string userName + 2: required TThrottleQuota throttleQuota +} + +struct TPipeHeartbeatResp { + 1: required list pipeMetaList + 2: optional list pipeCompletedList + 3: optional list pipeRemainingEventCountList + 4: optional list pipeRemainingTimeList +} + +struct TLicense { + 1: required i64 licenseIssueTimestamp + 2: required i64 expireTimestamp + 4: required i16 dataNodeNumLimit + 5: required i32 cpuCoreNumLimit + 6: required i64 deviceNumLimit + 7: required i64 sensorNumLimit + 8: required i64 disconnectionFromActiveNodeTimeLimit + 9: required i16 mlNodeNumLimit +} + +struct TLoadSample { + // Percentage of occupied cpu in Node + 1: required double cpuUsageRate + // Percentage of occupied memory space in Node + 2: required double memoryUsageRate + // Percentage of occupied disk space in Node + 3: required double diskUsageRate + // The size of free disk space + // Unit: Byte + 4: required double freeDiskSpace +} + +enum TServiceType { + ConfigNodeInternalService, + DataNodeInternalService, + DataNodeMPPService, + DataNodeExternalService, +} + +struct TServiceProvider { + 1: required TEndPoint endPoint + 2: required TServiceType serviceType + 3: required i32 nodeId +} + +struct TSender { + 1: optional TDataNodeLocation dataNodeLocation + 2: optional TConfigNodeLocation configNodeLocation +} + +struct TTestConnectionResult { + 1: required TServiceProvider serviceProvider + 2: required TSender sender + 3: required bool success + 4: optional string reason +} + +struct TTestConnectionResp { + 1: required TSStatus status + 2: required list resultList +} + +struct TNodeLocations { + 1: optional list configNodeLocations + 2: optional list dataNodeLocations +} + +enum TAggregationType { + COUNT, + AVG, + SUM, + FIRST_VALUE, + LAST_VALUE, + MAX_TIME, + MIN_TIME, + MAX_VALUE, + MIN_VALUE, + EXTREME, + COUNT_IF, + TIME_DURATION, + MODE, + COUNT_TIME, + STDDEV, + STDDEV_POP, + STDDEV_SAMP, + VARIANCE, + VAR_POP, + VAR_SAMP, + MAX_BY, + MIN_BY, + UDAF, + FIRST, + LAST, + FIRST_BY, + LAST_BY, + MIN, + MAX, + COUNT_ALL, + APPROX_COUNT_DISTINCT, + APPROX_MOST_FREQUENT +} + +struct TShowConfigurationTemplateResp { + 1: required TSStatus status + 2: required string content +} + +struct TShowConfigurationResp { + 1: required TSStatus status + 2: required string content +} + +// for AINode +enum TrainingState { + PENDING, + RUNNING, + FINISHED, + FAILED, + DROPPING +} + +enum Model{ + TREE=0, + TABLE=1 +} + +enum FunctionType{ + NONE=0, + SCALAR=1, + AGGREGATE=2, + TABLE=3 +} \ No newline at end of file diff --git a/src/Apache.IoTDB/SessionPool.Builder.cs b/src/Apache.IoTDB/SessionPool.Builder.cs index 69b8e42..f943d81 100644 --- a/src/Apache.IoTDB/SessionPool.Builder.cs +++ b/src/Apache.IoTDB/SessionPool.Builder.cs @@ -31,7 +31,7 @@ public class Builder private string _username = "root"; private string _password = "root"; private int _fetchSize = 1024; - private string _zoneId = "UTC+08:00"; + private string _zoneId = "Asia/Shanghai"; private int _poolSize = 8; private bool _enableRpcCompression = false; private int _connectionTimeoutInMs = 500; @@ -118,7 +118,7 @@ public Builder() _username = "root"; _password = "root"; _fetchSize = 1024; - _zoneId = "UTC+08:00"; + _zoneId = "Asia/Shanghai"; _poolSize = 8; _enableRpcCompression = false; _connectionTimeoutInMs = 500; diff --git a/src/Apache.IoTDB/SessionPool.cs b/src/Apache.IoTDB/SessionPool.cs index 0fb9089..135199b 100644 --- a/src/Apache.IoTDB/SessionPool.cs +++ b/src/Apache.IoTDB/SessionPool.cs @@ -66,23 +66,23 @@ public partial class SessionPool : IDisposable [Obsolete("This method is deprecated, please use new SessionPool.Builder().")] public SessionPool(string host, int port, int poolSize) - : this(host, port, "root", "root", 1024, "UTC+08:00", poolSize, true, 60) + : this(host, port, "root", "root", 1024, "Asia/Shanghai", poolSize, true, 60) { } [Obsolete(" This method is deprecated, please use new SessionPool.Builder().")] public SessionPool(string host, int port, string username, string password) - : this(host, port, username, password, 1024, "UTC+08:00", 8, true, 60) + : this(host, port, username, password, 1024, "Asia/Shanghai", 8, true, 60) { } public SessionPool(string host, int port, string username, string password, int fetchSize) - : this(host, port, username, password, fetchSize, "UTC+08:00", 8, true, 60) + : this(host, port, username, password, fetchSize, "Asia/Shanghai", 8, true, 60) { } - public SessionPool(string host, int port) : this(host, port, "root", "root", 1024, "UTC+08:00", 8, true, 60) + public SessionPool(string host, int port) : this(host, port, "root", "root", 1024, "Asia/Shanghai", 8, true, 60) { } public SessionPool(string host, int port, string username, string password, int fetchSize, string zoneId, int poolSize, bool enableRpcCompression, int timeout) @@ -110,15 +110,15 @@ protected internal SessionPool(string host, int port, string username, string pa /// The list of node URLs to connect to, multiple ip:rpcPort eg.127.0.0.1:9001 /// The size of the session pool. public SessionPool(List nodeUrls, int poolSize) - : this(nodeUrls, "root", "root", 1024, "UTC+08:00", poolSize, true, 60) + : this(nodeUrls, "root", "root", 1024, "Asia/Shanghai", poolSize, true, 60) { } public SessionPool(List nodeUrls, string username, string password) - : this(nodeUrls, username, password, 1024, "UTC+08:00", 8, true, 60) + : this(nodeUrls, username, password, 1024, "Asia/Shanghai", 8, true, 60) { } public SessionPool(List nodeUrls, string username, string password, int fetchSize) - : this(nodeUrls, username, password, fetchSize, "UTC+08:00", 8, true, 60) + : this(nodeUrls, username, password, fetchSize, "Asia/Shanghai", 8, true, 60) { } public SessionPool(List nodeUrls, string username, string password, int fetchSize, string zoneId) @@ -710,9 +710,9 @@ public async Task CheckTimeSeriesExistsAsync(string tsPath) try { var sql = "SHOW TIMESERIES " + tsPath; - var sessionDataset = await ExecuteQueryStatementAsync(sql); - bool timeSeriesExists = sessionDataset.HasNext(); - await sessionDataset.Close(); // be sure to close the sessionDataset to put the client back to the pool + var sessionDataSet = await ExecuteQueryStatementAsync(sql); + bool timeSeriesExists = sessionDataSet.HasNext(); + await sessionDataSet.Close(); // be sure to close the SessionDataSet to put the client back to the pool return timeSeriesExists; } catch (TException e) @@ -1327,7 +1327,7 @@ public async Task ExecuteQueryStatementAsync(string sql, long ti Timeout = timeoutInMs }; - var resp = await client.ServiceClient.executeQueryStatementAsync(req); + var resp = await client.ServiceClient.executeQueryStatementV2Async(req); var status = resp.Status; if (_utilFunctions.VerifySuccess(status) == -1) @@ -1335,7 +1335,11 @@ public async Task ExecuteQueryStatementAsync(string sql, long ti throw new Exception(string.Format("execute query failed, sql: {0}, message: {1}", sql, status.Message)); } - return new SessionDataSet(sql, resp, client, _clients, client.StatementId) + return new SessionDataSet( + sql, resp.Columns, resp.DataTypeList, resp.ColumnNameIndexMap, resp.QueryId, + client.StatementId, client, resp.QueryResult, resp.IgnoreTimeStamp, + resp.MoreData, _zoneId, resp.ColumnIndex2TsBlockColumnIndexList, _clients + ) { FetchSize = _fetchSize, }; @@ -1356,7 +1360,7 @@ public async Task ExecuteStatementAsync(string sql, long timeout Timeout = timeout }; - var resp = await client.ServiceClient.executeStatementAsync(req); + var resp = await client.ServiceClient.executeStatementV2Async(req); var status = resp.Status; if (_utilFunctions.VerifySuccess(status) == -1) @@ -1364,7 +1368,11 @@ public async Task ExecuteStatementAsync(string sql, long timeout throw new Exception(string.Format("execute query failed, sql: {0}, message: {1}", sql, status.Message)); } - return new SessionDataSet(sql, resp, client, _clients, client.StatementId) + return new SessionDataSet( + sql, resp.Columns, resp.DataTypeList, resp.ColumnNameIndexMap, resp.QueryId, + client.StatementId, client, resp.QueryResult, resp.IgnoreTimeStamp, + resp.MoreData, _zoneId, resp.ColumnIndex2TsBlockColumnIndexList, _clients + ) { FetchSize = _fetchSize, }; @@ -1432,7 +1440,7 @@ public async Task ExecuteRawDataQuery(List paths, long s EnableRedirectQuery = false }; - var resp = await client.ServiceClient.executeRawDataQueryAsync(req); + var resp = await client.ServiceClient.executeRawDataQueryV2Async(req); var status = resp.Status; if (_utilFunctions.VerifySuccess(status) == -1) @@ -1440,7 +1448,11 @@ public async Task ExecuteRawDataQuery(List paths, long s throw new Exception(string.Format("execute raw data query failed, message: {0}", status.Message)); } - return new SessionDataSet("", resp, client, _clients, client.StatementId) + return new SessionDataSet( + "", resp.Columns, resp.DataTypeList, resp.ColumnNameIndexMap, resp.QueryId, + client.StatementId, client, resp.QueryResult, resp.IgnoreTimeStamp, + resp.MoreData, _zoneId, resp.ColumnIndex2TsBlockColumnIndexList, _clients + ) { FetchSize = _fetchSize, }; @@ -1460,7 +1472,7 @@ public async Task ExecuteLastDataQueryAsync(List paths, EnableRedirectQuery = false }; - var resp = await client.ServiceClient.executeLastDataQueryAsync(req); + var resp = await client.ServiceClient.executeLastDataQueryV2Async(req); var status = resp.Status; if (_utilFunctions.VerifySuccess(status) == -1) @@ -1468,7 +1480,11 @@ public async Task ExecuteLastDataQueryAsync(List paths, throw new Exception(string.Format("execute last data query failed, message: {0}", status.Message)); } - return new SessionDataSet("", resp, client, _clients, client.StatementId) + return new SessionDataSet( + "", resp.Columns, resp.DataTypeList, resp.ColumnNameIndexMap, resp.QueryId, + client.StatementId, client, resp.QueryResult, resp.IgnoreTimeStamp, + resp.MoreData, _zoneId, resp.ColumnIndex2TsBlockColumnIndexList, _clients + ) { FetchSize = _fetchSize, }; diff --git a/src/Apache.IoTDB/TableSessionPool.Builder.cs b/src/Apache.IoTDB/TableSessionPool.Builder.cs index fdeb78e..07387b5 100644 --- a/src/Apache.IoTDB/TableSessionPool.Builder.cs +++ b/src/Apache.IoTDB/TableSessionPool.Builder.cs @@ -33,7 +33,7 @@ public class Builder private string _username = "root"; private string _password = "root"; private int _fetchSize = 1024; - private string _zoneId = "UTC+08:00"; + private string _zoneId = "Asia/Shanghai"; private int _poolSize = 8; private bool _enableRpcCompression = false; private int _connectionTimeoutInMs = 500; @@ -120,7 +120,7 @@ public Builder() _username = "root"; _password = "root"; _fetchSize = 1024; - _zoneId = "UTC+08:00"; + _zoneId = "Asia/Shanghai"; _poolSize = 8; _enableRpcCompression = false; _connectionTimeoutInMs = 500; diff --git a/tests/Apache.IoTDB.Tests/Tests.cs b/tests/Apache.IoTDB.Tests/Tests.cs deleted file mode 100644 index d796fa7..0000000 --- a/tests/Apache.IoTDB.Tests/Tests.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -using NUnit.Framework; - -namespace Apache.IoTDB.Tests -{ - public class Tests - { - [SetUp] - public void Setup() - { - } - - [Test] - public void Test1() - { - Assert.Pass(); - } - } -} diff --git a/tests/Apache.IoTDB.Tests/UtilsTests.cs b/tests/Apache.IoTDB.Tests/UtilsTests.cs new file mode 100644 index 0000000..8efe423 --- /dev/null +++ b/tests/Apache.IoTDB.Tests/UtilsTests.cs @@ -0,0 +1,266 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +using System; +using System.Collections.Generic; +using NUnit.Framework; + +namespace Apache.IoTDB.Tests +{ + [TestFixture] + public class UtilsTests + { + private Utils _utils; + + [SetUp] + public void Setup() + { + _utils = new Utils(); + } + + [TestFixture] + public class ParseTEndPointIpv4AndIpv6UrlTests : UtilsTests + { + [Test] + public void ParseTEndPointIpv4AndIpv6Url_ValidIPv4Address_ReturnsCorrectEndpoint() + { + // Arrange + string correctEndpointIPv4 = "192.168.1.1:8080"; + + // Act + var endpoint = _utils.ParseTEndPointIpv4AndIpv6Url(correctEndpointIPv4); + + // Assert + Assert.That(endpoint.Ip, Is.EqualTo("192.168.1.1"), "IPv4 address mismatch."); + Assert.That(endpoint.Port, Is.EqualTo(8080), "IPv4 port mismatch."); + } + + [Test] + public void ParseTEndPointIpv4AndIpv6Url_ValidIPv6Address_ReturnsCorrectEndpoint() + { + // Arrange + string correctEndpointIPv6 = "[2001:db8:85a3::8a2e:370:7334]:443"; + + // Act + var endpoint = _utils.ParseTEndPointIpv4AndIpv6Url(correctEndpointIPv6); + + // Assert + Assert.That(endpoint.Ip, Is.EqualTo("2001:db8:85a3::8a2e:370:7334"), "IPv6 address mismatch."); + Assert.That(endpoint.Port, Is.EqualTo(443), "IPv6 port mismatch."); + } + + [Test] + public void ParseTEndPointIpv4AndIpv6Url_NoPort_ReturnsEmptyEndpoint() + { + // Arrange + string noPort = "192.168.1.1"; + + // Act + var endpoint = _utils.ParseTEndPointIpv4AndIpv6Url(noPort); + + // Assert + Assert.That(string.IsNullOrEmpty(endpoint.Ip) && endpoint.Port == 0, + Is.True, "Failed to handle missing port."); + } + + [Test] + public void ParseTEndPointIpv4AndIpv6Url_EmptyInput_ReturnsEmptyEndpoint() + { + // Arrange + string emptyInput = ""; + + // Act + var endpoint = _utils.ParseTEndPointIpv4AndIpv6Url(emptyInput); + + // Assert + Assert.That(string.IsNullOrEmpty(endpoint.Ip) && endpoint.Port == 0, + Is.True, "Failed to handle empty input."); + } + + [Test] + public void ParseTEndPointIpv4AndIpv6Url_InvalidPortFormat_ThrowsFormatException() + { + // Arrange + string invalidFormat = "192.168.1.1:port"; + + // Act & Assert + Assert.Throws(() => _utils.ParseTEndPointIpv4AndIpv6Url(invalidFormat), + "Should have thrown an exception due to invalid port."); + } + } + + [TestFixture] + public class ParseSeedNodeUrlsTests : UtilsTests + { + [Test] + public void ParseSeedNodeUrls_ValidUrls_ReturnsCorrectEndpoints() + { + // Arrange + var urls = new List { "192.168.1.1:8080", "[2001:db8::1]:443" }; + + // Act + var endpoints = _utils.ParseSeedNodeUrls(urls); + + // Assert + Assert.That(endpoints, Has.Count.EqualTo(2)); + Assert.That(endpoints[0].Ip, Is.EqualTo("192.168.1.1")); + Assert.That(endpoints[0].Port, Is.EqualTo(8080)); + Assert.That(endpoints[1].Ip, Is.EqualTo("2001:db8::1")); + Assert.That(endpoints[1].Port, Is.EqualTo(443)); + } + + [Test] + public void ParseSeedNodeUrls_NullInput_ThrowsArgumentException() + { + // Act & Assert + Assert.Throws(() => _utils.ParseSeedNodeUrls(null), + "Should throw ArgumentException for null input."); + } + + [Test] + public void ParseSeedNodeUrls_EmptyList_ThrowsArgumentException() + { + // Arrange + var emptyList = new List(); + + // Act & Assert + Assert.Throws(() => _utils.ParseSeedNodeUrls(emptyList), + "Should throw ArgumentException for empty list."); + } + } + + [TestFixture] + public class IsSortedTests : UtilsTests + { + [Test] + public void IsSorted_SortedList_ReturnsTrue() + { + // Arrange + var sortedList = new List { 1, 2, 3, 4, 5 }; + + // Act + var result = _utils.IsSorted(sortedList); + + // Assert + Assert.That(result, Is.True, "Should return true for sorted list."); + } + + [Test] + public void IsSorted_UnsortedList_ReturnsFalse() + { + // Arrange + var unsortedList = new List { 1, 3, 2, 4, 5 }; + + // Act + var result = _utils.IsSorted(unsortedList); + + // Assert + Assert.That(result, Is.False, "Should return false for unsorted list."); + } + + [Test] + public void IsSorted_EmptyList_ReturnsTrue() + { + // Arrange + var emptyList = new List(); + + // Act + var result = _utils.IsSorted(emptyList); + + // Assert + Assert.That(result, Is.True, "Should return true for empty list."); + } + + [Test] + public void IsSorted_SingleElementList_ReturnsTrue() + { + // Arrange + var singleElementList = new List { 42 }; + + // Act + var result = _utils.IsSorted(singleElementList); + + // Assert + Assert.That(result, Is.True, "Should return true for single element list."); + } + } + + [TestFixture] + public class DateUtilsTests : UtilsTests + { + [Test] + public void ParseIntToDate_ValidDate_ReturnsCorrectDateTime() + { + // Arrange + int dateInt = 20231225; + + // Act + var result = Utils.ParseIntToDate(dateInt); + + // Assert + Assert.That(result.Year, Is.EqualTo(2023)); + Assert.That(result.Month, Is.EqualTo(12)); + Assert.That(result.Day, Is.EqualTo(25)); + } + + [Test] + public void ParseIntToDate_InvalidDate_ThrowsArgumentException() + { + // Arrange + int invalidDate = 123; + + // Act & Assert + Assert.Throws(() => Utils.ParseIntToDate(invalidDate), + "Should throw ArgumentException for invalid date."); + } + + [Test] + public void ParseDateToInt_ValidDateTime_ReturnsCorrectInt() + { + // Arrange + var dateTime = new DateTime(2023, 12, 25); + + // Act + var result = Utils.ParseDateToInt(dateTime); + + // Assert + Assert.That(result, Is.EqualTo(20231225)); + } + + [Test] + public void ParseDateToInt_NullDateTime_ThrowsArgumentException() + { + // Act & Assert + Assert.Throws(() => Utils.ParseDateToInt(null), + "Should throw ArgumentException for null DateTime."); + } + + [Test] + public void ParseDateToInt_YearLessThan1000_ThrowsArgumentException() + { + // Arrange + var dateTime = new DateTime(999, 12, 25); + + // Act & Assert + Assert.Throws(() => Utils.ParseDateToInt(dateTime), + "Should throw ArgumentException for year less than 1000."); + } + } + } +}