From c967c96f1e1947625dcca7dd8bdeeda135574a70 Mon Sep 17 00:00:00 2001 From: CritasWang Date: Wed, 12 Feb 2025 17:19:59 +0800 Subject: [PATCH 1/3] update Rpc to IoTDB 2.0.1 --- src/Apache.IoTDB/Apache.IoTDB.csproj | 2 +- .../Rpc/Generated/FunctionType.cs | 17 + .../Rpc/Generated/IClientRPCService.cs | 1995 +++-------------- src/Apache.IoTDB/Rpc/Generated/Model.cs | 15 + .../Rpc/Generated/ServerProperties.cs | 59 +- .../Rpc/Generated/TAINodeConfiguration.cs | 14 - .../Rpc/Generated/TAINodeLocation.cs | 11 - .../Rpc/Generated/TAggregationType.cs | 6 + .../Rpc/Generated/TConfigNodeLocation.cs | 15 - .../Rpc/Generated/TConsensusGroupId.cs | 8 - ...TCreateTimeseriesUsingSchemaTemplateReq.cs | 27 +- .../Rpc/Generated/TDataNodeConfiguration.cs | 14 - .../Rpc/Generated/TDataNodeLocation.cs | 27 - src/Apache.IoTDB/Rpc/Generated/TEndPoint.cs | 11 - src/Apache.IoTDB/Rpc/Generated/TFile.cs | 14 - src/Apache.IoTDB/Rpc/Generated/TFilesResp.cs | 32 +- src/Apache.IoTDB/Rpc/Generated/TFlushReq.cs | 38 +- src/Apache.IoTDB/Rpc/Generated/TLicense.cs | 14 - src/Apache.IoTDB/Rpc/Generated/TLoadSample.cs | 10 - .../Rpc/Generated/TNodeLocations.cs | 58 +- .../Rpc/Generated/TNodeResource.cs | 8 - .../Rpc/Generated/TPipeSubscribeReq.cs | 13 - .../Rpc/Generated/TPipeSubscribeResp.cs | 33 +- .../Rpc/Generated/TPipeTransferReq.cs | 12 - .../Rpc/Generated/TPipeTransferResp.cs | 15 - .../Rpc/Generated/TRegionReplicaSet.cs | 32 +- .../Rpc/Generated/TSAggregationQueryReq.cs | 83 +- .../Generated/TSAppendSchemaTemplateReq.cs | 92 +- .../Generated/TSBackupConfigurationResp.cs | 25 - .../Rpc/Generated/TSCancelOperationReq.cs | 8 - .../Rpc/Generated/TSCloseOperationReq.cs | 17 - .../Rpc/Generated/TSCloseSessionReq.cs | 7 - .../Rpc/Generated/TSConnectionInfo.cs | 16 - .../Rpc/Generated/TSConnectionInfoResp.cs | 28 +- .../Generated/TSCreateAlignedTimeseriesReq.cs | 194 +- .../Generated/TSCreateMultiTimeseriesReq.cs | 231 +- .../Generated/TSCreateSchemaTemplateReq.cs | 15 - .../Rpc/Generated/TSCreateTimeseriesReq.cs | 100 +- .../Rpc/Generated/TSDeleteDataReq.cs | 29 +- .../Rpc/Generated/TSDropSchemaTemplateReq.cs | 11 - .../Generated/TSExecuteBatchStatementReq.cs | 27 +- .../Rpc/Generated/TSExecuteStatementReq.cs | 32 - .../Rpc/Generated/TSExecuteStatementResp.cs | 328 +-- .../TSFastLastDataQueryForOneDeviceReq.cs | 61 +- .../Rpc/Generated/TSFetchMetadataReq.cs | 16 - .../Rpc/Generated/TSFetchMetadataResp.cs | 41 +- .../Rpc/Generated/TSFetchResultsReq.cs | 19 - .../Rpc/Generated/TSFetchResultsResp.cs | 48 +- .../Rpc/Generated/TSGetOperationStatusReq.cs | 8 - .../Rpc/Generated/TSGetTimeZoneResp.cs | 14 - .../Generated/TSGroupByQueryIntervalReq.cs | 48 - .../Rpc/Generated/TSInsertRecordReq.cs | 148 +- .../TSInsertRecordsOfOneDeviceReq.cs | 90 +- .../Rpc/Generated/TSInsertRecordsReq.cs | 106 +- .../Rpc/Generated/TSInsertStringRecordReq.cs | 62 +- .../TSInsertStringRecordsOfOneDeviceReq.cs | 104 +- .../Rpc/Generated/TSInsertStringRecordsReq.cs | 120 +- .../Rpc/Generated/TSInsertTabletReq.cs | 172 +- .../Rpc/Generated/TSInsertTabletsReq.cs | 160 +- .../Rpc/Generated/TSLastDataQueryReq.cs | 54 +- .../Rpc/Generated/TSOpenSessionReq.cs | 47 +- .../Rpc/Generated/TSOpenSessionResp.cs | 43 +- .../Rpc/Generated/TSPruneSchemaTemplateReq.cs | 15 - .../Rpc/Generated/TSQueryDataSet.cs | 50 +- .../Rpc/Generated/TSQueryNonAlignDataSet.cs | 46 +- .../Rpc/Generated/TSQueryTemplateReq.cs | 17 - .../Rpc/Generated/TSQueryTemplateResp.cs | 42 +- .../Rpc/Generated/TSRawDataQueryReq.cs | 55 +- .../Rpc/Generated/TSSetSchemaTemplateReq.cs | 15 - .../Rpc/Generated/TSSetTimeZoneReq.cs | 11 - src/Apache.IoTDB/Rpc/Generated/TSStatus.cs | 45 +- .../Rpc/Generated/TSTracingInfo.cs | 91 +- .../Rpc/Generated/TSUnsetSchemaTemplateReq.cs | 15 - src/Apache.IoTDB/Rpc/Generated/TSchemaNode.cs | 11 - src/Apache.IoTDB/Rpc/Generated/TSender.cs | 22 +- .../Rpc/Generated/TSeriesPartitionSlot.cs | 7 - .../Rpc/Generated/TServiceProvider.cs | 11 - .../Rpc/Generated/TSetConfigurationReq.cs | 33 +- .../Rpc/Generated/TSetSpaceQuotaReq.cs | 30 +- src/Apache.IoTDB/Rpc/Generated/TSetTTLReq.cs | 28 +- .../Rpc/Generated/TSetThrottleQuotaReq.cs | 14 - src/Apache.IoTDB/Rpc/Generated/TSettleReq.cs | 26 +- .../Rpc/Generated/TShowConfigurationResp.cs | 14 - .../TShowConfigurationTemplateResp.cs | 14 - src/Apache.IoTDB/Rpc/Generated/TShowTTLReq.cs | 26 +- src/Apache.IoTDB/Rpc/Generated/TSpaceQuota.cs | 29 +- .../Rpc/Generated/TSyncIdentityInfo.cs | 19 - .../Rpc/Generated/TSyncTransportMetaInfo.cs | 11 - .../Rpc/Generated/TTestConnectionResp.cs | 32 +- .../Rpc/Generated/TTestConnectionResult.cs | 20 - .../Rpc/Generated/TThrottleQuota.cs | 53 +- .../Rpc/Generated/TTimePartitionSlot.cs | 7 - src/Apache.IoTDB/Rpc/Generated/TTimedQuota.cs | 8 - .../Rpc/Generated/client.Extensions.cs | 156 -- .../Rpc/Generated/common.Extensions.cs | 60 - 95 files changed, 1534 insertions(+), 4603 deletions(-) create mode 100644 src/Apache.IoTDB/Rpc/Generated/FunctionType.cs create mode 100644 src/Apache.IoTDB/Rpc/Generated/Model.cs diff --git a/src/Apache.IoTDB/Apache.IoTDB.csproj b/src/Apache.IoTDB/Apache.IoTDB.csproj index 63cbe81..de84379 100644 --- a/src/Apache.IoTDB/Apache.IoTDB.csproj +++ b/src/Apache.IoTDB/Apache.IoTDB.csproj @@ -3,7 +3,7 @@ net5.0;net6.0;netstandard2.1;netstandard2.0;net461 latest - eedalong, lausannel, MysticBoy, Aiemu, HTHou + eedalong, lausannel, MysticBoy, Aiemu, HTHou, CritasWang https://github.com/apache/iotdb-client-csharp https://github.com/apache/iotdb-client-csharp README.md diff --git a/src/Apache.IoTDB/Rpc/Generated/FunctionType.cs b/src/Apache.IoTDB/Rpc/Generated/FunctionType.cs new file mode 100644 index 0000000..4ec65ad --- /dev/null +++ b/src/Apache.IoTDB/Rpc/Generated/FunctionType.cs @@ -0,0 +1,17 @@ +/** + * Autogenerated by Thrift Compiler (0.14.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ + +#pragma warning disable IDE0079 // remove unnecessary pragmas +#pragma warning disable IDE1006 // parts of the code use IDL spelling + +public enum FunctionType +{ + NONE = 0, + SCALAR = 1, + AGGREGATE = 2, + TABLE = 3, +} diff --git a/src/Apache.IoTDB/Rpc/Generated/IClientRPCService.cs b/src/Apache.IoTDB/Rpc/Generated/IClientRPCService.cs index d2771fc..c0a051d 100644 --- a/src/Apache.IoTDB/Rpc/Generated/IClientRPCService.cs +++ b/src/Apache.IoTDB/Rpc/Generated/IClientRPCService.cs @@ -4354,17 +4354,6 @@ public executeQueryStatementV2Args() { } - public executeQueryStatementV2Args DeepCopy() - { - var tmp471 = new executeQueryStatementV2Args(); - if((Req != null) && __isset.req) - { - tmp471.Req = (TSExecuteStatementReq)this.Req.DeepCopy(); - } - tmp471.__isset.req = this.__isset.req; - return tmp471; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -4456,10 +4445,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeQueryStatementV2_args("); - int tmp472 = 0; + int tmp429 = 0; if((Req != null) && __isset.req) { - if(0 < tmp472++) { sb.Append(", "); } + if(0 < tmp429++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -4497,17 +4486,6 @@ public executeQueryStatementV2Result() { } - public executeQueryStatementV2Result DeepCopy() - { - var tmp473 = new executeQueryStatementV2Result(); - if((Success != null) && __isset.success) - { - tmp473.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp473.__isset.success = this.__isset.success; - return tmp473; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -4603,10 +4581,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeQueryStatementV2_result("); - int tmp474 = 0; + int tmp430 = 0; if((Success != null) && __isset.success) { - if(0 < tmp474++) { sb.Append(", "); } + if(0 < tmp430++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -4644,17 +4622,6 @@ public executeUpdateStatementV2Args() { } - public executeUpdateStatementV2Args DeepCopy() - { - var tmp475 = new executeUpdateStatementV2Args(); - if((Req != null) && __isset.req) - { - tmp475.Req = (TSExecuteStatementReq)this.Req.DeepCopy(); - } - tmp475.__isset.req = this.__isset.req; - return tmp475; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -4746,10 +4713,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeUpdateStatementV2_args("); - int tmp476 = 0; + int tmp431 = 0; if((Req != null) && __isset.req) { - if(0 < tmp476++) { sb.Append(", "); } + if(0 < tmp431++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -4787,17 +4754,6 @@ public executeUpdateStatementV2Result() { } - public executeUpdateStatementV2Result DeepCopy() - { - var tmp477 = new executeUpdateStatementV2Result(); - if((Success != null) && __isset.success) - { - tmp477.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp477.__isset.success = this.__isset.success; - return tmp477; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -4893,10 +4849,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeUpdateStatementV2_result("); - int tmp478 = 0; + int tmp432 = 0; if((Success != null) && __isset.success) { - if(0 < tmp478++) { sb.Append(", "); } + if(0 < tmp432++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -4934,17 +4890,6 @@ public executeStatementV2Args() { } - public executeStatementV2Args DeepCopy() - { - var tmp479 = new executeStatementV2Args(); - if((Req != null) && __isset.req) - { - tmp479.Req = (TSExecuteStatementReq)this.Req.DeepCopy(); - } - tmp479.__isset.req = this.__isset.req; - return tmp479; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -5036,10 +4981,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeStatementV2_args("); - int tmp480 = 0; + int tmp433 = 0; if((Req != null) && __isset.req) { - if(0 < tmp480++) { sb.Append(", "); } + if(0 < tmp433++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -5077,17 +5022,6 @@ public executeStatementV2Result() { } - public executeStatementV2Result DeepCopy() - { - var tmp481 = new executeStatementV2Result(); - if((Success != null) && __isset.success) - { - tmp481.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp481.__isset.success = this.__isset.success; - return tmp481; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -5183,10 +5117,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeStatementV2_result("); - int tmp482 = 0; + int tmp434 = 0; if((Success != null) && __isset.success) { - if(0 < tmp482++) { sb.Append(", "); } + if(0 < tmp434++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -5224,17 +5158,6 @@ public executeRawDataQueryV2Args() { } - public executeRawDataQueryV2Args DeepCopy() - { - var tmp483 = new executeRawDataQueryV2Args(); - if((Req != null) && __isset.req) - { - tmp483.Req = (TSRawDataQueryReq)this.Req.DeepCopy(); - } - tmp483.__isset.req = this.__isset.req; - return tmp483; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -5326,10 +5249,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeRawDataQueryV2_args("); - int tmp484 = 0; + int tmp435 = 0; if((Req != null) && __isset.req) { - if(0 < tmp484++) { sb.Append(", "); } + if(0 < tmp435++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -5367,17 +5290,6 @@ public executeRawDataQueryV2Result() { } - public executeRawDataQueryV2Result DeepCopy() - { - var tmp485 = new executeRawDataQueryV2Result(); - if((Success != null) && __isset.success) - { - tmp485.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp485.__isset.success = this.__isset.success; - return tmp485; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -5473,10 +5385,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeRawDataQueryV2_result("); - int tmp486 = 0; + int tmp436 = 0; if((Success != null) && __isset.success) { - if(0 < tmp486++) { sb.Append(", "); } + if(0 < tmp436++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -5514,17 +5426,6 @@ public executeLastDataQueryV2Args() { } - public executeLastDataQueryV2Args DeepCopy() - { - var tmp487 = new executeLastDataQueryV2Args(); - if((Req != null) && __isset.req) - { - tmp487.Req = (TSLastDataQueryReq)this.Req.DeepCopy(); - } - tmp487.__isset.req = this.__isset.req; - return tmp487; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -5616,10 +5517,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeLastDataQueryV2_args("); - int tmp488 = 0; + int tmp437 = 0; if((Req != null) && __isset.req) { - if(0 < tmp488++) { sb.Append(", "); } + if(0 < tmp437++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -5657,17 +5558,6 @@ public executeLastDataQueryV2Result() { } - public executeLastDataQueryV2Result DeepCopy() - { - var tmp489 = new executeLastDataQueryV2Result(); - if((Success != null) && __isset.success) - { - tmp489.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp489.__isset.success = this.__isset.success; - return tmp489; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -5763,10 +5653,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeLastDataQueryV2_result("); - int tmp490 = 0; + int tmp438 = 0; if((Success != null) && __isset.success) { - if(0 < tmp490++) { sb.Append(", "); } + if(0 < tmp438++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -5804,17 +5694,6 @@ public executeFastLastDataQueryForOneDeviceV2Args() { } - public executeFastLastDataQueryForOneDeviceV2Args DeepCopy() - { - var tmp491 = new executeFastLastDataQueryForOneDeviceV2Args(); - if((Req != null) && __isset.req) - { - tmp491.Req = (TSFastLastDataQueryForOneDeviceReq)this.Req.DeepCopy(); - } - tmp491.__isset.req = this.__isset.req; - return tmp491; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -5906,10 +5785,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeFastLastDataQueryForOneDeviceV2_args("); - int tmp492 = 0; + int tmp439 = 0; if((Req != null) && __isset.req) { - if(0 < tmp492++) { sb.Append(", "); } + if(0 < tmp439++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -5947,17 +5826,6 @@ public executeFastLastDataQueryForOneDeviceV2Result() { } - public executeFastLastDataQueryForOneDeviceV2Result DeepCopy() - { - var tmp493 = new executeFastLastDataQueryForOneDeviceV2Result(); - if((Success != null) && __isset.success) - { - tmp493.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp493.__isset.success = this.__isset.success; - return tmp493; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -6053,10 +5921,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeFastLastDataQueryForOneDeviceV2_result("); - int tmp494 = 0; + int tmp440 = 0; if((Success != null) && __isset.success) { - if(0 < tmp494++) { sb.Append(", "); } + if(0 < tmp440++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -6094,17 +5962,6 @@ public executeAggregationQueryV2Args() { } - public executeAggregationQueryV2Args DeepCopy() - { - var tmp495 = new executeAggregationQueryV2Args(); - if((Req != null) && __isset.req) - { - tmp495.Req = (TSAggregationQueryReq)this.Req.DeepCopy(); - } - tmp495.__isset.req = this.__isset.req; - return tmp495; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -6196,10 +6053,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeAggregationQueryV2_args("); - int tmp496 = 0; + int tmp441 = 0; if((Req != null) && __isset.req) { - if(0 < tmp496++) { sb.Append(", "); } + if(0 < tmp441++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -6237,17 +6094,6 @@ public executeAggregationQueryV2Result() { } - public executeAggregationQueryV2Result DeepCopy() - { - var tmp497 = new executeAggregationQueryV2Result(); - if((Success != null) && __isset.success) - { - tmp497.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp497.__isset.success = this.__isset.success; - return tmp497; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -6343,10 +6189,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeAggregationQueryV2_result("); - int tmp498 = 0; + int tmp442 = 0; if((Success != null) && __isset.success) { - if(0 < tmp498++) { sb.Append(", "); } + if(0 < tmp442++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -6384,17 +6230,6 @@ public executeGroupByQueryIntervalQueryArgs() { } - public executeGroupByQueryIntervalQueryArgs DeepCopy() - { - var tmp499 = new executeGroupByQueryIntervalQueryArgs(); - if((Req != null) && __isset.req) - { - tmp499.Req = (TSGroupByQueryIntervalReq)this.Req.DeepCopy(); - } - tmp499.__isset.req = this.__isset.req; - return tmp499; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -6486,10 +6321,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeGroupByQueryIntervalQuery_args("); - int tmp500 = 0; + int tmp443 = 0; if((Req != null) && __isset.req) { - if(0 < tmp500++) { sb.Append(", "); } + if(0 < tmp443++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -6527,17 +6362,6 @@ public executeGroupByQueryIntervalQueryResult() { } - public executeGroupByQueryIntervalQueryResult DeepCopy() - { - var tmp501 = new executeGroupByQueryIntervalQueryResult(); - if((Success != null) && __isset.success) - { - tmp501.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp501.__isset.success = this.__isset.success; - return tmp501; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -6633,10 +6457,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeGroupByQueryIntervalQuery_result("); - int tmp502 = 0; + int tmp444 = 0; if((Success != null) && __isset.success) { - if(0 < tmp502++) { sb.Append(", "); } + if(0 < tmp444++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -6674,17 +6498,6 @@ public fetchResultsV2Args() { } - public fetchResultsV2Args DeepCopy() - { - var tmp503 = new fetchResultsV2Args(); - if((Req != null) && __isset.req) - { - tmp503.Req = (TSFetchResultsReq)this.Req.DeepCopy(); - } - tmp503.__isset.req = this.__isset.req; - return tmp503; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -6776,10 +6589,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchResultsV2_args("); - int tmp504 = 0; + int tmp445 = 0; if((Req != null) && __isset.req) { - if(0 < tmp504++) { sb.Append(", "); } + if(0 < tmp445++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -6817,17 +6630,6 @@ public fetchResultsV2Result() { } - public fetchResultsV2Result DeepCopy() - { - var tmp505 = new fetchResultsV2Result(); - if((Success != null) && __isset.success) - { - tmp505.Success = (TSFetchResultsResp)this.Success.DeepCopy(); - } - tmp505.__isset.success = this.__isset.success; - return tmp505; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -6923,10 +6725,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchResultsV2_result("); - int tmp506 = 0; + int tmp446 = 0; if((Success != null) && __isset.success) { - if(0 < tmp506++) { sb.Append(", "); } + if(0 < tmp446++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -6964,17 +6766,6 @@ public openSessionArgs() { } - public openSessionArgs DeepCopy() - { - var tmp507 = new openSessionArgs(); - if((Req != null) && __isset.req) - { - tmp507.Req = (TSOpenSessionReq)this.Req.DeepCopy(); - } - tmp507.__isset.req = this.__isset.req; - return tmp507; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -7066,10 +6857,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("openSession_args("); - int tmp508 = 0; + int tmp447 = 0; if((Req != null) && __isset.req) { - if(0 < tmp508++) { sb.Append(", "); } + if(0 < tmp447++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -7107,17 +6898,6 @@ public openSessionResult() { } - public openSessionResult DeepCopy() - { - var tmp509 = new openSessionResult(); - if((Success != null) && __isset.success) - { - tmp509.Success = (TSOpenSessionResp)this.Success.DeepCopy(); - } - tmp509.__isset.success = this.__isset.success; - return tmp509; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -7213,10 +6993,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("openSession_result("); - int tmp510 = 0; + int tmp448 = 0; if((Success != null) && __isset.success) { - if(0 < tmp510++) { sb.Append(", "); } + if(0 < tmp448++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -7254,17 +7034,6 @@ public closeSessionArgs() { } - public closeSessionArgs DeepCopy() - { - var tmp511 = new closeSessionArgs(); - if((Req != null) && __isset.req) - { - tmp511.Req = (TSCloseSessionReq)this.Req.DeepCopy(); - } - tmp511.__isset.req = this.__isset.req; - return tmp511; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -7356,10 +7125,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("closeSession_args("); - int tmp512 = 0; + int tmp449 = 0; if((Req != null) && __isset.req) { - if(0 < tmp512++) { sb.Append(", "); } + if(0 < tmp449++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -7397,17 +7166,6 @@ public closeSessionResult() { } - public closeSessionResult DeepCopy() - { - var tmp513 = new closeSessionResult(); - if((Success != null) && __isset.success) - { - tmp513.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp513.__isset.success = this.__isset.success; - return tmp513; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -7503,10 +7261,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("closeSession_result("); - int tmp514 = 0; + int tmp450 = 0; if((Success != null) && __isset.success) { - if(0 < tmp514++) { sb.Append(", "); } + if(0 < tmp450++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -7544,17 +7302,6 @@ public executeStatementArgs() { } - public executeStatementArgs DeepCopy() - { - var tmp515 = new executeStatementArgs(); - if((Req != null) && __isset.req) - { - tmp515.Req = (TSExecuteStatementReq)this.Req.DeepCopy(); - } - tmp515.__isset.req = this.__isset.req; - return tmp515; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -7646,10 +7393,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeStatement_args("); - int tmp516 = 0; + int tmp451 = 0; if((Req != null) && __isset.req) { - if(0 < tmp516++) { sb.Append(", "); } + if(0 < tmp451++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -7687,17 +7434,6 @@ public executeStatementResult() { } - public executeStatementResult DeepCopy() - { - var tmp517 = new executeStatementResult(); - if((Success != null) && __isset.success) - { - tmp517.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp517.__isset.success = this.__isset.success; - return tmp517; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -7793,10 +7529,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeStatement_result("); - int tmp518 = 0; + int tmp452 = 0; if((Success != null) && __isset.success) { - if(0 < tmp518++) { sb.Append(", "); } + if(0 < tmp452++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -7834,17 +7570,6 @@ public executeBatchStatementArgs() { } - public executeBatchStatementArgs DeepCopy() - { - var tmp519 = new executeBatchStatementArgs(); - if((Req != null) && __isset.req) - { - tmp519.Req = (TSExecuteBatchStatementReq)this.Req.DeepCopy(); - } - tmp519.__isset.req = this.__isset.req; - return tmp519; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -7936,10 +7661,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeBatchStatement_args("); - int tmp520 = 0; + int tmp453 = 0; if((Req != null) && __isset.req) { - if(0 < tmp520++) { sb.Append(", "); } + if(0 < tmp453++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -7977,17 +7702,6 @@ public executeBatchStatementResult() { } - public executeBatchStatementResult DeepCopy() - { - var tmp521 = new executeBatchStatementResult(); - if((Success != null) && __isset.success) - { - tmp521.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp521.__isset.success = this.__isset.success; - return tmp521; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -8083,10 +7797,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeBatchStatement_result("); - int tmp522 = 0; + int tmp454 = 0; if((Success != null) && __isset.success) { - if(0 < tmp522++) { sb.Append(", "); } + if(0 < tmp454++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -8124,17 +7838,6 @@ public executeQueryStatementArgs() { } - public executeQueryStatementArgs DeepCopy() - { - var tmp523 = new executeQueryStatementArgs(); - if((Req != null) && __isset.req) - { - tmp523.Req = (TSExecuteStatementReq)this.Req.DeepCopy(); - } - tmp523.__isset.req = this.__isset.req; - return tmp523; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -8226,10 +7929,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeQueryStatement_args("); - int tmp524 = 0; + int tmp455 = 0; if((Req != null) && __isset.req) { - if(0 < tmp524++) { sb.Append(", "); } + if(0 < tmp455++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -8267,17 +7970,6 @@ public executeQueryStatementResult() { } - public executeQueryStatementResult DeepCopy() - { - var tmp525 = new executeQueryStatementResult(); - if((Success != null) && __isset.success) - { - tmp525.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp525.__isset.success = this.__isset.success; - return tmp525; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -8373,10 +8065,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeQueryStatement_result("); - int tmp526 = 0; + int tmp456 = 0; if((Success != null) && __isset.success) { - if(0 < tmp526++) { sb.Append(", "); } + if(0 < tmp456++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -8414,17 +8106,6 @@ public executeUpdateStatementArgs() { } - public executeUpdateStatementArgs DeepCopy() - { - var tmp527 = new executeUpdateStatementArgs(); - if((Req != null) && __isset.req) - { - tmp527.Req = (TSExecuteStatementReq)this.Req.DeepCopy(); - } - tmp527.__isset.req = this.__isset.req; - return tmp527; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -8516,10 +8197,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeUpdateStatement_args("); - int tmp528 = 0; + int tmp457 = 0; if((Req != null) && __isset.req) { - if(0 < tmp528++) { sb.Append(", "); } + if(0 < tmp457++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -8557,17 +8238,6 @@ public executeUpdateStatementResult() { } - public executeUpdateStatementResult DeepCopy() - { - var tmp529 = new executeUpdateStatementResult(); - if((Success != null) && __isset.success) - { - tmp529.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp529.__isset.success = this.__isset.success; - return tmp529; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -8663,10 +8333,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeUpdateStatement_result("); - int tmp530 = 0; + int tmp458 = 0; if((Success != null) && __isset.success) { - if(0 < tmp530++) { sb.Append(", "); } + if(0 < tmp458++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -8704,17 +8374,6 @@ public fetchResultsArgs() { } - public fetchResultsArgs DeepCopy() - { - var tmp531 = new fetchResultsArgs(); - if((Req != null) && __isset.req) - { - tmp531.Req = (TSFetchResultsReq)this.Req.DeepCopy(); - } - tmp531.__isset.req = this.__isset.req; - return tmp531; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -8806,10 +8465,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchResults_args("); - int tmp532 = 0; + int tmp459 = 0; if((Req != null) && __isset.req) { - if(0 < tmp532++) { sb.Append(", "); } + if(0 < tmp459++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -8847,17 +8506,6 @@ public fetchResultsResult() { } - public fetchResultsResult DeepCopy() - { - var tmp533 = new fetchResultsResult(); - if((Success != null) && __isset.success) - { - tmp533.Success = (TSFetchResultsResp)this.Success.DeepCopy(); - } - tmp533.__isset.success = this.__isset.success; - return tmp533; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -8953,10 +8601,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchResults_result("); - int tmp534 = 0; + int tmp460 = 0; if((Success != null) && __isset.success) { - if(0 < tmp534++) { sb.Append(", "); } + if(0 < tmp460++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -8994,17 +8642,6 @@ public fetchMetadataArgs() { } - public fetchMetadataArgs DeepCopy() - { - var tmp535 = new fetchMetadataArgs(); - if((Req != null) && __isset.req) - { - tmp535.Req = (TSFetchMetadataReq)this.Req.DeepCopy(); - } - tmp535.__isset.req = this.__isset.req; - return tmp535; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -9096,10 +8733,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchMetadata_args("); - int tmp536 = 0; + int tmp461 = 0; if((Req != null) && __isset.req) { - if(0 < tmp536++) { sb.Append(", "); } + if(0 < tmp461++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -9137,17 +8774,6 @@ public fetchMetadataResult() { } - public fetchMetadataResult DeepCopy() - { - var tmp537 = new fetchMetadataResult(); - if((Success != null) && __isset.success) - { - tmp537.Success = (TSFetchMetadataResp)this.Success.DeepCopy(); - } - tmp537.__isset.success = this.__isset.success; - return tmp537; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -9243,10 +8869,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchMetadata_result("); - int tmp538 = 0; + int tmp462 = 0; if((Success != null) && __isset.success) { - if(0 < tmp538++) { sb.Append(", "); } + if(0 < tmp462++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -9284,17 +8910,6 @@ public cancelOperationArgs() { } - public cancelOperationArgs DeepCopy() - { - var tmp539 = new cancelOperationArgs(); - if((Req != null) && __isset.req) - { - tmp539.Req = (TSCancelOperationReq)this.Req.DeepCopy(); - } - tmp539.__isset.req = this.__isset.req; - return tmp539; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -9386,10 +9001,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("cancelOperation_args("); - int tmp540 = 0; + int tmp463 = 0; if((Req != null) && __isset.req) { - if(0 < tmp540++) { sb.Append(", "); } + if(0 < tmp463++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -9427,17 +9042,6 @@ public cancelOperationResult() { } - public cancelOperationResult DeepCopy() - { - var tmp541 = new cancelOperationResult(); - if((Success != null) && __isset.success) - { - tmp541.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp541.__isset.success = this.__isset.success; - return tmp541; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -9533,10 +9137,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("cancelOperation_result("); - int tmp542 = 0; + int tmp464 = 0; if((Success != null) && __isset.success) { - if(0 < tmp542++) { sb.Append(", "); } + if(0 < tmp464++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -9574,17 +9178,6 @@ public closeOperationArgs() { } - public closeOperationArgs DeepCopy() - { - var tmp543 = new closeOperationArgs(); - if((Req != null) && __isset.req) - { - tmp543.Req = (TSCloseOperationReq)this.Req.DeepCopy(); - } - tmp543.__isset.req = this.__isset.req; - return tmp543; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -9676,10 +9269,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("closeOperation_args("); - int tmp544 = 0; + int tmp465 = 0; if((Req != null) && __isset.req) { - if(0 < tmp544++) { sb.Append(", "); } + if(0 < tmp465++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -9717,17 +9310,6 @@ public closeOperationResult() { } - public closeOperationResult DeepCopy() - { - var tmp545 = new closeOperationResult(); - if((Success != null) && __isset.success) - { - tmp545.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp545.__isset.success = this.__isset.success; - return tmp545; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -9823,10 +9405,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("closeOperation_result("); - int tmp546 = 0; + int tmp466 = 0; if((Success != null) && __isset.success) { - if(0 < tmp546++) { sb.Append(", "); } + if(0 < tmp466++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -9864,17 +9446,6 @@ public getTimeZoneArgs() { } - public getTimeZoneArgs DeepCopy() - { - var tmp547 = new getTimeZoneArgs(); - if(__isset.sessionId) - { - tmp547.SessionId = this.SessionId; - } - tmp547.__isset.sessionId = this.__isset.sessionId; - return tmp547; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -9965,10 +9536,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("getTimeZone_args("); - int tmp548 = 0; + int tmp467 = 0; if(__isset.sessionId) { - if(0 < tmp548++) { sb.Append(", "); } + if(0 < tmp467++) { sb.Append(", "); } sb.Append("SessionId: "); SessionId.ToString(sb); } @@ -10006,17 +9577,6 @@ public getTimeZoneResult() { } - public getTimeZoneResult DeepCopy() - { - var tmp549 = new getTimeZoneResult(); - if((Success != null) && __isset.success) - { - tmp549.Success = (TSGetTimeZoneResp)this.Success.DeepCopy(); - } - tmp549.__isset.success = this.__isset.success; - return tmp549; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -10112,10 +9672,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("getTimeZone_result("); - int tmp550 = 0; + int tmp468 = 0; if((Success != null) && __isset.success) { - if(0 < tmp550++) { sb.Append(", "); } + if(0 < tmp468++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -10153,17 +9713,6 @@ public setTimeZoneArgs() { } - public setTimeZoneArgs DeepCopy() - { - var tmp551 = new setTimeZoneArgs(); - if((Req != null) && __isset.req) - { - tmp551.Req = (TSSetTimeZoneReq)this.Req.DeepCopy(); - } - tmp551.__isset.req = this.__isset.req; - return tmp551; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -10255,10 +9804,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("setTimeZone_args("); - int tmp552 = 0; + int tmp469 = 0; if((Req != null) && __isset.req) { - if(0 < tmp552++) { sb.Append(", "); } + if(0 < tmp469++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -10296,17 +9845,6 @@ public setTimeZoneResult() { } - public setTimeZoneResult DeepCopy() - { - var tmp553 = new setTimeZoneResult(); - if((Success != null) && __isset.success) - { - tmp553.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp553.__isset.success = this.__isset.success; - return tmp553; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -10402,10 +9940,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("setTimeZone_result("); - int tmp554 = 0; + int tmp470 = 0; if((Success != null) && __isset.success) { - if(0 < tmp554++) { sb.Append(", "); } + if(0 < tmp470++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -10422,12 +9960,6 @@ public getPropertiesArgs() { } - public getPropertiesArgs DeepCopy() - { - var tmp555 = new getPropertiesArgs(); - return tmp555; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -10528,17 +10060,6 @@ public getPropertiesResult() { } - public getPropertiesResult DeepCopy() - { - var tmp557 = new getPropertiesResult(); - if((Success != null) && __isset.success) - { - tmp557.Success = (ServerProperties)this.Success.DeepCopy(); - } - tmp557.__isset.success = this.__isset.success; - return tmp557; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -10634,10 +10155,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("getProperties_result("); - int tmp558 = 0; + int tmp472 = 0; if((Success != null) && __isset.success) { - if(0 < tmp558++) { sb.Append(", "); } + if(0 < tmp472++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -10690,22 +10211,6 @@ public setStorageGroupArgs() { } - public setStorageGroupArgs DeepCopy() - { - var tmp559 = new setStorageGroupArgs(); - if(__isset.sessionId) - { - tmp559.SessionId = this.SessionId; - } - tmp559.__isset.sessionId = this.__isset.sessionId; - if((StorageGroup != null) && __isset.storageGroup) - { - tmp559.StorageGroup = this.StorageGroup; - } - tmp559.__isset.storageGroup = this.__isset.storageGroup; - return tmp559; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -10820,16 +10325,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("setStorageGroup_args("); - int tmp560 = 0; + int tmp473 = 0; if(__isset.sessionId) { - if(0 < tmp560++) { sb.Append(", "); } + if(0 < tmp473++) { sb.Append(", "); } sb.Append("SessionId: "); SessionId.ToString(sb); } if((StorageGroup != null) && __isset.storageGroup) { - if(0 < tmp560++) { sb.Append(", "); } + if(0 < tmp473++) { sb.Append(", "); } sb.Append("StorageGroup: "); StorageGroup.ToString(sb); } @@ -10867,17 +10372,6 @@ public setStorageGroupResult() { } - public setStorageGroupResult DeepCopy() - { - var tmp561 = new setStorageGroupResult(); - if((Success != null) && __isset.success) - { - tmp561.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp561.__isset.success = this.__isset.success; - return tmp561; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -10973,10 +10467,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("setStorageGroup_result("); - int tmp562 = 0; + int tmp474 = 0; if((Success != null) && __isset.success) { - if(0 < tmp562++) { sb.Append(", "); } + if(0 < tmp474++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -11014,17 +10508,6 @@ public createTimeseriesArgs() { } - public createTimeseriesArgs DeepCopy() - { - var tmp563 = new createTimeseriesArgs(); - if((Req != null) && __isset.req) - { - tmp563.Req = (TSCreateTimeseriesReq)this.Req.DeepCopy(); - } - tmp563.__isset.req = this.__isset.req; - return tmp563; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -11116,10 +10599,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createTimeseries_args("); - int tmp564 = 0; + int tmp475 = 0; if((Req != null) && __isset.req) { - if(0 < tmp564++) { sb.Append(", "); } + if(0 < tmp475++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -11157,17 +10640,6 @@ public createTimeseriesResult() { } - public createTimeseriesResult DeepCopy() - { - var tmp565 = new createTimeseriesResult(); - if((Success != null) && __isset.success) - { - tmp565.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp565.__isset.success = this.__isset.success; - return tmp565; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -11263,10 +10735,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createTimeseries_result("); - int tmp566 = 0; + int tmp476 = 0; if((Success != null) && __isset.success) { - if(0 < tmp566++) { sb.Append(", "); } + if(0 < tmp476++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -11304,17 +10776,6 @@ public createAlignedTimeseriesArgs() { } - public createAlignedTimeseriesArgs DeepCopy() - { - var tmp567 = new createAlignedTimeseriesArgs(); - if((Req != null) && __isset.req) - { - tmp567.Req = (TSCreateAlignedTimeseriesReq)this.Req.DeepCopy(); - } - tmp567.__isset.req = this.__isset.req; - return tmp567; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -11406,10 +10867,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createAlignedTimeseries_args("); - int tmp568 = 0; + int tmp477 = 0; if((Req != null) && __isset.req) { - if(0 < tmp568++) { sb.Append(", "); } + if(0 < tmp477++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -11447,17 +10908,6 @@ public createAlignedTimeseriesResult() { } - public createAlignedTimeseriesResult DeepCopy() - { - var tmp569 = new createAlignedTimeseriesResult(); - if((Success != null) && __isset.success) - { - tmp569.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp569.__isset.success = this.__isset.success; - return tmp569; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -11553,10 +11003,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createAlignedTimeseries_result("); - int tmp570 = 0; + int tmp478 = 0; if((Success != null) && __isset.success) { - if(0 < tmp570++) { sb.Append(", "); } + if(0 < tmp478++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -11594,17 +11044,6 @@ public createMultiTimeseriesArgs() { } - public createMultiTimeseriesArgs DeepCopy() - { - var tmp571 = new createMultiTimeseriesArgs(); - if((Req != null) && __isset.req) - { - tmp571.Req = (TSCreateMultiTimeseriesReq)this.Req.DeepCopy(); - } - tmp571.__isset.req = this.__isset.req; - return tmp571; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -11696,10 +11135,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createMultiTimeseries_args("); - int tmp572 = 0; + int tmp479 = 0; if((Req != null) && __isset.req) { - if(0 < tmp572++) { sb.Append(", "); } + if(0 < tmp479++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -11737,17 +11176,6 @@ public createMultiTimeseriesResult() { } - public createMultiTimeseriesResult DeepCopy() - { - var tmp573 = new createMultiTimeseriesResult(); - if((Success != null) && __isset.success) - { - tmp573.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp573.__isset.success = this.__isset.success; - return tmp573; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -11843,10 +11271,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createMultiTimeseries_result("); - int tmp574 = 0; + int tmp480 = 0; if((Success != null) && __isset.success) { - if(0 < tmp574++) { sb.Append(", "); } + if(0 < tmp480++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -11899,22 +11327,6 @@ public deleteTimeseriesArgs() { } - public deleteTimeseriesArgs DeepCopy() - { - var tmp575 = new deleteTimeseriesArgs(); - if(__isset.sessionId) - { - tmp575.SessionId = this.SessionId; - } - tmp575.__isset.sessionId = this.__isset.sessionId; - if((Path != null) && __isset.path) - { - tmp575.Path = this.Path.DeepCopy(); - } - tmp575.__isset.path = this.__isset.path; - return tmp575; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -11946,13 +11358,13 @@ public deleteTimeseriesArgs DeepCopy() if (field.Type == TType.List) { { - TList _list576 = await iprot.ReadListBeginAsync(cancellationToken); - Path = new List(_list576.Count); - for(int _i577 = 0; _i577 < _list576.Count; ++_i577) + TList _list481 = await iprot.ReadListBeginAsync(cancellationToken); + Path = new List(_list481.Count); + for(int _i482 = 0; _i482 < _list481.Count; ++_i482) { - string _elem578; - _elem578 = await iprot.ReadStringAsync(cancellationToken); - Path.Add(_elem578); + string _elem483; + _elem483 = await iprot.ReadStringAsync(cancellationToken); + Path.Add(_elem483); } await iprot.ReadListEndAsync(cancellationToken); } @@ -12003,9 +11415,9 @@ public deleteTimeseriesArgs DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Path.Count), cancellationToken); - foreach (string _iter579 in Path) + foreach (string _iter484 in Path) { - await oprot.WriteStringAsync(_iter579, cancellationToken); + await oprot.WriteStringAsync(_iter484, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -12046,16 +11458,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("deleteTimeseries_args("); - int tmp580 = 0; + int tmp485 = 0; if(__isset.sessionId) { - if(0 < tmp580++) { sb.Append(", "); } + if(0 < tmp485++) { sb.Append(", "); } sb.Append("SessionId: "); SessionId.ToString(sb); } if((Path != null) && __isset.path) { - if(0 < tmp580++) { sb.Append(", "); } + if(0 < tmp485++) { sb.Append(", "); } sb.Append("Path: "); Path.ToString(sb); } @@ -12093,17 +11505,6 @@ public deleteTimeseriesResult() { } - public deleteTimeseriesResult DeepCopy() - { - var tmp581 = new deleteTimeseriesResult(); - if((Success != null) && __isset.success) - { - tmp581.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp581.__isset.success = this.__isset.success; - return tmp581; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -12199,10 +11600,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("deleteTimeseries_result("); - int tmp582 = 0; + int tmp486 = 0; if((Success != null) && __isset.success) { - if(0 < tmp582++) { sb.Append(", "); } + if(0 < tmp486++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -12255,22 +11656,6 @@ public deleteStorageGroupsArgs() { } - public deleteStorageGroupsArgs DeepCopy() - { - var tmp583 = new deleteStorageGroupsArgs(); - if(__isset.sessionId) - { - tmp583.SessionId = this.SessionId; - } - tmp583.__isset.sessionId = this.__isset.sessionId; - if((StorageGroup != null) && __isset.storageGroup) - { - tmp583.StorageGroup = this.StorageGroup.DeepCopy(); - } - tmp583.__isset.storageGroup = this.__isset.storageGroup; - return tmp583; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -12302,13 +11687,13 @@ public deleteStorageGroupsArgs DeepCopy() if (field.Type == TType.List) { { - TList _list584 = await iprot.ReadListBeginAsync(cancellationToken); - StorageGroup = new List(_list584.Count); - for(int _i585 = 0; _i585 < _list584.Count; ++_i585) + TList _list487 = await iprot.ReadListBeginAsync(cancellationToken); + StorageGroup = new List(_list487.Count); + for(int _i488 = 0; _i488 < _list487.Count; ++_i488) { - string _elem586; - _elem586 = await iprot.ReadStringAsync(cancellationToken); - StorageGroup.Add(_elem586); + string _elem489; + _elem489 = await iprot.ReadStringAsync(cancellationToken); + StorageGroup.Add(_elem489); } await iprot.ReadListEndAsync(cancellationToken); } @@ -12359,9 +11744,9 @@ public deleteStorageGroupsArgs DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, StorageGroup.Count), cancellationToken); - foreach (string _iter587 in StorageGroup) + foreach (string _iter490 in StorageGroup) { - await oprot.WriteStringAsync(_iter587, cancellationToken); + await oprot.WriteStringAsync(_iter490, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -12402,16 +11787,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("deleteStorageGroups_args("); - int tmp588 = 0; + int tmp491 = 0; if(__isset.sessionId) { - if(0 < tmp588++) { sb.Append(", "); } + if(0 < tmp491++) { sb.Append(", "); } sb.Append("SessionId: "); SessionId.ToString(sb); } if((StorageGroup != null) && __isset.storageGroup) { - if(0 < tmp588++) { sb.Append(", "); } + if(0 < tmp491++) { sb.Append(", "); } sb.Append("StorageGroup: "); StorageGroup.ToString(sb); } @@ -12449,17 +11834,6 @@ public deleteStorageGroupsResult() { } - public deleteStorageGroupsResult DeepCopy() - { - var tmp589 = new deleteStorageGroupsResult(); - if((Success != null) && __isset.success) - { - tmp589.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp589.__isset.success = this.__isset.success; - return tmp589; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -12555,10 +11929,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("deleteStorageGroups_result("); - int tmp590 = 0; + int tmp492 = 0; if((Success != null) && __isset.success) { - if(0 < tmp590++) { sb.Append(", "); } + if(0 < tmp492++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -12596,17 +11970,6 @@ public insertRecordArgs() { } - public insertRecordArgs DeepCopy() - { - var tmp591 = new insertRecordArgs(); - if((Req != null) && __isset.req) - { - tmp591.Req = (TSInsertRecordReq)this.Req.DeepCopy(); - } - tmp591.__isset.req = this.__isset.req; - return tmp591; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -12698,10 +12061,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertRecord_args("); - int tmp592 = 0; + int tmp493 = 0; if((Req != null) && __isset.req) { - if(0 < tmp592++) { sb.Append(", "); } + if(0 < tmp493++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -12739,17 +12102,6 @@ public insertRecordResult() { } - public insertRecordResult DeepCopy() - { - var tmp593 = new insertRecordResult(); - if((Success != null) && __isset.success) - { - tmp593.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp593.__isset.success = this.__isset.success; - return tmp593; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -12845,10 +12197,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertRecord_result("); - int tmp594 = 0; + int tmp494 = 0; if((Success != null) && __isset.success) { - if(0 < tmp594++) { sb.Append(", "); } + if(0 < tmp494++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -12886,17 +12238,6 @@ public insertStringRecordArgs() { } - public insertStringRecordArgs DeepCopy() - { - var tmp595 = new insertStringRecordArgs(); - if((Req != null) && __isset.req) - { - tmp595.Req = (TSInsertStringRecordReq)this.Req.DeepCopy(); - } - tmp595.__isset.req = this.__isset.req; - return tmp595; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -12988,10 +12329,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertStringRecord_args("); - int tmp596 = 0; + int tmp495 = 0; if((Req != null) && __isset.req) { - if(0 < tmp596++) { sb.Append(", "); } + if(0 < tmp495++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -13029,17 +12370,6 @@ public insertStringRecordResult() { } - public insertStringRecordResult DeepCopy() - { - var tmp597 = new insertStringRecordResult(); - if((Success != null) && __isset.success) - { - tmp597.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp597.__isset.success = this.__isset.success; - return tmp597; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -13135,10 +12465,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertStringRecord_result("); - int tmp598 = 0; + int tmp496 = 0; if((Success != null) && __isset.success) { - if(0 < tmp598++) { sb.Append(", "); } + if(0 < tmp496++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -13176,17 +12506,6 @@ public insertTabletArgs() { } - public insertTabletArgs DeepCopy() - { - var tmp599 = new insertTabletArgs(); - if((Req != null) && __isset.req) - { - tmp599.Req = (TSInsertTabletReq)this.Req.DeepCopy(); - } - tmp599.__isset.req = this.__isset.req; - return tmp599; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -13278,10 +12597,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertTablet_args("); - int tmp600 = 0; + int tmp497 = 0; if((Req != null) && __isset.req) { - if(0 < tmp600++) { sb.Append(", "); } + if(0 < tmp497++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -13319,17 +12638,6 @@ public insertTabletResult() { } - public insertTabletResult DeepCopy() - { - var tmp601 = new insertTabletResult(); - if((Success != null) && __isset.success) - { - tmp601.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp601.__isset.success = this.__isset.success; - return tmp601; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -13425,10 +12733,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertTablet_result("); - int tmp602 = 0; + int tmp498 = 0; if((Success != null) && __isset.success) { - if(0 < tmp602++) { sb.Append(", "); } + if(0 < tmp498++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -13466,17 +12774,6 @@ public insertTabletsArgs() { } - public insertTabletsArgs DeepCopy() - { - var tmp603 = new insertTabletsArgs(); - if((Req != null) && __isset.req) - { - tmp603.Req = (TSInsertTabletsReq)this.Req.DeepCopy(); - } - tmp603.__isset.req = this.__isset.req; - return tmp603; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -13568,10 +12865,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertTablets_args("); - int tmp604 = 0; + int tmp499 = 0; if((Req != null) && __isset.req) { - if(0 < tmp604++) { sb.Append(", "); } + if(0 < tmp499++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -13609,17 +12906,6 @@ public insertTabletsResult() { } - public insertTabletsResult DeepCopy() - { - var tmp605 = new insertTabletsResult(); - if((Success != null) && __isset.success) - { - tmp605.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp605.__isset.success = this.__isset.success; - return tmp605; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -13715,10 +13001,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertTablets_result("); - int tmp606 = 0; + int tmp500 = 0; if((Success != null) && __isset.success) { - if(0 < tmp606++) { sb.Append(", "); } + if(0 < tmp500++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -13756,17 +13042,6 @@ public insertRecordsArgs() { } - public insertRecordsArgs DeepCopy() - { - var tmp607 = new insertRecordsArgs(); - if((Req != null) && __isset.req) - { - tmp607.Req = (TSInsertRecordsReq)this.Req.DeepCopy(); - } - tmp607.__isset.req = this.__isset.req; - return tmp607; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -13858,10 +13133,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertRecords_args("); - int tmp608 = 0; + int tmp501 = 0; if((Req != null) && __isset.req) { - if(0 < tmp608++) { sb.Append(", "); } + if(0 < tmp501++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -13899,17 +13174,6 @@ public insertRecordsResult() { } - public insertRecordsResult DeepCopy() - { - var tmp609 = new insertRecordsResult(); - if((Success != null) && __isset.success) - { - tmp609.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp609.__isset.success = this.__isset.success; - return tmp609; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -14005,10 +13269,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertRecords_result("); - int tmp610 = 0; + int tmp502 = 0; if((Success != null) && __isset.success) { - if(0 < tmp610++) { sb.Append(", "); } + if(0 < tmp502++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -14046,17 +13310,6 @@ public insertRecordsOfOneDeviceArgs() { } - public insertRecordsOfOneDeviceArgs DeepCopy() - { - var tmp611 = new insertRecordsOfOneDeviceArgs(); - if((Req != null) && __isset.req) - { - tmp611.Req = (TSInsertRecordsOfOneDeviceReq)this.Req.DeepCopy(); - } - tmp611.__isset.req = this.__isset.req; - return tmp611; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -14148,10 +13401,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertRecordsOfOneDevice_args("); - int tmp612 = 0; + int tmp503 = 0; if((Req != null) && __isset.req) { - if(0 < tmp612++) { sb.Append(", "); } + if(0 < tmp503++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -14189,17 +13442,6 @@ public insertRecordsOfOneDeviceResult() { } - public insertRecordsOfOneDeviceResult DeepCopy() - { - var tmp613 = new insertRecordsOfOneDeviceResult(); - if((Success != null) && __isset.success) - { - tmp613.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp613.__isset.success = this.__isset.success; - return tmp613; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -14295,10 +13537,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertRecordsOfOneDevice_result("); - int tmp614 = 0; + int tmp504 = 0; if((Success != null) && __isset.success) { - if(0 < tmp614++) { sb.Append(", "); } + if(0 < tmp504++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -14336,17 +13578,6 @@ public insertStringRecordsOfOneDeviceArgs() { } - public insertStringRecordsOfOneDeviceArgs DeepCopy() - { - var tmp615 = new insertStringRecordsOfOneDeviceArgs(); - if((Req != null) && __isset.req) - { - tmp615.Req = (TSInsertStringRecordsOfOneDeviceReq)this.Req.DeepCopy(); - } - tmp615.__isset.req = this.__isset.req; - return tmp615; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -14438,10 +13669,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertStringRecordsOfOneDevice_args("); - int tmp616 = 0; + int tmp505 = 0; if((Req != null) && __isset.req) { - if(0 < tmp616++) { sb.Append(", "); } + if(0 < tmp505++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -14479,17 +13710,6 @@ public insertStringRecordsOfOneDeviceResult() { } - public insertStringRecordsOfOneDeviceResult DeepCopy() - { - var tmp617 = new insertStringRecordsOfOneDeviceResult(); - if((Success != null) && __isset.success) - { - tmp617.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp617.__isset.success = this.__isset.success; - return tmp617; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -14585,10 +13805,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertStringRecordsOfOneDevice_result("); - int tmp618 = 0; + int tmp506 = 0; if((Success != null) && __isset.success) { - if(0 < tmp618++) { sb.Append(", "); } + if(0 < tmp506++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -14626,17 +13846,6 @@ public insertStringRecordsArgs() { } - public insertStringRecordsArgs DeepCopy() - { - var tmp619 = new insertStringRecordsArgs(); - if((Req != null) && __isset.req) - { - tmp619.Req = (TSInsertStringRecordsReq)this.Req.DeepCopy(); - } - tmp619.__isset.req = this.__isset.req; - return tmp619; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -14728,10 +13937,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertStringRecords_args("); - int tmp620 = 0; + int tmp507 = 0; if((Req != null) && __isset.req) { - if(0 < tmp620++) { sb.Append(", "); } + if(0 < tmp507++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -14769,17 +13978,6 @@ public insertStringRecordsResult() { } - public insertStringRecordsResult DeepCopy() - { - var tmp621 = new insertStringRecordsResult(); - if((Success != null) && __isset.success) - { - tmp621.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp621.__isset.success = this.__isset.success; - return tmp621; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -14875,10 +14073,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("insertStringRecords_result("); - int tmp622 = 0; + int tmp508 = 0; if((Success != null) && __isset.success) { - if(0 < tmp622++) { sb.Append(", "); } + if(0 < tmp508++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -14916,17 +14114,6 @@ public testInsertTabletArgs() { } - public testInsertTabletArgs DeepCopy() - { - var tmp623 = new testInsertTabletArgs(); - if((Req != null) && __isset.req) - { - tmp623.Req = (TSInsertTabletReq)this.Req.DeepCopy(); - } - tmp623.__isset.req = this.__isset.req; - return tmp623; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -15018,10 +14205,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertTablet_args("); - int tmp624 = 0; + int tmp509 = 0; if((Req != null) && __isset.req) { - if(0 < tmp624++) { sb.Append(", "); } + if(0 < tmp509++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -15059,17 +14246,6 @@ public testInsertTabletResult() { } - public testInsertTabletResult DeepCopy() - { - var tmp625 = new testInsertTabletResult(); - if((Success != null) && __isset.success) - { - tmp625.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp625.__isset.success = this.__isset.success; - return tmp625; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -15165,10 +14341,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertTablet_result("); - int tmp626 = 0; + int tmp510 = 0; if((Success != null) && __isset.success) { - if(0 < tmp626++) { sb.Append(", "); } + if(0 < tmp510++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -15206,17 +14382,6 @@ public testInsertTabletsArgs() { } - public testInsertTabletsArgs DeepCopy() - { - var tmp627 = new testInsertTabletsArgs(); - if((Req != null) && __isset.req) - { - tmp627.Req = (TSInsertTabletsReq)this.Req.DeepCopy(); - } - tmp627.__isset.req = this.__isset.req; - return tmp627; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -15308,10 +14473,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertTablets_args("); - int tmp628 = 0; + int tmp511 = 0; if((Req != null) && __isset.req) { - if(0 < tmp628++) { sb.Append(", "); } + if(0 < tmp511++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -15349,17 +14514,6 @@ public testInsertTabletsResult() { } - public testInsertTabletsResult DeepCopy() - { - var tmp629 = new testInsertTabletsResult(); - if((Success != null) && __isset.success) - { - tmp629.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp629.__isset.success = this.__isset.success; - return tmp629; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -15455,10 +14609,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertTablets_result("); - int tmp630 = 0; + int tmp512 = 0; if((Success != null) && __isset.success) { - if(0 < tmp630++) { sb.Append(", "); } + if(0 < tmp512++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -15496,17 +14650,6 @@ public testInsertRecordArgs() { } - public testInsertRecordArgs DeepCopy() - { - var tmp631 = new testInsertRecordArgs(); - if((Req != null) && __isset.req) - { - tmp631.Req = (TSInsertRecordReq)this.Req.DeepCopy(); - } - tmp631.__isset.req = this.__isset.req; - return tmp631; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -15598,10 +14741,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertRecord_args("); - int tmp632 = 0; + int tmp513 = 0; if((Req != null) && __isset.req) { - if(0 < tmp632++) { sb.Append(", "); } + if(0 < tmp513++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -15639,17 +14782,6 @@ public testInsertRecordResult() { } - public testInsertRecordResult DeepCopy() - { - var tmp633 = new testInsertRecordResult(); - if((Success != null) && __isset.success) - { - tmp633.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp633.__isset.success = this.__isset.success; - return tmp633; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -15745,10 +14877,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertRecord_result("); - int tmp634 = 0; + int tmp514 = 0; if((Success != null) && __isset.success) { - if(0 < tmp634++) { sb.Append(", "); } + if(0 < tmp514++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -15786,17 +14918,6 @@ public testInsertStringRecordArgs() { } - public testInsertStringRecordArgs DeepCopy() - { - var tmp635 = new testInsertStringRecordArgs(); - if((Req != null) && __isset.req) - { - tmp635.Req = (TSInsertStringRecordReq)this.Req.DeepCopy(); - } - tmp635.__isset.req = this.__isset.req; - return tmp635; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -15888,10 +15009,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertStringRecord_args("); - int tmp636 = 0; + int tmp515 = 0; if((Req != null) && __isset.req) { - if(0 < tmp636++) { sb.Append(", "); } + if(0 < tmp515++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -15929,17 +15050,6 @@ public testInsertStringRecordResult() { } - public testInsertStringRecordResult DeepCopy() - { - var tmp637 = new testInsertStringRecordResult(); - if((Success != null) && __isset.success) - { - tmp637.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp637.__isset.success = this.__isset.success; - return tmp637; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -16035,10 +15145,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertStringRecord_result("); - int tmp638 = 0; + int tmp516 = 0; if((Success != null) && __isset.success) { - if(0 < tmp638++) { sb.Append(", "); } + if(0 < tmp516++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -16076,17 +15186,6 @@ public testInsertRecordsArgs() { } - public testInsertRecordsArgs DeepCopy() - { - var tmp639 = new testInsertRecordsArgs(); - if((Req != null) && __isset.req) - { - tmp639.Req = (TSInsertRecordsReq)this.Req.DeepCopy(); - } - tmp639.__isset.req = this.__isset.req; - return tmp639; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -16178,10 +15277,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertRecords_args("); - int tmp640 = 0; + int tmp517 = 0; if((Req != null) && __isset.req) { - if(0 < tmp640++) { sb.Append(", "); } + if(0 < tmp517++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -16219,17 +15318,6 @@ public testInsertRecordsResult() { } - public testInsertRecordsResult DeepCopy() - { - var tmp641 = new testInsertRecordsResult(); - if((Success != null) && __isset.success) - { - tmp641.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp641.__isset.success = this.__isset.success; - return tmp641; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -16325,10 +15413,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertRecords_result("); - int tmp642 = 0; + int tmp518 = 0; if((Success != null) && __isset.success) { - if(0 < tmp642++) { sb.Append(", "); } + if(0 < tmp518++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -16366,17 +15454,6 @@ public testInsertRecordsOfOneDeviceArgs() { } - public testInsertRecordsOfOneDeviceArgs DeepCopy() - { - var tmp643 = new testInsertRecordsOfOneDeviceArgs(); - if((Req != null) && __isset.req) - { - tmp643.Req = (TSInsertRecordsOfOneDeviceReq)this.Req.DeepCopy(); - } - tmp643.__isset.req = this.__isset.req; - return tmp643; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -16468,10 +15545,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertRecordsOfOneDevice_args("); - int tmp644 = 0; + int tmp519 = 0; if((Req != null) && __isset.req) { - if(0 < tmp644++) { sb.Append(", "); } + if(0 < tmp519++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -16509,17 +15586,6 @@ public testInsertRecordsOfOneDeviceResult() { } - public testInsertRecordsOfOneDeviceResult DeepCopy() - { - var tmp645 = new testInsertRecordsOfOneDeviceResult(); - if((Success != null) && __isset.success) - { - tmp645.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp645.__isset.success = this.__isset.success; - return tmp645; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -16615,10 +15681,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertRecordsOfOneDevice_result("); - int tmp646 = 0; + int tmp520 = 0; if((Success != null) && __isset.success) { - if(0 < tmp646++) { sb.Append(", "); } + if(0 < tmp520++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -16656,17 +15722,6 @@ public testInsertStringRecordsArgs() { } - public testInsertStringRecordsArgs DeepCopy() - { - var tmp647 = new testInsertStringRecordsArgs(); - if((Req != null) && __isset.req) - { - tmp647.Req = (TSInsertStringRecordsReq)this.Req.DeepCopy(); - } - tmp647.__isset.req = this.__isset.req; - return tmp647; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -16758,10 +15813,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertStringRecords_args("); - int tmp648 = 0; + int tmp521 = 0; if((Req != null) && __isset.req) { - if(0 < tmp648++) { sb.Append(", "); } + if(0 < tmp521++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -16799,17 +15854,6 @@ public testInsertStringRecordsResult() { } - public testInsertStringRecordsResult DeepCopy() - { - var tmp649 = new testInsertStringRecordsResult(); - if((Success != null) && __isset.success) - { - tmp649.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp649.__isset.success = this.__isset.success; - return tmp649; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -16905,10 +15949,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testInsertStringRecords_result("); - int tmp650 = 0; + int tmp522 = 0; if((Success != null) && __isset.success) { - if(0 < tmp650++) { sb.Append(", "); } + if(0 < tmp522++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -16946,17 +15990,6 @@ public deleteDataArgs() { } - public deleteDataArgs DeepCopy() - { - var tmp651 = new deleteDataArgs(); - if((Req != null) && __isset.req) - { - tmp651.Req = (TSDeleteDataReq)this.Req.DeepCopy(); - } - tmp651.__isset.req = this.__isset.req; - return tmp651; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -17048,10 +16081,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("deleteData_args("); - int tmp652 = 0; + int tmp523 = 0; if((Req != null) && __isset.req) { - if(0 < tmp652++) { sb.Append(", "); } + if(0 < tmp523++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -17089,17 +16122,6 @@ public deleteDataResult() { } - public deleteDataResult DeepCopy() - { - var tmp653 = new deleteDataResult(); - if((Success != null) && __isset.success) - { - tmp653.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp653.__isset.success = this.__isset.success; - return tmp653; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -17195,10 +16217,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("deleteData_result("); - int tmp654 = 0; + int tmp524 = 0; if((Success != null) && __isset.success) { - if(0 < tmp654++) { sb.Append(", "); } + if(0 < tmp524++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -17236,17 +16258,6 @@ public executeRawDataQueryArgs() { } - public executeRawDataQueryArgs DeepCopy() - { - var tmp655 = new executeRawDataQueryArgs(); - if((Req != null) && __isset.req) - { - tmp655.Req = (TSRawDataQueryReq)this.Req.DeepCopy(); - } - tmp655.__isset.req = this.__isset.req; - return tmp655; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -17338,10 +16349,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeRawDataQuery_args("); - int tmp656 = 0; + int tmp525 = 0; if((Req != null) && __isset.req) { - if(0 < tmp656++) { sb.Append(", "); } + if(0 < tmp525++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -17379,17 +16390,6 @@ public executeRawDataQueryResult() { } - public executeRawDataQueryResult DeepCopy() - { - var tmp657 = new executeRawDataQueryResult(); - if((Success != null) && __isset.success) - { - tmp657.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp657.__isset.success = this.__isset.success; - return tmp657; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -17485,10 +16485,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeRawDataQuery_result("); - int tmp658 = 0; + int tmp526 = 0; if((Success != null) && __isset.success) { - if(0 < tmp658++) { sb.Append(", "); } + if(0 < tmp526++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -17526,17 +16526,6 @@ public executeLastDataQueryArgs() { } - public executeLastDataQueryArgs DeepCopy() - { - var tmp659 = new executeLastDataQueryArgs(); - if((Req != null) && __isset.req) - { - tmp659.Req = (TSLastDataQueryReq)this.Req.DeepCopy(); - } - tmp659.__isset.req = this.__isset.req; - return tmp659; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -17628,10 +16617,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeLastDataQuery_args("); - int tmp660 = 0; + int tmp527 = 0; if((Req != null) && __isset.req) { - if(0 < tmp660++) { sb.Append(", "); } + if(0 < tmp527++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -17669,17 +16658,6 @@ public executeLastDataQueryResult() { } - public executeLastDataQueryResult DeepCopy() - { - var tmp661 = new executeLastDataQueryResult(); - if((Success != null) && __isset.success) - { - tmp661.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp661.__isset.success = this.__isset.success; - return tmp661; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -17775,10 +16753,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeLastDataQuery_result("); - int tmp662 = 0; + int tmp528 = 0; if((Success != null) && __isset.success) { - if(0 < tmp662++) { sb.Append(", "); } + if(0 < tmp528++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -17816,17 +16794,6 @@ public executeAggregationQueryArgs() { } - public executeAggregationQueryArgs DeepCopy() - { - var tmp663 = new executeAggregationQueryArgs(); - if((Req != null) && __isset.req) - { - tmp663.Req = (TSAggregationQueryReq)this.Req.DeepCopy(); - } - tmp663.__isset.req = this.__isset.req; - return tmp663; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -17918,10 +16885,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeAggregationQuery_args("); - int tmp664 = 0; + int tmp529 = 0; if((Req != null) && __isset.req) { - if(0 < tmp664++) { sb.Append(", "); } + if(0 < tmp529++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -17959,17 +16926,6 @@ public executeAggregationQueryResult() { } - public executeAggregationQueryResult DeepCopy() - { - var tmp665 = new executeAggregationQueryResult(); - if((Success != null) && __isset.success) - { - tmp665.Success = (TSExecuteStatementResp)this.Success.DeepCopy(); - } - tmp665.__isset.success = this.__isset.success; - return tmp665; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -18065,10 +17021,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("executeAggregationQuery_result("); - int tmp666 = 0; + int tmp530 = 0; if((Success != null) && __isset.success) { - if(0 < tmp666++) { sb.Append(", "); } + if(0 < tmp530++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -18106,17 +17062,6 @@ public requestStatementIdArgs() { } - public requestStatementIdArgs DeepCopy() - { - var tmp667 = new requestStatementIdArgs(); - if(__isset.sessionId) - { - tmp667.SessionId = this.SessionId; - } - tmp667.__isset.sessionId = this.__isset.sessionId; - return tmp667; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -18207,10 +17152,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("requestStatementId_args("); - int tmp668 = 0; + int tmp531 = 0; if(__isset.sessionId) { - if(0 < tmp668++) { sb.Append(", "); } + if(0 < tmp531++) { sb.Append(", "); } sb.Append("SessionId: "); SessionId.ToString(sb); } @@ -18248,17 +17193,6 @@ public requestStatementIdResult() { } - public requestStatementIdResult DeepCopy() - { - var tmp669 = new requestStatementIdResult(); - if(__isset.success) - { - tmp669.Success = this.Success; - } - tmp669.__isset.success = this.__isset.success; - return tmp669; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -18350,10 +17284,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("requestStatementId_result("); - int tmp670 = 0; + int tmp532 = 0; if(__isset.success) { - if(0 < tmp670++) { sb.Append(", "); } + if(0 < tmp532++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -18391,17 +17325,6 @@ public createSchemaTemplateArgs() { } - public createSchemaTemplateArgs DeepCopy() - { - var tmp671 = new createSchemaTemplateArgs(); - if((Req != null) && __isset.req) - { - tmp671.Req = (TSCreateSchemaTemplateReq)this.Req.DeepCopy(); - } - tmp671.__isset.req = this.__isset.req; - return tmp671; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -18493,10 +17416,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createSchemaTemplate_args("); - int tmp672 = 0; + int tmp533 = 0; if((Req != null) && __isset.req) { - if(0 < tmp672++) { sb.Append(", "); } + if(0 < tmp533++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -18534,17 +17457,6 @@ public createSchemaTemplateResult() { } - public createSchemaTemplateResult DeepCopy() - { - var tmp673 = new createSchemaTemplateResult(); - if((Success != null) && __isset.success) - { - tmp673.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp673.__isset.success = this.__isset.success; - return tmp673; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -18640,10 +17552,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createSchemaTemplate_result("); - int tmp674 = 0; + int tmp534 = 0; if((Success != null) && __isset.success) { - if(0 < tmp674++) { sb.Append(", "); } + if(0 < tmp534++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -18681,17 +17593,6 @@ public appendSchemaTemplateArgs() { } - public appendSchemaTemplateArgs DeepCopy() - { - var tmp675 = new appendSchemaTemplateArgs(); - if((Req != null) && __isset.req) - { - tmp675.Req = (TSAppendSchemaTemplateReq)this.Req.DeepCopy(); - } - tmp675.__isset.req = this.__isset.req; - return tmp675; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -18783,10 +17684,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("appendSchemaTemplate_args("); - int tmp676 = 0; + int tmp535 = 0; if((Req != null) && __isset.req) { - if(0 < tmp676++) { sb.Append(", "); } + if(0 < tmp535++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -18824,17 +17725,6 @@ public appendSchemaTemplateResult() { } - public appendSchemaTemplateResult DeepCopy() - { - var tmp677 = new appendSchemaTemplateResult(); - if((Success != null) && __isset.success) - { - tmp677.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp677.__isset.success = this.__isset.success; - return tmp677; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -18930,10 +17820,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("appendSchemaTemplate_result("); - int tmp678 = 0; + int tmp536 = 0; if((Success != null) && __isset.success) { - if(0 < tmp678++) { sb.Append(", "); } + if(0 < tmp536++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -18971,17 +17861,6 @@ public pruneSchemaTemplateArgs() { } - public pruneSchemaTemplateArgs DeepCopy() - { - var tmp679 = new pruneSchemaTemplateArgs(); - if((Req != null) && __isset.req) - { - tmp679.Req = (TSPruneSchemaTemplateReq)this.Req.DeepCopy(); - } - tmp679.__isset.req = this.__isset.req; - return tmp679; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -19073,10 +17952,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("pruneSchemaTemplate_args("); - int tmp680 = 0; + int tmp537 = 0; if((Req != null) && __isset.req) { - if(0 < tmp680++) { sb.Append(", "); } + if(0 < tmp537++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -19114,17 +17993,6 @@ public pruneSchemaTemplateResult() { } - public pruneSchemaTemplateResult DeepCopy() - { - var tmp681 = new pruneSchemaTemplateResult(); - if((Success != null) && __isset.success) - { - tmp681.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp681.__isset.success = this.__isset.success; - return tmp681; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -19220,10 +18088,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("pruneSchemaTemplate_result("); - int tmp682 = 0; + int tmp538 = 0; if((Success != null) && __isset.success) { - if(0 < tmp682++) { sb.Append(", "); } + if(0 < tmp538++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -19261,17 +18129,6 @@ public querySchemaTemplateArgs() { } - public querySchemaTemplateArgs DeepCopy() - { - var tmp683 = new querySchemaTemplateArgs(); - if((Req != null) && __isset.req) - { - tmp683.Req = (TSQueryTemplateReq)this.Req.DeepCopy(); - } - tmp683.__isset.req = this.__isset.req; - return tmp683; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -19363,10 +18220,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("querySchemaTemplate_args("); - int tmp684 = 0; + int tmp539 = 0; if((Req != null) && __isset.req) { - if(0 < tmp684++) { sb.Append(", "); } + if(0 < tmp539++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -19404,17 +18261,6 @@ public querySchemaTemplateResult() { } - public querySchemaTemplateResult DeepCopy() - { - var tmp685 = new querySchemaTemplateResult(); - if((Success != null) && __isset.success) - { - tmp685.Success = (TSQueryTemplateResp)this.Success.DeepCopy(); - } - tmp685.__isset.success = this.__isset.success; - return tmp685; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -19510,10 +18356,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("querySchemaTemplate_result("); - int tmp686 = 0; + int tmp540 = 0; if((Success != null) && __isset.success) { - if(0 < tmp686++) { sb.Append(", "); } + if(0 < tmp540++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -19530,12 +18376,6 @@ public showConfigurationTemplateArgs() { } - public showConfigurationTemplateArgs DeepCopy() - { - var tmp687 = new showConfigurationTemplateArgs(); - return tmp687; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -19636,17 +18476,6 @@ public showConfigurationTemplateResult() { } - public showConfigurationTemplateResult DeepCopy() - { - var tmp689 = new showConfigurationTemplateResult(); - if((Success != null) && __isset.success) - { - tmp689.Success = (TShowConfigurationTemplateResp)this.Success.DeepCopy(); - } - tmp689.__isset.success = this.__isset.success; - return tmp689; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -19742,10 +18571,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("showConfigurationTemplate_result("); - int tmp690 = 0; + int tmp542 = 0; if((Success != null) && __isset.success) { - if(0 < tmp690++) { sb.Append(", "); } + if(0 < tmp542++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -19783,17 +18612,6 @@ public showConfigurationArgs() { } - public showConfigurationArgs DeepCopy() - { - var tmp691 = new showConfigurationArgs(); - if(__isset.nodeId) - { - tmp691.NodeId = this.NodeId; - } - tmp691.__isset.nodeId = this.__isset.nodeId; - return tmp691; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -19884,10 +18702,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("showConfiguration_args("); - int tmp692 = 0; + int tmp543 = 0; if(__isset.nodeId) { - if(0 < tmp692++) { sb.Append(", "); } + if(0 < tmp543++) { sb.Append(", "); } sb.Append("NodeId: "); NodeId.ToString(sb); } @@ -19925,17 +18743,6 @@ public showConfigurationResult() { } - public showConfigurationResult DeepCopy() - { - var tmp693 = new showConfigurationResult(); - if((Success != null) && __isset.success) - { - tmp693.Success = (TShowConfigurationResp)this.Success.DeepCopy(); - } - tmp693.__isset.success = this.__isset.success; - return tmp693; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -20031,10 +18838,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("showConfiguration_result("); - int tmp694 = 0; + int tmp544 = 0; if((Success != null) && __isset.success) { - if(0 < tmp694++) { sb.Append(", "); } + if(0 < tmp544++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -20072,17 +18879,6 @@ public setSchemaTemplateArgs() { } - public setSchemaTemplateArgs DeepCopy() - { - var tmp695 = new setSchemaTemplateArgs(); - if((Req != null) && __isset.req) - { - tmp695.Req = (TSSetSchemaTemplateReq)this.Req.DeepCopy(); - } - tmp695.__isset.req = this.__isset.req; - return tmp695; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -20174,10 +18970,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("setSchemaTemplate_args("); - int tmp696 = 0; + int tmp545 = 0; if((Req != null) && __isset.req) { - if(0 < tmp696++) { sb.Append(", "); } + if(0 < tmp545++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -20215,17 +19011,6 @@ public setSchemaTemplateResult() { } - public setSchemaTemplateResult DeepCopy() - { - var tmp697 = new setSchemaTemplateResult(); - if((Success != null) && __isset.success) - { - tmp697.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp697.__isset.success = this.__isset.success; - return tmp697; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -20321,10 +19106,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("setSchemaTemplate_result("); - int tmp698 = 0; + int tmp546 = 0; if((Success != null) && __isset.success) { - if(0 < tmp698++) { sb.Append(", "); } + if(0 < tmp546++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -20362,17 +19147,6 @@ public unsetSchemaTemplateArgs() { } - public unsetSchemaTemplateArgs DeepCopy() - { - var tmp699 = new unsetSchemaTemplateArgs(); - if((Req != null) && __isset.req) - { - tmp699.Req = (TSUnsetSchemaTemplateReq)this.Req.DeepCopy(); - } - tmp699.__isset.req = this.__isset.req; - return tmp699; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -20464,10 +19238,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("unsetSchemaTemplate_args("); - int tmp700 = 0; + int tmp547 = 0; if((Req != null) && __isset.req) { - if(0 < tmp700++) { sb.Append(", "); } + if(0 < tmp547++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -20505,17 +19279,6 @@ public unsetSchemaTemplateResult() { } - public unsetSchemaTemplateResult DeepCopy() - { - var tmp701 = new unsetSchemaTemplateResult(); - if((Success != null) && __isset.success) - { - tmp701.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp701.__isset.success = this.__isset.success; - return tmp701; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -20611,10 +19374,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("unsetSchemaTemplate_result("); - int tmp702 = 0; + int tmp548 = 0; if((Success != null) && __isset.success) { - if(0 < tmp702++) { sb.Append(", "); } + if(0 < tmp548++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -20652,17 +19415,6 @@ public dropSchemaTemplateArgs() { } - public dropSchemaTemplateArgs DeepCopy() - { - var tmp703 = new dropSchemaTemplateArgs(); - if((Req != null) && __isset.req) - { - tmp703.Req = (TSDropSchemaTemplateReq)this.Req.DeepCopy(); - } - tmp703.__isset.req = this.__isset.req; - return tmp703; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -20754,10 +19506,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("dropSchemaTemplate_args("); - int tmp704 = 0; + int tmp549 = 0; if((Req != null) && __isset.req) { - if(0 < tmp704++) { sb.Append(", "); } + if(0 < tmp549++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -20795,17 +19547,6 @@ public dropSchemaTemplateResult() { } - public dropSchemaTemplateResult DeepCopy() - { - var tmp705 = new dropSchemaTemplateResult(); - if((Success != null) && __isset.success) - { - tmp705.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp705.__isset.success = this.__isset.success; - return tmp705; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -20901,10 +19642,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("dropSchemaTemplate_result("); - int tmp706 = 0; + int tmp550 = 0; if((Success != null) && __isset.success) { - if(0 < tmp706++) { sb.Append(", "); } + if(0 < tmp550++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -20942,17 +19683,6 @@ public createTimeseriesUsingSchemaTemplateArgs() { } - public createTimeseriesUsingSchemaTemplateArgs DeepCopy() - { - var tmp707 = new createTimeseriesUsingSchemaTemplateArgs(); - if((Req != null) && __isset.req) - { - tmp707.Req = (TCreateTimeseriesUsingSchemaTemplateReq)this.Req.DeepCopy(); - } - tmp707.__isset.req = this.__isset.req; - return tmp707; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -21044,10 +19774,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createTimeseriesUsingSchemaTemplate_args("); - int tmp708 = 0; + int tmp551 = 0; if((Req != null) && __isset.req) { - if(0 < tmp708++) { sb.Append(", "); } + if(0 < tmp551++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -21085,17 +19815,6 @@ public createTimeseriesUsingSchemaTemplateResult() { } - public createTimeseriesUsingSchemaTemplateResult DeepCopy() - { - var tmp709 = new createTimeseriesUsingSchemaTemplateResult(); - if((Success != null) && __isset.success) - { - tmp709.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp709.__isset.success = this.__isset.success; - return tmp709; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -21191,10 +19910,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("createTimeseriesUsingSchemaTemplate_result("); - int tmp710 = 0; + int tmp552 = 0; if((Success != null) && __isset.success) { - if(0 < tmp710++) { sb.Append(", "); } + if(0 < tmp552++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -21232,17 +19951,6 @@ public handshakeArgs() { } - public handshakeArgs DeepCopy() - { - var tmp711 = new handshakeArgs(); - if((Info != null) && __isset.info) - { - tmp711.Info = (TSyncIdentityInfo)this.Info.DeepCopy(); - } - tmp711.__isset.info = this.__isset.info; - return tmp711; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -21334,10 +20042,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("handshake_args("); - int tmp712 = 0; + int tmp553 = 0; if((Info != null) && __isset.info) { - if(0 < tmp712++) { sb.Append(", "); } + if(0 < tmp553++) { sb.Append(", "); } sb.Append("Info: "); Info.ToString(sb); } @@ -21375,17 +20083,6 @@ public handshakeResult() { } - public handshakeResult DeepCopy() - { - var tmp713 = new handshakeResult(); - if((Success != null) && __isset.success) - { - tmp713.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp713.__isset.success = this.__isset.success; - return tmp713; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -21481,10 +20178,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("handshake_result("); - int tmp714 = 0; + int tmp554 = 0; if((Success != null) && __isset.success) { - if(0 < tmp714++) { sb.Append(", "); } + if(0 < tmp554++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -21522,17 +20219,6 @@ public sendPipeDataArgs() { } - public sendPipeDataArgs DeepCopy() - { - var tmp715 = new sendPipeDataArgs(); - if((Buff != null) && __isset.buff) - { - tmp715.Buff = this.Buff.ToArray(); - } - tmp715.__isset.buff = this.__isset.buff; - return tmp715; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -21623,10 +20309,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("sendPipeData_args("); - int tmp716 = 0; + int tmp555 = 0; if((Buff != null) && __isset.buff) { - if(0 < tmp716++) { sb.Append(", "); } + if(0 < tmp555++) { sb.Append(", "); } sb.Append("Buff: "); Buff.ToString(sb); } @@ -21664,17 +20350,6 @@ public sendPipeDataResult() { } - public sendPipeDataResult DeepCopy() - { - var tmp717 = new sendPipeDataResult(); - if((Success != null) && __isset.success) - { - tmp717.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp717.__isset.success = this.__isset.success; - return tmp717; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -21770,10 +20445,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("sendPipeData_result("); - int tmp718 = 0; + int tmp556 = 0; if((Success != null) && __isset.success) { - if(0 < tmp718++) { sb.Append(", "); } + if(0 < tmp556++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -21826,22 +20501,6 @@ public sendFileArgs() { } - public sendFileArgs DeepCopy() - { - var tmp719 = new sendFileArgs(); - if((MetaInfo != null) && __isset.metaInfo) - { - tmp719.MetaInfo = (TSyncTransportMetaInfo)this.MetaInfo.DeepCopy(); - } - tmp719.__isset.metaInfo = this.__isset.metaInfo; - if((Buff != null) && __isset.buff) - { - tmp719.Buff = this.Buff.ToArray(); - } - tmp719.__isset.buff = this.__isset.buff; - return tmp719; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -21957,16 +20616,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("sendFile_args("); - int tmp720 = 0; + int tmp557 = 0; if((MetaInfo != null) && __isset.metaInfo) { - if(0 < tmp720++) { sb.Append(", "); } + if(0 < tmp557++) { sb.Append(", "); } sb.Append("MetaInfo: "); MetaInfo.ToString(sb); } if((Buff != null) && __isset.buff) { - if(0 < tmp720++) { sb.Append(", "); } + if(0 < tmp557++) { sb.Append(", "); } sb.Append("Buff: "); Buff.ToString(sb); } @@ -22004,17 +20663,6 @@ public sendFileResult() { } - public sendFileResult DeepCopy() - { - var tmp721 = new sendFileResult(); - if((Success != null) && __isset.success) - { - tmp721.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp721.__isset.success = this.__isset.success; - return tmp721; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -22110,10 +20758,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("sendFile_result("); - int tmp722 = 0; + int tmp558 = 0; if((Success != null) && __isset.success) { - if(0 < tmp722++) { sb.Append(", "); } + if(0 < tmp558++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -22151,17 +20799,6 @@ public pipeTransferArgs() { } - public pipeTransferArgs DeepCopy() - { - var tmp723 = new pipeTransferArgs(); - if((Req != null) && __isset.req) - { - tmp723.Req = (TPipeTransferReq)this.Req.DeepCopy(); - } - tmp723.__isset.req = this.__isset.req; - return tmp723; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -22253,10 +20890,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("pipeTransfer_args("); - int tmp724 = 0; + int tmp559 = 0; if((Req != null) && __isset.req) { - if(0 < tmp724++) { sb.Append(", "); } + if(0 < tmp559++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -22294,17 +20931,6 @@ public pipeTransferResult() { } - public pipeTransferResult DeepCopy() - { - var tmp725 = new pipeTransferResult(); - if((Success != null) && __isset.success) - { - tmp725.Success = (TPipeTransferResp)this.Success.DeepCopy(); - } - tmp725.__isset.success = this.__isset.success; - return tmp725; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -22400,10 +21026,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("pipeTransfer_result("); - int tmp726 = 0; + int tmp560 = 0; if((Success != null) && __isset.success) { - if(0 < tmp726++) { sb.Append(", "); } + if(0 < tmp560++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -22441,17 +21067,6 @@ public pipeSubscribeArgs() { } - public pipeSubscribeArgs DeepCopy() - { - var tmp727 = new pipeSubscribeArgs(); - if((Req != null) && __isset.req) - { - tmp727.Req = (TPipeSubscribeReq)this.Req.DeepCopy(); - } - tmp727.__isset.req = this.__isset.req; - return tmp727; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -22543,10 +21158,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("pipeSubscribe_args("); - int tmp728 = 0; + int tmp561 = 0; if((Req != null) && __isset.req) { - if(0 < tmp728++) { sb.Append(", "); } + if(0 < tmp561++) { sb.Append(", "); } sb.Append("Req: "); Req.ToString(sb); } @@ -22584,17 +21199,6 @@ public pipeSubscribeResult() { } - public pipeSubscribeResult DeepCopy() - { - var tmp729 = new pipeSubscribeResult(); - if((Success != null) && __isset.success) - { - tmp729.Success = (TPipeSubscribeResp)this.Success.DeepCopy(); - } - tmp729.__isset.success = this.__isset.success; - return tmp729; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -22690,10 +21294,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("pipeSubscribe_result("); - int tmp730 = 0; + int tmp562 = 0; if((Success != null) && __isset.success) { - if(0 < tmp730++) { sb.Append(", "); } + if(0 < tmp562++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -22710,12 +21314,6 @@ public getBackupConfigurationArgs() { } - public getBackupConfigurationArgs DeepCopy() - { - var tmp731 = new getBackupConfigurationArgs(); - return tmp731; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -22816,17 +21414,6 @@ public getBackupConfigurationResult() { } - public getBackupConfigurationResult DeepCopy() - { - var tmp733 = new getBackupConfigurationResult(); - if((Success != null) && __isset.success) - { - tmp733.Success = (TSBackupConfigurationResp)this.Success.DeepCopy(); - } - tmp733.__isset.success = this.__isset.success; - return tmp733; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -22922,10 +21509,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("getBackupConfiguration_result("); - int tmp734 = 0; + int tmp564 = 0; if((Success != null) && __isset.success) { - if(0 < tmp734++) { sb.Append(", "); } + if(0 < tmp564++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -22942,12 +21529,6 @@ public fetchAllConnectionsInfoArgs() { } - public fetchAllConnectionsInfoArgs DeepCopy() - { - var tmp735 = new fetchAllConnectionsInfoArgs(); - return tmp735; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -23048,17 +21629,6 @@ public fetchAllConnectionsInfoResult() { } - public fetchAllConnectionsInfoResult DeepCopy() - { - var tmp737 = new fetchAllConnectionsInfoResult(); - if((Success != null) && __isset.success) - { - tmp737.Success = (TSConnectionInfoResp)this.Success.DeepCopy(); - } - tmp737.__isset.success = this.__isset.success; - return tmp737; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -23154,10 +21724,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("fetchAllConnectionsInfo_result("); - int tmp738 = 0; + int tmp566 = 0; if((Success != null) && __isset.success) { - if(0 < tmp738++) { sb.Append(", "); } + if(0 < tmp566++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } @@ -23174,12 +21744,6 @@ public testConnectionEmptyRPCArgs() { } - public testConnectionEmptyRPCArgs DeepCopy() - { - var tmp739 = new testConnectionEmptyRPCArgs(); - return tmp739; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -23280,17 +21844,6 @@ public testConnectionEmptyRPCResult() { } - public testConnectionEmptyRPCResult DeepCopy() - { - var tmp741 = new testConnectionEmptyRPCResult(); - if((Success != null) && __isset.success) - { - tmp741.Success = (TSStatus)this.Success.DeepCopy(); - } - tmp741.__isset.success = this.__isset.success; - return tmp741; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -23386,10 +21939,10 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("testConnectionEmptyRPC_result("); - int tmp742 = 0; + int tmp568 = 0; if((Success != null) && __isset.success) { - if(0 < tmp742++) { sb.Append(", "); } + if(0 < tmp568++) { sb.Append(", "); } sb.Append("Success: "); Success.ToString(sb); } diff --git a/src/Apache.IoTDB/Rpc/Generated/Model.cs b/src/Apache.IoTDB/Rpc/Generated/Model.cs new file mode 100644 index 0000000..dfb0315 --- /dev/null +++ b/src/Apache.IoTDB/Rpc/Generated/Model.cs @@ -0,0 +1,15 @@ +/** + * Autogenerated by Thrift Compiler (0.14.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ + +#pragma warning disable IDE0079 // remove unnecessary pragmas +#pragma warning disable IDE1006 // parts of the code use IDL spelling + +public enum Model +{ + TREE = 0, + TABLE = 1, +} diff --git a/src/Apache.IoTDB/Rpc/Generated/ServerProperties.cs b/src/Apache.IoTDB/Rpc/Generated/ServerProperties.cs index f94b7e0..dcfe488 100644 --- a/src/Apache.IoTDB/Rpc/Generated/ServerProperties.cs +++ b/src/Apache.IoTDB/Rpc/Generated/ServerProperties.cs @@ -130,49 +130,6 @@ public ServerProperties(string version, List supportedTimeAggregationOpe this.TimestampPrecision = timestampPrecision; } - public ServerProperties DeepCopy() - { - var tmp397 = new ServerProperties(); - if((Version != null)) - { - tmp397.Version = this.Version; - } - if((SupportedTimeAggregationOperations != null)) - { - tmp397.SupportedTimeAggregationOperations = this.SupportedTimeAggregationOperations.DeepCopy(); - } - if((TimestampPrecision != null)) - { - tmp397.TimestampPrecision = this.TimestampPrecision; - } - if(__isset.maxConcurrentClientNum) - { - tmp397.MaxConcurrentClientNum = this.MaxConcurrentClientNum; - } - tmp397.__isset.maxConcurrentClientNum = this.__isset.maxConcurrentClientNum; - if(__isset.thriftMaxFrameSize) - { - tmp397.ThriftMaxFrameSize = this.ThriftMaxFrameSize; - } - tmp397.__isset.thriftMaxFrameSize = this.__isset.thriftMaxFrameSize; - if(__isset.isReadOnly) - { - tmp397.IsReadOnly = this.IsReadOnly; - } - tmp397.__isset.isReadOnly = this.__isset.isReadOnly; - if((BuildInfo != null) && __isset.buildInfo) - { - tmp397.BuildInfo = this.BuildInfo; - } - tmp397.__isset.buildInfo = this.__isset.buildInfo; - if((Logo != null) && __isset.logo) - { - tmp397.Logo = this.Logo; - } - tmp397.__isset.logo = this.__isset.logo; - return tmp397; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -208,13 +165,13 @@ public ServerProperties DeepCopy() if (field.Type == TType.List) { { - TList _list398 = await iprot.ReadListBeginAsync(cancellationToken); - SupportedTimeAggregationOperations = new List(_list398.Count); - for(int _i399 = 0; _i399 < _list398.Count; ++_i399) + TList _list374 = await iprot.ReadListBeginAsync(cancellationToken); + SupportedTimeAggregationOperations = new List(_list374.Count); + for(int _i375 = 0; _i375 < _list374.Count; ++_i375) { - string _elem400; - _elem400 = await iprot.ReadStringAsync(cancellationToken); - SupportedTimeAggregationOperations.Add(_elem400); + string _elem376; + _elem376 = await iprot.ReadStringAsync(cancellationToken); + SupportedTimeAggregationOperations.Add(_elem376); } await iprot.ReadListEndAsync(cancellationToken); } @@ -339,9 +296,9 @@ public ServerProperties DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, SupportedTimeAggregationOperations.Count), cancellationToken); - foreach (string _iter401 in SupportedTimeAggregationOperations) + foreach (string _iter377 in SupportedTimeAggregationOperations) { - await oprot.WriteStringAsync(_iter401, cancellationToken); + await oprot.WriteStringAsync(_iter377, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TAINodeConfiguration.cs b/src/Apache.IoTDB/Rpc/Generated/TAINodeConfiguration.cs index 29f1fa8..bc17548 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TAINodeConfiguration.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TAINodeConfiguration.cs @@ -46,20 +46,6 @@ public TAINodeConfiguration(TAINodeLocation location, TNodeResource resource) : this.Resource = resource; } - public TAINodeConfiguration DeepCopy() - { - var tmp30 = new TAINodeConfiguration(); - if((Location != null)) - { - tmp30.Location = (TAINodeLocation)this.Location.DeepCopy(); - } - if((Resource != null)) - { - tmp30.Resource = (TNodeResource)this.Resource.DeepCopy(); - } - return tmp30; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TAINodeLocation.cs b/src/Apache.IoTDB/Rpc/Generated/TAINodeLocation.cs index 976f2c1..d090f57 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TAINodeLocation.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TAINodeLocation.cs @@ -46,17 +46,6 @@ public TAINodeLocation(int aiNodeId, TEndPoint internalEndPoint) : this() this.InternalEndPoint = internalEndPoint; } - public TAINodeLocation DeepCopy() - { - var tmp26 = new TAINodeLocation(); - tmp26.AiNodeId = this.AiNodeId; - if((InternalEndPoint != null)) - { - tmp26.InternalEndPoint = (TEndPoint)this.InternalEndPoint.DeepCopy(); - } - return tmp26; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TAggregationType.cs b/src/Apache.IoTDB/Rpc/Generated/TAggregationType.cs index fb8929f..b2af6d7 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TAggregationType.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TAggregationType.cs @@ -33,4 +33,10 @@ public enum TAggregationType MAX_BY = 20, MIN_BY = 21, UDAF = 22, + FIRST = 23, + LAST = 24, + FIRST_BY = 25, + LAST_BY = 26, + MIN = 27, + MAX = 28, } diff --git a/src/Apache.IoTDB/Rpc/Generated/TConfigNodeLocation.cs b/src/Apache.IoTDB/Rpc/Generated/TConfigNodeLocation.cs index 30536a5..f43a427 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TConfigNodeLocation.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TConfigNodeLocation.cs @@ -49,21 +49,6 @@ public TConfigNodeLocation(int configNodeId, TEndPoint internalEndPoint, TEndPoi this.ConsensusEndPoint = consensusEndPoint; } - public TConfigNodeLocation DeepCopy() - { - var tmp22 = new TConfigNodeLocation(); - tmp22.ConfigNodeId = this.ConfigNodeId; - if((InternalEndPoint != null)) - { - tmp22.InternalEndPoint = (TEndPoint)this.InternalEndPoint.DeepCopy(); - } - if((ConsensusEndPoint != null)) - { - tmp22.ConsensusEndPoint = (TEndPoint)this.ConsensusEndPoint.DeepCopy(); - } - return tmp22; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TConsensusGroupId.cs b/src/Apache.IoTDB/Rpc/Generated/TConsensusGroupId.cs index 867226b..34492a9 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TConsensusGroupId.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TConsensusGroupId.cs @@ -50,14 +50,6 @@ public TConsensusGroupId(TConsensusGroupType type, int id) : this() this.Id = id; } - public TConsensusGroupId DeepCopy() - { - var tmp8 = new TConsensusGroupId(); - tmp8.Type = this.Type; - tmp8.Id = this.Id; - return tmp8; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TCreateTimeseriesUsingSchemaTemplateReq.cs b/src/Apache.IoTDB/Rpc/Generated/TCreateTimeseriesUsingSchemaTemplateReq.cs index c2627e2..c5b2d41 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TCreateTimeseriesUsingSchemaTemplateReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TCreateTimeseriesUsingSchemaTemplateReq.cs @@ -46,17 +46,6 @@ public TCreateTimeseriesUsingSchemaTemplateReq(long sessionId, List devi this.DevicePathList = devicePathList; } - public TCreateTimeseriesUsingSchemaTemplateReq DeepCopy() - { - var tmp439 = new TCreateTimeseriesUsingSchemaTemplateReq(); - tmp439.SessionId = this.SessionId; - if((DevicePathList != null)) - { - tmp439.DevicePathList = this.DevicePathList.DeepCopy(); - } - return tmp439; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -91,13 +80,13 @@ public TCreateTimeseriesUsingSchemaTemplateReq DeepCopy() if (field.Type == TType.List) { { - TList _list440 = await iprot.ReadListBeginAsync(cancellationToken); - DevicePathList = new List(_list440.Count); - for(int _i441 = 0; _i441 < _list440.Count; ++_i441) + TList _list407 = await iprot.ReadListBeginAsync(cancellationToken); + DevicePathList = new List(_list407.Count); + for(int _i408 = 0; _i408 < _list407.Count; ++_i408) { - string _elem442; - _elem442 = await iprot.ReadStringAsync(cancellationToken); - DevicePathList.Add(_elem442); + string _elem409; + _elem409 = await iprot.ReadStringAsync(cancellationToken); + DevicePathList.Add(_elem409); } await iprot.ReadListEndAsync(cancellationToken); } @@ -154,9 +143,9 @@ public TCreateTimeseriesUsingSchemaTemplateReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, DevicePathList.Count), cancellationToken); - foreach (string _iter443 in DevicePathList) + foreach (string _iter410 in DevicePathList) { - await oprot.WriteStringAsync(_iter443, cancellationToken); + await oprot.WriteStringAsync(_iter410, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TDataNodeConfiguration.cs b/src/Apache.IoTDB/Rpc/Generated/TDataNodeConfiguration.cs index a416447..e56db6c 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TDataNodeConfiguration.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TDataNodeConfiguration.cs @@ -46,20 +46,6 @@ public TDataNodeConfiguration(TDataNodeLocation location, TNodeResource resource this.Resource = resource; } - public TDataNodeConfiguration DeepCopy() - { - var tmp28 = new TDataNodeConfiguration(); - if((Location != null)) - { - tmp28.Location = (TDataNodeLocation)this.Location.DeepCopy(); - } - if((Resource != null)) - { - tmp28.Resource = (TNodeResource)this.Resource.DeepCopy(); - } - return tmp28; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TDataNodeLocation.cs b/src/Apache.IoTDB/Rpc/Generated/TDataNodeLocation.cs index 6d81c2c..303f0b6 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TDataNodeLocation.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TDataNodeLocation.cs @@ -58,33 +58,6 @@ public TDataNodeLocation(int dataNodeId, TEndPoint clientRpcEndPoint, TEndPoint this.SchemaRegionConsensusEndPoint = schemaRegionConsensusEndPoint; } - public TDataNodeLocation DeepCopy() - { - var tmp24 = new TDataNodeLocation(); - tmp24.DataNodeId = this.DataNodeId; - if((ClientRpcEndPoint != null)) - { - tmp24.ClientRpcEndPoint = (TEndPoint)this.ClientRpcEndPoint.DeepCopy(); - } - if((InternalEndPoint != null)) - { - tmp24.InternalEndPoint = (TEndPoint)this.InternalEndPoint.DeepCopy(); - } - if((MPPDataExchangeEndPoint != null)) - { - tmp24.MPPDataExchangeEndPoint = (TEndPoint)this.MPPDataExchangeEndPoint.DeepCopy(); - } - if((DataRegionConsensusEndPoint != null)) - { - tmp24.DataRegionConsensusEndPoint = (TEndPoint)this.DataRegionConsensusEndPoint.DeepCopy(); - } - if((SchemaRegionConsensusEndPoint != null)) - { - tmp24.SchemaRegionConsensusEndPoint = (TEndPoint)this.SchemaRegionConsensusEndPoint.DeepCopy(); - } - return tmp24; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TEndPoint.cs b/src/Apache.IoTDB/Rpc/Generated/TEndPoint.cs index 23dbeb0..db66a12 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TEndPoint.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TEndPoint.cs @@ -46,17 +46,6 @@ public TEndPoint(string ip, int port) : this() this.Port = port; } - public TEndPoint DeepCopy() - { - var tmp0 = new TEndPoint(); - if((Ip != null)) - { - tmp0.Ip = this.Ip; - } - tmp0.Port = this.Port; - return tmp0; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TFile.cs b/src/Apache.IoTDB/Rpc/Generated/TFile.cs index 811fe6f..1ff51fc 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TFile.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TFile.cs @@ -46,20 +46,6 @@ public TFile(string fileName, byte[] file) : this() this.File = file; } - public TFile DeepCopy() - { - var tmp65 = new TFile(); - if((FileName != null)) - { - tmp65.FileName = this.FileName; - } - if((File != null)) - { - tmp65.File = this.File.ToArray(); - } - return tmp65; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TFilesResp.cs b/src/Apache.IoTDB/Rpc/Generated/TFilesResp.cs index 31234ef..6337dce 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TFilesResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TFilesResp.cs @@ -46,20 +46,6 @@ public TFilesResp(TSStatus status, List files) : this() this.Files = files; } - public TFilesResp DeepCopy() - { - var tmp67 = new TFilesResp(); - if((Status != null)) - { - tmp67.Status = (TSStatus)this.Status.DeepCopy(); - } - if((Files != null)) - { - tmp67.Files = this.Files.DeepCopy(); - } - return tmp67; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -95,14 +81,14 @@ public TFilesResp DeepCopy() if (field.Type == TType.List) { { - TList _list68 = await iprot.ReadListBeginAsync(cancellationToken); - Files = new List(_list68.Count); - for(int _i69 = 0; _i69 < _list68.Count; ++_i69) + TList _list48 = await iprot.ReadListBeginAsync(cancellationToken); + Files = new List(_list48.Count); + for(int _i49 = 0; _i49 < _list48.Count; ++_i49) { - TFile _elem70; - _elem70 = new TFile(); - await _elem70.ReadAsync(iprot, cancellationToken); - Files.Add(_elem70); + TFile _elem50; + _elem50 = new TFile(); + await _elem50.ReadAsync(iprot, cancellationToken); + Files.Add(_elem50); } await iprot.ReadListEndAsync(cancellationToken); } @@ -162,9 +148,9 @@ public TFilesResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Struct, Files.Count), cancellationToken); - foreach (TFile _iter71 in Files) + foreach (TFile _iter51 in Files) { - await _iter71.WriteAsync(oprot, cancellationToken); + await _iter51.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 214247f..79860a3 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TFlushReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TFlushReq.cs @@ -72,22 +72,6 @@ public TFlushReq() { } - public TFlushReq DeepCopy() - { - var tmp32 = new TFlushReq(); - if((IsSeq != null) && __isset.isSeq) - { - tmp32.IsSeq = this.IsSeq; - } - tmp32.__isset.isSeq = this.__isset.isSeq; - if((StorageGroups != null) && __isset.storageGroups) - { - tmp32.StorageGroups = this.StorageGroups.DeepCopy(); - } - tmp32.__isset.storageGroups = this.__isset.storageGroups; - return tmp32; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -119,13 +103,13 @@ public TFlushReq DeepCopy() if (field.Type == TType.List) { { - TList _list33 = await iprot.ReadListBeginAsync(cancellationToken); - StorageGroups = new List(_list33.Count); - for(int _i34 = 0; _i34 < _list33.Count; ++_i34) + TList _list20 = await iprot.ReadListBeginAsync(cancellationToken); + StorageGroups = new List(_list20.Count); + for(int _i21 = 0; _i21 < _list20.Count; ++_i21) { - string _elem35; - _elem35 = await iprot.ReadStringAsync(cancellationToken); - StorageGroups.Add(_elem35); + string _elem22; + _elem22 = await iprot.ReadStringAsync(cancellationToken); + StorageGroups.Add(_elem22); } await iprot.ReadListEndAsync(cancellationToken); } @@ -176,9 +160,9 @@ public TFlushReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, StorageGroups.Count), cancellationToken); - foreach (string _iter36 in StorageGroups) + foreach (string _iter23 in StorageGroups) { - await oprot.WriteStringAsync(_iter36, cancellationToken); + await oprot.WriteStringAsync(_iter23, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -219,16 +203,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("TFlushReq("); - int tmp37 = 0; + int tmp24 = 0; if((IsSeq != null) && __isset.isSeq) { - if(0 < tmp37++) { sb.Append(", "); } + if(0 < tmp24++) { sb.Append(", "); } sb.Append("IsSeq: "); IsSeq.ToString(sb); } if((StorageGroups != null) && __isset.storageGroups) { - if(0 < tmp37++) { sb.Append(", "); } + if(0 < tmp24++) { sb.Append(", "); } sb.Append("StorageGroups: "); StorageGroups.ToString(sb); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TLicense.cs b/src/Apache.IoTDB/Rpc/Generated/TLicense.cs index 914e165..173ddf7 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TLicense.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TLicense.cs @@ -64,20 +64,6 @@ public TLicense(long licenseIssueTimestamp, long expireTimestamp, short dataNode this.MlNodeNumLimit = mlNodeNumLimit; } - public TLicense DeepCopy() - { - var tmp92 = new TLicense(); - tmp92.LicenseIssueTimestamp = this.LicenseIssueTimestamp; - tmp92.ExpireTimestamp = this.ExpireTimestamp; - tmp92.DataNodeNumLimit = this.DataNodeNumLimit; - tmp92.CpuCoreNumLimit = this.CpuCoreNumLimit; - tmp92.DeviceNumLimit = this.DeviceNumLimit; - tmp92.SensorNumLimit = this.SensorNumLimit; - tmp92.DisconnectionFromActiveNodeTimeLimit = this.DisconnectionFromActiveNodeTimeLimit; - tmp92.MlNodeNumLimit = this.MlNodeNumLimit; - return tmp92; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TLoadSample.cs b/src/Apache.IoTDB/Rpc/Generated/TLoadSample.cs index 4aa6e38..d4248b9 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TLoadSample.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TLoadSample.cs @@ -52,16 +52,6 @@ public TLoadSample(double cpuUsageRate, double memoryUsageRate, double diskUsage this.FreeDiskSpace = freeDiskSpace; } - public TLoadSample DeepCopy() - { - var tmp94 = new TLoadSample(); - tmp94.CpuUsageRate = this.CpuUsageRate; - tmp94.MemoryUsageRate = this.MemoryUsageRate; - tmp94.DiskUsageRate = this.DiskUsageRate; - tmp94.FreeDiskSpace = this.FreeDiskSpace; - return tmp94; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TNodeLocations.cs b/src/Apache.IoTDB/Rpc/Generated/TNodeLocations.cs index 16f50f8..a00dd53 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TNodeLocations.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TNodeLocations.cs @@ -72,22 +72,6 @@ public TNodeLocations() { } - public TNodeLocations DeepCopy() - { - var tmp108 = new TNodeLocations(); - if((ConfigNodeLocations != null) && __isset.configNodeLocations) - { - tmp108.ConfigNodeLocations = this.ConfigNodeLocations.DeepCopy(); - } - tmp108.__isset.configNodeLocations = this.__isset.configNodeLocations; - if((DataNodeLocations != null) && __isset.dataNodeLocations) - { - tmp108.DataNodeLocations = this.DataNodeLocations.DeepCopy(); - } - tmp108.__isset.dataNodeLocations = this.__isset.dataNodeLocations; - return tmp108; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -109,14 +93,14 @@ public TNodeLocations DeepCopy() if (field.Type == TType.List) { { - TList _list109 = await iprot.ReadListBeginAsync(cancellationToken); - ConfigNodeLocations = new List(_list109.Count); - for(int _i110 = 0; _i110 < _list109.Count; ++_i110) + TList _list77 = await iprot.ReadListBeginAsync(cancellationToken); + ConfigNodeLocations = new List(_list77.Count); + for(int _i78 = 0; _i78 < _list77.Count; ++_i78) { - TConfigNodeLocation _elem111; - _elem111 = new TConfigNodeLocation(); - await _elem111.ReadAsync(iprot, cancellationToken); - ConfigNodeLocations.Add(_elem111); + TConfigNodeLocation _elem79; + _elem79 = new TConfigNodeLocation(); + await _elem79.ReadAsync(iprot, cancellationToken); + ConfigNodeLocations.Add(_elem79); } await iprot.ReadListEndAsync(cancellationToken); } @@ -130,14 +114,14 @@ public TNodeLocations DeepCopy() if (field.Type == TType.List) { { - TList _list112 = await iprot.ReadListBeginAsync(cancellationToken); - DataNodeLocations = new List(_list112.Count); - for(int _i113 = 0; _i113 < _list112.Count; ++_i113) + TList _list80 = await iprot.ReadListBeginAsync(cancellationToken); + DataNodeLocations = new List(_list80.Count); + for(int _i81 = 0; _i81 < _list80.Count; ++_i81) { - TDataNodeLocation _elem114; - _elem114 = new TDataNodeLocation(); - await _elem114.ReadAsync(iprot, cancellationToken); - DataNodeLocations.Add(_elem114); + TDataNodeLocation _elem82; + _elem82 = new TDataNodeLocation(); + await _elem82.ReadAsync(iprot, cancellationToken); + DataNodeLocations.Add(_elem82); } await iprot.ReadListEndAsync(cancellationToken); } @@ -179,9 +163,9 @@ public TNodeLocations DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Struct, ConfigNodeLocations.Count), cancellationToken); - foreach (TConfigNodeLocation _iter115 in ConfigNodeLocations) + foreach (TConfigNodeLocation _iter83 in ConfigNodeLocations) { - await _iter115.WriteAsync(oprot, cancellationToken); + await _iter83.WriteAsync(oprot, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -195,9 +179,9 @@ public TNodeLocations DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Struct, DataNodeLocations.Count), cancellationToken); - foreach (TDataNodeLocation _iter116 in DataNodeLocations) + foreach (TDataNodeLocation _iter84 in DataNodeLocations) { - await _iter116.WriteAsync(oprot, cancellationToken); + await _iter84.WriteAsync(oprot, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -238,16 +222,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("TNodeLocations("); - int tmp117 = 0; + int tmp85 = 0; if((ConfigNodeLocations != null) && __isset.configNodeLocations) { - if(0 < tmp117++) { sb.Append(", "); } + if(0 < tmp85++) { sb.Append(", "); } sb.Append("ConfigNodeLocations: "); ConfigNodeLocations.ToString(sb); } if((DataNodeLocations != null) && __isset.dataNodeLocations) { - if(0 < tmp117++) { sb.Append(", "); } + if(0 < tmp85++) { sb.Append(", "); } sb.Append("DataNodeLocations: "); DataNodeLocations.ToString(sb); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TNodeResource.cs b/src/Apache.IoTDB/Rpc/Generated/TNodeResource.cs index fc2083c..3df3303 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TNodeResource.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TNodeResource.cs @@ -46,14 +46,6 @@ public TNodeResource(int cpuCoreNum, long maxMemory) : this() this.MaxMemory = maxMemory; } - public TNodeResource DeepCopy() - { - var tmp20 = new TNodeResource(); - tmp20.CpuCoreNum = this.CpuCoreNum; - tmp20.MaxMemory = this.MaxMemory; - return tmp20; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TPipeSubscribeReq.cs b/src/Apache.IoTDB/Rpc/Generated/TPipeSubscribeReq.cs index 5322c69..bf1e167 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TPipeSubscribeReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TPipeSubscribeReq.cs @@ -67,19 +67,6 @@ public TPipeSubscribeReq(sbyte version, short type) : this() this.Type = type; } - public TPipeSubscribeReq DeepCopy() - { - var tmp453 = new TPipeSubscribeReq(); - tmp453.Version = this.Version; - tmp453.Type = this.Type; - if((Body != null) && __isset.body) - { - tmp453.Body = this.Body.ToArray(); - } - tmp453.__isset.body = this.__isset.body; - return tmp453; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TPipeSubscribeResp.cs b/src/Apache.IoTDB/Rpc/Generated/TPipeSubscribeResp.cs index ce31469..e44ac85 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TPipeSubscribeResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TPipeSubscribeResp.cs @@ -70,23 +70,6 @@ public TPipeSubscribeResp(TSStatus status, sbyte version, short type) : this() this.Type = type; } - public TPipeSubscribeResp DeepCopy() - { - var tmp455 = new TPipeSubscribeResp(); - if((Status != null)) - { - tmp455.Status = (TSStatus)this.Status.DeepCopy(); - } - tmp455.Version = this.Version; - tmp455.Type = this.Type; - if((Body != null) && __isset.body) - { - tmp455.Body = this.Body.DeepCopy(); - } - tmp455.__isset.body = this.__isset.body; - return tmp455; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -145,13 +128,13 @@ public TPipeSubscribeResp DeepCopy() if (field.Type == TType.List) { { - TList _list456 = await iprot.ReadListBeginAsync(cancellationToken); - Body = new List(_list456.Count); - for(int _i457 = 0; _i457 < _list456.Count; ++_i457) + TList _list417 = await iprot.ReadListBeginAsync(cancellationToken); + Body = new List(_list417.Count); + for(int _i418 = 0; _i418 < _list417.Count; ++_i418) { - byte[] _elem458; - _elem458 = await iprot.ReadBinaryAsync(cancellationToken); - Body.Add(_elem458); + byte[] _elem419; + _elem419 = await iprot.ReadBinaryAsync(cancellationToken); + Body.Add(_elem419); } await iprot.ReadListEndAsync(cancellationToken); } @@ -226,9 +209,9 @@ public TPipeSubscribeResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Body.Count), cancellationToken); - foreach (byte[] _iter459 in Body) + foreach (byte[] _iter420 in Body) { - await oprot.WriteBinaryAsync(_iter459, cancellationToken); + await oprot.WriteBinaryAsync(_iter420, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TPipeTransferReq.cs b/src/Apache.IoTDB/Rpc/Generated/TPipeTransferReq.cs index 74a98a4..dc854d7 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TPipeTransferReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TPipeTransferReq.cs @@ -49,18 +49,6 @@ public TPipeTransferReq(sbyte version, short type, byte[] body) : this() this.Body = body; } - public TPipeTransferReq DeepCopy() - { - var tmp449 = new TPipeTransferReq(); - tmp449.Version = this.Version; - tmp449.Type = this.Type; - if((Body != null)) - { - tmp449.Body = this.Body.ToArray(); - } - return tmp449; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TPipeTransferResp.cs b/src/Apache.IoTDB/Rpc/Generated/TPipeTransferResp.cs index bafabd4..faaa628 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TPipeTransferResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TPipeTransferResp.cs @@ -64,21 +64,6 @@ public TPipeTransferResp(TSStatus status) : this() this.Status = status; } - public TPipeTransferResp DeepCopy() - { - var tmp451 = new TPipeTransferResp(); - if((Status != null)) - { - tmp451.Status = (TSStatus)this.Status.DeepCopy(); - } - if((Body != null) && __isset.body) - { - tmp451.Body = this.Body.ToArray(); - } - tmp451.__isset.body = this.__isset.body; - return tmp451; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TRegionReplicaSet.cs b/src/Apache.IoTDB/Rpc/Generated/TRegionReplicaSet.cs index 25f7b72..d745048 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TRegionReplicaSet.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TRegionReplicaSet.cs @@ -46,20 +46,6 @@ public TRegionReplicaSet(TConsensusGroupId regionId, List dat this.DataNodeLocations = dataNodeLocations; } - public TRegionReplicaSet DeepCopy() - { - var tmp14 = new TRegionReplicaSet(); - if((RegionId != null)) - { - tmp14.RegionId = (TConsensusGroupId)this.RegionId.DeepCopy(); - } - if((DataNodeLocations != null)) - { - tmp14.DataNodeLocations = this.DataNodeLocations.DeepCopy(); - } - return tmp14; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -95,14 +81,14 @@ public TRegionReplicaSet DeepCopy() if (field.Type == TType.List) { { - TList _list15 = await iprot.ReadListBeginAsync(cancellationToken); - DataNodeLocations = new List(_list15.Count); - for(int _i16 = 0; _i16 < _list15.Count; ++_i16) + TList _list9 = await iprot.ReadListBeginAsync(cancellationToken); + DataNodeLocations = new List(_list9.Count); + for(int _i10 = 0; _i10 < _list9.Count; ++_i10) { - TDataNodeLocation _elem17; - _elem17 = new TDataNodeLocation(); - await _elem17.ReadAsync(iprot, cancellationToken); - DataNodeLocations.Add(_elem17); + TDataNodeLocation _elem11; + _elem11 = new TDataNodeLocation(); + await _elem11.ReadAsync(iprot, cancellationToken); + DataNodeLocations.Add(_elem11); } await iprot.ReadListEndAsync(cancellationToken); } @@ -162,9 +148,9 @@ public TRegionReplicaSet DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Struct, DataNodeLocations.Count), cancellationToken); - foreach (TDataNodeLocation _iter18 in DataNodeLocations) + foreach (TDataNodeLocation _iter12 in DataNodeLocations) { - await _iter18.WriteAsync(oprot, cancellationToken); + await _iter12.WriteAsync(oprot, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSAggregationQueryReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSAggregationQueryReq.cs index 3395474..c6b14e0 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSAggregationQueryReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSAggregationQueryReq.cs @@ -163,57 +163,6 @@ public TSAggregationQueryReq(long sessionId, long statementId, List path this.Aggregations = aggregations; } - public TSAggregationQueryReq DeepCopy() - { - var tmp336 = new TSAggregationQueryReq(); - tmp336.SessionId = this.SessionId; - tmp336.StatementId = this.StatementId; - if((Paths != null)) - { - tmp336.Paths = this.Paths.DeepCopy(); - } - if((Aggregations != null)) - { - tmp336.Aggregations = this.Aggregations.DeepCopy(); - } - if(__isset.startTime) - { - tmp336.StartTime = this.StartTime; - } - tmp336.__isset.startTime = this.__isset.startTime; - if(__isset.endTime) - { - tmp336.EndTime = this.EndTime; - } - tmp336.__isset.endTime = this.__isset.endTime; - if(__isset.interval) - { - tmp336.Interval = this.Interval; - } - tmp336.__isset.interval = this.__isset.interval; - if(__isset.slidingStep) - { - tmp336.SlidingStep = this.SlidingStep; - } - tmp336.__isset.slidingStep = this.__isset.slidingStep; - if(__isset.fetchSize) - { - tmp336.FetchSize = this.FetchSize; - } - tmp336.__isset.fetchSize = this.__isset.fetchSize; - if(__isset.timeout) - { - tmp336.Timeout = this.Timeout; - } - tmp336.__isset.timeout = this.__isset.timeout; - if(__isset.legalPathNodes) - { - tmp336.LegalPathNodes = this.LegalPathNodes; - } - tmp336.__isset.legalPathNodes = this.__isset.legalPathNodes; - return tmp336; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -261,13 +210,13 @@ public TSAggregationQueryReq DeepCopy() if (field.Type == TType.List) { { - TList _list337 = await iprot.ReadListBeginAsync(cancellationToken); - Paths = new List(_list337.Count); - for(int _i338 = 0; _i338 < _list337.Count; ++_i338) + TList _list316 = await iprot.ReadListBeginAsync(cancellationToken); + Paths = new List(_list316.Count); + for(int _i317 = 0; _i317 < _list316.Count; ++_i317) { - string _elem339; - _elem339 = await iprot.ReadStringAsync(cancellationToken); - Paths.Add(_elem339); + string _elem318; + _elem318 = await iprot.ReadStringAsync(cancellationToken); + Paths.Add(_elem318); } await iprot.ReadListEndAsync(cancellationToken); } @@ -282,13 +231,13 @@ public TSAggregationQueryReq DeepCopy() if (field.Type == TType.List) { { - TList _list340 = await iprot.ReadListBeginAsync(cancellationToken); - Aggregations = new List(_list340.Count); - for(int _i341 = 0; _i341 < _list340.Count; ++_i341) + TList _list319 = await iprot.ReadListBeginAsync(cancellationToken); + Aggregations = new List(_list319.Count); + for(int _i320 = 0; _i320 < _list319.Count; ++_i320) { - TAggregationType _elem342; - _elem342 = (TAggregationType)await iprot.ReadI32Async(cancellationToken); - Aggregations.Add(_elem342); + TAggregationType _elem321; + _elem321 = (TAggregationType)await iprot.ReadI32Async(cancellationToken); + Aggregations.Add(_elem321); } await iprot.ReadListEndAsync(cancellationToken); } @@ -429,9 +378,9 @@ public TSAggregationQueryReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken); - foreach (string _iter343 in Paths) + foreach (string _iter322 in Paths) { - await oprot.WriteStringAsync(_iter343, cancellationToken); + await oprot.WriteStringAsync(_iter322, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -445,9 +394,9 @@ public TSAggregationQueryReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Aggregations.Count), cancellationToken); - foreach (TAggregationType _iter344 in Aggregations) + foreach (TAggregationType _iter323 in Aggregations) { - await oprot.WriteI32Async((int)_iter344, cancellationToken); + await oprot.WriteI32Async((int)_iter323, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSAppendSchemaTemplateReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSAppendSchemaTemplateReq.cs index f5b5f1a..8fac227 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSAppendSchemaTemplateReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSAppendSchemaTemplateReq.cs @@ -61,34 +61,6 @@ public TSAppendSchemaTemplateReq(long sessionId, string name, bool isAligned, Li this.Compressors = compressors; } - public TSAppendSchemaTemplateReq DeepCopy() - { - var tmp407 = new TSAppendSchemaTemplateReq(); - tmp407.SessionId = this.SessionId; - if((Name != null)) - { - tmp407.Name = this.Name; - } - tmp407.IsAligned = this.IsAligned; - if((Measurements != null)) - { - tmp407.Measurements = this.Measurements.DeepCopy(); - } - if((DataTypes != null)) - { - tmp407.DataTypes = this.DataTypes.DeepCopy(); - } - if((Encodings != null)) - { - tmp407.Encodings = this.Encodings.DeepCopy(); - } - if((Compressors != null)) - { - tmp407.Compressors = this.Compressors.DeepCopy(); - } - return tmp407; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -150,13 +122,13 @@ public TSAppendSchemaTemplateReq DeepCopy() if (field.Type == TType.List) { { - TList _list408 = await iprot.ReadListBeginAsync(cancellationToken); - Measurements = new List(_list408.Count); - for(int _i409 = 0; _i409 < _list408.Count; ++_i409) + TList _list381 = await iprot.ReadListBeginAsync(cancellationToken); + Measurements = new List(_list381.Count); + for(int _i382 = 0; _i382 < _list381.Count; ++_i382) { - string _elem410; - _elem410 = await iprot.ReadStringAsync(cancellationToken); - Measurements.Add(_elem410); + string _elem383; + _elem383 = await iprot.ReadStringAsync(cancellationToken); + Measurements.Add(_elem383); } await iprot.ReadListEndAsync(cancellationToken); } @@ -171,13 +143,13 @@ public TSAppendSchemaTemplateReq DeepCopy() if (field.Type == TType.List) { { - TList _list411 = await iprot.ReadListBeginAsync(cancellationToken); - DataTypes = new List(_list411.Count); - for(int _i412 = 0; _i412 < _list411.Count; ++_i412) + TList _list384 = await iprot.ReadListBeginAsync(cancellationToken); + DataTypes = new List(_list384.Count); + for(int _i385 = 0; _i385 < _list384.Count; ++_i385) { - int _elem413; - _elem413 = await iprot.ReadI32Async(cancellationToken); - DataTypes.Add(_elem413); + int _elem386; + _elem386 = await iprot.ReadI32Async(cancellationToken); + DataTypes.Add(_elem386); } await iprot.ReadListEndAsync(cancellationToken); } @@ -192,13 +164,13 @@ public TSAppendSchemaTemplateReq DeepCopy() if (field.Type == TType.List) { { - TList _list414 = await iprot.ReadListBeginAsync(cancellationToken); - Encodings = new List(_list414.Count); - for(int _i415 = 0; _i415 < _list414.Count; ++_i415) + TList _list387 = await iprot.ReadListBeginAsync(cancellationToken); + Encodings = new List(_list387.Count); + for(int _i388 = 0; _i388 < _list387.Count; ++_i388) { - int _elem416; - _elem416 = await iprot.ReadI32Async(cancellationToken); - Encodings.Add(_elem416); + int _elem389; + _elem389 = await iprot.ReadI32Async(cancellationToken); + Encodings.Add(_elem389); } await iprot.ReadListEndAsync(cancellationToken); } @@ -213,13 +185,13 @@ public TSAppendSchemaTemplateReq DeepCopy() if (field.Type == TType.List) { { - TList _list417 = await iprot.ReadListBeginAsync(cancellationToken); - Compressors = new List(_list417.Count); - for(int _i418 = 0; _i418 < _list417.Count; ++_i418) + TList _list390 = await iprot.ReadListBeginAsync(cancellationToken); + Compressors = new List(_list390.Count); + for(int _i391 = 0; _i391 < _list390.Count; ++_i391) { - int _elem419; - _elem419 = await iprot.ReadI32Async(cancellationToken); - Compressors.Add(_elem419); + int _elem392; + _elem392 = await iprot.ReadI32Async(cancellationToken); + Compressors.Add(_elem392); } await iprot.ReadListEndAsync(cancellationToken); } @@ -311,9 +283,9 @@ public TSAppendSchemaTemplateReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Measurements.Count), cancellationToken); - foreach (string _iter420 in Measurements) + foreach (string _iter393 in Measurements) { - await oprot.WriteStringAsync(_iter420, cancellationToken); + await oprot.WriteStringAsync(_iter393, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -327,9 +299,9 @@ public TSAppendSchemaTemplateReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, DataTypes.Count), cancellationToken); - foreach (int _iter421 in DataTypes) + foreach (int _iter394 in DataTypes) { - await oprot.WriteI32Async(_iter421, cancellationToken); + await oprot.WriteI32Async(_iter394, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -343,9 +315,9 @@ public TSAppendSchemaTemplateReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Encodings.Count), cancellationToken); - foreach (int _iter422 in Encodings) + foreach (int _iter395 in Encodings) { - await oprot.WriteI32Async(_iter422, cancellationToken); + await oprot.WriteI32Async(_iter395, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -359,9 +331,9 @@ public TSAppendSchemaTemplateReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Compressors.Count), cancellationToken); - foreach (int _iter423 in Compressors) + foreach (int _iter396 in Compressors) { - await oprot.WriteI32Async(_iter423, cancellationToken); + await oprot.WriteI32Async(_iter396, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSBackupConfigurationResp.cs b/src/Apache.IoTDB/Rpc/Generated/TSBackupConfigurationResp.cs index d35999b..5cdb21f 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSBackupConfigurationResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSBackupConfigurationResp.cs @@ -94,31 +94,6 @@ public TSBackupConfigurationResp(TSStatus status) : this() this.Status = status; } - public TSBackupConfigurationResp DeepCopy() - { - var tmp461 = new TSBackupConfigurationResp(); - if((Status != null)) - { - tmp461.Status = (TSStatus)this.Status.DeepCopy(); - } - if(__isset.enableOperationSync) - { - tmp461.EnableOperationSync = this.EnableOperationSync; - } - tmp461.__isset.enableOperationSync = this.__isset.enableOperationSync; - if((SecondaryAddress != null) && __isset.secondaryAddress) - { - tmp461.SecondaryAddress = this.SecondaryAddress; - } - tmp461.__isset.secondaryAddress = this.__isset.secondaryAddress; - if(__isset.secondaryPort) - { - tmp461.SecondaryPort = this.SecondaryPort; - } - tmp461.__isset.secondaryPort = this.__isset.secondaryPort; - return tmp461; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSCancelOperationReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSCancelOperationReq.cs index 715b4a0..6cd4f4a 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSCancelOperationReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSCancelOperationReq.cs @@ -46,14 +46,6 @@ public TSCancelOperationReq(long sessionId, long queryId) : this() this.QueryId = queryId; } - public TSCancelOperationReq DeepCopy() - { - var tmp83 = new TSCancelOperationReq(); - tmp83.SessionId = this.SessionId; - tmp83.QueryId = this.QueryId; - return tmp83; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSCloseOperationReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSCloseOperationReq.cs index fe97220..c574d80 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSCloseOperationReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSCloseOperationReq.cs @@ -79,23 +79,6 @@ public TSCloseOperationReq(long sessionId) : this() this.SessionId = sessionId; } - public TSCloseOperationReq DeepCopy() - { - var tmp85 = new TSCloseOperationReq(); - tmp85.SessionId = this.SessionId; - if(__isset.queryId) - { - tmp85.QueryId = this.QueryId; - } - tmp85.__isset.queryId = this.__isset.queryId; - if(__isset.statementId) - { - tmp85.StatementId = this.StatementId; - } - tmp85.__isset.statementId = this.__isset.statementId; - return tmp85; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSCloseSessionReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSCloseSessionReq.cs index 9ba92c1..e0c3a44 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSCloseSessionReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSCloseSessionReq.cs @@ -43,13 +43,6 @@ public TSCloseSessionReq(long sessionId) : this() this.SessionId = sessionId; } - public TSCloseSessionReq DeepCopy() - { - var tmp71 = new TSCloseSessionReq(); - tmp71.SessionId = this.SessionId; - return tmp71; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSConnectionInfo.cs b/src/Apache.IoTDB/Rpc/Generated/TSConnectionInfo.cs index bb7fdcd..95c1a2e 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSConnectionInfo.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSConnectionInfo.cs @@ -56,22 +56,6 @@ public TSConnectionInfo(string userName, long logInTime, string connectionId, TS this.Type = type; } - public TSConnectionInfo DeepCopy() - { - var tmp463 = new TSConnectionInfo(); - if((UserName != null)) - { - tmp463.UserName = this.UserName; - } - tmp463.LogInTime = this.LogInTime; - if((ConnectionId != null)) - { - tmp463.ConnectionId = this.ConnectionId; - } - tmp463.Type = this.Type; - return tmp463; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSConnectionInfoResp.cs b/src/Apache.IoTDB/Rpc/Generated/TSConnectionInfoResp.cs index 6039412..4e5869f 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSConnectionInfoResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSConnectionInfoResp.cs @@ -43,16 +43,6 @@ public TSConnectionInfoResp(List connectionInfoList) : this() this.ConnectionInfoList = connectionInfoList; } - public TSConnectionInfoResp DeepCopy() - { - var tmp465 = new TSConnectionInfoResp(); - if((ConnectionInfoList != null)) - { - tmp465.ConnectionInfoList = this.ConnectionInfoList.DeepCopy(); - } - return tmp465; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -75,14 +65,14 @@ public TSConnectionInfoResp DeepCopy() if (field.Type == TType.List) { { - TList _list466 = await iprot.ReadListBeginAsync(cancellationToken); - ConnectionInfoList = new List(_list466.Count); - for(int _i467 = 0; _i467 < _list466.Count; ++_i467) + TList _list424 = await iprot.ReadListBeginAsync(cancellationToken); + ConnectionInfoList = new List(_list424.Count); + for(int _i425 = 0; _i425 < _list424.Count; ++_i425) { - TSConnectionInfo _elem468; - _elem468 = new TSConnectionInfo(); - await _elem468.ReadAsync(iprot, cancellationToken); - ConnectionInfoList.Add(_elem468); + TSConnectionInfo _elem426; + _elem426 = new TSConnectionInfo(); + await _elem426.ReadAsync(iprot, cancellationToken); + ConnectionInfoList.Add(_elem426); } await iprot.ReadListEndAsync(cancellationToken); } @@ -129,9 +119,9 @@ public TSConnectionInfoResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Struct, ConnectionInfoList.Count), cancellationToken); - foreach (TSConnectionInfo _iter469 in ConnectionInfoList) + foreach (TSConnectionInfo _iter427 in ConnectionInfoList) { - await _iter469.WriteAsync(oprot, cancellationToken); + await _iter427.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 4697d28..94a9316 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSCreateAlignedTimeseriesReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSCreateAlignedTimeseriesReq.cs @@ -109,48 +109,6 @@ public TSCreateAlignedTimeseriesReq(long sessionId, string prefixPath, List(_list279.Count); - for(int _i280 = 0; _i280 < _list279.Count; ++_i280) + TList _list262 = await iprot.ReadListBeginAsync(cancellationToken); + Measurements = new List(_list262.Count); + for(int _i263 = 0; _i263 < _list262.Count; ++_i263) { - string _elem281; - _elem281 = await iprot.ReadStringAsync(cancellationToken); - Measurements.Add(_elem281); + string _elem264; + _elem264 = await iprot.ReadStringAsync(cancellationToken); + Measurements.Add(_elem264); } await iprot.ReadListEndAsync(cancellationToken); } @@ -221,13 +179,13 @@ public TSCreateAlignedTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list282 = await iprot.ReadListBeginAsync(cancellationToken); - DataTypes = new List(_list282.Count); - for(int _i283 = 0; _i283 < _list282.Count; ++_i283) + TList _list265 = await iprot.ReadListBeginAsync(cancellationToken); + DataTypes = new List(_list265.Count); + for(int _i266 = 0; _i266 < _list265.Count; ++_i266) { - int _elem284; - _elem284 = await iprot.ReadI32Async(cancellationToken); - DataTypes.Add(_elem284); + int _elem267; + _elem267 = await iprot.ReadI32Async(cancellationToken); + DataTypes.Add(_elem267); } await iprot.ReadListEndAsync(cancellationToken); } @@ -242,13 +200,13 @@ public TSCreateAlignedTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list285 = await iprot.ReadListBeginAsync(cancellationToken); - Encodings = new List(_list285.Count); - for(int _i286 = 0; _i286 < _list285.Count; ++_i286) + TList _list268 = await iprot.ReadListBeginAsync(cancellationToken); + Encodings = new List(_list268.Count); + for(int _i269 = 0; _i269 < _list268.Count; ++_i269) { - int _elem287; - _elem287 = await iprot.ReadI32Async(cancellationToken); - Encodings.Add(_elem287); + int _elem270; + _elem270 = await iprot.ReadI32Async(cancellationToken); + Encodings.Add(_elem270); } await iprot.ReadListEndAsync(cancellationToken); } @@ -263,13 +221,13 @@ public TSCreateAlignedTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list288 = await iprot.ReadListBeginAsync(cancellationToken); - Compressors = new List(_list288.Count); - for(int _i289 = 0; _i289 < _list288.Count; ++_i289) + TList _list271 = await iprot.ReadListBeginAsync(cancellationToken); + Compressors = new List(_list271.Count); + for(int _i272 = 0; _i272 < _list271.Count; ++_i272) { - int _elem290; - _elem290 = await iprot.ReadI32Async(cancellationToken); - Compressors.Add(_elem290); + int _elem273; + _elem273 = await iprot.ReadI32Async(cancellationToken); + Compressors.Add(_elem273); } await iprot.ReadListEndAsync(cancellationToken); } @@ -284,13 +242,13 @@ public TSCreateAlignedTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list291 = await iprot.ReadListBeginAsync(cancellationToken); - MeasurementAlias = new List(_list291.Count); - for(int _i292 = 0; _i292 < _list291.Count; ++_i292) + TList _list274 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementAlias = new List(_list274.Count); + for(int _i275 = 0; _i275 < _list274.Count; ++_i275) { - string _elem293; - _elem293 = await iprot.ReadStringAsync(cancellationToken); - MeasurementAlias.Add(_elem293); + string _elem276; + _elem276 = await iprot.ReadStringAsync(cancellationToken); + MeasurementAlias.Add(_elem276); } await iprot.ReadListEndAsync(cancellationToken); } @@ -304,25 +262,25 @@ public TSCreateAlignedTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list294 = await iprot.ReadListBeginAsync(cancellationToken); - TagsList = new List>(_list294.Count); - for(int _i295 = 0; _i295 < _list294.Count; ++_i295) + TList _list277 = await iprot.ReadListBeginAsync(cancellationToken); + TagsList = new List>(_list277.Count); + for(int _i278 = 0; _i278 < _list277.Count; ++_i278) { - Dictionary _elem296; + Dictionary _elem279; { - TMap _map297 = await iprot.ReadMapBeginAsync(cancellationToken); - _elem296 = new Dictionary(_map297.Count); - for(int _i298 = 0; _i298 < _map297.Count; ++_i298) + TMap _map280 = await iprot.ReadMapBeginAsync(cancellationToken); + _elem279 = new Dictionary(_map280.Count); + for(int _i281 = 0; _i281 < _map280.Count; ++_i281) { - string _key299; - string _val300; - _key299 = await iprot.ReadStringAsync(cancellationToken); - _val300 = await iprot.ReadStringAsync(cancellationToken); - _elem296[_key299] = _val300; + string _key282; + string _val283; + _key282 = await iprot.ReadStringAsync(cancellationToken); + _val283 = await iprot.ReadStringAsync(cancellationToken); + _elem279[_key282] = _val283; } await iprot.ReadMapEndAsync(cancellationToken); } - TagsList.Add(_elem296); + TagsList.Add(_elem279); } await iprot.ReadListEndAsync(cancellationToken); } @@ -336,25 +294,25 @@ public TSCreateAlignedTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list301 = await iprot.ReadListBeginAsync(cancellationToken); - AttributesList = new List>(_list301.Count); - for(int _i302 = 0; _i302 < _list301.Count; ++_i302) + TList _list284 = await iprot.ReadListBeginAsync(cancellationToken); + AttributesList = new List>(_list284.Count); + for(int _i285 = 0; _i285 < _list284.Count; ++_i285) { - Dictionary _elem303; + Dictionary _elem286; { - TMap _map304 = await iprot.ReadMapBeginAsync(cancellationToken); - _elem303 = new Dictionary(_map304.Count); - for(int _i305 = 0; _i305 < _map304.Count; ++_i305) + TMap _map287 = await iprot.ReadMapBeginAsync(cancellationToken); + _elem286 = new Dictionary(_map287.Count); + for(int _i288 = 0; _i288 < _map287.Count; ++_i288) { - string _key306; - string _val307; - _key306 = await iprot.ReadStringAsync(cancellationToken); - _val307 = await iprot.ReadStringAsync(cancellationToken); - _elem303[_key306] = _val307; + string _key289; + string _val290; + _key289 = await iprot.ReadStringAsync(cancellationToken); + _val290 = await iprot.ReadStringAsync(cancellationToken); + _elem286[_key289] = _val290; } await iprot.ReadMapEndAsync(cancellationToken); } - AttributesList.Add(_elem303); + AttributesList.Add(_elem286); } await iprot.ReadListEndAsync(cancellationToken); } @@ -435,9 +393,9 @@ public TSCreateAlignedTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Measurements.Count), cancellationToken); - foreach (string _iter308 in Measurements) + foreach (string _iter291 in Measurements) { - await oprot.WriteStringAsync(_iter308, cancellationToken); + await oprot.WriteStringAsync(_iter291, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -451,9 +409,9 @@ public TSCreateAlignedTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, DataTypes.Count), cancellationToken); - foreach (int _iter309 in DataTypes) + foreach (int _iter292 in DataTypes) { - await oprot.WriteI32Async(_iter309, cancellationToken); + await oprot.WriteI32Async(_iter292, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -467,9 +425,9 @@ public TSCreateAlignedTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Encodings.Count), cancellationToken); - foreach (int _iter310 in Encodings) + foreach (int _iter293 in Encodings) { - await oprot.WriteI32Async(_iter310, cancellationToken); + await oprot.WriteI32Async(_iter293, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -483,9 +441,9 @@ public TSCreateAlignedTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Compressors.Count), cancellationToken); - foreach (int _iter311 in Compressors) + foreach (int _iter294 in Compressors) { - await oprot.WriteI32Async(_iter311, cancellationToken); + await oprot.WriteI32Async(_iter294, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -499,9 +457,9 @@ public TSCreateAlignedTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, MeasurementAlias.Count), cancellationToken); - foreach (string _iter312 in MeasurementAlias) + foreach (string _iter295 in MeasurementAlias) { - await oprot.WriteStringAsync(_iter312, cancellationToken); + await oprot.WriteStringAsync(_iter295, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -515,14 +473,14 @@ public TSCreateAlignedTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Map, TagsList.Count), cancellationToken); - foreach (Dictionary _iter313 in TagsList) + foreach (Dictionary _iter296 in TagsList) { { - await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter313.Count), cancellationToken); - foreach (string _iter314 in _iter313.Keys) + await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter296.Count), cancellationToken); + foreach (string _iter297 in _iter296.Keys) { - await oprot.WriteStringAsync(_iter314, cancellationToken); - await oprot.WriteStringAsync(_iter313[_iter314], cancellationToken); + await oprot.WriteStringAsync(_iter297, cancellationToken); + await oprot.WriteStringAsync(_iter296[_iter297], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -539,14 +497,14 @@ public TSCreateAlignedTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Map, AttributesList.Count), cancellationToken); - foreach (Dictionary _iter315 in AttributesList) + foreach (Dictionary _iter298 in AttributesList) { { - await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter315.Count), cancellationToken); - foreach (string _iter316 in _iter315.Keys) + await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter298.Count), cancellationToken); + foreach (string _iter299 in _iter298.Keys) { - await oprot.WriteStringAsync(_iter316, cancellationToken); - await oprot.WriteStringAsync(_iter315[_iter316], cancellationToken); + await oprot.WriteStringAsync(_iter299, cancellationToken); + await oprot.WriteStringAsync(_iter298[_iter299], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSCreateMultiTimeseriesReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSCreateMultiTimeseriesReq.cs index 3d2759f..c917a7e 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSCreateMultiTimeseriesReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSCreateMultiTimeseriesReq.cs @@ -121,49 +121,6 @@ public TSCreateMultiTimeseriesReq(long sessionId, List paths, List this.Compressors = compressors; } - public TSCreateMultiTimeseriesReq DeepCopy() - { - var tmp348 = new TSCreateMultiTimeseriesReq(); - tmp348.SessionId = this.SessionId; - if((Paths != null)) - { - tmp348.Paths = this.Paths.DeepCopy(); - } - if((DataTypes != null)) - { - tmp348.DataTypes = this.DataTypes.DeepCopy(); - } - if((Encodings != null)) - { - tmp348.Encodings = this.Encodings.DeepCopy(); - } - if((Compressors != null)) - { - tmp348.Compressors = this.Compressors.DeepCopy(); - } - if((PropsList != null) && __isset.propsList) - { - tmp348.PropsList = this.PropsList.DeepCopy(); - } - tmp348.__isset.propsList = this.__isset.propsList; - if((TagsList != null) && __isset.tagsList) - { - tmp348.TagsList = this.TagsList.DeepCopy(); - } - tmp348.__isset.tagsList = this.__isset.tagsList; - if((AttributesList != null) && __isset.attributesList) - { - tmp348.AttributesList = this.AttributesList.DeepCopy(); - } - tmp348.__isset.attributesList = this.__isset.attributesList; - if((MeasurementAliasList != null) && __isset.measurementAliasList) - { - tmp348.MeasurementAliasList = this.MeasurementAliasList.DeepCopy(); - } - tmp348.__isset.measurementAliasList = this.__isset.measurementAliasList; - return tmp348; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -201,13 +158,13 @@ public TSCreateMultiTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list349 = await iprot.ReadListBeginAsync(cancellationToken); - Paths = new List(_list349.Count); - for(int _i350 = 0; _i350 < _list349.Count; ++_i350) + TList _list326 = await iprot.ReadListBeginAsync(cancellationToken); + Paths = new List(_list326.Count); + for(int _i327 = 0; _i327 < _list326.Count; ++_i327) { - string _elem351; - _elem351 = await iprot.ReadStringAsync(cancellationToken); - Paths.Add(_elem351); + string _elem328; + _elem328 = await iprot.ReadStringAsync(cancellationToken); + Paths.Add(_elem328); } await iprot.ReadListEndAsync(cancellationToken); } @@ -222,13 +179,13 @@ public TSCreateMultiTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list352 = await iprot.ReadListBeginAsync(cancellationToken); - DataTypes = new List(_list352.Count); - for(int _i353 = 0; _i353 < _list352.Count; ++_i353) + TList _list329 = await iprot.ReadListBeginAsync(cancellationToken); + DataTypes = new List(_list329.Count); + for(int _i330 = 0; _i330 < _list329.Count; ++_i330) { - int _elem354; - _elem354 = await iprot.ReadI32Async(cancellationToken); - DataTypes.Add(_elem354); + int _elem331; + _elem331 = await iprot.ReadI32Async(cancellationToken); + DataTypes.Add(_elem331); } await iprot.ReadListEndAsync(cancellationToken); } @@ -243,13 +200,13 @@ public TSCreateMultiTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list355 = await iprot.ReadListBeginAsync(cancellationToken); - Encodings = new List(_list355.Count); - for(int _i356 = 0; _i356 < _list355.Count; ++_i356) + TList _list332 = await iprot.ReadListBeginAsync(cancellationToken); + Encodings = new List(_list332.Count); + for(int _i333 = 0; _i333 < _list332.Count; ++_i333) { - int _elem357; - _elem357 = await iprot.ReadI32Async(cancellationToken); - Encodings.Add(_elem357); + int _elem334; + _elem334 = await iprot.ReadI32Async(cancellationToken); + Encodings.Add(_elem334); } await iprot.ReadListEndAsync(cancellationToken); } @@ -264,13 +221,13 @@ public TSCreateMultiTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list358 = await iprot.ReadListBeginAsync(cancellationToken); - Compressors = new List(_list358.Count); - for(int _i359 = 0; _i359 < _list358.Count; ++_i359) + TList _list335 = await iprot.ReadListBeginAsync(cancellationToken); + Compressors = new List(_list335.Count); + for(int _i336 = 0; _i336 < _list335.Count; ++_i336) { - int _elem360; - _elem360 = await iprot.ReadI32Async(cancellationToken); - Compressors.Add(_elem360); + int _elem337; + _elem337 = await iprot.ReadI32Async(cancellationToken); + Compressors.Add(_elem337); } await iprot.ReadListEndAsync(cancellationToken); } @@ -285,25 +242,25 @@ public TSCreateMultiTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list361 = await iprot.ReadListBeginAsync(cancellationToken); - PropsList = new List>(_list361.Count); - for(int _i362 = 0; _i362 < _list361.Count; ++_i362) + TList _list338 = await iprot.ReadListBeginAsync(cancellationToken); + PropsList = new List>(_list338.Count); + for(int _i339 = 0; _i339 < _list338.Count; ++_i339) { - Dictionary _elem363; + Dictionary _elem340; { - TMap _map364 = await iprot.ReadMapBeginAsync(cancellationToken); - _elem363 = new Dictionary(_map364.Count); - for(int _i365 = 0; _i365 < _map364.Count; ++_i365) + TMap _map341 = await iprot.ReadMapBeginAsync(cancellationToken); + _elem340 = new Dictionary(_map341.Count); + for(int _i342 = 0; _i342 < _map341.Count; ++_i342) { - string _key366; - string _val367; - _key366 = await iprot.ReadStringAsync(cancellationToken); - _val367 = await iprot.ReadStringAsync(cancellationToken); - _elem363[_key366] = _val367; + string _key343; + string _val344; + _key343 = await iprot.ReadStringAsync(cancellationToken); + _val344 = await iprot.ReadStringAsync(cancellationToken); + _elem340[_key343] = _val344; } await iprot.ReadMapEndAsync(cancellationToken); } - PropsList.Add(_elem363); + PropsList.Add(_elem340); } await iprot.ReadListEndAsync(cancellationToken); } @@ -317,25 +274,25 @@ public TSCreateMultiTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list368 = await iprot.ReadListBeginAsync(cancellationToken); - TagsList = new List>(_list368.Count); - for(int _i369 = 0; _i369 < _list368.Count; ++_i369) + TList _list345 = await iprot.ReadListBeginAsync(cancellationToken); + TagsList = new List>(_list345.Count); + for(int _i346 = 0; _i346 < _list345.Count; ++_i346) { - Dictionary _elem370; + Dictionary _elem347; { - TMap _map371 = await iprot.ReadMapBeginAsync(cancellationToken); - _elem370 = new Dictionary(_map371.Count); - for(int _i372 = 0; _i372 < _map371.Count; ++_i372) + TMap _map348 = await iprot.ReadMapBeginAsync(cancellationToken); + _elem347 = new Dictionary(_map348.Count); + for(int _i349 = 0; _i349 < _map348.Count; ++_i349) { - string _key373; - string _val374; - _key373 = await iprot.ReadStringAsync(cancellationToken); - _val374 = await iprot.ReadStringAsync(cancellationToken); - _elem370[_key373] = _val374; + string _key350; + string _val351; + _key350 = await iprot.ReadStringAsync(cancellationToken); + _val351 = await iprot.ReadStringAsync(cancellationToken); + _elem347[_key350] = _val351; } await iprot.ReadMapEndAsync(cancellationToken); } - TagsList.Add(_elem370); + TagsList.Add(_elem347); } await iprot.ReadListEndAsync(cancellationToken); } @@ -349,25 +306,25 @@ public TSCreateMultiTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list375 = await iprot.ReadListBeginAsync(cancellationToken); - AttributesList = new List>(_list375.Count); - for(int _i376 = 0; _i376 < _list375.Count; ++_i376) + TList _list352 = await iprot.ReadListBeginAsync(cancellationToken); + AttributesList = new List>(_list352.Count); + for(int _i353 = 0; _i353 < _list352.Count; ++_i353) { - Dictionary _elem377; + Dictionary _elem354; { - TMap _map378 = await iprot.ReadMapBeginAsync(cancellationToken); - _elem377 = new Dictionary(_map378.Count); - for(int _i379 = 0; _i379 < _map378.Count; ++_i379) + TMap _map355 = await iprot.ReadMapBeginAsync(cancellationToken); + _elem354 = new Dictionary(_map355.Count); + for(int _i356 = 0; _i356 < _map355.Count; ++_i356) { - string _key380; - string _val381; - _key380 = await iprot.ReadStringAsync(cancellationToken); - _val381 = await iprot.ReadStringAsync(cancellationToken); - _elem377[_key380] = _val381; + string _key357; + string _val358; + _key357 = await iprot.ReadStringAsync(cancellationToken); + _val358 = await iprot.ReadStringAsync(cancellationToken); + _elem354[_key357] = _val358; } await iprot.ReadMapEndAsync(cancellationToken); } - AttributesList.Add(_elem377); + AttributesList.Add(_elem354); } await iprot.ReadListEndAsync(cancellationToken); } @@ -381,13 +338,13 @@ public TSCreateMultiTimeseriesReq DeepCopy() if (field.Type == TType.List) { { - TList _list382 = await iprot.ReadListBeginAsync(cancellationToken); - MeasurementAliasList = new List(_list382.Count); - for(int _i383 = 0; _i383 < _list382.Count; ++_i383) + TList _list359 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementAliasList = new List(_list359.Count); + for(int _i360 = 0; _i360 < _list359.Count; ++_i360) { - string _elem384; - _elem384 = await iprot.ReadStringAsync(cancellationToken); - MeasurementAliasList.Add(_elem384); + string _elem361; + _elem361 = await iprot.ReadStringAsync(cancellationToken); + MeasurementAliasList.Add(_elem361); } await iprot.ReadListEndAsync(cancellationToken); } @@ -455,9 +412,9 @@ public TSCreateMultiTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken); - foreach (string _iter385 in Paths) + foreach (string _iter362 in Paths) { - await oprot.WriteStringAsync(_iter385, cancellationToken); + await oprot.WriteStringAsync(_iter362, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -471,9 +428,9 @@ public TSCreateMultiTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, DataTypes.Count), cancellationToken); - foreach (int _iter386 in DataTypes) + foreach (int _iter363 in DataTypes) { - await oprot.WriteI32Async(_iter386, cancellationToken); + await oprot.WriteI32Async(_iter363, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -487,9 +444,9 @@ public TSCreateMultiTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Encodings.Count), cancellationToken); - foreach (int _iter387 in Encodings) + foreach (int _iter364 in Encodings) { - await oprot.WriteI32Async(_iter387, cancellationToken); + await oprot.WriteI32Async(_iter364, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -503,9 +460,9 @@ public TSCreateMultiTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Compressors.Count), cancellationToken); - foreach (int _iter388 in Compressors) + foreach (int _iter365 in Compressors) { - await oprot.WriteI32Async(_iter388, cancellationToken); + await oprot.WriteI32Async(_iter365, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -519,14 +476,14 @@ public TSCreateMultiTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Map, PropsList.Count), cancellationToken); - foreach (Dictionary _iter389 in PropsList) + foreach (Dictionary _iter366 in PropsList) { { - await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter389.Count), cancellationToken); - foreach (string _iter390 in _iter389.Keys) + await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter366.Count), cancellationToken); + foreach (string _iter367 in _iter366.Keys) { - await oprot.WriteStringAsync(_iter390, cancellationToken); - await oprot.WriteStringAsync(_iter389[_iter390], cancellationToken); + await oprot.WriteStringAsync(_iter367, cancellationToken); + await oprot.WriteStringAsync(_iter366[_iter367], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -543,14 +500,14 @@ public TSCreateMultiTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Map, TagsList.Count), cancellationToken); - foreach (Dictionary _iter391 in TagsList) + foreach (Dictionary _iter368 in TagsList) { { - await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter391.Count), cancellationToken); - foreach (string _iter392 in _iter391.Keys) + await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter368.Count), cancellationToken); + foreach (string _iter369 in _iter368.Keys) { - await oprot.WriteStringAsync(_iter392, cancellationToken); - await oprot.WriteStringAsync(_iter391[_iter392], cancellationToken); + await oprot.WriteStringAsync(_iter369, cancellationToken); + await oprot.WriteStringAsync(_iter368[_iter369], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -567,14 +524,14 @@ public TSCreateMultiTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Map, AttributesList.Count), cancellationToken); - foreach (Dictionary _iter393 in AttributesList) + foreach (Dictionary _iter370 in AttributesList) { { - await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter393.Count), cancellationToken); - foreach (string _iter394 in _iter393.Keys) + await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter370.Count), cancellationToken); + foreach (string _iter371 in _iter370.Keys) { - await oprot.WriteStringAsync(_iter394, cancellationToken); - await oprot.WriteStringAsync(_iter393[_iter394], cancellationToken); + await oprot.WriteStringAsync(_iter371, cancellationToken); + await oprot.WriteStringAsync(_iter370[_iter371], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -591,9 +548,9 @@ public TSCreateMultiTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, MeasurementAliasList.Count), cancellationToken); - foreach (string _iter395 in MeasurementAliasList) + foreach (string _iter372 in MeasurementAliasList) { - await oprot.WriteStringAsync(_iter395, cancellationToken); + await oprot.WriteStringAsync(_iter372, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSCreateSchemaTemplateReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSCreateSchemaTemplateReq.cs index 9f618da..8167de9 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSCreateSchemaTemplateReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSCreateSchemaTemplateReq.cs @@ -49,21 +49,6 @@ public TSCreateSchemaTemplateReq(long sessionId, string name, byte[] serializedT this.SerializedTemplate = serializedTemplate; } - public TSCreateSchemaTemplateReq DeepCopy() - { - var tmp405 = new TSCreateSchemaTemplateReq(); - tmp405.SessionId = this.SessionId; - if((Name != null)) - { - tmp405.Name = this.Name; - } - if((SerializedTemplate != null)) - { - tmp405.SerializedTemplate = this.SerializedTemplate.ToArray(); - } - return tmp405; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSCreateTimeseriesReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSCreateTimeseriesReq.cs index 7d65aa6..5dedcfd 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSCreateTimeseriesReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSCreateTimeseriesReq.cs @@ -121,40 +121,6 @@ public TSCreateTimeseriesReq(long sessionId, string path, int dataType, int enco this.Compressor = compressor; } - public TSCreateTimeseriesReq DeepCopy() - { - var tmp261 = new TSCreateTimeseriesReq(); - tmp261.SessionId = this.SessionId; - if((Path != null)) - { - tmp261.Path = this.Path; - } - tmp261.DataType = this.DataType; - tmp261.Encoding = this.Encoding; - tmp261.Compressor = this.Compressor; - if((Props != null) && __isset.props) - { - tmp261.Props = this.Props.DeepCopy(); - } - tmp261.__isset.props = this.__isset.props; - if((Tags != null) && __isset.tags) - { - tmp261.Tags = this.Tags.DeepCopy(); - } - tmp261.__isset.tags = this.__isset.tags; - if((Attributes != null) && __isset.attributes) - { - tmp261.Attributes = this.Attributes.DeepCopy(); - } - tmp261.__isset.attributes = this.__isset.attributes; - if((MeasurementAlias != null) && __isset.measurementAlias) - { - tmp261.MeasurementAlias = this.MeasurementAlias; - } - tmp261.__isset.measurementAlias = this.__isset.measurementAlias; - return tmp261; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -236,15 +202,15 @@ public TSCreateTimeseriesReq DeepCopy() if (field.Type == TType.Map) { { - TMap _map262 = await iprot.ReadMapBeginAsync(cancellationToken); - Props = new Dictionary(_map262.Count); - for(int _i263 = 0; _i263 < _map262.Count; ++_i263) + TMap _map246 = await iprot.ReadMapBeginAsync(cancellationToken); + Props = new Dictionary(_map246.Count); + for(int _i247 = 0; _i247 < _map246.Count; ++_i247) { - string _key264; - string _val265; - _key264 = await iprot.ReadStringAsync(cancellationToken); - _val265 = await iprot.ReadStringAsync(cancellationToken); - Props[_key264] = _val265; + string _key248; + string _val249; + _key248 = await iprot.ReadStringAsync(cancellationToken); + _val249 = await iprot.ReadStringAsync(cancellationToken); + Props[_key248] = _val249; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -258,15 +224,15 @@ public TSCreateTimeseriesReq DeepCopy() if (field.Type == TType.Map) { { - TMap _map266 = await iprot.ReadMapBeginAsync(cancellationToken); - Tags = new Dictionary(_map266.Count); - for(int _i267 = 0; _i267 < _map266.Count; ++_i267) + TMap _map250 = await iprot.ReadMapBeginAsync(cancellationToken); + Tags = new Dictionary(_map250.Count); + for(int _i251 = 0; _i251 < _map250.Count; ++_i251) { - string _key268; - string _val269; - _key268 = await iprot.ReadStringAsync(cancellationToken); - _val269 = await iprot.ReadStringAsync(cancellationToken); - Tags[_key268] = _val269; + string _key252; + string _val253; + _key252 = await iprot.ReadStringAsync(cancellationToken); + _val253 = await iprot.ReadStringAsync(cancellationToken); + Tags[_key252] = _val253; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -280,15 +246,15 @@ public TSCreateTimeseriesReq DeepCopy() if (field.Type == TType.Map) { { - TMap _map270 = await iprot.ReadMapBeginAsync(cancellationToken); - Attributes = new Dictionary(_map270.Count); - for(int _i271 = 0; _i271 < _map270.Count; ++_i271) + TMap _map254 = await iprot.ReadMapBeginAsync(cancellationToken); + Attributes = new Dictionary(_map254.Count); + for(int _i255 = 0; _i255 < _map254.Count; ++_i255) { - string _key272; - string _val273; - _key272 = await iprot.ReadStringAsync(cancellationToken); - _val273 = await iprot.ReadStringAsync(cancellationToken); - Attributes[_key272] = _val273; + string _key256; + string _val257; + _key256 = await iprot.ReadStringAsync(cancellationToken); + _val257 = await iprot.ReadStringAsync(cancellationToken); + Attributes[_key256] = _val257; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -393,10 +359,10 @@ public TSCreateTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, Props.Count), cancellationToken); - foreach (string _iter274 in Props.Keys) + foreach (string _iter258 in Props.Keys) { - await oprot.WriteStringAsync(_iter274, cancellationToken); - await oprot.WriteStringAsync(Props[_iter274], cancellationToken); + await oprot.WriteStringAsync(_iter258, cancellationToken); + await oprot.WriteStringAsync(Props[_iter258], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -410,10 +376,10 @@ public TSCreateTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, Tags.Count), cancellationToken); - foreach (string _iter275 in Tags.Keys) + foreach (string _iter259 in Tags.Keys) { - await oprot.WriteStringAsync(_iter275, cancellationToken); - await oprot.WriteStringAsync(Tags[_iter275], cancellationToken); + await oprot.WriteStringAsync(_iter259, cancellationToken); + await oprot.WriteStringAsync(Tags[_iter259], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -427,10 +393,10 @@ public TSCreateTimeseriesReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, Attributes.Count), cancellationToken); - foreach (string _iter276 in Attributes.Keys) + foreach (string _iter260 in Attributes.Keys) { - await oprot.WriteStringAsync(_iter276, cancellationToken); - await oprot.WriteStringAsync(Attributes[_iter276], cancellationToken); + await oprot.WriteStringAsync(_iter260, cancellationToken); + await oprot.WriteStringAsync(Attributes[_iter260], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSDeleteDataReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSDeleteDataReq.cs index 78cdcc7..249c98c 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSDeleteDataReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSDeleteDataReq.cs @@ -52,19 +52,6 @@ public TSDeleteDataReq(long sessionId, List paths, long startTime, long this.EndTime = endTime; } - public TSDeleteDataReq DeepCopy() - { - var tmp255 = new TSDeleteDataReq(); - tmp255.SessionId = this.SessionId; - if((Paths != null)) - { - tmp255.Paths = this.Paths.DeepCopy(); - } - tmp255.StartTime = this.StartTime; - tmp255.EndTime = this.EndTime; - return tmp255; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -101,13 +88,13 @@ public TSDeleteDataReq DeepCopy() if (field.Type == TType.List) { { - TList _list256 = await iprot.ReadListBeginAsync(cancellationToken); - Paths = new List(_list256.Count); - for(int _i257 = 0; _i257 < _list256.Count; ++_i257) + TList _list241 = await iprot.ReadListBeginAsync(cancellationToken); + Paths = new List(_list241.Count); + for(int _i242 = 0; _i242 < _list241.Count; ++_i242) { - string _elem258; - _elem258 = await iprot.ReadStringAsync(cancellationToken); - Paths.Add(_elem258); + string _elem243; + _elem243 = await iprot.ReadStringAsync(cancellationToken); + Paths.Add(_elem243); } await iprot.ReadListEndAsync(cancellationToken); } @@ -194,9 +181,9 @@ public TSDeleteDataReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken); - foreach (string _iter259 in Paths) + foreach (string _iter244 in Paths) { - await oprot.WriteStringAsync(_iter259, cancellationToken); + await oprot.WriteStringAsync(_iter244, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSDropSchemaTemplateReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSDropSchemaTemplateReq.cs index 406cb92..8454585 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSDropSchemaTemplateReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSDropSchemaTemplateReq.cs @@ -46,17 +46,6 @@ public TSDropSchemaTemplateReq(long sessionId, string templateName) : this() this.TemplateName = templateName; } - public TSDropSchemaTemplateReq DeepCopy() - { - var tmp437 = new TSDropSchemaTemplateReq(); - tmp437.SessionId = this.SessionId; - if((TemplateName != null)) - { - tmp437.TemplateName = this.TemplateName; - } - return tmp437; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSExecuteBatchStatementReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSExecuteBatchStatementReq.cs index 6aeea3f..9d4a1fe 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSExecuteBatchStatementReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSExecuteBatchStatementReq.cs @@ -46,17 +46,6 @@ public TSExecuteBatchStatementReq(long sessionId, List statements) : thi this.Statements = statements; } - public TSExecuteBatchStatementReq DeepCopy() - { - var tmp75 = new TSExecuteBatchStatementReq(); - tmp75.SessionId = this.SessionId; - if((Statements != null)) - { - tmp75.Statements = this.Statements.DeepCopy(); - } - return tmp75; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -91,13 +80,13 @@ public TSExecuteBatchStatementReq DeepCopy() if (field.Type == TType.List) { { - TList _list76 = await iprot.ReadListBeginAsync(cancellationToken); - Statements = new List(_list76.Count); - for(int _i77 = 0; _i77 < _list76.Count; ++_i77) + TList _list71 = await iprot.ReadListBeginAsync(cancellationToken); + Statements = new List(_list71.Count); + for(int _i72 = 0; _i72 < _list71.Count; ++_i72) { - string _elem78; - _elem78 = await iprot.ReadStringAsync(cancellationToken); - Statements.Add(_elem78); + string _elem73; + _elem73 = await iprot.ReadStringAsync(cancellationToken); + Statements.Add(_elem73); } await iprot.ReadListEndAsync(cancellationToken); } @@ -154,9 +143,9 @@ public TSExecuteBatchStatementReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Statements.Count), cancellationToken); - foreach (string _iter79 in Statements) + foreach (string _iter74 in Statements) { - await oprot.WriteStringAsync(_iter79, cancellationToken); + await oprot.WriteStringAsync(_iter74, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSExecuteStatementReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSExecuteStatementReq.cs index 4dae933..c626b3e 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSExecuteStatementReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSExecuteStatementReq.cs @@ -115,38 +115,6 @@ public TSExecuteStatementReq(long sessionId, string statement, long statementId) this.StatementId = statementId; } - public TSExecuteStatementReq DeepCopy() - { - var tmp73 = new TSExecuteStatementReq(); - tmp73.SessionId = this.SessionId; - if((Statement != null)) - { - tmp73.Statement = this.Statement; - } - tmp73.StatementId = this.StatementId; - if(__isset.fetchSize) - { - tmp73.FetchSize = this.FetchSize; - } - tmp73.__isset.fetchSize = this.__isset.fetchSize; - if(__isset.timeout) - { - tmp73.Timeout = this.Timeout; - } - tmp73.__isset.timeout = this.__isset.timeout; - if(__isset.enableRedirectQuery) - { - tmp73.EnableRedirectQuery = this.EnableRedirectQuery; - } - tmp73.__isset.enableRedirectQuery = this.__isset.enableRedirectQuery; - if(__isset.jdbcQuery) - { - tmp73.JdbcQuery = this.JdbcQuery; - } - tmp73.__isset.jdbcQuery = this.__isset.jdbcQuery; - return tmp73; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSExecuteStatementResp.cs b/src/Apache.IoTDB/Rpc/Generated/TSExecuteStatementResp.cs index 790850d..74a5042 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSExecuteStatementResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSExecuteStatementResp.cs @@ -44,6 +44,9 @@ public partial class TSExecuteStatementResp : TBase private TSTracingInfo _tracingInfo; private List _queryResult; private bool _moreData; + private string _database; + private bool _tableModel; + private List _columnIndex2TsBlockColumnIndexList; public TSStatus Status { get; set; } @@ -216,6 +219,45 @@ public bool MoreData } } + public string Database + { + get + { + return _database; + } + set + { + __isset.database = true; + this._database = value; + } + } + + public bool TableModel + { + get + { + return _tableModel; + } + set + { + __isset.tableModel = true; + this._tableModel = value; + } + } + + public List ColumnIndex2TsBlockColumnIndexList + { + get + { + return _columnIndex2TsBlockColumnIndexList; + } + set + { + __isset.columnIndex2TsBlockColumnIndexList = true; + this._columnIndex2TsBlockColumnIndexList = value; + } + } + public Isset __isset; public struct Isset @@ -233,6 +275,9 @@ public struct Isset public bool tracingInfo; public bool queryResult; public bool moreData; + public bool database; + public bool tableModel; + public bool columnIndex2TsBlockColumnIndexList; } public TSExecuteStatementResp() @@ -244,81 +289,6 @@ public TSExecuteStatementResp(TSStatus status) : this() this.Status = status; } - public TSExecuteStatementResp DeepCopy() - { - var tmp30 = new TSExecuteStatementResp(); - if((Status != null)) - { - tmp30.Status = (TSStatus)this.Status.DeepCopy(); - } - if(__isset.queryId) - { - tmp30.QueryId = this.QueryId; - } - tmp30.__isset.queryId = this.__isset.queryId; - if((Columns != null) && __isset.columns) - { - tmp30.Columns = this.Columns.DeepCopy(); - } - tmp30.__isset.columns = this.__isset.columns; - if((OperationType != null) && __isset.operationType) - { - tmp30.OperationType = this.OperationType; - } - tmp30.__isset.operationType = this.__isset.operationType; - if(__isset.ignoreTimeStamp) - { - tmp30.IgnoreTimeStamp = this.IgnoreTimeStamp; - } - tmp30.__isset.ignoreTimeStamp = this.__isset.ignoreTimeStamp; - if((DataTypeList != null) && __isset.dataTypeList) - { - tmp30.DataTypeList = this.DataTypeList.DeepCopy(); - } - tmp30.__isset.dataTypeList = this.__isset.dataTypeList; - if((QueryDataSet != null) && __isset.queryDataSet) - { - tmp30.QueryDataSet = (TSQueryDataSet)this.QueryDataSet.DeepCopy(); - } - tmp30.__isset.queryDataSet = this.__isset.queryDataSet; - if((NonAlignQueryDataSet != null) && __isset.nonAlignQueryDataSet) - { - tmp30.NonAlignQueryDataSet = (TSQueryNonAlignDataSet)this.NonAlignQueryDataSet.DeepCopy(); - } - tmp30.__isset.nonAlignQueryDataSet = this.__isset.nonAlignQueryDataSet; - if((ColumnNameIndexMap != null) && __isset.columnNameIndexMap) - { - tmp30.ColumnNameIndexMap = this.ColumnNameIndexMap.DeepCopy(); - } - tmp30.__isset.columnNameIndexMap = this.__isset.columnNameIndexMap; - if((SgColumns != null) && __isset.sgColumns) - { - tmp30.SgColumns = this.SgColumns.DeepCopy(); - } - tmp30.__isset.sgColumns = this.__isset.sgColumns; - if((AliasColumns != null) && __isset.aliasColumns) - { - tmp30.AliasColumns = this.AliasColumns.DeepCopy(); - } - tmp30.__isset.aliasColumns = this.__isset.aliasColumns; - if((TracingInfo != null) && __isset.tracingInfo) - { - tmp30.TracingInfo = (TSTracingInfo)this.TracingInfo.DeepCopy(); - } - tmp30.__isset.tracingInfo = this.__isset.tracingInfo; - if((QueryResult != null) && __isset.queryResult) - { - tmp30.QueryResult = this.QueryResult.DeepCopy(); - } - tmp30.__isset.queryResult = this.__isset.queryResult; - if(__isset.moreData) - { - tmp30.MoreData = this.MoreData; - } - tmp30.__isset.moreData = this.__isset.moreData; - return tmp30; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -363,13 +333,13 @@ public TSExecuteStatementResp DeepCopy() if (field.Type == TType.List) { { - TList _list31 = await iprot.ReadListBeginAsync(cancellationToken); - Columns = new List(_list31.Count); - for(int _i32 = 0; _i32 < _list31.Count; ++_i32) + TList _list27 = await iprot.ReadListBeginAsync(cancellationToken); + Columns = new List(_list27.Count); + for(int _i28 = 0; _i28 < _list27.Count; ++_i28) { - string _elem33; - _elem33 = await iprot.ReadStringAsync(cancellationToken); - Columns.Add(_elem33); + string _elem29; + _elem29 = await iprot.ReadStringAsync(cancellationToken); + Columns.Add(_elem29); } await iprot.ReadListEndAsync(cancellationToken); } @@ -403,13 +373,13 @@ public TSExecuteStatementResp DeepCopy() if (field.Type == TType.List) { { - TList _list34 = await iprot.ReadListBeginAsync(cancellationToken); - DataTypeList = new List(_list34.Count); - for(int _i35 = 0; _i35 < _list34.Count; ++_i35) + TList _list30 = await iprot.ReadListBeginAsync(cancellationToken); + DataTypeList = new List(_list30.Count); + for(int _i31 = 0; _i31 < _list30.Count; ++_i31) { - string _elem36; - _elem36 = await iprot.ReadStringAsync(cancellationToken); - DataTypeList.Add(_elem36); + string _elem32; + _elem32 = await iprot.ReadStringAsync(cancellationToken); + DataTypeList.Add(_elem32); } await iprot.ReadListEndAsync(cancellationToken); } @@ -445,15 +415,15 @@ public TSExecuteStatementResp DeepCopy() if (field.Type == TType.Map) { { - TMap _map37 = await iprot.ReadMapBeginAsync(cancellationToken); - ColumnNameIndexMap = new Dictionary(_map37.Count); - for(int _i38 = 0; _i38 < _map37.Count; ++_i38) + TMap _map33 = await iprot.ReadMapBeginAsync(cancellationToken); + ColumnNameIndexMap = new Dictionary(_map33.Count); + for(int _i34 = 0; _i34 < _map33.Count; ++_i34) { - string _key39; - int _val40; - _key39 = await iprot.ReadStringAsync(cancellationToken); - _val40 = await iprot.ReadI32Async(cancellationToken); - ColumnNameIndexMap[_key39] = _val40; + string _key35; + int _val36; + _key35 = await iprot.ReadStringAsync(cancellationToken); + _val36 = await iprot.ReadI32Async(cancellationToken); + ColumnNameIndexMap[_key35] = _val36; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -467,13 +437,13 @@ public TSExecuteStatementResp DeepCopy() if (field.Type == TType.List) { { - TList _list41 = await iprot.ReadListBeginAsync(cancellationToken); - SgColumns = new List(_list41.Count); - for(int _i42 = 0; _i42 < _list41.Count; ++_i42) + TList _list37 = await iprot.ReadListBeginAsync(cancellationToken); + SgColumns = new List(_list37.Count); + for(int _i38 = 0; _i38 < _list37.Count; ++_i38) { - string _elem43; - _elem43 = await iprot.ReadStringAsync(cancellationToken); - SgColumns.Add(_elem43); + string _elem39; + _elem39 = await iprot.ReadStringAsync(cancellationToken); + SgColumns.Add(_elem39); } await iprot.ReadListEndAsync(cancellationToken); } @@ -487,13 +457,13 @@ public TSExecuteStatementResp DeepCopy() if (field.Type == TType.List) { { - TList _list44 = await iprot.ReadListBeginAsync(cancellationToken); - AliasColumns = new List(_list44.Count); - for(int _i45 = 0; _i45 < _list44.Count; ++_i45) + TList _list40 = await iprot.ReadListBeginAsync(cancellationToken); + AliasColumns = new List(_list40.Count); + for(int _i41 = 0; _i41 < _list40.Count; ++_i41) { - sbyte _elem46; - _elem46 = await iprot.ReadByteAsync(cancellationToken); - AliasColumns.Add(_elem46); + sbyte _elem42; + _elem42 = await iprot.ReadByteAsync(cancellationToken); + AliasColumns.Add(_elem42); } await iprot.ReadListEndAsync(cancellationToken); } @@ -518,13 +488,13 @@ public TSExecuteStatementResp DeepCopy() if (field.Type == TType.List) { { - TList _list47 = await iprot.ReadListBeginAsync(cancellationToken); - QueryResult = new List(_list47.Count); - for(int _i48 = 0; _i48 < _list47.Count; ++_i48) + TList _list43 = await iprot.ReadListBeginAsync(cancellationToken); + QueryResult = new List(_list43.Count); + for(int _i44 = 0; _i44 < _list43.Count; ++_i44) { - byte[] _elem49; - _elem49 = await iprot.ReadBinaryAsync(cancellationToken); - QueryResult.Add(_elem49); + byte[] _elem45; + _elem45 = await iprot.ReadBinaryAsync(cancellationToken); + QueryResult.Add(_elem45); } await iprot.ReadListEndAsync(cancellationToken); } @@ -544,6 +514,46 @@ public TSExecuteStatementResp DeepCopy() await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; + case 15: + if (field.Type == TType.String) + { + Database = await iprot.ReadStringAsync(cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 16: + if (field.Type == TType.Bool) + { + TableModel = await iprot.ReadBoolAsync(cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 17: + if (field.Type == TType.List) + { + { + TList _list46 = await iprot.ReadListBeginAsync(cancellationToken); + ColumnIndex2TsBlockColumnIndexList = new List(_list46.Count); + for(int _i47 = 0; _i47 < _list46.Count; ++_i47) + { + int _elem48; + _elem48 = await iprot.ReadI32Async(cancellationToken); + ColumnIndex2TsBlockColumnIndexList.Add(_elem48); + } + await iprot.ReadListEndAsync(cancellationToken); + } + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; @@ -598,9 +608,9 @@ public TSExecuteStatementResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Columns.Count), cancellationToken); - foreach (string _iter50 in Columns) + foreach (string _iter49 in Columns) { - await oprot.WriteStringAsync(_iter50, cancellationToken); + await oprot.WriteStringAsync(_iter49, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -632,9 +642,9 @@ public TSExecuteStatementResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, DataTypeList.Count), cancellationToken); - foreach (string _iter51 in DataTypeList) + foreach (string _iter50 in DataTypeList) { - await oprot.WriteStringAsync(_iter51, cancellationToken); + await oprot.WriteStringAsync(_iter50, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -666,10 +676,10 @@ public TSExecuteStatementResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.I32, ColumnNameIndexMap.Count), cancellationToken); - foreach (string _iter52 in ColumnNameIndexMap.Keys) + foreach (string _iter51 in ColumnNameIndexMap.Keys) { - await oprot.WriteStringAsync(_iter52, cancellationToken); - await oprot.WriteI32Async(ColumnNameIndexMap[_iter52], cancellationToken); + await oprot.WriteStringAsync(_iter51, cancellationToken); + await oprot.WriteI32Async(ColumnNameIndexMap[_iter51], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -683,9 +693,9 @@ public TSExecuteStatementResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, SgColumns.Count), cancellationToken); - foreach (string _iter53 in SgColumns) + foreach (string _iter52 in SgColumns) { - await oprot.WriteStringAsync(_iter53, cancellationToken); + await oprot.WriteStringAsync(_iter52, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -699,9 +709,9 @@ public TSExecuteStatementResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Byte, AliasColumns.Count), cancellationToken); - foreach (sbyte _iter54 in AliasColumns) + foreach (sbyte _iter53 in AliasColumns) { - await oprot.WriteByteAsync(_iter54, cancellationToken); + await oprot.WriteByteAsync(_iter53, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -724,9 +734,9 @@ public TSExecuteStatementResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, QueryResult.Count), cancellationToken); - foreach (byte[] _iter55 in QueryResult) + foreach (byte[] _iter54 in QueryResult) { - await oprot.WriteBinaryAsync(_iter55, cancellationToken); + await oprot.WriteBinaryAsync(_iter54, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -741,6 +751,40 @@ public TSExecuteStatementResp DeepCopy() await oprot.WriteBoolAsync(MoreData, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } + if((Database != null) && __isset.database) + { + field.Name = "database"; + field.Type = TType.String; + field.ID = 15; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteStringAsync(Database, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } + if(__isset.tableModel) + { + field.Name = "tableModel"; + field.Type = TType.Bool; + field.ID = 16; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteBoolAsync(TableModel, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } + if((ColumnIndex2TsBlockColumnIndexList != null) && __isset.columnIndex2TsBlockColumnIndexList) + { + field.Name = "columnIndex2TsBlockColumnIndexList"; + field.Type = TType.List; + field.ID = 17; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + { + await oprot.WriteListBeginAsync(new TList(TType.I32, ColumnIndex2TsBlockColumnIndexList.Count), cancellationToken); + foreach (int _iter55 in ColumnIndex2TsBlockColumnIndexList) + { + await oprot.WriteI32Async(_iter55, cancellationToken); + } + await oprot.WriteListEndAsync(cancellationToken); + } + await oprot.WriteFieldEndAsync(cancellationToken); + } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } @@ -767,7 +811,10 @@ public override bool Equals(object that) && ((__isset.aliasColumns == other.__isset.aliasColumns) && ((!__isset.aliasColumns) || (TCollections.Equals(AliasColumns, other.AliasColumns)))) && ((__isset.tracingInfo == other.__isset.tracingInfo) && ((!__isset.tracingInfo) || (System.Object.Equals(TracingInfo, other.TracingInfo)))) && ((__isset.queryResult == other.__isset.queryResult) && ((!__isset.queryResult) || (TCollections.Equals(QueryResult, other.QueryResult)))) - && ((__isset.moreData == other.__isset.moreData) && ((!__isset.moreData) || (System.Object.Equals(MoreData, other.MoreData)))); + && ((__isset.moreData == other.__isset.moreData) && ((!__isset.moreData) || (System.Object.Equals(MoreData, other.MoreData)))) + && ((__isset.database == other.__isset.database) && ((!__isset.database) || (System.Object.Equals(Database, other.Database)))) + && ((__isset.tableModel == other.__isset.tableModel) && ((!__isset.tableModel) || (System.Object.Equals(TableModel, other.TableModel)))) + && ((__isset.columnIndex2TsBlockColumnIndexList == other.__isset.columnIndex2TsBlockColumnIndexList) && ((!__isset.columnIndex2TsBlockColumnIndexList) || (TCollections.Equals(ColumnIndex2TsBlockColumnIndexList, other.ColumnIndex2TsBlockColumnIndexList)))); } public override int GetHashCode() { @@ -829,6 +876,18 @@ public override int GetHashCode() { { hashcode = (hashcode * 397) + MoreData.GetHashCode(); } + if((Database != null) && __isset.database) + { + hashcode = (hashcode * 397) + Database.GetHashCode(); + } + if(__isset.tableModel) + { + hashcode = (hashcode * 397) + TableModel.GetHashCode(); + } + if((ColumnIndex2TsBlockColumnIndexList != null) && __isset.columnIndex2TsBlockColumnIndexList) + { + hashcode = (hashcode * 397) + TCollections.GetHashCode(ColumnIndex2TsBlockColumnIndexList); + } } return hashcode; } @@ -906,6 +965,21 @@ public override string ToString() sb.Append(", MoreData: "); MoreData.ToString(sb); } + if((Database != null) && __isset.database) + { + sb.Append(", Database: "); + Database.ToString(sb); + } + if(__isset.tableModel) + { + sb.Append(", TableModel: "); + TableModel.ToString(sb); + } + if((ColumnIndex2TsBlockColumnIndexList != null) && __isset.columnIndex2TsBlockColumnIndexList) + { + sb.Append(", ColumnIndex2TsBlockColumnIndexList: "); + ColumnIndex2TsBlockColumnIndexList.ToString(sb); + } sb.Append(')'); return sb.ToString(); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSFastLastDataQueryForOneDeviceReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSFastLastDataQueryForOneDeviceReq.cs index 511a42e..3ae1472 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSFastLastDataQueryForOneDeviceReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSFastLastDataQueryForOneDeviceReq.cs @@ -136,51 +136,6 @@ public TSFastLastDataQueryForOneDeviceReq(long sessionId, string db, string devi this.StatementId = statementId; } - public TSFastLastDataQueryForOneDeviceReq DeepCopy() - { - var tmp330 = new TSFastLastDataQueryForOneDeviceReq(); - tmp330.SessionId = this.SessionId; - if((Db != null)) - { - tmp330.Db = this.Db; - } - if((DeviceId != null)) - { - tmp330.DeviceId = this.DeviceId; - } - if((Sensors != null)) - { - tmp330.Sensors = this.Sensors.DeepCopy(); - } - if(__isset.fetchSize) - { - tmp330.FetchSize = this.FetchSize; - } - tmp330.__isset.fetchSize = this.__isset.fetchSize; - tmp330.StatementId = this.StatementId; - if(__isset.enableRedirectQuery) - { - tmp330.EnableRedirectQuery = this.EnableRedirectQuery; - } - tmp330.__isset.enableRedirectQuery = this.__isset.enableRedirectQuery; - if(__isset.jdbcQuery) - { - tmp330.JdbcQuery = this.JdbcQuery; - } - tmp330.__isset.jdbcQuery = this.__isset.jdbcQuery; - if(__isset.timeout) - { - tmp330.Timeout = this.Timeout; - } - tmp330.__isset.timeout = this.__isset.timeout; - if(__isset.legalPathNodes) - { - tmp330.LegalPathNodes = this.LegalPathNodes; - } - tmp330.__isset.legalPathNodes = this.__isset.legalPathNodes; - return tmp330; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -240,13 +195,13 @@ public TSFastLastDataQueryForOneDeviceReq DeepCopy() if (field.Type == TType.List) { { - TList _list331 = await iprot.ReadListBeginAsync(cancellationToken); - Sensors = new List(_list331.Count); - for(int _i332 = 0; _i332 < _list331.Count; ++_i332) + TList _list311 = await iprot.ReadListBeginAsync(cancellationToken); + Sensors = new List(_list311.Count); + for(int _i312 = 0; _i312 < _list311.Count; ++_i312) { - string _elem333; - _elem333 = await iprot.ReadStringAsync(cancellationToken); - Sensors.Add(_elem333); + string _elem313; + _elem313 = await iprot.ReadStringAsync(cancellationToken); + Sensors.Add(_elem313); } await iprot.ReadListEndAsync(cancellationToken); } @@ -394,9 +349,9 @@ public TSFastLastDataQueryForOneDeviceReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Sensors.Count), cancellationToken); - foreach (string _iter334 in Sensors) + foreach (string _iter314 in Sensors) { - await oprot.WriteStringAsync(_iter334, cancellationToken); + await oprot.WriteStringAsync(_iter314, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSFetchMetadataReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSFetchMetadataReq.cs index 0e37b8a..630fab7 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSFetchMetadataReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSFetchMetadataReq.cs @@ -67,22 +67,6 @@ public TSFetchMetadataReq(long sessionId, string type) : this() this.Type = type; } - public TSFetchMetadataReq DeepCopy() - { - var tmp101 = new TSFetchMetadataReq(); - tmp101.SessionId = this.SessionId; - if((Type != null)) - { - tmp101.Type = this.Type; - } - if((ColumnPath != null) && __isset.columnPath) - { - tmp101.ColumnPath = this.ColumnPath; - } - tmp101.__isset.columnPath = this.__isset.columnPath; - return tmp101; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSFetchMetadataResp.cs b/src/Apache.IoTDB/Rpc/Generated/TSFetchMetadataResp.cs index 0561acb..edf27ec 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSFetchMetadataResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSFetchMetadataResp.cs @@ -94,31 +94,6 @@ public TSFetchMetadataResp(TSStatus status) : this() this.Status = status; } - public TSFetchMetadataResp DeepCopy() - { - var tmp95 = new TSFetchMetadataResp(); - if((Status != null)) - { - tmp95.Status = (TSStatus)this.Status.DeepCopy(); - } - if((MetadataInJson != null) && __isset.metadataInJson) - { - tmp95.MetadataInJson = this.MetadataInJson; - } - tmp95.__isset.metadataInJson = this.__isset.metadataInJson; - if((ColumnsList != null) && __isset.columnsList) - { - tmp95.ColumnsList = this.ColumnsList.DeepCopy(); - } - tmp95.__isset.columnsList = this.__isset.columnsList; - if((DataType != null) && __isset.dataType) - { - tmp95.DataType = this.DataType; - } - tmp95.__isset.dataType = this.__isset.dataType; - return tmp95; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -163,13 +138,13 @@ public TSFetchMetadataResp DeepCopy() if (field.Type == TType.List) { { - TList _list96 = await iprot.ReadListBeginAsync(cancellationToken); - ColumnsList = new List(_list96.Count); - for(int _i97 = 0; _i97 < _list96.Count; ++_i97) + TList _list85 = await iprot.ReadListBeginAsync(cancellationToken); + ColumnsList = new List(_list85.Count); + for(int _i86 = 0; _i86 < _list85.Count; ++_i86) { - string _elem98; - _elem98 = await iprot.ReadStringAsync(cancellationToken); - ColumnsList.Add(_elem98); + string _elem87; + _elem87 = await iprot.ReadStringAsync(cancellationToken); + ColumnsList.Add(_elem87); } await iprot.ReadListEndAsync(cancellationToken); } @@ -243,9 +218,9 @@ public TSFetchMetadataResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, ColumnsList.Count), cancellationToken); - foreach (string _iter99 in ColumnsList) + foreach (string _iter88 in ColumnsList) { - await oprot.WriteStringAsync(_iter99, cancellationToken); + await oprot.WriteStringAsync(_iter88, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSFetchResultsReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSFetchResultsReq.cs index 89494bc..828f47d 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSFetchResultsReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSFetchResultsReq.cs @@ -76,25 +76,6 @@ public TSFetchResultsReq(long sessionId, string statement, int fetchSize, long q this.IsAlign = isAlign; } - public TSFetchResultsReq DeepCopy() - { - var tmp87 = new TSFetchResultsReq(); - tmp87.SessionId = this.SessionId; - if((Statement != null)) - { - tmp87.Statement = this.Statement; - } - tmp87.FetchSize = this.FetchSize; - tmp87.QueryId = this.QueryId; - tmp87.IsAlign = this.IsAlign; - if(__isset.timeout) - { - tmp87.Timeout = this.Timeout; - } - tmp87.__isset.timeout = this.__isset.timeout; - return tmp87; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSFetchResultsResp.cs b/src/Apache.IoTDB/Rpc/Generated/TSFetchResultsResp.cs index 5b1ad02..687a230 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSFetchResultsResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSFetchResultsResp.cs @@ -115,38 +115,6 @@ public TSFetchResultsResp(TSStatus status, bool hasResultSet, bool isAlign) : th this.IsAlign = isAlign; } - public TSFetchResultsResp DeepCopy() - { - var tmp89 = new TSFetchResultsResp(); - if((Status != null)) - { - tmp89.Status = (TSStatus)this.Status.DeepCopy(); - } - tmp89.HasResultSet = this.HasResultSet; - tmp89.IsAlign = this.IsAlign; - if((QueryDataSet != null) && __isset.queryDataSet) - { - tmp89.QueryDataSet = (TSQueryDataSet)this.QueryDataSet.DeepCopy(); - } - tmp89.__isset.queryDataSet = this.__isset.queryDataSet; - if((NonAlignQueryDataSet != null) && __isset.nonAlignQueryDataSet) - { - tmp89.NonAlignQueryDataSet = (TSQueryNonAlignDataSet)this.NonAlignQueryDataSet.DeepCopy(); - } - tmp89.__isset.nonAlignQueryDataSet = this.__isset.nonAlignQueryDataSet; - if((QueryResult != null) && __isset.queryResult) - { - tmp89.QueryResult = this.QueryResult.DeepCopy(); - } - tmp89.__isset.queryResult = this.__isset.queryResult; - if(__isset.moreData) - { - tmp89.MoreData = this.MoreData; - } - tmp89.__isset.moreData = this.__isset.moreData; - return tmp89; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -227,13 +195,13 @@ public TSFetchResultsResp DeepCopy() if (field.Type == TType.List) { { - TList _list90 = await iprot.ReadListBeginAsync(cancellationToken); - QueryResult = new List(_list90.Count); - for(int _i91 = 0; _i91 < _list90.Count; ++_i91) + TList _list80 = await iprot.ReadListBeginAsync(cancellationToken); + QueryResult = new List(_list80.Count); + for(int _i81 = 0; _i81 < _list80.Count; ++_i81) { - byte[] _elem92; - _elem92 = await iprot.ReadBinaryAsync(cancellationToken); - QueryResult.Add(_elem92); + byte[] _elem82; + _elem82 = await iprot.ReadBinaryAsync(cancellationToken); + QueryResult.Add(_elem82); } await iprot.ReadListEndAsync(cancellationToken); } @@ -336,9 +304,9 @@ public TSFetchResultsResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, QueryResult.Count), cancellationToken); - foreach (byte[] _iter93 in QueryResult) + foreach (byte[] _iter83 in QueryResult) { - await oprot.WriteBinaryAsync(_iter93, cancellationToken); + await oprot.WriteBinaryAsync(_iter83, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSGetOperationStatusReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSGetOperationStatusReq.cs index 2da3b04..7369e01 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSGetOperationStatusReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSGetOperationStatusReq.cs @@ -46,14 +46,6 @@ public TSGetOperationStatusReq(long sessionId, long queryId) : this() this.QueryId = queryId; } - public TSGetOperationStatusReq DeepCopy() - { - var tmp81 = new TSGetOperationStatusReq(); - tmp81.SessionId = this.SessionId; - tmp81.QueryId = this.QueryId; - return tmp81; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSGetTimeZoneResp.cs b/src/Apache.IoTDB/Rpc/Generated/TSGetTimeZoneResp.cs index 0327bcf..e10c613 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSGetTimeZoneResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSGetTimeZoneResp.cs @@ -46,20 +46,6 @@ public TSGetTimeZoneResp(TSStatus status, string timeZone) : this() this.TimeZone = timeZone; } - public TSGetTimeZoneResp DeepCopy() - { - var tmp103 = new TSGetTimeZoneResp(); - if((Status != null)) - { - tmp103.Status = (TSStatus)this.Status.DeepCopy(); - } - if((TimeZone != null)) - { - tmp103.TimeZone = this.TimeZone; - } - return tmp103; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSGroupByQueryIntervalReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSGroupByQueryIntervalReq.cs index 6ced16a..5f43094 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSGroupByQueryIntervalReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSGroupByQueryIntervalReq.cs @@ -158,54 +158,6 @@ public TSGroupByQueryIntervalReq(long sessionId, long statementId, string device this.AggregationType = aggregationType; } - public TSGroupByQueryIntervalReq DeepCopy() - { - var tmp346 = new TSGroupByQueryIntervalReq(); - tmp346.SessionId = this.SessionId; - tmp346.StatementId = this.StatementId; - if((Device != null)) - { - tmp346.Device = this.Device; - } - if((Measurement != null)) - { - tmp346.Measurement = this.Measurement; - } - tmp346.DataType = this.DataType; - tmp346.AggregationType = this.AggregationType; - if((Database != null) && __isset.database) - { - tmp346.Database = this.Database; - } - tmp346.__isset.database = this.__isset.database; - if(__isset.startTime) - { - tmp346.StartTime = this.StartTime; - } - tmp346.__isset.startTime = this.__isset.startTime; - if(__isset.endTime) - { - tmp346.EndTime = this.EndTime; - } - tmp346.__isset.endTime = this.__isset.endTime; - if(__isset.interval) - { - tmp346.Interval = this.Interval; - } - tmp346.__isset.interval = this.__isset.interval; - if(__isset.fetchSize) - { - tmp346.FetchSize = this.FetchSize; - } - tmp346.__isset.fetchSize = this.__isset.fetchSize; - if(__isset.timeout) - { - tmp346.Timeout = this.Timeout; - } - tmp346.__isset.timeout = this.__isset.timeout; - return tmp346; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordReq.cs index 1699a35..4ac99eb 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordReq.cs @@ -32,6 +32,8 @@ public partial class TSInsertRecordReq : TBase { private bool _isAligned; + private bool _isWriteToTable; + private List _columnCategoryies; public long SessionId { get; set; } @@ -56,11 +58,39 @@ public bool IsAligned } } + public bool IsWriteToTable + { + get + { + return _isWriteToTable; + } + set + { + __isset.isWriteToTable = true; + this._isWriteToTable = value; + } + } + + public List ColumnCategoryies + { + get + { + return _columnCategoryies; + } + set + { + __isset.columnCategoryies = true; + this._columnCategoryies = value; + } + } + public Isset __isset; public struct Isset { public bool isAligned; + public bool isWriteToTable; + public bool columnCategoryies; } public TSInsertRecordReq() @@ -76,31 +106,6 @@ public TSInsertRecordReq(long sessionId, string prefixPath, List measure this.Timestamp = timestamp; } - public TSInsertRecordReq DeepCopy() - { - var tmp107 = new TSInsertRecordReq(); - tmp107.SessionId = this.SessionId; - if((PrefixPath != null)) - { - tmp107.PrefixPath = this.PrefixPath; - } - if((Measurements != null)) - { - tmp107.Measurements = this.Measurements.DeepCopy(); - } - if((Values != null)) - { - tmp107.Values = this.Values.ToArray(); - } - tmp107.Timestamp = this.Timestamp; - if(__isset.isAligned) - { - tmp107.IsAligned = this.IsAligned; - } - tmp107.__isset.isAligned = this.__isset.isAligned; - return tmp107; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -149,13 +154,13 @@ public TSInsertRecordReq DeepCopy() if (field.Type == TType.List) { { - TList _list108 = await iprot.ReadListBeginAsync(cancellationToken); - Measurements = new List(_list108.Count); - for(int _i109 = 0; _i109 < _list108.Count; ++_i109) + TList _list93 = await iprot.ReadListBeginAsync(cancellationToken); + Measurements = new List(_list93.Count); + for(int _i94 = 0; _i94 < _list93.Count; ++_i94) { - string _elem110; - _elem110 = await iprot.ReadStringAsync(cancellationToken); - Measurements.Add(_elem110); + string _elem95; + _elem95 = await iprot.ReadStringAsync(cancellationToken); + Measurements.Add(_elem95); } await iprot.ReadListEndAsync(cancellationToken); } @@ -198,6 +203,36 @@ public TSInsertRecordReq DeepCopy() await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; + case 7: + if (field.Type == TType.Bool) + { + IsWriteToTable = await iprot.ReadBoolAsync(cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 8: + if (field.Type == TType.List) + { + { + TList _list96 = await iprot.ReadListBeginAsync(cancellationToken); + ColumnCategoryies = new List(_list96.Count); + for(int _i97 = 0; _i97 < _list96.Count; ++_i97) + { + sbyte _elem98; + _elem98 = await iprot.ReadByteAsync(cancellationToken); + ColumnCategoryies.Add(_elem98); + } + await iprot.ReadListEndAsync(cancellationToken); + } + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; @@ -265,9 +300,9 @@ public TSInsertRecordReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Measurements.Count), cancellationToken); - foreach (string _iter111 in Measurements) + foreach (string _iter99 in Measurements) { - await oprot.WriteStringAsync(_iter111, cancellationToken); + await oprot.WriteStringAsync(_iter99, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -297,6 +332,31 @@ public TSInsertRecordReq DeepCopy() await oprot.WriteBoolAsync(IsAligned, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } + if(__isset.isWriteToTable) + { + field.Name = "isWriteToTable"; + field.Type = TType.Bool; + field.ID = 7; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteBoolAsync(IsWriteToTable, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } + if((ColumnCategoryies != null) && __isset.columnCategoryies) + { + field.Name = "columnCategoryies"; + field.Type = TType.List; + field.ID = 8; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + { + await oprot.WriteListBeginAsync(new TList(TType.Byte, ColumnCategoryies.Count), cancellationToken); + foreach (sbyte _iter100 in ColumnCategoryies) + { + await oprot.WriteByteAsync(_iter100, cancellationToken); + } + await oprot.WriteListEndAsync(cancellationToken); + } + await oprot.WriteFieldEndAsync(cancellationToken); + } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } @@ -315,7 +375,9 @@ public override bool Equals(object that) && TCollections.Equals(Measurements, other.Measurements) && TCollections.Equals(Values, other.Values) && System.Object.Equals(Timestamp, other.Timestamp) - && ((__isset.isAligned == other.__isset.isAligned) && ((!__isset.isAligned) || (System.Object.Equals(IsAligned, other.IsAligned)))); + && ((__isset.isAligned == other.__isset.isAligned) && ((!__isset.isAligned) || (System.Object.Equals(IsAligned, other.IsAligned)))) + && ((__isset.isWriteToTable == other.__isset.isWriteToTable) && ((!__isset.isWriteToTable) || (System.Object.Equals(IsWriteToTable, other.IsWriteToTable)))) + && ((__isset.columnCategoryies == other.__isset.columnCategoryies) && ((!__isset.columnCategoryies) || (TCollections.Equals(ColumnCategoryies, other.ColumnCategoryies)))); } public override int GetHashCode() { @@ -339,6 +401,14 @@ public override int GetHashCode() { { hashcode = (hashcode * 397) + IsAligned.GetHashCode(); } + if(__isset.isWriteToTable) + { + hashcode = (hashcode * 397) + IsWriteToTable.GetHashCode(); + } + if((ColumnCategoryies != null) && __isset.columnCategoryies) + { + hashcode = (hashcode * 397) + TCollections.GetHashCode(ColumnCategoryies); + } } return hashcode; } @@ -370,6 +440,16 @@ public override string ToString() sb.Append(", IsAligned: "); IsAligned.ToString(sb); } + if(__isset.isWriteToTable) + { + sb.Append(", IsWriteToTable: "); + IsWriteToTable.ToString(sb); + } + if((ColumnCategoryies != null) && __isset.columnCategoryies) + { + sb.Append(", ColumnCategoryies: "); + ColumnCategoryies.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 72468cd..9633c5a 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordsOfOneDeviceReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordsOfOneDeviceReq.cs @@ -76,34 +76,6 @@ public TSInsertRecordsOfOneDeviceReq(long sessionId, string prefixPath, List>(_list190.Count); - for(int _i191 = 0; _i191 < _list190.Count; ++_i191) + TList _list178 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementsList = new List>(_list178.Count); + for(int _i179 = 0; _i179 < _list178.Count; ++_i179) { - List _elem192; + List _elem180; { - TList _list193 = await iprot.ReadListBeginAsync(cancellationToken); - _elem192 = new List(_list193.Count); - for(int _i194 = 0; _i194 < _list193.Count; ++_i194) + TList _list181 = await iprot.ReadListBeginAsync(cancellationToken); + _elem180 = new List(_list181.Count); + for(int _i182 = 0; _i182 < _list181.Count; ++_i182) { - string _elem195; - _elem195 = await iprot.ReadStringAsync(cancellationToken); - _elem192.Add(_elem195); + string _elem183; + _elem183 = await iprot.ReadStringAsync(cancellationToken); + _elem180.Add(_elem183); } await iprot.ReadListEndAsync(cancellationToken); } - MeasurementsList.Add(_elem192); + MeasurementsList.Add(_elem180); } await iprot.ReadListEndAsync(cancellationToken); } @@ -183,13 +155,13 @@ public TSInsertRecordsOfOneDeviceReq DeepCopy() if (field.Type == TType.List) { { - TList _list196 = await iprot.ReadListBeginAsync(cancellationToken); - ValuesList = new List(_list196.Count); - for(int _i197 = 0; _i197 < _list196.Count; ++_i197) + TList _list184 = await iprot.ReadListBeginAsync(cancellationToken); + ValuesList = new List(_list184.Count); + for(int _i185 = 0; _i185 < _list184.Count; ++_i185) { - byte[] _elem198; - _elem198 = await iprot.ReadBinaryAsync(cancellationToken); - ValuesList.Add(_elem198); + byte[] _elem186; + _elem186 = await iprot.ReadBinaryAsync(cancellationToken); + ValuesList.Add(_elem186); } await iprot.ReadListEndAsync(cancellationToken); } @@ -204,13 +176,13 @@ public TSInsertRecordsOfOneDeviceReq DeepCopy() if (field.Type == TType.List) { { - TList _list199 = await iprot.ReadListBeginAsync(cancellationToken); - Timestamps = new List(_list199.Count); - for(int _i200 = 0; _i200 < _list199.Count; ++_i200) + TList _list187 = await iprot.ReadListBeginAsync(cancellationToken); + Timestamps = new List(_list187.Count); + for(int _i188 = 0; _i188 < _list187.Count; ++_i188) { - long _elem201; - _elem201 = await iprot.ReadI64Async(cancellationToken); - Timestamps.Add(_elem201); + long _elem189; + _elem189 = await iprot.ReadI64Async(cancellationToken); + Timestamps.Add(_elem189); } await iprot.ReadListEndAsync(cancellationToken); } @@ -298,13 +270,13 @@ public TSInsertRecordsOfOneDeviceReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.List, MeasurementsList.Count), cancellationToken); - foreach (List _iter202 in MeasurementsList) + foreach (List _iter190 in MeasurementsList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter202.Count), cancellationToken); - foreach (string _iter203 in _iter202) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter190.Count), cancellationToken); + foreach (string _iter191 in _iter190) { - await oprot.WriteStringAsync(_iter203, cancellationToken); + await oprot.WriteStringAsync(_iter191, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -321,9 +293,9 @@ public TSInsertRecordsOfOneDeviceReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, ValuesList.Count), cancellationToken); - foreach (byte[] _iter204 in ValuesList) + foreach (byte[] _iter192 in ValuesList) { - await oprot.WriteBinaryAsync(_iter204, cancellationToken); + await oprot.WriteBinaryAsync(_iter192, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -337,9 +309,9 @@ public TSInsertRecordsOfOneDeviceReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I64, Timestamps.Count), cancellationToken); - foreach (long _iter205 in Timestamps) + foreach (long _iter193 in Timestamps) { - await oprot.WriteI64Async(_iter205, cancellationToken); + await oprot.WriteI64Async(_iter193, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordsReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordsReq.cs index 5f1d8dc..945c383 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordsReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSInsertRecordsReq.cs @@ -76,34 +76,6 @@ public TSInsertRecordsReq(long sessionId, List prefixPaths, List(_list168.Count); - for(int _i169 = 0; _i169 < _list168.Count; ++_i169) + TList _list157 = await iprot.ReadListBeginAsync(cancellationToken); + PrefixPaths = new List(_list157.Count); + for(int _i158 = 0; _i158 < _list157.Count; ++_i158) { - string _elem170; - _elem170 = await iprot.ReadStringAsync(cancellationToken); - PrefixPaths.Add(_elem170); + string _elem159; + _elem159 = await iprot.ReadStringAsync(cancellationToken); + PrefixPaths.Add(_elem159); } await iprot.ReadListEndAsync(cancellationToken); } @@ -162,23 +134,23 @@ public TSInsertRecordsReq DeepCopy() if (field.Type == TType.List) { { - TList _list171 = await iprot.ReadListBeginAsync(cancellationToken); - MeasurementsList = new List>(_list171.Count); - for(int _i172 = 0; _i172 < _list171.Count; ++_i172) + TList _list160 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementsList = new List>(_list160.Count); + for(int _i161 = 0; _i161 < _list160.Count; ++_i161) { - List _elem173; + List _elem162; { - TList _list174 = await iprot.ReadListBeginAsync(cancellationToken); - _elem173 = new List(_list174.Count); - for(int _i175 = 0; _i175 < _list174.Count; ++_i175) + TList _list163 = await iprot.ReadListBeginAsync(cancellationToken); + _elem162 = new List(_list163.Count); + for(int _i164 = 0; _i164 < _list163.Count; ++_i164) { - string _elem176; - _elem176 = await iprot.ReadStringAsync(cancellationToken); - _elem173.Add(_elem176); + string _elem165; + _elem165 = await iprot.ReadStringAsync(cancellationToken); + _elem162.Add(_elem165); } await iprot.ReadListEndAsync(cancellationToken); } - MeasurementsList.Add(_elem173); + MeasurementsList.Add(_elem162); } await iprot.ReadListEndAsync(cancellationToken); } @@ -193,13 +165,13 @@ public TSInsertRecordsReq DeepCopy() if (field.Type == TType.List) { { - TList _list177 = await iprot.ReadListBeginAsync(cancellationToken); - ValuesList = new List(_list177.Count); - for(int _i178 = 0; _i178 < _list177.Count; ++_i178) + TList _list166 = await iprot.ReadListBeginAsync(cancellationToken); + ValuesList = new List(_list166.Count); + for(int _i167 = 0; _i167 < _list166.Count; ++_i167) { - byte[] _elem179; - _elem179 = await iprot.ReadBinaryAsync(cancellationToken); - ValuesList.Add(_elem179); + byte[] _elem168; + _elem168 = await iprot.ReadBinaryAsync(cancellationToken); + ValuesList.Add(_elem168); } await iprot.ReadListEndAsync(cancellationToken); } @@ -214,13 +186,13 @@ public TSInsertRecordsReq DeepCopy() if (field.Type == TType.List) { { - TList _list180 = await iprot.ReadListBeginAsync(cancellationToken); - Timestamps = new List(_list180.Count); - for(int _i181 = 0; _i181 < _list180.Count; ++_i181) + TList _list169 = await iprot.ReadListBeginAsync(cancellationToken); + Timestamps = new List(_list169.Count); + for(int _i170 = 0; _i170 < _list169.Count; ++_i170) { - long _elem182; - _elem182 = await iprot.ReadI64Async(cancellationToken); - Timestamps.Add(_elem182); + long _elem171; + _elem171 = await iprot.ReadI64Async(cancellationToken); + Timestamps.Add(_elem171); } await iprot.ReadListEndAsync(cancellationToken); } @@ -299,9 +271,9 @@ public TSInsertRecordsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, PrefixPaths.Count), cancellationToken); - foreach (string _iter183 in PrefixPaths) + foreach (string _iter172 in PrefixPaths) { - await oprot.WriteStringAsync(_iter183, cancellationToken); + await oprot.WriteStringAsync(_iter172, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -315,13 +287,13 @@ public TSInsertRecordsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.List, MeasurementsList.Count), cancellationToken); - foreach (List _iter184 in MeasurementsList) + foreach (List _iter173 in MeasurementsList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter184.Count), cancellationToken); - foreach (string _iter185 in _iter184) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter173.Count), cancellationToken); + foreach (string _iter174 in _iter173) { - await oprot.WriteStringAsync(_iter185, cancellationToken); + await oprot.WriteStringAsync(_iter174, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -338,9 +310,9 @@ public TSInsertRecordsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, ValuesList.Count), cancellationToken); - foreach (byte[] _iter186 in ValuesList) + foreach (byte[] _iter175 in ValuesList) { - await oprot.WriteBinaryAsync(_iter186, cancellationToken); + await oprot.WriteBinaryAsync(_iter175, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -354,9 +326,9 @@ public TSInsertRecordsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I64, Timestamps.Count), cancellationToken); - foreach (long _iter187 in Timestamps) + foreach (long _iter176 in Timestamps) { - await oprot.WriteI64Async(_iter187, cancellationToken); + await oprot.WriteI64Async(_iter176, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordReq.cs index 74f3de3..8184d3b 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordReq.cs @@ -91,36 +91,6 @@ public TSInsertStringRecordReq(long sessionId, string prefixPath, List m this.Timestamp = timestamp; } - public TSInsertStringRecordReq DeepCopy() - { - var tmp113 = new TSInsertStringRecordReq(); - tmp113.SessionId = this.SessionId; - if((PrefixPath != null)) - { - tmp113.PrefixPath = this.PrefixPath; - } - if((Measurements != null)) - { - tmp113.Measurements = this.Measurements.DeepCopy(); - } - if((Values != null)) - { - tmp113.Values = this.Values.DeepCopy(); - } - tmp113.Timestamp = this.Timestamp; - if(__isset.isAligned) - { - tmp113.IsAligned = this.IsAligned; - } - tmp113.__isset.isAligned = this.__isset.isAligned; - if(__isset.timeout) - { - tmp113.Timeout = this.Timeout; - } - tmp113.__isset.timeout = this.__isset.timeout; - return tmp113; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -169,13 +139,13 @@ public TSInsertStringRecordReq DeepCopy() if (field.Type == TType.List) { { - TList _list114 = await iprot.ReadListBeginAsync(cancellationToken); - Measurements = new List(_list114.Count); - for(int _i115 = 0; _i115 < _list114.Count; ++_i115) + TList _list102 = await iprot.ReadListBeginAsync(cancellationToken); + Measurements = new List(_list102.Count); + for(int _i103 = 0; _i103 < _list102.Count; ++_i103) { - string _elem116; - _elem116 = await iprot.ReadStringAsync(cancellationToken); - Measurements.Add(_elem116); + string _elem104; + _elem104 = await iprot.ReadStringAsync(cancellationToken); + Measurements.Add(_elem104); } await iprot.ReadListEndAsync(cancellationToken); } @@ -190,13 +160,13 @@ public TSInsertStringRecordReq DeepCopy() if (field.Type == TType.List) { { - TList _list117 = await iprot.ReadListBeginAsync(cancellationToken); - Values = new List(_list117.Count); - for(int _i118 = 0; _i118 < _list117.Count; ++_i118) + TList _list105 = await iprot.ReadListBeginAsync(cancellationToken); + Values = new List(_list105.Count); + for(int _i106 = 0; _i106 < _list105.Count; ++_i106) { - string _elem119; - _elem119 = await iprot.ReadStringAsync(cancellationToken); - Values.Add(_elem119); + string _elem107; + _elem107 = await iprot.ReadStringAsync(cancellationToken); + Values.Add(_elem107); } await iprot.ReadListEndAsync(cancellationToken); } @@ -305,9 +275,9 @@ public TSInsertStringRecordReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Measurements.Count), cancellationToken); - foreach (string _iter120 in Measurements) + foreach (string _iter108 in Measurements) { - await oprot.WriteStringAsync(_iter120, cancellationToken); + await oprot.WriteStringAsync(_iter108, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -321,9 +291,9 @@ public TSInsertStringRecordReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Values.Count), cancellationToken); - foreach (string _iter121 in Values) + foreach (string _iter109 in Values) { - await oprot.WriteStringAsync(_iter121, cancellationToken); + await oprot.WriteStringAsync(_iter109, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordsOfOneDeviceReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordsOfOneDeviceReq.cs index 2252912..76e5443 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordsOfOneDeviceReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordsOfOneDeviceReq.cs @@ -76,34 +76,6 @@ public TSInsertStringRecordsOfOneDeviceReq(long sessionId, string prefixPath, Li this.Timestamps = timestamps; } - public TSInsertStringRecordsOfOneDeviceReq DeepCopy() - { - var tmp207 = new TSInsertStringRecordsOfOneDeviceReq(); - tmp207.SessionId = this.SessionId; - if((PrefixPath != null)) - { - tmp207.PrefixPath = this.PrefixPath; - } - if((MeasurementsList != null)) - { - tmp207.MeasurementsList = this.MeasurementsList.DeepCopy(); - } - if((ValuesList != null)) - { - tmp207.ValuesList = this.ValuesList.DeepCopy(); - } - if((Timestamps != null)) - { - tmp207.Timestamps = this.Timestamps.DeepCopy(); - } - if(__isset.isAligned) - { - tmp207.IsAligned = this.IsAligned; - } - tmp207.__isset.isAligned = this.__isset.isAligned; - return tmp207; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -152,23 +124,23 @@ public TSInsertStringRecordsOfOneDeviceReq DeepCopy() if (field.Type == TType.List) { { - TList _list208 = await iprot.ReadListBeginAsync(cancellationToken); - MeasurementsList = new List>(_list208.Count); - for(int _i209 = 0; _i209 < _list208.Count; ++_i209) + TList _list195 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementsList = new List>(_list195.Count); + for(int _i196 = 0; _i196 < _list195.Count; ++_i196) { - List _elem210; + List _elem197; { - TList _list211 = await iprot.ReadListBeginAsync(cancellationToken); - _elem210 = new List(_list211.Count); - for(int _i212 = 0; _i212 < _list211.Count; ++_i212) + TList _list198 = await iprot.ReadListBeginAsync(cancellationToken); + _elem197 = new List(_list198.Count); + for(int _i199 = 0; _i199 < _list198.Count; ++_i199) { - string _elem213; - _elem213 = await iprot.ReadStringAsync(cancellationToken); - _elem210.Add(_elem213); + string _elem200; + _elem200 = await iprot.ReadStringAsync(cancellationToken); + _elem197.Add(_elem200); } await iprot.ReadListEndAsync(cancellationToken); } - MeasurementsList.Add(_elem210); + MeasurementsList.Add(_elem197); } await iprot.ReadListEndAsync(cancellationToken); } @@ -183,23 +155,23 @@ public TSInsertStringRecordsOfOneDeviceReq DeepCopy() if (field.Type == TType.List) { { - TList _list214 = await iprot.ReadListBeginAsync(cancellationToken); - ValuesList = new List>(_list214.Count); - for(int _i215 = 0; _i215 < _list214.Count; ++_i215) + TList _list201 = await iprot.ReadListBeginAsync(cancellationToken); + ValuesList = new List>(_list201.Count); + for(int _i202 = 0; _i202 < _list201.Count; ++_i202) { - List _elem216; + List _elem203; { - TList _list217 = await iprot.ReadListBeginAsync(cancellationToken); - _elem216 = new List(_list217.Count); - for(int _i218 = 0; _i218 < _list217.Count; ++_i218) + TList _list204 = await iprot.ReadListBeginAsync(cancellationToken); + _elem203 = new List(_list204.Count); + for(int _i205 = 0; _i205 < _list204.Count; ++_i205) { - string _elem219; - _elem219 = await iprot.ReadStringAsync(cancellationToken); - _elem216.Add(_elem219); + string _elem206; + _elem206 = await iprot.ReadStringAsync(cancellationToken); + _elem203.Add(_elem206); } await iprot.ReadListEndAsync(cancellationToken); } - ValuesList.Add(_elem216); + ValuesList.Add(_elem203); } await iprot.ReadListEndAsync(cancellationToken); } @@ -214,13 +186,13 @@ public TSInsertStringRecordsOfOneDeviceReq DeepCopy() if (field.Type == TType.List) { { - TList _list220 = await iprot.ReadListBeginAsync(cancellationToken); - Timestamps = new List(_list220.Count); - for(int _i221 = 0; _i221 < _list220.Count; ++_i221) + TList _list207 = await iprot.ReadListBeginAsync(cancellationToken); + Timestamps = new List(_list207.Count); + for(int _i208 = 0; _i208 < _list207.Count; ++_i208) { - long _elem222; - _elem222 = await iprot.ReadI64Async(cancellationToken); - Timestamps.Add(_elem222); + long _elem209; + _elem209 = await iprot.ReadI64Async(cancellationToken); + Timestamps.Add(_elem209); } await iprot.ReadListEndAsync(cancellationToken); } @@ -308,13 +280,13 @@ public TSInsertStringRecordsOfOneDeviceReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.List, MeasurementsList.Count), cancellationToken); - foreach (List _iter223 in MeasurementsList) + foreach (List _iter210 in MeasurementsList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter223.Count), cancellationToken); - foreach (string _iter224 in _iter223) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter210.Count), cancellationToken); + foreach (string _iter211 in _iter210) { - await oprot.WriteStringAsync(_iter224, cancellationToken); + await oprot.WriteStringAsync(_iter211, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -331,13 +303,13 @@ public TSInsertStringRecordsOfOneDeviceReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.List, ValuesList.Count), cancellationToken); - foreach (List _iter225 in ValuesList) + foreach (List _iter212 in ValuesList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter225.Count), cancellationToken); - foreach (string _iter226 in _iter225) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter212.Count), cancellationToken); + foreach (string _iter213 in _iter212) { - await oprot.WriteStringAsync(_iter226, cancellationToken); + await oprot.WriteStringAsync(_iter213, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -354,9 +326,9 @@ public TSInsertStringRecordsOfOneDeviceReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I64, Timestamps.Count), cancellationToken); - foreach (long _iter227 in Timestamps) + foreach (long _iter214 in Timestamps) { - await oprot.WriteI64Async(_iter227, cancellationToken); + await oprot.WriteI64Async(_iter214, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordsReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordsReq.cs index 104cc85..1fca025 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordsReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSInsertStringRecordsReq.cs @@ -76,34 +76,6 @@ public TSInsertStringRecordsReq(long sessionId, List prefixPaths, List(_list230.Count); - for(int _i231 = 0; _i231 < _list230.Count; ++_i231) + TList _list216 = await iprot.ReadListBeginAsync(cancellationToken); + PrefixPaths = new List(_list216.Count); + for(int _i217 = 0; _i217 < _list216.Count; ++_i217) { - string _elem232; - _elem232 = await iprot.ReadStringAsync(cancellationToken); - PrefixPaths.Add(_elem232); + string _elem218; + _elem218 = await iprot.ReadStringAsync(cancellationToken); + PrefixPaths.Add(_elem218); } await iprot.ReadListEndAsync(cancellationToken); } @@ -162,23 +134,23 @@ public TSInsertStringRecordsReq DeepCopy() if (field.Type == TType.List) { { - TList _list233 = await iprot.ReadListBeginAsync(cancellationToken); - MeasurementsList = new List>(_list233.Count); - for(int _i234 = 0; _i234 < _list233.Count; ++_i234) + TList _list219 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementsList = new List>(_list219.Count); + for(int _i220 = 0; _i220 < _list219.Count; ++_i220) { - List _elem235; + List _elem221; { - TList _list236 = await iprot.ReadListBeginAsync(cancellationToken); - _elem235 = new List(_list236.Count); - for(int _i237 = 0; _i237 < _list236.Count; ++_i237) + TList _list222 = await iprot.ReadListBeginAsync(cancellationToken); + _elem221 = new List(_list222.Count); + for(int _i223 = 0; _i223 < _list222.Count; ++_i223) { - string _elem238; - _elem238 = await iprot.ReadStringAsync(cancellationToken); - _elem235.Add(_elem238); + string _elem224; + _elem224 = await iprot.ReadStringAsync(cancellationToken); + _elem221.Add(_elem224); } await iprot.ReadListEndAsync(cancellationToken); } - MeasurementsList.Add(_elem235); + MeasurementsList.Add(_elem221); } await iprot.ReadListEndAsync(cancellationToken); } @@ -193,23 +165,23 @@ public TSInsertStringRecordsReq DeepCopy() if (field.Type == TType.List) { { - TList _list239 = await iprot.ReadListBeginAsync(cancellationToken); - ValuesList = new List>(_list239.Count); - for(int _i240 = 0; _i240 < _list239.Count; ++_i240) + TList _list225 = await iprot.ReadListBeginAsync(cancellationToken); + ValuesList = new List>(_list225.Count); + for(int _i226 = 0; _i226 < _list225.Count; ++_i226) { - List _elem241; + List _elem227; { - TList _list242 = await iprot.ReadListBeginAsync(cancellationToken); - _elem241 = new List(_list242.Count); - for(int _i243 = 0; _i243 < _list242.Count; ++_i243) + TList _list228 = await iprot.ReadListBeginAsync(cancellationToken); + _elem227 = new List(_list228.Count); + for(int _i229 = 0; _i229 < _list228.Count; ++_i229) { - string _elem244; - _elem244 = await iprot.ReadStringAsync(cancellationToken); - _elem241.Add(_elem244); + string _elem230; + _elem230 = await iprot.ReadStringAsync(cancellationToken); + _elem227.Add(_elem230); } await iprot.ReadListEndAsync(cancellationToken); } - ValuesList.Add(_elem241); + ValuesList.Add(_elem227); } await iprot.ReadListEndAsync(cancellationToken); } @@ -224,13 +196,13 @@ public TSInsertStringRecordsReq DeepCopy() if (field.Type == TType.List) { { - TList _list245 = await iprot.ReadListBeginAsync(cancellationToken); - Timestamps = new List(_list245.Count); - for(int _i246 = 0; _i246 < _list245.Count; ++_i246) + TList _list231 = await iprot.ReadListBeginAsync(cancellationToken); + Timestamps = new List(_list231.Count); + for(int _i232 = 0; _i232 < _list231.Count; ++_i232) { - long _elem247; - _elem247 = await iprot.ReadI64Async(cancellationToken); - Timestamps.Add(_elem247); + long _elem233; + _elem233 = await iprot.ReadI64Async(cancellationToken); + Timestamps.Add(_elem233); } await iprot.ReadListEndAsync(cancellationToken); } @@ -309,9 +281,9 @@ public TSInsertStringRecordsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, PrefixPaths.Count), cancellationToken); - foreach (string _iter248 in PrefixPaths) + foreach (string _iter234 in PrefixPaths) { - await oprot.WriteStringAsync(_iter248, cancellationToken); + await oprot.WriteStringAsync(_iter234, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -325,13 +297,13 @@ public TSInsertStringRecordsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.List, MeasurementsList.Count), cancellationToken); - foreach (List _iter249 in MeasurementsList) + foreach (List _iter235 in MeasurementsList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter249.Count), cancellationToken); - foreach (string _iter250 in _iter249) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter235.Count), cancellationToken); + foreach (string _iter236 in _iter235) { - await oprot.WriteStringAsync(_iter250, cancellationToken); + await oprot.WriteStringAsync(_iter236, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -348,13 +320,13 @@ public TSInsertStringRecordsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.List, ValuesList.Count), cancellationToken); - foreach (List _iter251 in ValuesList) + foreach (List _iter237 in ValuesList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter251.Count), cancellationToken); - foreach (string _iter252 in _iter251) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter237.Count), cancellationToken); + foreach (string _iter238 in _iter237) { - await oprot.WriteStringAsync(_iter252, cancellationToken); + await oprot.WriteStringAsync(_iter238, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -371,9 +343,9 @@ public TSInsertStringRecordsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I64, Timestamps.Count), cancellationToken); - foreach (long _iter253 in Timestamps) + foreach (long _iter239 in Timestamps) { - await oprot.WriteI64Async(_iter253, cancellationToken); + await oprot.WriteI64Async(_iter239, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSInsertTabletReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSInsertTabletReq.cs index 2d4ce1e..3096eed 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSInsertTabletReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSInsertTabletReq.cs @@ -32,6 +32,8 @@ public partial class TSInsertTabletReq : TBase { private bool _isAligned; + private bool _writeToTable; + private List _columnCategories; public long SessionId { get; set; } @@ -60,11 +62,39 @@ public bool IsAligned } } + public bool WriteToTable + { + get + { + return _writeToTable; + } + set + { + __isset.writeToTable = true; + this._writeToTable = value; + } + } + + public List ColumnCategories + { + get + { + return _columnCategories; + } + set + { + __isset.columnCategories = true; + this._columnCategories = value; + } + } + public Isset __isset; public struct Isset { public bool isAligned; + public bool writeToTable; + public bool columnCategories; } public TSInsertTabletReq() @@ -82,39 +112,6 @@ public TSInsertTabletReq(long sessionId, string prefixPath, List measure this.Size = size; } - public TSInsertTabletReq DeepCopy() - { - var tmp123 = new TSInsertTabletReq(); - tmp123.SessionId = this.SessionId; - if((PrefixPath != null)) - { - tmp123.PrefixPath = this.PrefixPath; - } - if((Measurements != null)) - { - tmp123.Measurements = this.Measurements.DeepCopy(); - } - if((Values != null)) - { - tmp123.Values = this.Values.ToArray(); - } - if((Timestamps != null)) - { - tmp123.Timestamps = this.Timestamps.ToArray(); - } - if((Types != null)) - { - tmp123.Types = this.Types.DeepCopy(); - } - tmp123.Size = this.Size; - if(__isset.isAligned) - { - tmp123.IsAligned = this.IsAligned; - } - tmp123.__isset.isAligned = this.__isset.isAligned; - return tmp123; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -165,13 +162,13 @@ public TSInsertTabletReq DeepCopy() if (field.Type == TType.List) { { - TList _list124 = await iprot.ReadListBeginAsync(cancellationToken); - Measurements = new List(_list124.Count); - for(int _i125 = 0; _i125 < _list124.Count; ++_i125) + TList _list111 = await iprot.ReadListBeginAsync(cancellationToken); + Measurements = new List(_list111.Count); + for(int _i112 = 0; _i112 < _list111.Count; ++_i112) { - string _elem126; - _elem126 = await iprot.ReadStringAsync(cancellationToken); - Measurements.Add(_elem126); + string _elem113; + _elem113 = await iprot.ReadStringAsync(cancellationToken); + Measurements.Add(_elem113); } await iprot.ReadListEndAsync(cancellationToken); } @@ -208,13 +205,13 @@ public TSInsertTabletReq DeepCopy() if (field.Type == TType.List) { { - TList _list127 = await iprot.ReadListBeginAsync(cancellationToken); - Types = new List(_list127.Count); - for(int _i128 = 0; _i128 < _list127.Count; ++_i128) + TList _list114 = await iprot.ReadListBeginAsync(cancellationToken); + Types = new List(_list114.Count); + for(int _i115 = 0; _i115 < _list114.Count; ++_i115) { - int _elem129; - _elem129 = await iprot.ReadI32Async(cancellationToken); - Types.Add(_elem129); + int _elem116; + _elem116 = await iprot.ReadI32Async(cancellationToken); + Types.Add(_elem116); } await iprot.ReadListEndAsync(cancellationToken); } @@ -246,6 +243,36 @@ public TSInsertTabletReq DeepCopy() await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; + case 9: + if (field.Type == TType.Bool) + { + WriteToTable = await iprot.ReadBoolAsync(cancellationToken); + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; + case 10: + if (field.Type == TType.List) + { + { + TList _list117 = await iprot.ReadListBeginAsync(cancellationToken); + ColumnCategories = new List(_list117.Count); + for(int _i118 = 0; _i118 < _list117.Count; ++_i118) + { + sbyte _elem119; + _elem119 = await iprot.ReadByteAsync(cancellationToken); + ColumnCategories.Add(_elem119); + } + await iprot.ReadListEndAsync(cancellationToken); + } + } + else + { + await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); + } + break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; @@ -321,9 +348,9 @@ public TSInsertTabletReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Measurements.Count), cancellationToken); - foreach (string _iter130 in Measurements) + foreach (string _iter120 in Measurements) { - await oprot.WriteStringAsync(_iter130, cancellationToken); + await oprot.WriteStringAsync(_iter120, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -355,9 +382,9 @@ public TSInsertTabletReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, Types.Count), cancellationToken); - foreach (int _iter131 in Types) + foreach (int _iter121 in Types) { - await oprot.WriteI32Async(_iter131, cancellationToken); + await oprot.WriteI32Async(_iter121, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -378,6 +405,31 @@ public TSInsertTabletReq DeepCopy() await oprot.WriteBoolAsync(IsAligned, cancellationToken); await oprot.WriteFieldEndAsync(cancellationToken); } + if(__isset.writeToTable) + { + field.Name = "writeToTable"; + field.Type = TType.Bool; + field.ID = 9; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + await oprot.WriteBoolAsync(WriteToTable, cancellationToken); + await oprot.WriteFieldEndAsync(cancellationToken); + } + if((ColumnCategories != null) && __isset.columnCategories) + { + field.Name = "columnCategories"; + field.Type = TType.List; + field.ID = 10; + await oprot.WriteFieldBeginAsync(field, cancellationToken); + { + await oprot.WriteListBeginAsync(new TList(TType.Byte, ColumnCategories.Count), cancellationToken); + foreach (sbyte _iter122 in ColumnCategories) + { + await oprot.WriteByteAsync(_iter122, cancellationToken); + } + await oprot.WriteListEndAsync(cancellationToken); + } + await oprot.WriteFieldEndAsync(cancellationToken); + } await oprot.WriteFieldStopAsync(cancellationToken); await oprot.WriteStructEndAsync(cancellationToken); } @@ -398,7 +450,9 @@ public override bool Equals(object that) && TCollections.Equals(Timestamps, other.Timestamps) && TCollections.Equals(Types, other.Types) && System.Object.Equals(Size, other.Size) - && ((__isset.isAligned == other.__isset.isAligned) && ((!__isset.isAligned) || (System.Object.Equals(IsAligned, other.IsAligned)))); + && ((__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)))); } public override int GetHashCode() { @@ -430,6 +484,14 @@ public override int GetHashCode() { { hashcode = (hashcode * 397) + IsAligned.GetHashCode(); } + if(__isset.writeToTable) + { + hashcode = (hashcode * 397) + WriteToTable.GetHashCode(); + } + if((ColumnCategories != null) && __isset.columnCategories) + { + hashcode = (hashcode * 397) + TCollections.GetHashCode(ColumnCategories); + } } return hashcode; } @@ -471,6 +533,16 @@ public override string ToString() sb.Append(", IsAligned: "); IsAligned.ToString(sb); } + if(__isset.writeToTable) + { + sb.Append(", WriteToTable: "); + WriteToTable.ToString(sb); + } + if((ColumnCategories != null) && __isset.columnCategories) + { + sb.Append(", ColumnCategories: "); + ColumnCategories.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 e35d43c..4673f35 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSInsertTabletsReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSInsertTabletsReq.cs @@ -82,42 +82,6 @@ public TSInsertTabletsReq(long sessionId, List prefixPaths, List(_list134.Count); - for(int _i135 = 0; _i135 < _list134.Count; ++_i135) + TList _list124 = await iprot.ReadListBeginAsync(cancellationToken); + PrefixPaths = new List(_list124.Count); + for(int _i125 = 0; _i125 < _list124.Count; ++_i125) { - string _elem136; - _elem136 = await iprot.ReadStringAsync(cancellationToken); - PrefixPaths.Add(_elem136); + string _elem126; + _elem126 = await iprot.ReadStringAsync(cancellationToken); + PrefixPaths.Add(_elem126); } await iprot.ReadListEndAsync(cancellationToken); } @@ -178,23 +142,23 @@ public TSInsertTabletsReq DeepCopy() if (field.Type == TType.List) { { - TList _list137 = await iprot.ReadListBeginAsync(cancellationToken); - MeasurementsList = new List>(_list137.Count); - for(int _i138 = 0; _i138 < _list137.Count; ++_i138) + TList _list127 = await iprot.ReadListBeginAsync(cancellationToken); + MeasurementsList = new List>(_list127.Count); + for(int _i128 = 0; _i128 < _list127.Count; ++_i128) { - List _elem139; + List _elem129; { - TList _list140 = await iprot.ReadListBeginAsync(cancellationToken); - _elem139 = new List(_list140.Count); - for(int _i141 = 0; _i141 < _list140.Count; ++_i141) + TList _list130 = await iprot.ReadListBeginAsync(cancellationToken); + _elem129 = new List(_list130.Count); + for(int _i131 = 0; _i131 < _list130.Count; ++_i131) { - string _elem142; - _elem142 = await iprot.ReadStringAsync(cancellationToken); - _elem139.Add(_elem142); + string _elem132; + _elem132 = await iprot.ReadStringAsync(cancellationToken); + _elem129.Add(_elem132); } await iprot.ReadListEndAsync(cancellationToken); } - MeasurementsList.Add(_elem139); + MeasurementsList.Add(_elem129); } await iprot.ReadListEndAsync(cancellationToken); } @@ -209,13 +173,13 @@ public TSInsertTabletsReq DeepCopy() if (field.Type == TType.List) { { - TList _list143 = await iprot.ReadListBeginAsync(cancellationToken); - ValuesList = new List(_list143.Count); - for(int _i144 = 0; _i144 < _list143.Count; ++_i144) + TList _list133 = await iprot.ReadListBeginAsync(cancellationToken); + ValuesList = new List(_list133.Count); + for(int _i134 = 0; _i134 < _list133.Count; ++_i134) { - byte[] _elem145; - _elem145 = await iprot.ReadBinaryAsync(cancellationToken); - ValuesList.Add(_elem145); + byte[] _elem135; + _elem135 = await iprot.ReadBinaryAsync(cancellationToken); + ValuesList.Add(_elem135); } await iprot.ReadListEndAsync(cancellationToken); } @@ -230,13 +194,13 @@ public TSInsertTabletsReq DeepCopy() if (field.Type == TType.List) { { - TList _list146 = await iprot.ReadListBeginAsync(cancellationToken); - TimestampsList = new List(_list146.Count); - for(int _i147 = 0; _i147 < _list146.Count; ++_i147) + TList _list136 = await iprot.ReadListBeginAsync(cancellationToken); + TimestampsList = new List(_list136.Count); + for(int _i137 = 0; _i137 < _list136.Count; ++_i137) { - byte[] _elem148; - _elem148 = await iprot.ReadBinaryAsync(cancellationToken); - TimestampsList.Add(_elem148); + byte[] _elem138; + _elem138 = await iprot.ReadBinaryAsync(cancellationToken); + TimestampsList.Add(_elem138); } await iprot.ReadListEndAsync(cancellationToken); } @@ -251,23 +215,23 @@ public TSInsertTabletsReq DeepCopy() if (field.Type == TType.List) { { - TList _list149 = await iprot.ReadListBeginAsync(cancellationToken); - TypesList = new List>(_list149.Count); - for(int _i150 = 0; _i150 < _list149.Count; ++_i150) + TList _list139 = await iprot.ReadListBeginAsync(cancellationToken); + TypesList = new List>(_list139.Count); + for(int _i140 = 0; _i140 < _list139.Count; ++_i140) { - List _elem151; + List _elem141; { - TList _list152 = await iprot.ReadListBeginAsync(cancellationToken); - _elem151 = new List(_list152.Count); - for(int _i153 = 0; _i153 < _list152.Count; ++_i153) + TList _list142 = await iprot.ReadListBeginAsync(cancellationToken); + _elem141 = new List(_list142.Count); + for(int _i143 = 0; _i143 < _list142.Count; ++_i143) { - int _elem154; - _elem154 = await iprot.ReadI32Async(cancellationToken); - _elem151.Add(_elem154); + int _elem144; + _elem144 = await iprot.ReadI32Async(cancellationToken); + _elem141.Add(_elem144); } await iprot.ReadListEndAsync(cancellationToken); } - TypesList.Add(_elem151); + TypesList.Add(_elem141); } await iprot.ReadListEndAsync(cancellationToken); } @@ -282,13 +246,13 @@ public TSInsertTabletsReq DeepCopy() if (field.Type == TType.List) { { - TList _list155 = await iprot.ReadListBeginAsync(cancellationToken); - SizeList = new List(_list155.Count); - for(int _i156 = 0; _i156 < _list155.Count; ++_i156) + TList _list145 = await iprot.ReadListBeginAsync(cancellationToken); + SizeList = new List(_list145.Count); + for(int _i146 = 0; _i146 < _list145.Count; ++_i146) { - int _elem157; - _elem157 = await iprot.ReadI32Async(cancellationToken); - SizeList.Add(_elem157); + int _elem147; + _elem147 = await iprot.ReadI32Async(cancellationToken); + SizeList.Add(_elem147); } await iprot.ReadListEndAsync(cancellationToken); } @@ -375,9 +339,9 @@ public TSInsertTabletsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, PrefixPaths.Count), cancellationToken); - foreach (string _iter158 in PrefixPaths) + foreach (string _iter148 in PrefixPaths) { - await oprot.WriteStringAsync(_iter158, cancellationToken); + await oprot.WriteStringAsync(_iter148, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -391,13 +355,13 @@ public TSInsertTabletsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.List, MeasurementsList.Count), cancellationToken); - foreach (List _iter159 in MeasurementsList) + foreach (List _iter149 in MeasurementsList) { { - await oprot.WriteListBeginAsync(new TList(TType.String, _iter159.Count), cancellationToken); - foreach (string _iter160 in _iter159) + await oprot.WriteListBeginAsync(new TList(TType.String, _iter149.Count), cancellationToken); + foreach (string _iter150 in _iter149) { - await oprot.WriteStringAsync(_iter160, cancellationToken); + await oprot.WriteStringAsync(_iter150, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -414,9 +378,9 @@ public TSInsertTabletsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, ValuesList.Count), cancellationToken); - foreach (byte[] _iter161 in ValuesList) + foreach (byte[] _iter151 in ValuesList) { - await oprot.WriteBinaryAsync(_iter161, cancellationToken); + await oprot.WriteBinaryAsync(_iter151, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -430,9 +394,9 @@ public TSInsertTabletsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, TimestampsList.Count), cancellationToken); - foreach (byte[] _iter162 in TimestampsList) + foreach (byte[] _iter152 in TimestampsList) { - await oprot.WriteBinaryAsync(_iter162, cancellationToken); + await oprot.WriteBinaryAsync(_iter152, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -446,13 +410,13 @@ public TSInsertTabletsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.List, TypesList.Count), cancellationToken); - foreach (List _iter163 in TypesList) + foreach (List _iter153 in TypesList) { { - await oprot.WriteListBeginAsync(new TList(TType.I32, _iter163.Count), cancellationToken); - foreach (int _iter164 in _iter163) + await oprot.WriteListBeginAsync(new TList(TType.I32, _iter153.Count), cancellationToken); + foreach (int _iter154 in _iter153) { - await oprot.WriteI32Async(_iter164, cancellationToken); + await oprot.WriteI32Async(_iter154, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -469,9 +433,9 @@ public TSInsertTabletsReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I32, SizeList.Count), cancellationToken); - foreach (int _iter165 in SizeList) + foreach (int _iter155 in SizeList) { - await oprot.WriteI32Async(_iter165, cancellationToken); + await oprot.WriteI32Async(_iter155, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSLastDataQueryReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSLastDataQueryReq.cs index 685a95f..cb89bb4 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSLastDataQueryReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSLastDataQueryReq.cs @@ -133,44 +133,6 @@ public TSLastDataQueryReq(long sessionId, List paths, long time, long st this.StatementId = statementId; } - public TSLastDataQueryReq DeepCopy() - { - var tmp324 = new TSLastDataQueryReq(); - tmp324.SessionId = this.SessionId; - if((Paths != null)) - { - tmp324.Paths = this.Paths.DeepCopy(); - } - if(__isset.fetchSize) - { - tmp324.FetchSize = this.FetchSize; - } - tmp324.__isset.fetchSize = this.__isset.fetchSize; - tmp324.Time = this.Time; - tmp324.StatementId = this.StatementId; - if(__isset.enableRedirectQuery) - { - tmp324.EnableRedirectQuery = this.EnableRedirectQuery; - } - tmp324.__isset.enableRedirectQuery = this.__isset.enableRedirectQuery; - if(__isset.jdbcQuery) - { - tmp324.JdbcQuery = this.JdbcQuery; - } - tmp324.__isset.jdbcQuery = this.__isset.jdbcQuery; - if(__isset.timeout) - { - tmp324.Timeout = this.Timeout; - } - tmp324.__isset.timeout = this.__isset.timeout; - if(__isset.legalPathNodes) - { - tmp324.LegalPathNodes = this.LegalPathNodes; - } - tmp324.__isset.legalPathNodes = this.__isset.legalPathNodes; - return tmp324; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -207,13 +169,13 @@ public TSLastDataQueryReq DeepCopy() if (field.Type == TType.List) { { - TList _list325 = await iprot.ReadListBeginAsync(cancellationToken); - Paths = new List(_list325.Count); - for(int _i326 = 0; _i326 < _list325.Count; ++_i326) + TList _list306 = await iprot.ReadListBeginAsync(cancellationToken); + Paths = new List(_list306.Count); + for(int _i307 = 0; _i307 < _list306.Count; ++_i307) { - string _elem327; - _elem327 = await iprot.ReadStringAsync(cancellationToken); - Paths.Add(_elem327); + string _elem308; + _elem308 = await iprot.ReadStringAsync(cancellationToken); + Paths.Add(_elem308); } await iprot.ReadListEndAsync(cancellationToken); } @@ -350,9 +312,9 @@ public TSLastDataQueryReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken); - foreach (string _iter328 in Paths) + foreach (string _iter309 in Paths) { - await oprot.WriteStringAsync(_iter328, cancellationToken); + await oprot.WriteStringAsync(_iter309, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSOpenSessionReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSOpenSessionReq.cs index 1fa5440..f39b75a 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSOpenSessionReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSOpenSessionReq.cs @@ -90,31 +90,6 @@ public TSOpenSessionReq(TSProtocolVersion client_protocol, string zoneId, string this.Username = username; } - public TSOpenSessionReq DeepCopy() - { - var tmp64 = new TSOpenSessionReq(); - tmp64.Client_protocol = this.Client_protocol; - if((ZoneId != null)) - { - tmp64.ZoneId = this.ZoneId; - } - if((Username != null)) - { - tmp64.Username = this.Username; - } - if((Password != null) && __isset.password) - { - tmp64.Password = this.Password; - } - tmp64.__isset.password = this.__isset.password; - if((Configuration != null) && __isset.configuration) - { - tmp64.Configuration = this.Configuration.DeepCopy(); - } - tmp64.__isset.configuration = this.__isset.configuration; - return tmp64; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -182,15 +157,15 @@ public TSOpenSessionReq DeepCopy() if (field.Type == TType.Map) { { - TMap _map65 = await iprot.ReadMapBeginAsync(cancellationToken); - Configuration = new Dictionary(_map65.Count); - for(int _i66 = 0; _i66 < _map65.Count; ++_i66) + TMap _map63 = await iprot.ReadMapBeginAsync(cancellationToken); + Configuration = new Dictionary(_map63.Count); + for(int _i64 = 0; _i64 < _map63.Count; ++_i64) { - string _key67; - string _val68; - _key67 = await iprot.ReadStringAsync(cancellationToken); - _val68 = await iprot.ReadStringAsync(cancellationToken); - Configuration[_key67] = _val68; + string _key65; + string _val66; + _key65 = await iprot.ReadStringAsync(cancellationToken); + _val66 = await iprot.ReadStringAsync(cancellationToken); + Configuration[_key65] = _val66; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -277,10 +252,10 @@ public TSOpenSessionReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, Configuration.Count), cancellationToken); - foreach (string _iter69 in Configuration.Keys) + foreach (string _iter67 in Configuration.Keys) { - await oprot.WriteStringAsync(_iter69, cancellationToken); - await oprot.WriteStringAsync(Configuration[_iter69], cancellationToken); + await oprot.WriteStringAsync(_iter67, cancellationToken); + await oprot.WriteStringAsync(Configuration[_iter67], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSOpenSessionResp.cs b/src/Apache.IoTDB/Rpc/Generated/TSOpenSessionResp.cs index 72e59bf..759bdea 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSOpenSessionResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSOpenSessionResp.cs @@ -87,27 +87,6 @@ public TSOpenSessionResp(TSStatus status, TSProtocolVersion serverProtocolVersio this.ServerProtocolVersion = serverProtocolVersion; } - public TSOpenSessionResp DeepCopy() - { - var tmp57 = new TSOpenSessionResp(); - if((Status != null)) - { - tmp57.Status = (TSStatus)this.Status.DeepCopy(); - } - tmp57.ServerProtocolVersion = this.ServerProtocolVersion; - if(__isset.sessionId) - { - tmp57.SessionId = this.SessionId; - } - tmp57.__isset.sessionId = this.__isset.sessionId; - if((Configuration != null) && __isset.configuration) - { - tmp57.Configuration = this.Configuration.DeepCopy(); - } - tmp57.__isset.configuration = this.__isset.configuration; - return tmp57; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -164,15 +143,15 @@ public TSOpenSessionResp DeepCopy() if (field.Type == TType.Map) { { - TMap _map58 = await iprot.ReadMapBeginAsync(cancellationToken); - Configuration = new Dictionary(_map58.Count); - for(int _i59 = 0; _i59 < _map58.Count; ++_i59) + TMap _map57 = await iprot.ReadMapBeginAsync(cancellationToken); + Configuration = new Dictionary(_map57.Count); + for(int _i58 = 0; _i58 < _map57.Count; ++_i58) { - string _key60; - string _val61; - _key60 = await iprot.ReadStringAsync(cancellationToken); - _val61 = await iprot.ReadStringAsync(cancellationToken); - Configuration[_key60] = _val61; + string _key59; + string _val60; + _key59 = await iprot.ReadStringAsync(cancellationToken); + _val60 = await iprot.ReadStringAsync(cancellationToken); + Configuration[_key59] = _val60; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -246,10 +225,10 @@ public TSOpenSessionResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, Configuration.Count), cancellationToken); - foreach (string _iter62 in Configuration.Keys) + foreach (string _iter61 in Configuration.Keys) { - await oprot.WriteStringAsync(_iter62, cancellationToken); - await oprot.WriteStringAsync(Configuration[_iter62], cancellationToken); + await oprot.WriteStringAsync(_iter61, cancellationToken); + await oprot.WriteStringAsync(Configuration[_iter61], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSPruneSchemaTemplateReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSPruneSchemaTemplateReq.cs index 087a3d5..d377c88 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSPruneSchemaTemplateReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSPruneSchemaTemplateReq.cs @@ -49,21 +49,6 @@ public TSPruneSchemaTemplateReq(long sessionId, string name, string path) : this this.Path = path; } - public TSPruneSchemaTemplateReq DeepCopy() - { - var tmp425 = new TSPruneSchemaTemplateReq(); - tmp425.SessionId = this.SessionId; - if((Name != null)) - { - tmp425.Name = this.Name; - } - if((Path != null)) - { - tmp425.Path = this.Path; - } - return tmp425; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSQueryDataSet.cs b/src/Apache.IoTDB/Rpc/Generated/TSQueryDataSet.cs index 8606cd1..4927f17 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSQueryDataSet.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSQueryDataSet.cs @@ -49,24 +49,6 @@ public TSQueryDataSet(byte[] time, List valueList, List bitmapLi this.BitmapList = bitmapList; } - public TSQueryDataSet DeepCopy() - { - var tmp0 = new TSQueryDataSet(); - if((Time != null)) - { - tmp0.Time = this.Time.ToArray(); - } - if((ValueList != null)) - { - tmp0.ValueList = this.ValueList.DeepCopy(); - } - if((BitmapList != null)) - { - tmp0.BitmapList = this.BitmapList.DeepCopy(); - } - return tmp0; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -102,13 +84,13 @@ public TSQueryDataSet DeepCopy() if (field.Type == TType.List) { { - TList _list1 = await iprot.ReadListBeginAsync(cancellationToken); - ValueList = new List(_list1.Count); - for(int _i2 = 0; _i2 < _list1.Count; ++_i2) + TList _list0 = await iprot.ReadListBeginAsync(cancellationToken); + ValueList = new List(_list0.Count); + for(int _i1 = 0; _i1 < _list0.Count; ++_i1) { - byte[] _elem3; - _elem3 = await iprot.ReadBinaryAsync(cancellationToken); - ValueList.Add(_elem3); + byte[] _elem2; + _elem2 = await iprot.ReadBinaryAsync(cancellationToken); + ValueList.Add(_elem2); } await iprot.ReadListEndAsync(cancellationToken); } @@ -123,13 +105,13 @@ public TSQueryDataSet DeepCopy() if (field.Type == TType.List) { { - TList _list4 = await iprot.ReadListBeginAsync(cancellationToken); - BitmapList = new List(_list4.Count); - for(int _i5 = 0; _i5 < _list4.Count; ++_i5) + TList _list3 = await iprot.ReadListBeginAsync(cancellationToken); + BitmapList = new List(_list3.Count); + for(int _i4 = 0; _i4 < _list3.Count; ++_i4) { - byte[] _elem6; - _elem6 = await iprot.ReadBinaryAsync(cancellationToken); - BitmapList.Add(_elem6); + byte[] _elem5; + _elem5 = await iprot.ReadBinaryAsync(cancellationToken); + BitmapList.Add(_elem5); } await iprot.ReadListEndAsync(cancellationToken); } @@ -193,9 +175,9 @@ public TSQueryDataSet DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, ValueList.Count), cancellationToken); - foreach (byte[] _iter7 in ValueList) + foreach (byte[] _iter6 in ValueList) { - await oprot.WriteBinaryAsync(_iter7, cancellationToken); + await oprot.WriteBinaryAsync(_iter6, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -209,9 +191,9 @@ public TSQueryDataSet DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, BitmapList.Count), cancellationToken); - foreach (byte[] _iter8 in BitmapList) + foreach (byte[] _iter7 in BitmapList) { - await oprot.WriteBinaryAsync(_iter8, cancellationToken); + await oprot.WriteBinaryAsync(_iter7, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSQueryNonAlignDataSet.cs b/src/Apache.IoTDB/Rpc/Generated/TSQueryNonAlignDataSet.cs index f1b7e58..73fac7c 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSQueryNonAlignDataSet.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSQueryNonAlignDataSet.cs @@ -46,20 +46,6 @@ public TSQueryNonAlignDataSet(List timeList, List valueList) : t this.ValueList = valueList; } - public TSQueryNonAlignDataSet DeepCopy() - { - var tmp10 = new TSQueryNonAlignDataSet(); - if((TimeList != null)) - { - tmp10.TimeList = this.TimeList.DeepCopy(); - } - if((ValueList != null)) - { - tmp10.ValueList = this.ValueList.DeepCopy(); - } - return tmp10; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -83,13 +69,13 @@ public TSQueryNonAlignDataSet DeepCopy() if (field.Type == TType.List) { { - TList _list11 = await iprot.ReadListBeginAsync(cancellationToken); - TimeList = new List(_list11.Count); - for(int _i12 = 0; _i12 < _list11.Count; ++_i12) + TList _list9 = await iprot.ReadListBeginAsync(cancellationToken); + TimeList = new List(_list9.Count); + for(int _i10 = 0; _i10 < _list9.Count; ++_i10) { - byte[] _elem13; - _elem13 = await iprot.ReadBinaryAsync(cancellationToken); - TimeList.Add(_elem13); + byte[] _elem11; + _elem11 = await iprot.ReadBinaryAsync(cancellationToken); + TimeList.Add(_elem11); } await iprot.ReadListEndAsync(cancellationToken); } @@ -104,13 +90,13 @@ public TSQueryNonAlignDataSet DeepCopy() if (field.Type == TType.List) { { - TList _list14 = await iprot.ReadListBeginAsync(cancellationToken); - ValueList = new List(_list14.Count); - for(int _i15 = 0; _i15 < _list14.Count; ++_i15) + TList _list12 = await iprot.ReadListBeginAsync(cancellationToken); + ValueList = new List(_list12.Count); + for(int _i13 = 0; _i13 < _list12.Count; ++_i13) { - byte[] _elem16; - _elem16 = await iprot.ReadBinaryAsync(cancellationToken); - ValueList.Add(_elem16); + byte[] _elem14; + _elem14 = await iprot.ReadBinaryAsync(cancellationToken); + ValueList.Add(_elem14); } await iprot.ReadListEndAsync(cancellationToken); } @@ -161,9 +147,9 @@ public TSQueryNonAlignDataSet DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, TimeList.Count), cancellationToken); - foreach (byte[] _iter17 in TimeList) + foreach (byte[] _iter15 in TimeList) { - await oprot.WriteBinaryAsync(_iter17, cancellationToken); + await oprot.WriteBinaryAsync(_iter15, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -177,9 +163,9 @@ public TSQueryNonAlignDataSet DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, ValueList.Count), cancellationToken); - foreach (byte[] _iter18 in ValueList) + foreach (byte[] _iter16 in ValueList) { - await oprot.WriteBinaryAsync(_iter18, cancellationToken); + await oprot.WriteBinaryAsync(_iter16, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSQueryTemplateReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSQueryTemplateReq.cs index 51b6d40..5073c0e 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSQueryTemplateReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSQueryTemplateReq.cs @@ -70,23 +70,6 @@ public TSQueryTemplateReq(long sessionId, string name, int queryType) : this() this.QueryType = queryType; } - public TSQueryTemplateReq DeepCopy() - { - var tmp427 = new TSQueryTemplateReq(); - tmp427.SessionId = this.SessionId; - if((Name != null)) - { - tmp427.Name = this.Name; - } - tmp427.QueryType = this.QueryType; - if((Measurement != null) && __isset.measurement) - { - tmp427.Measurement = this.Measurement; - } - tmp427.__isset.measurement = this.__isset.measurement; - return tmp427; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSQueryTemplateResp.cs b/src/Apache.IoTDB/Rpc/Generated/TSQueryTemplateResp.cs index 6372222..f7d1c78 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSQueryTemplateResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSQueryTemplateResp.cs @@ -97,32 +97,6 @@ public TSQueryTemplateResp(TSStatus status, int queryType) : this() this.QueryType = queryType; } - public TSQueryTemplateResp DeepCopy() - { - var tmp429 = new TSQueryTemplateResp(); - if((Status != null)) - { - tmp429.Status = (TSStatus)this.Status.DeepCopy(); - } - tmp429.QueryType = this.QueryType; - if(__isset.result) - { - tmp429.Result = this.Result; - } - tmp429.__isset.result = this.__isset.result; - if(__isset.count) - { - tmp429.Count = this.Count; - } - tmp429.__isset.count = this.__isset.count; - if((Measurements != null) && __isset.measurements) - { - tmp429.Measurements = this.Measurements.DeepCopy(); - } - tmp429.__isset.measurements = this.__isset.measurements; - return tmp429; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -189,13 +163,13 @@ public TSQueryTemplateResp DeepCopy() if (field.Type == TType.List) { { - TList _list430 = await iprot.ReadListBeginAsync(cancellationToken); - Measurements = new List(_list430.Count); - for(int _i431 = 0; _i431 < _list430.Count; ++_i431) + TList _list400 = await iprot.ReadListBeginAsync(cancellationToken); + Measurements = new List(_list400.Count); + for(int _i401 = 0; _i401 < _list400.Count; ++_i401) { - string _elem432; - _elem432 = await iprot.ReadStringAsync(cancellationToken); - Measurements.Add(_elem432); + string _elem402; + _elem402 = await iprot.ReadStringAsync(cancellationToken); + Measurements.Add(_elem402); } await iprot.ReadListEndAsync(cancellationToken); } @@ -278,9 +252,9 @@ public TSQueryTemplateResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Measurements.Count), cancellationToken); - foreach (string _iter433 in Measurements) + foreach (string _iter403 in Measurements) { - await oprot.WriteStringAsync(_iter433, cancellationToken); + await oprot.WriteStringAsync(_iter403, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSRawDataQueryReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSRawDataQueryReq.cs index c621f21..df69c53 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSRawDataQueryReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSRawDataQueryReq.cs @@ -136,45 +136,6 @@ public TSRawDataQueryReq(long sessionId, List paths, long startTime, lon this.StatementId = statementId; } - public TSRawDataQueryReq DeepCopy() - { - var tmp318 = new TSRawDataQueryReq(); - tmp318.SessionId = this.SessionId; - if((Paths != null)) - { - tmp318.Paths = this.Paths.DeepCopy(); - } - if(__isset.fetchSize) - { - tmp318.FetchSize = this.FetchSize; - } - tmp318.__isset.fetchSize = this.__isset.fetchSize; - tmp318.StartTime = this.StartTime; - tmp318.EndTime = this.EndTime; - tmp318.StatementId = this.StatementId; - if(__isset.enableRedirectQuery) - { - tmp318.EnableRedirectQuery = this.EnableRedirectQuery; - } - tmp318.__isset.enableRedirectQuery = this.__isset.enableRedirectQuery; - if(__isset.jdbcQuery) - { - tmp318.JdbcQuery = this.JdbcQuery; - } - tmp318.__isset.jdbcQuery = this.__isset.jdbcQuery; - if(__isset.timeout) - { - tmp318.Timeout = this.Timeout; - } - tmp318.__isset.timeout = this.__isset.timeout; - if(__isset.legalPathNodes) - { - tmp318.LegalPathNodes = this.LegalPathNodes; - } - tmp318.__isset.legalPathNodes = this.__isset.legalPathNodes; - return tmp318; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -212,13 +173,13 @@ public TSRawDataQueryReq DeepCopy() if (field.Type == TType.List) { { - TList _list319 = await iprot.ReadListBeginAsync(cancellationToken); - Paths = new List(_list319.Count); - for(int _i320 = 0; _i320 < _list319.Count; ++_i320) + TList _list301 = await iprot.ReadListBeginAsync(cancellationToken); + Paths = new List(_list301.Count); + for(int _i302 = 0; _i302 < _list301.Count; ++_i302) { - string _elem321; - _elem321 = await iprot.ReadStringAsync(cancellationToken); - Paths.Add(_elem321); + string _elem303; + _elem303 = await iprot.ReadStringAsync(cancellationToken); + Paths.Add(_elem303); } await iprot.ReadListEndAsync(cancellationToken); } @@ -370,9 +331,9 @@ public TSRawDataQueryReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken); - foreach (string _iter322 in Paths) + foreach (string _iter304 in Paths) { - await oprot.WriteStringAsync(_iter322, cancellationToken); + await oprot.WriteStringAsync(_iter304, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSSetSchemaTemplateReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSSetSchemaTemplateReq.cs index 930d22b..7d7e213 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSSetSchemaTemplateReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSSetSchemaTemplateReq.cs @@ -49,21 +49,6 @@ public TSSetSchemaTemplateReq(long sessionId, string templateName, string prefix this.PrefixPath = prefixPath; } - public TSSetSchemaTemplateReq DeepCopy() - { - var tmp403 = new TSSetSchemaTemplateReq(); - tmp403.SessionId = this.SessionId; - if((TemplateName != null)) - { - tmp403.TemplateName = this.TemplateName; - } - if((PrefixPath != null)) - { - tmp403.PrefixPath = this.PrefixPath; - } - return tmp403; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSSetTimeZoneReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSSetTimeZoneReq.cs index a91c322..f9f2d84 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSSetTimeZoneReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSSetTimeZoneReq.cs @@ -46,17 +46,6 @@ public TSSetTimeZoneReq(long sessionId, string timeZone) : this() this.TimeZone = timeZone; } - public TSSetTimeZoneReq DeepCopy() - { - var tmp105 = new TSSetTimeZoneReq(); - tmp105.SessionId = this.SessionId; - if((TimeZone != null)) - { - tmp105.TimeZone = this.TimeZone; - } - return tmp105; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSStatus.cs b/src/Apache.IoTDB/Rpc/Generated/TSStatus.cs index 0e738ef..3575330 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSStatus.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSStatus.cs @@ -109,33 +109,6 @@ public TSStatus(int code) : this() this.Code = code; } - public TSStatus DeepCopy() - { - var tmp2 = new TSStatus(); - tmp2.Code = this.Code; - if((Message != null) && __isset.message) - { - tmp2.Message = this.Message; - } - tmp2.__isset.message = this.__isset.message; - if((SubStatus != null) && __isset.subStatus) - { - tmp2.SubStatus = this.SubStatus.DeepCopy(); - } - tmp2.__isset.subStatus = this.__isset.subStatus; - if((RedirectNode != null) && __isset.redirectNode) - { - tmp2.RedirectNode = (TEndPoint)this.RedirectNode.DeepCopy(); - } - tmp2.__isset.redirectNode = this.__isset.redirectNode; - if(__isset.needRetry) - { - tmp2.NeedRetry = this.NeedRetry; - } - tmp2.__isset.needRetry = this.__isset.needRetry; - return tmp2; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -179,14 +152,14 @@ public TSStatus DeepCopy() if (field.Type == TType.List) { { - TList _list3 = await iprot.ReadListBeginAsync(cancellationToken); - SubStatus = new List(_list3.Count); - for(int _i4 = 0; _i4 < _list3.Count; ++_i4) + TList _list1 = await iprot.ReadListBeginAsync(cancellationToken); + SubStatus = new List(_list1.Count); + for(int _i2 = 0; _i2 < _list1.Count; ++_i2) { - TSStatus _elem5; - _elem5 = new TSStatus(); - await _elem5.ReadAsync(iprot, cancellationToken); - SubStatus.Add(_elem5); + TSStatus _elem3; + _elem3 = new TSStatus(); + await _elem3.ReadAsync(iprot, cancellationToken); + SubStatus.Add(_elem3); } await iprot.ReadListEndAsync(cancellationToken); } @@ -268,9 +241,9 @@ public TSStatus DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Struct, SubStatus.Count), cancellationToken); - foreach (TSStatus _iter6 in SubStatus) + foreach (TSStatus _iter4 in SubStatus) { - await _iter6.WriteAsync(oprot, cancellationToken); + await _iter4.WriteAsync(oprot, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSTracingInfo.cs b/src/Apache.IoTDB/Rpc/Generated/TSTracingInfo.cs index 73d55dd..a5029a9 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSTracingInfo.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSTracingInfo.cs @@ -187,65 +187,6 @@ public TSTracingInfo(List activityList, List elapsedTimeList) : th this.ElapsedTimeList = elapsedTimeList; } - public TSTracingInfo DeepCopy() - { - var tmp20 = new TSTracingInfo(); - if((ActivityList != null)) - { - tmp20.ActivityList = this.ActivityList.DeepCopy(); - } - if((ElapsedTimeList != null)) - { - tmp20.ElapsedTimeList = this.ElapsedTimeList.DeepCopy(); - } - if(__isset.seriesPathNum) - { - tmp20.SeriesPathNum = this.SeriesPathNum; - } - tmp20.__isset.seriesPathNum = this.__isset.seriesPathNum; - if(__isset.seqFileNum) - { - tmp20.SeqFileNum = this.SeqFileNum; - } - tmp20.__isset.seqFileNum = this.__isset.seqFileNum; - if(__isset.unSeqFileNum) - { - tmp20.UnSeqFileNum = this.UnSeqFileNum; - } - tmp20.__isset.unSeqFileNum = this.__isset.unSeqFileNum; - if(__isset.sequenceChunkNum) - { - tmp20.SequenceChunkNum = this.SequenceChunkNum; - } - tmp20.__isset.sequenceChunkNum = this.__isset.sequenceChunkNum; - if(__isset.sequenceChunkPointNum) - { - tmp20.SequenceChunkPointNum = this.SequenceChunkPointNum; - } - tmp20.__isset.sequenceChunkPointNum = this.__isset.sequenceChunkPointNum; - if(__isset.unsequenceChunkNum) - { - tmp20.UnsequenceChunkNum = this.UnsequenceChunkNum; - } - tmp20.__isset.unsequenceChunkNum = this.__isset.unsequenceChunkNum; - if(__isset.unsequenceChunkPointNum) - { - tmp20.UnsequenceChunkPointNum = this.UnsequenceChunkPointNum; - } - tmp20.__isset.unsequenceChunkPointNum = this.__isset.unsequenceChunkPointNum; - if(__isset.totalPageNum) - { - tmp20.TotalPageNum = this.TotalPageNum; - } - tmp20.__isset.totalPageNum = this.__isset.totalPageNum; - if(__isset.overlappedPageNum) - { - tmp20.OverlappedPageNum = this.OverlappedPageNum; - } - tmp20.__isset.overlappedPageNum = this.__isset.overlappedPageNum; - return tmp20; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -269,13 +210,13 @@ public TSTracingInfo DeepCopy() if (field.Type == TType.List) { { - TList _list21 = await iprot.ReadListBeginAsync(cancellationToken); - ActivityList = new List(_list21.Count); - for(int _i22 = 0; _i22 < _list21.Count; ++_i22) + TList _list18 = await iprot.ReadListBeginAsync(cancellationToken); + ActivityList = new List(_list18.Count); + for(int _i19 = 0; _i19 < _list18.Count; ++_i19) { - string _elem23; - _elem23 = await iprot.ReadStringAsync(cancellationToken); - ActivityList.Add(_elem23); + string _elem20; + _elem20 = await iprot.ReadStringAsync(cancellationToken); + ActivityList.Add(_elem20); } await iprot.ReadListEndAsync(cancellationToken); } @@ -290,13 +231,13 @@ public TSTracingInfo DeepCopy() if (field.Type == TType.List) { { - TList _list24 = await iprot.ReadListBeginAsync(cancellationToken); - ElapsedTimeList = new List(_list24.Count); - for(int _i25 = 0; _i25 < _list24.Count; ++_i25) + TList _list21 = await iprot.ReadListBeginAsync(cancellationToken); + ElapsedTimeList = new List(_list21.Count); + for(int _i22 = 0; _i22 < _list21.Count; ++_i22) { - long _elem26; - _elem26 = await iprot.ReadI64Async(cancellationToken); - ElapsedTimeList.Add(_elem26); + long _elem23; + _elem23 = await iprot.ReadI64Async(cancellationToken); + ElapsedTimeList.Add(_elem23); } await iprot.ReadListEndAsync(cancellationToken); } @@ -437,9 +378,9 @@ public TSTracingInfo DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, ActivityList.Count), cancellationToken); - foreach (string _iter27 in ActivityList) + foreach (string _iter24 in ActivityList) { - await oprot.WriteStringAsync(_iter27, cancellationToken); + await oprot.WriteStringAsync(_iter24, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } @@ -453,9 +394,9 @@ public TSTracingInfo DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.I64, ElapsedTimeList.Count), cancellationToken); - foreach (long _iter28 in ElapsedTimeList) + foreach (long _iter25 in ElapsedTimeList) { - await oprot.WriteI64Async(_iter28, cancellationToken); + await oprot.WriteI64Async(_iter25, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSUnsetSchemaTemplateReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSUnsetSchemaTemplateReq.cs index e400e8c..7aa04f4 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSUnsetSchemaTemplateReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSUnsetSchemaTemplateReq.cs @@ -49,21 +49,6 @@ public TSUnsetSchemaTemplateReq(long sessionId, string prefixPath, string templa this.TemplateName = templateName; } - public TSUnsetSchemaTemplateReq DeepCopy() - { - var tmp435 = new TSUnsetSchemaTemplateReq(); - tmp435.SessionId = this.SessionId; - if((PrefixPath != null)) - { - tmp435.PrefixPath = this.PrefixPath; - } - if((TemplateName != null)) - { - tmp435.TemplateName = this.TemplateName; - } - return tmp435; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSchemaNode.cs b/src/Apache.IoTDB/Rpc/Generated/TSchemaNode.cs index 79e0feb..1cc55f7 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSchemaNode.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSchemaNode.cs @@ -46,17 +46,6 @@ public TSchemaNode(string nodeName, sbyte nodeType) : this() this.NodeType = nodeType; } - public TSchemaNode DeepCopy() - { - var tmp44 = new TSchemaNode(); - if((NodeName != null)) - { - tmp44.NodeName = this.NodeName; - } - tmp44.NodeType = this.NodeType; - return tmp44; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSender.cs b/src/Apache.IoTDB/Rpc/Generated/TSender.cs index 07fdcca..c530a44 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSender.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSender.cs @@ -72,22 +72,6 @@ public TSender() { } - public TSender DeepCopy() - { - var tmp98 = new TSender(); - if((DataNodeLocation != null) && __isset.dataNodeLocation) - { - tmp98.DataNodeLocation = (TDataNodeLocation)this.DataNodeLocation.DeepCopy(); - } - tmp98.__isset.dataNodeLocation = this.__isset.dataNodeLocation; - if((ConfigNodeLocation != null) && __isset.configNodeLocation) - { - tmp98.ConfigNodeLocation = (TConfigNodeLocation)this.ConfigNodeLocation.DeepCopy(); - } - tmp98.__isset.configNodeLocation = this.__isset.configNodeLocation; - return tmp98; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -204,16 +188,16 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("TSender("); - int tmp99 = 0; + int tmp70 = 0; if((DataNodeLocation != null) && __isset.dataNodeLocation) { - if(0 < tmp99++) { sb.Append(", "); } + if(0 < tmp70++) { sb.Append(", "); } sb.Append("DataNodeLocation: "); DataNodeLocation.ToString(sb); } if((ConfigNodeLocation != null) && __isset.configNodeLocation) { - if(0 < tmp99++) { sb.Append(", "); } + if(0 < tmp70++) { sb.Append(", "); } sb.Append("ConfigNodeLocation: "); ConfigNodeLocation.ToString(sb); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSeriesPartitionSlot.cs b/src/Apache.IoTDB/Rpc/Generated/TSeriesPartitionSlot.cs index 81bff8c..3f14d2b 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSeriesPartitionSlot.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSeriesPartitionSlot.cs @@ -43,13 +43,6 @@ public TSeriesPartitionSlot(int slotId) : this() this.SlotId = slotId; } - public TSeriesPartitionSlot DeepCopy() - { - var tmp10 = new TSeriesPartitionSlot(); - tmp10.SlotId = this.SlotId; - return tmp10; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TServiceProvider.cs b/src/Apache.IoTDB/Rpc/Generated/TServiceProvider.cs index f50ceea..3480593 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TServiceProvider.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TServiceProvider.cs @@ -50,17 +50,6 @@ public TServiceProvider(TEndPoint endPoint, TServiceType serviceType) : this() this.ServiceType = serviceType; } - public TServiceProvider DeepCopy() - { - var tmp96 = new TServiceProvider(); - if((EndPoint != null)) - { - tmp96.EndPoint = (TEndPoint)this.EndPoint.DeepCopy(); - } - tmp96.ServiceType = this.ServiceType; - return tmp96; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSetConfigurationReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSetConfigurationReq.cs index 328dd57..a152b1c 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSetConfigurationReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSetConfigurationReq.cs @@ -46,17 +46,6 @@ public TSetConfigurationReq(Dictionary configs, int nodeId) : th this.NodeId = nodeId; } - public TSetConfigurationReq DeepCopy() - { - var tmp46 = new TSetConfigurationReq(); - if((Configs != null)) - { - tmp46.Configs = this.Configs.DeepCopy(); - } - tmp46.NodeId = this.NodeId; - return tmp46; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -80,15 +69,15 @@ public TSetConfigurationReq DeepCopy() if (field.Type == TType.Map) { { - TMap _map47 = await iprot.ReadMapBeginAsync(cancellationToken); - Configs = new Dictionary(_map47.Count); - for(int _i48 = 0; _i48 < _map47.Count; ++_i48) + TMap _map31 = await iprot.ReadMapBeginAsync(cancellationToken); + Configs = new Dictionary(_map31.Count); + for(int _i32 = 0; _i32 < _map31.Count; ++_i32) { - string _key49; - string _val50; - _key49 = await iprot.ReadStringAsync(cancellationToken); - _val50 = await iprot.ReadStringAsync(cancellationToken); - Configs[_key49] = _val50; + string _key33; + string _val34; + _key33 = await iprot.ReadStringAsync(cancellationToken); + _val34 = await iprot.ReadStringAsync(cancellationToken); + Configs[_key33] = _val34; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -150,10 +139,10 @@ public TSetConfigurationReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, Configs.Count), cancellationToken); - foreach (string _iter51 in Configs.Keys) + foreach (string _iter35 in Configs.Keys) { - await oprot.WriteStringAsync(_iter51, cancellationToken); - await oprot.WriteStringAsync(Configs[_iter51], cancellationToken); + await oprot.WriteStringAsync(_iter35, cancellationToken); + await oprot.WriteStringAsync(Configs[_iter35], cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSetSpaceQuotaReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSetSpaceQuotaReq.cs index bd01682..e9a23e9 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSetSpaceQuotaReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSetSpaceQuotaReq.cs @@ -46,20 +46,6 @@ public TSetSpaceQuotaReq(List database, TSpaceQuota spaceLimit) : this() this.SpaceLimit = spaceLimit; } - public TSetSpaceQuotaReq DeepCopy() - { - var tmp84 = new TSetSpaceQuotaReq(); - if((Database != null)) - { - tmp84.Database = this.Database.DeepCopy(); - } - if((SpaceLimit != null)) - { - tmp84.SpaceLimit = (TSpaceQuota)this.SpaceLimit.DeepCopy(); - } - return tmp84; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -83,13 +69,13 @@ public TSetSpaceQuotaReq DeepCopy() if (field.Type == TType.List) { { - TList _list85 = await iprot.ReadListBeginAsync(cancellationToken); - Database = new List(_list85.Count); - for(int _i86 = 0; _i86 < _list85.Count; ++_i86) + TList _list61 = await iprot.ReadListBeginAsync(cancellationToken); + Database = new List(_list61.Count); + for(int _i62 = 0; _i62 < _list61.Count; ++_i62) { - string _elem87; - _elem87 = await iprot.ReadStringAsync(cancellationToken); - Database.Add(_elem87); + string _elem63; + _elem63 = await iprot.ReadStringAsync(cancellationToken); + Database.Add(_elem63); } await iprot.ReadListEndAsync(cancellationToken); } @@ -152,9 +138,9 @@ public TSetSpaceQuotaReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Database.Count), cancellationToken); - foreach (string _iter88 in Database) + foreach (string _iter64 in Database) { - await oprot.WriteStringAsync(_iter88, cancellationToken); + await oprot.WriteStringAsync(_iter64, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSetTTLReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSetTTLReq.cs index c482a2f..b2ad1ae 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSetTTLReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSetTTLReq.cs @@ -49,18 +49,6 @@ public TSetTTLReq(List pathPattern, long TTL, bool isDataBase) : this() this.IsDataBase = isDataBase; } - public TSetTTLReq DeepCopy() - { - var tmp53 = new TSetTTLReq(); - if((PathPattern != null)) - { - tmp53.PathPattern = this.PathPattern.DeepCopy(); - } - tmp53.TTL = this.TTL; - tmp53.IsDataBase = this.IsDataBase; - return tmp53; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -85,13 +73,13 @@ public TSetTTLReq DeepCopy() if (field.Type == TType.List) { { - TList _list54 = await iprot.ReadListBeginAsync(cancellationToken); - PathPattern = new List(_list54.Count); - for(int _i55 = 0; _i55 < _list54.Count; ++_i55) + TList _list37 = await iprot.ReadListBeginAsync(cancellationToken); + PathPattern = new List(_list37.Count); + for(int _i38 = 0; _i38 < _list37.Count; ++_i38) { - string _elem56; - _elem56 = await iprot.ReadStringAsync(cancellationToken); - PathPattern.Add(_elem56); + string _elem39; + _elem39 = await iprot.ReadStringAsync(cancellationToken); + PathPattern.Add(_elem39); } await iprot.ReadListEndAsync(cancellationToken); } @@ -168,9 +156,9 @@ public TSetTTLReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, PathPattern.Count), cancellationToken); - foreach (string _iter57 in PathPattern) + foreach (string _iter40 in PathPattern) { - await oprot.WriteStringAsync(_iter57, cancellationToken); + await oprot.WriteStringAsync(_iter40, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSetThrottleQuotaReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSetThrottleQuotaReq.cs index 857de3e..651db17 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSetThrottleQuotaReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSetThrottleQuotaReq.cs @@ -46,20 +46,6 @@ public TSetThrottleQuotaReq(string userName, TThrottleQuota throttleQuota) : thi this.ThrottleQuota = throttleQuota; } - public TSetThrottleQuotaReq DeepCopy() - { - var tmp90 = new TSetThrottleQuotaReq(); - if((UserName != null)) - { - tmp90.UserName = this.UserName; - } - if((ThrottleQuota != null)) - { - tmp90.ThrottleQuota = (TThrottleQuota)this.ThrottleQuota.DeepCopy(); - } - return tmp90; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSettleReq.cs b/src/Apache.IoTDB/Rpc/Generated/TSettleReq.cs index c32ea9c..f2d9138 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSettleReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSettleReq.cs @@ -43,16 +43,6 @@ public TSettleReq(List paths) : this() this.Paths = paths; } - public TSettleReq DeepCopy() - { - var tmp38 = new TSettleReq(); - if((Paths != null)) - { - tmp38.Paths = this.Paths.DeepCopy(); - } - return tmp38; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -75,13 +65,13 @@ public TSettleReq DeepCopy() if (field.Type == TType.List) { { - TList _list39 = await iprot.ReadListBeginAsync(cancellationToken); - Paths = new List(_list39.Count); - for(int _i40 = 0; _i40 < _list39.Count; ++_i40) + TList _list25 = await iprot.ReadListBeginAsync(cancellationToken); + Paths = new List(_list25.Count); + for(int _i26 = 0; _i26 < _list25.Count; ++_i26) { - string _elem41; - _elem41 = await iprot.ReadStringAsync(cancellationToken); - Paths.Add(_elem41); + string _elem27; + _elem27 = await iprot.ReadStringAsync(cancellationToken); + Paths.Add(_elem27); } await iprot.ReadListEndAsync(cancellationToken); } @@ -128,9 +118,9 @@ public TSettleReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken); - foreach (string _iter42 in Paths) + foreach (string _iter28 in Paths) { - await oprot.WriteStringAsync(_iter42, cancellationToken); + await oprot.WriteStringAsync(_iter28, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TShowConfigurationResp.cs b/src/Apache.IoTDB/Rpc/Generated/TShowConfigurationResp.cs index c8cc62c..0fa4bb9 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TShowConfigurationResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TShowConfigurationResp.cs @@ -46,20 +46,6 @@ public TShowConfigurationResp(TSStatus status, string content) : this() this.Content = content; } - public TShowConfigurationResp DeepCopy() - { - var tmp120 = new TShowConfigurationResp(); - if((Status != null)) - { - tmp120.Status = (TSStatus)this.Status.DeepCopy(); - } - if((Content != null)) - { - tmp120.Content = this.Content; - } - return tmp120; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TShowConfigurationTemplateResp.cs b/src/Apache.IoTDB/Rpc/Generated/TShowConfigurationTemplateResp.cs index bb6fcb7..79ab277 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TShowConfigurationTemplateResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TShowConfigurationTemplateResp.cs @@ -46,20 +46,6 @@ public TShowConfigurationTemplateResp(TSStatus status, string content) : this() this.Content = content; } - public TShowConfigurationTemplateResp DeepCopy() - { - var tmp118 = new TShowConfigurationTemplateResp(); - if((Status != null)) - { - tmp118.Status = (TSStatus)this.Status.DeepCopy(); - } - if((Content != null)) - { - tmp118.Content = this.Content; - } - return tmp118; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TShowTTLReq.cs b/src/Apache.IoTDB/Rpc/Generated/TShowTTLReq.cs index ee655ac..d99929a 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TShowTTLReq.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TShowTTLReq.cs @@ -43,16 +43,6 @@ public TShowTTLReq(List pathPattern) : this() this.PathPattern = pathPattern; } - public TShowTTLReq DeepCopy() - { - var tmp59 = new TShowTTLReq(); - if((PathPattern != null)) - { - tmp59.PathPattern = this.PathPattern.DeepCopy(); - } - return tmp59; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -75,13 +65,13 @@ public TShowTTLReq DeepCopy() if (field.Type == TType.List) { { - TList _list60 = await iprot.ReadListBeginAsync(cancellationToken); - PathPattern = new List(_list60.Count); - for(int _i61 = 0; _i61 < _list60.Count; ++_i61) + TList _list42 = await iprot.ReadListBeginAsync(cancellationToken); + PathPattern = new List(_list42.Count); + for(int _i43 = 0; _i43 < _list42.Count; ++_i43) { - string _elem62; - _elem62 = await iprot.ReadStringAsync(cancellationToken); - PathPattern.Add(_elem62); + string _elem44; + _elem44 = await iprot.ReadStringAsync(cancellationToken); + PathPattern.Add(_elem44); } await iprot.ReadListEndAsync(cancellationToken); } @@ -128,9 +118,9 @@ public TShowTTLReq DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.String, PathPattern.Count), cancellationToken); - foreach (string _iter63 in PathPattern) + foreach (string _iter45 in PathPattern) { - await oprot.WriteStringAsync(_iter63, cancellationToken); + await oprot.WriteStringAsync(_iter45, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSpaceQuota.cs b/src/Apache.IoTDB/Rpc/Generated/TSpaceQuota.cs index 5ea5f21..4f48520 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSpaceQuota.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSpaceQuota.cs @@ -87,27 +87,6 @@ public TSpaceQuota() { } - public TSpaceQuota DeepCopy() - { - var tmp73 = new TSpaceQuota(); - if(__isset.diskSize) - { - tmp73.DiskSize = this.DiskSize; - } - tmp73.__isset.diskSize = this.__isset.diskSize; - if(__isset.deviceNum) - { - tmp73.DeviceNum = this.DeviceNum; - } - tmp73.__isset.deviceNum = this.__isset.deviceNum; - if(__isset.timeserieNum) - { - tmp73.TimeserieNum = this.TimeserieNum; - } - tmp73.__isset.timeserieNum = this.__isset.timeserieNum; - return tmp73; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -246,22 +225,22 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("TSpaceQuota("); - int tmp74 = 0; + int tmp53 = 0; if(__isset.diskSize) { - if(0 < tmp74++) { sb.Append(", "); } + if(0 < tmp53++) { sb.Append(", "); } sb.Append("DiskSize: "); DiskSize.ToString(sb); } if(__isset.deviceNum) { - if(0 < tmp74++) { sb.Append(", "); } + if(0 < tmp53++) { sb.Append(", "); } sb.Append("DeviceNum: "); DeviceNum.ToString(sb); } if(__isset.timeserieNum) { - if(0 < tmp74++) { sb.Append(", "); } + if(0 < tmp53++) { sb.Append(", "); } sb.Append("TimeserieNum: "); TimeserieNum.ToString(sb); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TSyncIdentityInfo.cs b/src/Apache.IoTDB/Rpc/Generated/TSyncIdentityInfo.cs index fde1167..ccf7bc5 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSyncIdentityInfo.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSyncIdentityInfo.cs @@ -52,25 +52,6 @@ public TSyncIdentityInfo(string pipeName, long createTime, string version, strin this.Database = database; } - public TSyncIdentityInfo DeepCopy() - { - var tmp445 = new TSyncIdentityInfo(); - if((PipeName != null)) - { - tmp445.PipeName = this.PipeName; - } - tmp445.CreateTime = this.CreateTime; - if((Version != null)) - { - tmp445.Version = this.Version; - } - if((Database != null)) - { - tmp445.Database = this.Database; - } - return tmp445; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TSyncTransportMetaInfo.cs b/src/Apache.IoTDB/Rpc/Generated/TSyncTransportMetaInfo.cs index 1482952..ef840cc 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TSyncTransportMetaInfo.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TSyncTransportMetaInfo.cs @@ -46,17 +46,6 @@ public TSyncTransportMetaInfo(string fileName, long startIndex) : this() this.StartIndex = startIndex; } - public TSyncTransportMetaInfo DeepCopy() - { - var tmp447 = new TSyncTransportMetaInfo(); - if((FileName != null)) - { - tmp447.FileName = this.FileName; - } - tmp447.StartIndex = this.StartIndex; - return tmp447; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TTestConnectionResp.cs b/src/Apache.IoTDB/Rpc/Generated/TTestConnectionResp.cs index 060a0d5..f6b74eb 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TTestConnectionResp.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TTestConnectionResp.cs @@ -46,20 +46,6 @@ public TTestConnectionResp(TSStatus status, List resultLi this.ResultList = resultList; } - public TTestConnectionResp DeepCopy() - { - var tmp102 = new TTestConnectionResp(); - if((Status != null)) - { - tmp102.Status = (TSStatus)this.Status.DeepCopy(); - } - if((ResultList != null)) - { - tmp102.ResultList = this.ResultList.DeepCopy(); - } - return tmp102; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -95,14 +81,14 @@ public TTestConnectionResp DeepCopy() if (field.Type == TType.List) { { - TList _list103 = await iprot.ReadListBeginAsync(cancellationToken); - ResultList = new List(_list103.Count); - for(int _i104 = 0; _i104 < _list103.Count; ++_i104) + TList _list72 = await iprot.ReadListBeginAsync(cancellationToken); + ResultList = new List(_list72.Count); + for(int _i73 = 0; _i73 < _list72.Count; ++_i73) { - TTestConnectionResult _elem105; - _elem105 = new TTestConnectionResult(); - await _elem105.ReadAsync(iprot, cancellationToken); - ResultList.Add(_elem105); + TTestConnectionResult _elem74; + _elem74 = new TTestConnectionResult(); + await _elem74.ReadAsync(iprot, cancellationToken); + ResultList.Add(_elem74); } await iprot.ReadListEndAsync(cancellationToken); } @@ -162,9 +148,9 @@ public TTestConnectionResp DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteListBeginAsync(new TList(TType.Struct, ResultList.Count), cancellationToken); - foreach (TTestConnectionResult _iter106 in ResultList) + foreach (TTestConnectionResult _iter75 in ResultList) { - await _iter106.WriteAsync(oprot, cancellationToken); + await _iter75.WriteAsync(oprot, cancellationToken); } await oprot.WriteListEndAsync(cancellationToken); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TTestConnectionResult.cs b/src/Apache.IoTDB/Rpc/Generated/TTestConnectionResult.cs index 7a1774c..b4117b9 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TTestConnectionResult.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TTestConnectionResult.cs @@ -70,26 +70,6 @@ public TTestConnectionResult(TServiceProvider serviceProvider, TSender sender, b this.Success = success; } - public TTestConnectionResult DeepCopy() - { - var tmp100 = new TTestConnectionResult(); - if((ServiceProvider != null)) - { - tmp100.ServiceProvider = (TServiceProvider)this.ServiceProvider.DeepCopy(); - } - if((Sender != null)) - { - tmp100.Sender = (TSender)this.Sender.DeepCopy(); - } - tmp100.Success = this.Success; - if((Reason != null) && __isset.reason) - { - tmp100.Reason = this.Reason; - } - tmp100.__isset.reason = this.__isset.reason; - return tmp100; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TThrottleQuota.cs b/src/Apache.IoTDB/Rpc/Generated/TThrottleQuota.cs index 8cd5b17..16b958b 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TThrottleQuota.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TThrottleQuota.cs @@ -87,27 +87,6 @@ public TThrottleQuota() { } - public TThrottleQuota DeepCopy() - { - var tmp77 = new TThrottleQuota(); - if((ThrottleLimit != null) && __isset.throttleLimit) - { - tmp77.ThrottleLimit = this.ThrottleLimit.DeepCopy(); - } - tmp77.__isset.throttleLimit = this.__isset.throttleLimit; - if(__isset.memLimit) - { - tmp77.MemLimit = this.MemLimit; - } - tmp77.__isset.memLimit = this.__isset.memLimit; - if(__isset.cpuLimit) - { - tmp77.CpuLimit = this.CpuLimit; - } - tmp77.__isset.cpuLimit = this.__isset.cpuLimit; - return tmp77; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); @@ -129,16 +108,16 @@ public TThrottleQuota DeepCopy() if (field.Type == TType.Map) { { - TMap _map78 = await iprot.ReadMapBeginAsync(cancellationToken); - ThrottleLimit = new Dictionary(_map78.Count); - for(int _i79 = 0; _i79 < _map78.Count; ++_i79) + TMap _map55 = await iprot.ReadMapBeginAsync(cancellationToken); + ThrottleLimit = new Dictionary(_map55.Count); + for(int _i56 = 0; _i56 < _map55.Count; ++_i56) { - ThrottleType _key80; - TTimedQuota _val81; - _key80 = (ThrottleType)await iprot.ReadI32Async(cancellationToken); - _val81 = new TTimedQuota(); - await _val81.ReadAsync(iprot, cancellationToken); - ThrottleLimit[_key80] = _val81; + ThrottleType _key57; + TTimedQuota _val58; + _key57 = (ThrottleType)await iprot.ReadI32Async(cancellationToken); + _val58 = new TTimedQuota(); + await _val58.ReadAsync(iprot, cancellationToken); + ThrottleLimit[_key57] = _val58; } await iprot.ReadMapEndAsync(cancellationToken); } @@ -200,10 +179,10 @@ public TThrottleQuota DeepCopy() await oprot.WriteFieldBeginAsync(field, cancellationToken); { await oprot.WriteMapBeginAsync(new TMap(TType.I32, TType.Struct, ThrottleLimit.Count), cancellationToken); - foreach (ThrottleType _iter82 in ThrottleLimit.Keys) + foreach (ThrottleType _iter59 in ThrottleLimit.Keys) { - await oprot.WriteI32Async((int)_iter82, cancellationToken); - await ThrottleLimit[_iter82].WriteAsync(oprot, cancellationToken); + await oprot.WriteI32Async((int)_iter59, cancellationToken); + await ThrottleLimit[_iter59].WriteAsync(oprot, cancellationToken); } await oprot.WriteMapEndAsync(cancellationToken); } @@ -267,22 +246,22 @@ public override int GetHashCode() { public override string ToString() { var sb = new StringBuilder("TThrottleQuota("); - int tmp83 = 0; + int tmp60 = 0; if((ThrottleLimit != null) && __isset.throttleLimit) { - if(0 < tmp83++) { sb.Append(", "); } + if(0 < tmp60++) { sb.Append(", "); } sb.Append("ThrottleLimit: "); ThrottleLimit.ToString(sb); } if(__isset.memLimit) { - if(0 < tmp83++) { sb.Append(", "); } + if(0 < tmp60++) { sb.Append(", "); } sb.Append("MemLimit: "); MemLimit.ToString(sb); } if(__isset.cpuLimit) { - if(0 < tmp83++) { sb.Append(", "); } + if(0 < tmp60++) { sb.Append(", "); } sb.Append("CpuLimit: "); CpuLimit.ToString(sb); } diff --git a/src/Apache.IoTDB/Rpc/Generated/TTimePartitionSlot.cs b/src/Apache.IoTDB/Rpc/Generated/TTimePartitionSlot.cs index 7ac09f7..abf1d79 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TTimePartitionSlot.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TTimePartitionSlot.cs @@ -43,13 +43,6 @@ public TTimePartitionSlot(long startTime) : this() this.StartTime = startTime; } - public TTimePartitionSlot DeepCopy() - { - var tmp12 = new TTimePartitionSlot(); - tmp12.StartTime = this.StartTime; - return tmp12; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/TTimedQuota.cs b/src/Apache.IoTDB/Rpc/Generated/TTimedQuota.cs index 153ed79..282ac91 100644 --- a/src/Apache.IoTDB/Rpc/Generated/TTimedQuota.cs +++ b/src/Apache.IoTDB/Rpc/Generated/TTimedQuota.cs @@ -46,14 +46,6 @@ public TTimedQuota(long timeUnit, long softLimit) : this() this.SoftLimit = softLimit; } - public TTimedQuota DeepCopy() - { - var tmp75 = new TTimedQuota(); - tmp75.TimeUnit = this.TimeUnit; - tmp75.SoftLimit = this.SoftLimit; - return tmp75; - } - public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); diff --git a/src/Apache.IoTDB/Rpc/Generated/client.Extensions.cs b/src/Apache.IoTDB/Rpc/Generated/client.Extensions.cs index 17fda94..49c8a7e 100644 --- a/src/Apache.IoTDB/Rpc/Generated/client.Extensions.cs +++ b/src/Apache.IoTDB/Rpc/Generated/client.Extensions.cs @@ -37,18 +37,6 @@ public static int GetHashCode(this Dictionary instance) } - public static Dictionary DeepCopy(this Dictionary source) - { - if (source == null) - return null; - - var tmp743 = new Dictionary(source.Count); - foreach (var pair in source) - tmp743.Add((pair.Key != null) ? pair.Key : null, pair.Value); - return tmp743; - } - - public static bool Equals(this Dictionary instance, object that) { if (!(that is Dictionary other)) return false; @@ -64,18 +52,6 @@ public static int GetHashCode(this Dictionary instance) } - public static Dictionary DeepCopy(this Dictionary source) - { - if (source == null) - return null; - - var tmp744 = new Dictionary(source.Count); - foreach (var pair in source) - tmp744.Add((pair.Key != null) ? pair.Key : null, (pair.Value != null) ? pair.Value : null); - return tmp744; - } - - public static bool Equals(this List> instance, object that) { if (!(that is List> other)) return false; @@ -91,18 +67,6 @@ public static int GetHashCode(this List> instance) } - public static List> DeepCopy(this List> source) - { - if (source == null) - return null; - - var tmp745 = new List>(source.Count); - foreach (var elem in source) - tmp745.Add((elem != null) ? elem.DeepCopy() : null); - return tmp745; - } - - public static bool Equals(this List> instance, object that) { if (!(that is List> other)) return false; @@ -118,18 +82,6 @@ public static int GetHashCode(this List> instance) } - public static List> DeepCopy(this List> source) - { - if (source == null) - return null; - - var tmp746 = new List>(source.Count); - foreach (var elem in source) - tmp746.Add((elem != null) ? elem.DeepCopy() : null); - return tmp746; - } - - public static bool Equals(this List> instance, object that) { if (!(that is List> other)) return false; @@ -145,18 +97,6 @@ public static int GetHashCode(this List> instance) } - public static List> DeepCopy(this List> source) - { - if (source == null) - return null; - - var tmp747 = new List>(source.Count); - foreach (var elem in source) - tmp747.Add((elem != null) ? elem.DeepCopy() : null); - return tmp747; - } - - public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; @@ -172,18 +112,6 @@ public static int GetHashCode(this List instance) } - public static List DeepCopy(this List source) - { - if (source == null) - return null; - - var tmp748 = new List(source.Count); - foreach (var elem in source) - tmp748.Add(elem); - return tmp748; - } - - public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; @@ -199,18 +127,6 @@ public static int GetHashCode(this List instance) } - public static List DeepCopy(this List source) - { - if (source == null) - return null; - - var tmp749 = new List(source.Count); - foreach (var elem in source) - tmp749.Add((elem != null) ? elem.DeepCopy() : null); - return tmp749; - } - - public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; @@ -226,18 +142,6 @@ public static int GetHashCode(this List instance) } - public static List DeepCopy(this List source) - { - if (source == null) - return null; - - var tmp750 = new List(source.Count); - foreach (var elem in source) - tmp750.Add((elem != null) ? elem.DeepCopy() : null); - return tmp750; - } - - public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; @@ -253,18 +157,6 @@ public static int GetHashCode(this List instance) } - public static List DeepCopy(this List source) - { - if (source == null) - return null; - - var tmp751 = new List(source.Count); - foreach (var elem in source) - tmp751.Add((elem != null) ? elem.ToArray() : null); - return tmp751; - } - - public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; @@ -280,18 +172,6 @@ public static int GetHashCode(this List instance) } - public static List DeepCopy(this List source) - { - if (source == null) - return null; - - var tmp752 = new List(source.Count); - foreach (var elem in source) - tmp752.Add(elem); - return tmp752; - } - - public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; @@ -307,18 +187,6 @@ public static int GetHashCode(this List instance) } - public static List DeepCopy(this List source) - { - if (source == null) - return null; - - var tmp753 = new List(source.Count); - foreach (var elem in source) - tmp753.Add(elem); - return tmp753; - } - - public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; @@ -334,18 +202,6 @@ public static int GetHashCode(this List instance) } - public static List DeepCopy(this List source) - { - if (source == null) - return null; - - var tmp754 = new List(source.Count); - foreach (var elem in source) - tmp754.Add(elem); - return tmp754; - } - - public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; @@ -361,16 +217,4 @@ public static int GetHashCode(this List instance) } - public static List DeepCopy(this List source) - { - if (source == null) - return null; - - var tmp755 = new List(source.Count); - foreach (var elem in source) - tmp755.Add((elem != null) ? elem : null); - return tmp755; - } - - } diff --git a/src/Apache.IoTDB/Rpc/Generated/common.Extensions.cs b/src/Apache.IoTDB/Rpc/Generated/common.Extensions.cs index 306f9b7..4fd2bad 100644 --- a/src/Apache.IoTDB/Rpc/Generated/common.Extensions.cs +++ b/src/Apache.IoTDB/Rpc/Generated/common.Extensions.cs @@ -37,18 +37,6 @@ public static int GetHashCode(this Dictionary instanc } - public static Dictionary DeepCopy(this Dictionary source) - { - if (source == null) - return null; - - var tmp122 = new Dictionary(source.Count); - foreach (var pair in source) - tmp122.Add(pair.Key, (pair.Value != null) ? pair.Value.DeepCopy() : null); - return tmp122; - } - - public static bool Equals(this Dictionary instance, object that) { if (!(that is Dictionary other)) return false; @@ -79,18 +67,6 @@ public static int GetHashCode(this List instance) } - public static List DeepCopy(this List source) - { - if (source == null) - return null; - - var tmp124 = new List(source.Count); - foreach (var elem in source) - tmp124.Add((elem != null) ? elem.DeepCopy() : null); - return tmp124; - } - - public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; @@ -106,18 +82,6 @@ public static int GetHashCode(this List instance) } - public static List DeepCopy(this List source) - { - if (source == null) - return null; - - var tmp125 = new List(source.Count); - foreach (var elem in source) - tmp125.Add((elem != null) ? elem.DeepCopy() : null); - return tmp125; - } - - public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; @@ -133,18 +97,6 @@ public static int GetHashCode(this List instance) } - public static List DeepCopy(this List source) - { - if (source == null) - return null; - - var tmp126 = new List(source.Count); - foreach (var elem in source) - tmp126.Add((elem != null) ? elem.DeepCopy() : null); - return tmp126; - } - - public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; @@ -175,18 +127,6 @@ public static int GetHashCode(this List instance) } - public static List DeepCopy(this List source) - { - if (source == null) - return null; - - var tmp128 = new List(source.Count); - foreach (var elem in source) - tmp128.Add((elem != null) ? elem.DeepCopy() : null); - return tmp128; - } - - public static bool Equals(this List instance, object that) { if (!(that is List other)) return false; From 40d9afd385f4288852c8346466268e1a57df1a5e Mon Sep 17 00:00:00 2001 From: CritasWang Date: Thu, 13 Feb 2025 17:03:42 +0800 Subject: [PATCH 2/3] feat: add TableSessionPool 1. add TableSessionPool 2. add SessionPool.Builder --- samples/Apache.IoTDB.Samples/Program.cs | 10 + .../SessionPoolTest.AlignedRecord.cs | 220 +- .../SessionPoolTest.AlignedTablet.cs | 56 +- .../SessionPoolTest.Record.cs | 272 +- .../SessionPoolTest.Tablet.cs | 78 +- .../SessionPoolTest.Template.cs | 46 +- .../SessionPoolTest.TestNetwork.cs | 122 +- .../SessionPoolTest.TimeSeries.cs | 66 +- .../Apache.IoTDB.Samples/SessionPoolTest.cs | 236 +- .../TableSessionPoolTest.cs | 182 + src/Apache.IoTDB/DataStructure/Tablet.cs | 79 +- src/Apache.IoTDB/IoTDBConstants.cs | 10 + src/Apache.IoTDB/SessionPool.Builder.cs | 139 + src/Apache.IoTDB/SessionPool.cs | 2976 +++++++++-------- src/Apache.IoTDB/TableSessionPool.Builder.cs | 146 + src/Apache.IoTDB/TableSessionPool.cs | 72 + 16 files changed, 2714 insertions(+), 1996 deletions(-) create mode 100644 samples/Apache.IoTDB.Samples/TableSessionPoolTest.cs create mode 100644 src/Apache.IoTDB/SessionPool.Builder.cs create mode 100644 src/Apache.IoTDB/TableSessionPool.Builder.cs create mode 100644 src/Apache.IoTDB/TableSessionPool.cs diff --git a/samples/Apache.IoTDB.Samples/Program.cs b/samples/Apache.IoTDB.Samples/Program.cs index 6b054e7..861ca27 100644 --- a/samples/Apache.IoTDB.Samples/Program.cs +++ b/samples/Apache.IoTDB.Samples/Program.cs @@ -32,6 +32,8 @@ public static async Task Main(string[] args) utilsTest.TestParseEndPoint(); var sessionPoolTest = new SessionPoolTest("iotdb"); await sessionPoolTest.Test(); + var tableSessionPoolTest = new TableSessionPoolTest(sessionPoolTest); + await tableSessionPoolTest.Test(); } public static void OpenDebugMode(this SessionPool session) @@ -42,5 +44,13 @@ public static void OpenDebugMode(this SessionPool session) builder.AddNLog(); }); } + public static void OpenDebugMode(this TableSessionPool session) + { + session.OpenDebugMode(builder => + { + builder.AddConsole(); + builder.AddNLog(); + }); + } } } diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedRecord.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedRecord.cs index 241a229..e43ef35 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedRecord.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedRecord.cs @@ -28,16 +28,16 @@ public partial class SessionPoolTest { public async Task TestInsertAlignedRecord() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); int status; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); - string prefixPath = string.Format("{0}.{1}", test_database_name, test_device); - var measurements = new List { test_measurements[1], test_measurements[2], test_measurements[3] }; + string prefixPath = string.Format("{0}.{1}", testDatabaseName, testDevice); + var measurements = new List { testMeasurements[1], testMeasurements[2], testMeasurements[3] }; var types = new List { TSDataType.TEXT, TSDataType.BOOLEAN, TSDataType.INT32 }; var encodings = new List { TSEncoding.PLAIN, TSEncoding.PLAIN, TSEncoding.PLAIN }; var compressors = new List { Compressor.UNCOMPRESSED, Compressor.UNCOMPRESSED, Compressor.UNCOMPRESSED }; @@ -45,89 +45,89 @@ public async Task TestInsertAlignedRecord() //System.Diagnostics.Debug.Assert(status == 0); var measures = new List - { test_measurements[1], test_measurements[2], test_measurements[3] }; + { testMeasurements[1], testMeasurements[2], testMeasurements[3] }; var values = new List { "test_text", true, (int)123 }; var tasks = new List>(); var start_ms = DateTime.Now.Ticks / 10000; - for (var timestamp = 1; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 1; timestamp <= fetchSize * processedSize; timestamp++) { var rowRecord = new RowRecord(timestamp, values, measures); var task = session_pool.InsertAlignedRecordAsync( - string.Format("{0}.{1}", test_database_name, test_device), rowRecord); + string.Format("{0}.{1}", testDatabaseName, testDevice), rowRecord); tasks.Add(task); } Task.WaitAll(tasks.ToArray()); var end_ms = DateTime.Now.Ticks / 10000; Console.WriteLine(string.Format("total insert record time is {0}", end_ms - start_ms)); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.Close(); Console.WriteLine("TestInsertAlignedRecordAsync Passed"); } public async Task TestInsertAlignedStringRecord() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); status = await session_pool.CreateAlignedTimeseriesAsync( - string.Format("{0}.{1}", test_database_name, test_device), - new List() { test_measurements[0], test_measurements[1], test_measurements[2] }, + string.Format("{0}.{1}", testDatabaseName, testDevice), + new List() { testMeasurements[0], testMeasurements[1], testMeasurements[2] }, new List() { TSDataType.TEXT, TSDataType.TEXT, TSDataType.TEXT }, new List() { TSEncoding.PLAIN, TSEncoding.PLAIN, TSEncoding.PLAIN }, new List() { Compressor.UNCOMPRESSED, Compressor.UNCOMPRESSED, Compressor.UNCOMPRESSED }); System.Diagnostics.Debug.Assert(status == 0); var measurements = new List - {test_measurements[0], test_measurements[1], test_measurements[2]}; + {testMeasurements[0], testMeasurements[1], testMeasurements[2]}; var values = new List { "test_text1", "test_text2", "test_text3" }; var tasks = new List>(); var start_ms = DateTime.Now.Ticks / 10000; - for (var timestamp = 1; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 1; timestamp <= fetchSize * processedSize; timestamp++) { var task = session_pool.InsertAlignedStringRecordAsync( - string.Format("{0}.{1}", test_database_name, test_device), measurements, values, timestamp); + string.Format("{0}.{1}", testDatabaseName, testDevice), measurements, values, timestamp); tasks.Add(task); } Task.WaitAll(tasks.ToArray()); var end_ms = DateTime.Now.Ticks / 10000; Console.WriteLine(string.Format("total insert aligned string record time is {0}", end_ms - start_ms)); - var res = await session_pool.ExecuteQueryStatementAsync("select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + var res = await session_pool.ExecuteQueryStatementAsync("select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); var res_cnt = 0; while (res.HasNext()) { res.Next(); res_cnt++; } - Console.WriteLine(res_cnt + " " + fetch_size * processed_size); - System.Diagnostics.Debug.Assert(res_cnt == fetch_size * processed_size); - await session_pool.DeleteDatabaseAsync(test_database_name); + Console.WriteLine(res_cnt + " " + fetchSize * processedSize); + System.Diagnostics.Debug.Assert(res_cnt == fetchSize * processedSize); + await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.Close(); Console.WriteLine("TestInsertAlignedStringRecordAsync Passed"); } public async Task TestInsertAlignedRecords() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); var status = 0; - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); - string prefixPath = string.Format("{0}.{1}", test_database_name, test_device); + string prefixPath = string.Format("{0}.{1}", testDatabaseName, testDevice); var measurement_lst = new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4], - test_measurements[5], - test_measurements[6] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4], + testMeasurements[5], + testMeasurements[6] }; var data_type_lst = new List() { @@ -149,24 +149,24 @@ public async Task TestInsertAlignedRecords() System.Diagnostics.Debug.Assert(status == 0); var device_id = new List() { }; - for (var i = 0; i < 3; i++) device_id.Add(string.Format("{0}.{1}", test_database_name, test_device)); + for (var i = 0; i < 3; i++) device_id.Add(string.Format("{0}.{1}", testDatabaseName, testDevice)); var measurements_lst = new List>() { }; - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); measurements_lst.Add(new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4] }); measurements_lst.Add(new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4], - test_measurements[5], - test_measurements[6] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4], + testMeasurements[5], + testMeasurements[6] }); var values_lst = new List>() { }; values_lst.Add(new List() { true, (int)123 }); @@ -184,7 +184,7 @@ public async Task TestInsertAlignedRecords() status = await session_pool.InsertAlignedRecordsAsync(device_id, rowRecords); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -195,12 +195,12 @@ public async Task TestInsertAlignedRecords() device_id = new List() { }; rowRecords = new List() { }; var tasks = new List>(); - for (var timestamp = 4; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 4; timestamp <= fetchSize * processedSize; timestamp++) { - device_id.Add(string.Format("{0}.{1}", test_database_name, test_device)); + device_id.Add(string.Format("{0}.{1}", testDatabaseName, testDevice)); rowRecords.Add(new RowRecord(timestamp, new List() { true, (int)123 }, - new List() { test_measurements[1], test_measurements[2] })); - if (timestamp % fetch_size == 0) + new List() { testMeasurements[1], testMeasurements[2] })); + if (timestamp % fetchSize == 0) { tasks.Add(session_pool.InsertAlignedRecordsAsync(device_id, rowRecords)); device_id = new List() { }; @@ -210,9 +210,9 @@ public async Task TestInsertAlignedRecords() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); res.ShowTableNames(); - var record_count = fetch_size * processed_size; + var record_count = fetchSize * processedSize; var res_count = 0; while (res.HasNext()) { @@ -221,27 +221,27 @@ public async Task TestInsertAlignedRecords() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); + Console.WriteLine(res_count + " " + fetchSize * processedSize); System.Diagnostics.Debug.Assert(res_count == record_count); System.Diagnostics.Debug.Assert(status == 0); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertAlignedRecords Passed!"); } public async Task TestInsertAlignedStringRecords() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); var status = 0; - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); - string prefixPath = string.Format("{0}.{1}", test_database_name, test_device); - var measurement_lst = new List() { test_measurements[1], test_measurements[2] }; + string prefixPath = string.Format("{0}.{1}", testDatabaseName, testDevice); + var measurement_lst = new List() { testMeasurements[1], testMeasurements[2] }; var data_type_lst = new List() { TSDataType.TEXT, TSDataType.TEXT }; var encoding_lst = new List() { TSEncoding.PLAIN, TSEncoding.PLAIN }; var compressor_lst = new List() { Compressor.SNAPPY, Compressor.SNAPPY }; @@ -250,11 +250,11 @@ public async Task TestInsertAlignedStringRecords() System.Diagnostics.Debug.Assert(status == 0); var device_id = new List() { }; - for (var i = 0; i < 3; i++) device_id.Add(string.Format("{0}.{1}", test_database_name, test_device)); + for (var i = 0; i < 3; i++) device_id.Add(string.Format("{0}.{1}", testDatabaseName, testDevice)); var measurements_lst = new List>() { }; - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); var values_lst = new List>() { }; values_lst.Add(new List() { "test1", "test2" }); values_lst.Add(new List() { "test3", "test4" }); @@ -264,7 +264,7 @@ public async Task TestInsertAlignedStringRecords() status = await session_pool.InsertAlignedStringRecordsAsync(device_id, measurements_lst, values_lst, timestamp_lst); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -276,13 +276,13 @@ public async Task TestInsertAlignedStringRecords() values_lst = new List>() { }; timestamp_lst = new List() { }; List> tasks = new List>(); - for (var timestamp = 4; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 4; timestamp <= fetchSize * processedSize; timestamp++) { - device_id.Add(string.Format("{0}.{1}", test_database_name, test_device)); - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); + device_id.Add(string.Format("{0}.{1}", testDatabaseName, testDevice)); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); values_lst.Add(new List() { "test1", "test2" }); timestamp_lst.Add(timestamp); - if (timestamp % fetch_size == 0) + if (timestamp % fetchSize == 0) { tasks.Add(session_pool.InsertAlignedStringRecordsAsync(device_id, measurements_lst, values_lst, timestamp_lst)); device_id = new List() { }; @@ -294,7 +294,7 @@ public async Task TestInsertAlignedStringRecords() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); res.ShowTableNames(); var res_count = 0; while (res.HasNext()) @@ -304,32 +304,32 @@ public async Task TestInsertAlignedStringRecords() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); - System.Diagnostics.Debug.Assert(res_count == fetch_size * processed_size); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + Console.WriteLine(res_count + " " + fetchSize * processedSize); + System.Diagnostics.Debug.Assert(res_count == fetchSize * processedSize); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertAlignedStringRecords Passed!"); } public async Task TestInsertAlignedRecordsOfOneDevice() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); var status = 0; - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); - string prefixPath = string.Format("{0}.{1}", test_database_name, test_device); + string prefixPath = string.Format("{0}.{1}", testDatabaseName, testDevice); var measurement_lst = new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4], - test_measurements[5], - test_measurements[6] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4], + testMeasurements[5], + testMeasurements[6] }; var data_type_lst = new List() { @@ -351,24 +351,24 @@ public async Task TestInsertAlignedRecordsOfOneDevice() compressor_lst); System.Diagnostics.Debug.Assert(status == 0); - var device_id = string.Format("{0}.{1}", test_database_name, test_device); + var device_id = string.Format("{0}.{1}", testDatabaseName, testDevice); var measurements_lst = new List>() { }; - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); measurements_lst.Add(new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4] }); measurements_lst.Add(new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4], - test_measurements[5], - test_measurements[6] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4], + testMeasurements[5], + testMeasurements[6] }); var values_lst = new List>() { }; values_lst.Add(new List() { true, (int)123 }); @@ -385,18 +385,18 @@ public async Task TestInsertAlignedRecordsOfOneDevice() status = await session_pool.InsertAlignedRecordsOfOneDeviceAsync(device_id, rowRecords); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); rowRecords = new List() { }; var tasks = new List>(); - for (var timestamp = 4; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 4; timestamp <= fetchSize * processedSize; timestamp++) { rowRecords.Add(new RowRecord(timestamp, new List() { true, (int)123 }, - new List() { test_measurements[1], test_measurements[2] })); - if (timestamp % fetch_size == 0) + new List() { testMeasurements[1], testMeasurements[2] })); + if (timestamp % fetchSize == 0) { tasks.Add(session_pool.InsertAlignedRecordsOfOneDeviceAsync(device_id, rowRecords)); rowRecords = new List() { }; @@ -405,7 +405,7 @@ public async Task TestInsertAlignedRecordsOfOneDevice() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); var res_count = 0; while (res.HasNext()) { @@ -414,24 +414,24 @@ public async Task TestInsertAlignedRecordsOfOneDevice() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); - System.Diagnostics.Debug.Assert(res_count == fetch_size * processed_size); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + Console.WriteLine(res_count + " " + fetchSize * processedSize); + System.Diagnostics.Debug.Assert(res_count == fetchSize * processedSize); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertAlignedRecordsOfOneDevice Passed!"); } public async Task TestInsertAlignedStringRecordsOfOneDevice() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); var status = 0; - await session_pool.DeleteDatabaseAsync(test_database_name); - var device_id = string.Format("{0}.{1}", test_database_name, test_device); - var measurements = new List() { test_measurements[0], test_measurements[1], test_measurements[2] }; + await session_pool.DeleteDatabaseAsync(testDatabaseName); + var device_id = string.Format("{0}.{1}", testDatabaseName, testDevice); + var measurements = new List() { testMeasurements[0], testMeasurements[1], testMeasurements[2] }; var data_type_lst = new List() { TSDataType.TEXT, TSDataType.TEXT, TSDataType.TEXT }; var encoding_lst = new List() { TSEncoding.PLAIN, TSEncoding.PLAIN, TSEncoding.PLAIN }; var compressor_lst = new List() { Compressor.SNAPPY, Compressor.SNAPPY, Compressor.SNAPPY }; @@ -439,9 +439,9 @@ public async Task TestInsertAlignedStringRecordsOfOneDevice() System.Diagnostics.Debug.Assert(status == 0); var measurements_lst = new List>() { }; - measurements_lst.Add(new List() { test_measurements[0], test_measurements[1], test_measurements[2] }); - measurements_lst.Add(new List() { test_measurements[0], test_measurements[1], test_measurements[2] }); - measurements_lst.Add(new List() { test_measurements[0], test_measurements[1], test_measurements[2] }); + measurements_lst.Add(new List() { testMeasurements[0], testMeasurements[1], testMeasurements[2] }); + measurements_lst.Add(new List() { testMeasurements[0], testMeasurements[1], testMeasurements[2] }); + measurements_lst.Add(new List() { testMeasurements[0], testMeasurements[1], testMeasurements[2] }); var values_lst = new List>() { }; values_lst.Add(new List() { "test1", "test2", "test3" }); @@ -453,7 +453,7 @@ public async Task TestInsertAlignedStringRecordsOfOneDevice() status = await session_pool.InsertAlignedStringRecordsOfOneDeviceAsync(device_id, timestamp_lst, measurements_lst, values_lst); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -463,12 +463,12 @@ public async Task TestInsertAlignedStringRecordsOfOneDevice() var tasks = new List>(); measurements_lst = new List>() { }; timestamp_lst = new List() { }; - for (var timestamp = 4; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 4; timestamp <= fetchSize * processedSize; timestamp++) { values_lst.Add(new List() { "test1", "test2" }); - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); timestamp_lst.Add(timestamp); - if (timestamp % fetch_size == 0) + if (timestamp % fetchSize == 0) { tasks.Add(session_pool.InsertAlignedStringRecordsOfOneDeviceAsync(device_id, timestamp_lst, measurements_lst, values_lst)); values_lst = new List>() { }; @@ -479,7 +479,7 @@ public async Task TestInsertAlignedStringRecordsOfOneDevice() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); var res_count = 0; while (res.HasNext()) { @@ -488,9 +488,9 @@ public async Task TestInsertAlignedStringRecordsOfOneDevice() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); - System.Diagnostics.Debug.Assert(res_count == fetch_size * processed_size); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + Console.WriteLine(res_count + " " + fetchSize * processedSize); + System.Diagnostics.Debug.Assert(res_count == fetchSize * processedSize); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertAlignedStringRecordsOfOneDevice Passed!"); diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedTablet.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedTablet.cs index 1b6f044..1b63271 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedTablet.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedTablet.cs @@ -29,18 +29,18 @@ public partial class SessionPoolTest { public async Task TestInsertAlignedTablet() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); - var device_id = string.Format("{0}.{1}", test_database_name, test_device); + await session_pool.DeleteDatabaseAsync(testDatabaseName); + var device_id = string.Format("{0}.{1}", testDatabaseName, testDevice); var measurement_lst = new List - { test_measurements[1], - test_measurements[2], - test_measurements[3] + { testMeasurements[1], + testMeasurements[2], + testMeasurements[3] }; var value_lst = new List> { @@ -53,7 +53,7 @@ public async Task TestInsertAlignedTablet() status = await session_pool.InsertAlignedTabletAsync(tablet); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<15"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -63,11 +63,11 @@ public async Task TestInsertAlignedTablet() timestamp_lst = new List() { }; var tasks = new List>(); var start_ms = DateTime.Now.Ticks / 10000; - for (var timestamp = 4; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 4; timestamp <= fetchSize * processedSize; timestamp++) { timestamp_lst.Add(timestamp); value_lst.Add(new List() { "iotdb", true, (int)timestamp }); - if (timestamp % fetch_size == 0) + if (timestamp % fetchSize == 0) { tablet = new Tablet(device_id, measurement_lst, datatype_lst, value_lst, timestamp_lst); tasks.Add(session_pool.InsertAlignedTabletAsync(tablet)); @@ -81,7 +81,7 @@ public async Task TestInsertAlignedTablet() var end_ms = DateTime.Now.Ticks / 10000; Console.WriteLine(string.Format("total tablet insert time is {0}", end_ms - start_ms)); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); res.ShowTableNames(); var res_count = 0; while (res.HasNext()) @@ -91,9 +91,9 @@ public async Task TestInsertAlignedTablet() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); - System.Diagnostics.Debug.Assert(res_count == fetch_size * processed_size); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + Console.WriteLine(res_count + " " + fetchSize * processedSize); + System.Diagnostics.Debug.Assert(res_count == fetchSize * processedSize); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertAlignedTablet Passed!"); @@ -101,22 +101,22 @@ public async Task TestInsertAlignedTablet() public async Task TestInsertAlignedTablets() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); var device_id = new List() { - string.Format("{0}.{1}", test_database_name, test_devices[1]), - string.Format("{0}.{1}", test_database_name, test_devices[2]) + string.Format("{0}.{1}", testDatabaseName, testDevices[1]), + string.Format("{0}.{1}", testDatabaseName, testDevices[2]) }; var measurements_lst = new List>() { - new() {test_measurements[1], test_measurements[2], test_measurements[3] }, - new() {test_measurements[1], test_measurements[2], test_measurements[3] } + new() {testMeasurements[1], testMeasurements[2], testMeasurements[3] }, + new() {testMeasurements[1], testMeasurements[2], testMeasurements[3] } }; var values_lst = new List>>() { @@ -148,24 +148,24 @@ public async Task TestInsertAlignedTablets() status = await session_pool.InsertAlignedTabletsAsync(tablets); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_devices[1]) + " where time<15"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); // large data test var tasks = new List>(); // tablets = new List() { }; - for (var timestamp = 4; timestamp <= processed_size * fetch_size; timestamp++) + for (var timestamp = 4; timestamp <= processedSize * fetchSize; timestamp++) { - var local_device_id = string.Format("{0}.{1}", test_database_name, test_devices[1]); + var local_device_id = string.Format("{0}.{1}", testDatabaseName, testDevices[1]); var local_measurements = new List() - {test_measurements[1], test_measurements[2], test_measurements[3]}; + {testMeasurements[1], testMeasurements[2], testMeasurements[3]}; var local_value = new List>() { new() { "iotdb", true, (int)timestamp } }; var local_data_type = new List() { TSDataType.TEXT, TSDataType.BOOLEAN, TSDataType.INT32 }; var local_timestamp = new List { timestamp }; var tablet = new Tablet(local_device_id, local_measurements, local_data_type, local_value, local_timestamp); tablets.Add(tablet); - if (timestamp % fetch_size == 0) + if (timestamp % fetchSize == 0) { tasks.Add(session_pool.InsertAlignedTabletsAsync(tablets)); tablets = new List() { }; @@ -174,7 +174,7 @@ public async Task TestInsertAlignedTablets() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_devices[1])); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1])); res.ShowTableNames(); var res_count = 0; while (res.HasNext()) @@ -184,9 +184,9 @@ public async Task TestInsertAlignedTablets() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); - System.Diagnostics.Debug.Assert(res_count == fetch_size * processed_size); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + Console.WriteLine(res_count + " " + fetchSize * processedSize); + System.Diagnostics.Debug.Assert(res_count == fetchSize * processedSize); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertAlignedTablets Passed!"); diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.Record.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.Record.cs index a0b26e6..3a7f7c3 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.Record.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.Record.cs @@ -30,125 +30,125 @@ public partial class SessionPoolTest public async Task TestInsertRecord() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); int status; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), TSDataType.TEXT, + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.BOOLEAN, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[3]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[3]), TSDataType.INT32, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); var measures = new List - {test_measurements[1], test_measurements[2], test_measurements[3]}; + {testMeasurements[1], testMeasurements[2], testMeasurements[3]}; var values = new List { "test_text", true, (int)123 }; var tasks = new List>(); var start_ms = DateTime.Now.Ticks / 10000; - for (var timestamp = 1; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 1; timestamp <= fetchSize * processedSize; timestamp++) { var rowRecord = new RowRecord(timestamp, values, measures); var task = session_pool.InsertRecordAsync( - string.Format("{0}.{1}", test_database_name, test_device), rowRecord); + string.Format("{0}.{1}", testDatabaseName, testDevice), rowRecord); tasks.Add(task); } Task.WaitAll(tasks.ToArray()); var end_ms = DateTime.Now.Ticks / 10000; Console.WriteLine(string.Format("total insert aligned record time is {0}", end_ms - start_ms)); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.Close(); Console.WriteLine("TestInsertRecordAsync Passed"); } public async Task TestInsertStringRecord() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[0]), TSDataType.TEXT, + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[0]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); var measurements = new List - {test_measurements[0], test_measurements[1], test_measurements[2]}; + {testMeasurements[0], testMeasurements[1], testMeasurements[2]}; var values = new List { "test_text1", "test_text2", "test_text3" }; var tasks = new List>(); var start_ms = DateTime.Now.Ticks / 10000; - for (var timestamp = 1; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 1; timestamp <= fetchSize * processedSize; timestamp++) { var task = session_pool.InsertStringRecordAsync( - string.Format("{0}.{1}", test_database_name, test_device), measurements, values, timestamp); + string.Format("{0}.{1}", testDatabaseName, testDevice), measurements, values, timestamp); tasks.Add(task); } Task.WaitAll(tasks.ToArray()); var end_ms = DateTime.Now.Ticks / 10000; Console.WriteLine(string.Format("total insert string record time is {0}", end_ms - start_ms)); - var res = await session_pool.ExecuteQueryStatementAsync("select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + var res = await session_pool.ExecuteQueryStatementAsync("select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); var res_cnt = 0; while (res.HasNext()) { res.Next(); res_cnt++; } - Console.WriteLine(res_cnt + " " + fetch_size * processed_size); - System.Diagnostics.Debug.Assert(res_cnt == fetch_size * processed_size); - await session_pool.DeleteDatabaseAsync(test_database_name); + Console.WriteLine(res_cnt + " " + fetchSize * processedSize); + System.Diagnostics.Debug.Assert(res_cnt == fetchSize * processedSize); + await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.Close(); Console.WriteLine("TestInsertStringRecordAsync Passed"); } public async Task TestInsertStrRecord() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.INT32, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.INT32, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); - var measures = new List { test_measurements[1], test_measurements[2] }; + var measures = new List { testMeasurements[1], testMeasurements[2] }; var values = new List { (int)1, (int)2 }; var rowRecord = new RowRecord(1, values, measures); status = await session_pool.InsertRecordAsync( - string.Format("{0}.{1}", test_database_name, test_device), rowRecord); + string.Format("{0}.{1}", testDatabaseName, testDevice), rowRecord); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<2"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<2"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -157,19 +157,19 @@ public async Task TestInsertStrRecord() var tasks = new List>(); // large data test var rowRecords = new List() { }; - for (var timestamp = 2; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 2; timestamp <= fetchSize * processedSize; timestamp++) rowRecords.Add(new RowRecord(timestamp, values, measures)); - for (var timestamp = 2; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 2; timestamp <= fetchSize * processedSize; timestamp++) { var task = session_pool.InsertRecordAsync( - string.Format("{0}.{1}", test_database_name, test_device), rowRecords[timestamp - 2]); + string.Format("{0}.{1}", testDatabaseName, testDevice), rowRecords[timestamp - 2]); tasks.Add(task); } Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); var res_count = 0; while (res.HasNext()) { @@ -178,66 +178,66 @@ public async Task TestInsertStrRecord() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); - System.Diagnostics.Debug.Assert(res_count == fetch_size * processed_size); - await session_pool.DeleteDatabaseAsync(test_database_name); + Console.WriteLine(res_count + " " + fetchSize * processedSize); + System.Diagnostics.Debug.Assert(res_count == fetchSize * processedSize); + await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.Close(); Console.WriteLine("TestInsertStrRecord Passed!"); } public async Task TestInsertRecords() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); var status = 0; - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.BOOLEAN, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.INT32, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[3]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[3]), TSDataType.INT64, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[4]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[4]), TSDataType.DOUBLE, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[5]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[5]), TSDataType.FLOAT, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[6]), TSDataType.TEXT, + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[6]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); var device_id = new List() { }; - for (var i = 0; i < 3; i++) device_id.Add(string.Format("{0}.{1}", test_database_name, test_device)); + for (var i = 0; i < 3; i++) device_id.Add(string.Format("{0}.{1}", testDatabaseName, testDevice)); var measurements_lst = new List>() { }; - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); measurements_lst.Add(new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4] }); measurements_lst.Add(new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4], - test_measurements[5], - test_measurements[6] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4], + testMeasurements[5], + testMeasurements[6] }); var values_lst = new List>() { }; values_lst.Add(new List() { true, (int)123 }); @@ -255,7 +255,7 @@ public async Task TestInsertRecords() status = await session_pool.InsertRecordsAsync(device_id, rowRecords); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -266,12 +266,12 @@ public async Task TestInsertRecords() device_id = new List() { }; rowRecords = new List() { }; var tasks = new List>(); - for (var timestamp = 4; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 4; timestamp <= fetchSize * processedSize; timestamp++) { - device_id.Add(string.Format("{0}.{1}", test_database_name, test_device)); + device_id.Add(string.Format("{0}.{1}", testDatabaseName, testDevice)); rowRecords.Add(new RowRecord(timestamp, new List() { true, (int)123 }, - new List() { test_measurements[1], test_measurements[2] })); - if (timestamp % fetch_size == 0) + new List() { testMeasurements[1], testMeasurements[2] })); + if (timestamp % fetchSize == 0) { tasks.Add(session_pool.InsertRecordsAsync(device_id, rowRecords)); device_id = new List() { }; @@ -281,9 +281,9 @@ public async Task TestInsertRecords() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); res.ShowTableNames(); - var record_count = fetch_size * processed_size; + var record_count = fetchSize * processedSize; var res_count = 0; while (res.HasNext()) { @@ -292,11 +292,11 @@ public async Task TestInsertRecords() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); + Console.WriteLine(res_count + " " + fetchSize * processedSize); System.Diagnostics.Debug.Assert(res_count == record_count); System.Diagnostics.Debug.Assert(status == 0); - string sql = string.Format("select {0}, {1}, {2} from ", test_measurements[3], test_measurements[1], test_measurements[2]) + string.Format("{0}.{1}", test_database_name, test_device); + string sql = string.Format("select {0}, {1}, {2} from ", testMeasurements[3], testMeasurements[1], testMeasurements[2]) + string.Format("{0}.{1}", testDatabaseName, testDevice); res = await session_pool.ExecuteQueryStatementAsync(sql); res.ShowTableNames(); RowRecord row = null; @@ -306,41 +306,41 @@ public async Task TestInsertRecords() break; } - Console.WriteLine($"{test_database_name}.{test_device}.{row.Measurements[0]} {test_measurements[3]}"); - System.Diagnostics.Debug.Assert($"{test_database_name}.{test_device}.{test_measurements[3]}" == row.Measurements[0]); - System.Diagnostics.Debug.Assert($"{test_database_name}.{test_device}.{test_measurements[1]}" == row.Measurements[1]); - System.Diagnostics.Debug.Assert($"{test_database_name}.{test_device}.{test_measurements[2]}" == row.Measurements[2]); + 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]); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertRecords Passed!"); } public async Task TestInsertStringRecords() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); var status = 0; - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), TSDataType.TEXT, + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), TSDataType.TEXT, + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); var device_id = new List() { }; - for (var i = 0; i < 3; i++) device_id.Add(string.Format("{0}.{1}", test_database_name, test_device)); + for (var i = 0; i < 3; i++) device_id.Add(string.Format("{0}.{1}", testDatabaseName, testDevice)); var measurements_lst = new List>() { }; - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); var values_lst = new List>() { }; values_lst.Add(new List() { "test1", "test2" }); values_lst.Add(new List() { "test3", "test4" }); @@ -350,7 +350,7 @@ public async Task TestInsertStringRecords() status = await session_pool.InsertStringRecordsAsync(device_id, measurements_lst, values_lst, timestamp_lst); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -362,13 +362,13 @@ public async Task TestInsertStringRecords() values_lst = new List>() { }; timestamp_lst = new List() { }; var tasks = new List>(); - for (var timestamp = 4; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 4; timestamp <= fetchSize * processedSize; timestamp++) { - device_id.Add(string.Format("{0}.{1}", test_database_name, test_device)); - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); + device_id.Add(string.Format("{0}.{1}", testDatabaseName, testDevice)); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); values_lst.Add(new List() { "test" + timestamp, "test" + timestamp }); timestamp_lst.Add(timestamp); - if (timestamp % fetch_size == 0) + if (timestamp % fetchSize == 0) { tasks.Add(session_pool.InsertStringRecordsAsync(device_id, measurements_lst, values_lst, timestamp_lst)); device_id = new List() { }; @@ -380,9 +380,9 @@ public async Task TestInsertStringRecords() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); res.ShowTableNames(); - var record_count = fetch_size * processed_size; + var record_count = fetchSize * processedSize; var res_count = 0; while (res.HasNext()) { @@ -391,65 +391,65 @@ public async Task TestInsertStringRecords() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); + Console.WriteLine(res_count + " " + fetchSize * processedSize); System.Diagnostics.Debug.Assert(res_count == record_count); System.Diagnostics.Debug.Assert(status == 0); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertStringRecords Passed!"); } public async Task TestInsertRecordsOfOneDevice() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); var status = 0; - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.BOOLEAN, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.INT32, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[3]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[3]), TSDataType.INT64, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[4]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[4]), TSDataType.DOUBLE, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[5]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[5]), TSDataType.FLOAT, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[6]), TSDataType.TEXT, + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[6]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); - var device_id = string.Format("{0}.{1}", test_database_name, test_device); + var device_id = string.Format("{0}.{1}", testDatabaseName, testDevice); var measurements_lst = new List>() { }; - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); measurements_lst.Add(new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4] }); measurements_lst.Add(new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4], - test_measurements[5], - test_measurements[6] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4], + testMeasurements[5], + testMeasurements[6] }); var values_lst = new List>() { }; values_lst.Add(new List() { true, (int)123 }); @@ -467,7 +467,7 @@ public async Task TestInsertRecordsOfOneDevice() status = await session_pool.InsertRecordsOfOneDeviceAsync(device_id, rowRecords); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -475,11 +475,11 @@ public async Task TestInsertRecordsOfOneDevice() // large data test rowRecords = new List() { }; var tasks = new List>(); - for (var timestamp = 4; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 4; timestamp <= fetchSize * processedSize; timestamp++) { rowRecords.Add(new RowRecord(timestamp, new List() { true, (int)123 }, - new List() { test_measurements[1], test_measurements[2] })); - if (timestamp % fetch_size == 0) + new List() { testMeasurements[1], testMeasurements[2] })); + if (timestamp % fetchSize == 0) { tasks.Add(session_pool.InsertRecordsOfOneDeviceAsync(device_id, rowRecords)); rowRecords = new List() { }; @@ -488,7 +488,7 @@ public async Task TestInsertRecordsOfOneDevice() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); var res_count = 0; while (res.HasNext()) { @@ -497,40 +497,40 @@ public async Task TestInsertRecordsOfOneDevice() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); - System.Diagnostics.Debug.Assert(res_count == fetch_size * processed_size); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + Console.WriteLine(res_count + " " + fetchSize * processedSize); + System.Diagnostics.Debug.Assert(res_count == fetchSize * processedSize); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertRecordsOfOneDevice Passed!"); } public async Task TestInsertStringRecordsOfOneDevice() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); var status = 0; - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[0]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[0]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); - var device_id = string.Format("{0}.{1}", test_database_name, test_device); + var device_id = string.Format("{0}.{1}", testDatabaseName, testDevice); var measurements_lst = new List>() { }; - measurements_lst.Add(new List() { test_measurements[0], test_measurements[1], test_measurements[2] }); - measurements_lst.Add(new List() { test_measurements[0], test_measurements[1], test_measurements[2] }); - measurements_lst.Add(new List() { test_measurements[0], test_measurements[1], test_measurements[2] }); + measurements_lst.Add(new List() { testMeasurements[0], testMeasurements[1], testMeasurements[2] }); + measurements_lst.Add(new List() { testMeasurements[0], testMeasurements[1], testMeasurements[2] }); + measurements_lst.Add(new List() { testMeasurements[0], testMeasurements[1], testMeasurements[2] }); var values_lst = new List>() { }; values_lst.Add(new List() { "test1", "test2", "test3" }); @@ -542,7 +542,7 @@ public async Task TestInsertStringRecordsOfOneDevice() status = await session_pool.InsertStringRecordsOfOneDeviceAsync(device_id, timestamp_lst, measurements_lst, values_lst); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -552,12 +552,12 @@ public async Task TestInsertStringRecordsOfOneDevice() var tasks = new List>(); measurements_lst = new List>() { }; timestamp_lst = new List() { }; - for (var timestamp = 4; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 4; timestamp <= fetchSize * processedSize; timestamp++) { values_lst.Add(new List() { "test1", "test2" }); - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); timestamp_lst.Add(timestamp); - if (timestamp % fetch_size == 0) + if (timestamp % fetchSize == 0) { tasks.Add(session_pool.InsertStringRecordsOfOneDeviceAsync(device_id, timestamp_lst, measurements_lst, values_lst)); values_lst = new List>() { }; @@ -568,7 +568,7 @@ public async Task TestInsertStringRecordsOfOneDevice() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); var res_count = 0; while (res.HasNext()) { @@ -577,9 +577,9 @@ public async Task TestInsertStringRecordsOfOneDevice() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); - System.Diagnostics.Debug.Assert(res_count == fetch_size * processed_size); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + Console.WriteLine(res_count + " " + fetchSize * processedSize); + System.Diagnostics.Debug.Assert(res_count == fetchSize * processedSize); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertStringRecordsOfOneDevice Passed!"); @@ -587,13 +587,13 @@ public async Task TestInsertStringRecordsOfOneDevice() public async Task TestInsertRecordsWithAllType() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); var measurements = new List { @@ -641,14 +641,14 @@ public async Task TestInsertRecordsWithAllType() var rowRecord2 = new RowRecord(2, values2, measurements, dataTypes); var rowRecord3 = new RowRecord(3, values3, measurements, dataTypes); - var device_id = new List { string.Format("{0}.{1}", test_database_name, test_device),string.Format("{0}.{1}", test_database_name, test_device),string.Format("{0}.{1}", test_database_name, test_device) }; + var device_id = new List { string.Format("{0}.{1}", testDatabaseName, testDevice),string.Format("{0}.{1}", testDatabaseName, testDevice),string.Format("{0}.{1}", testDatabaseName, testDevice) }; var rowRecords = new List { rowRecord1, rowRecord2, rowRecord3 }; status = await session_pool.InsertRecordsAsync(device_id, rowRecords); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); res.ShowTableNames(); var res_count = 0; while (res.HasNext()) @@ -658,7 +658,7 @@ public async Task TestInsertRecordsWithAllType() } await res.Close(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertRecordsWithAllType Passed!"); diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.Tablet.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.Tablet.cs index e7c5f5b..299050e 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.Tablet.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.Tablet.cs @@ -29,19 +29,19 @@ public partial class SessionPoolTest { public async Task TestInsertTablet() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); - var device_id = string.Format("{0}.{1}", test_database_name, test_device); + await session_pool.DeleteDatabaseAsync(testDatabaseName); + var device_id = string.Format("{0}.{1}", testDatabaseName, testDevice); var measurement_lst = new List { - test_measurements[1], - test_measurements[2], - test_measurements[3] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3] }; var value_lst = new List> { @@ -54,7 +54,7 @@ public async Task TestInsertTablet() status = await session_pool.InsertTabletAsync(tablet); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<15"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -64,11 +64,11 @@ public async Task TestInsertTablet() timestamp_lst = new List() { }; var tasks = new List>(); var start_ms = DateTime.Now.Ticks / 10000; - for (var timestamp = 4; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 4; timestamp <= fetchSize * processedSize; timestamp++) { timestamp_lst.Add(timestamp); value_lst.Add(new List() { "iotdb", true, (int)timestamp }); - if (timestamp % fetch_size == 0) + if (timestamp % fetchSize == 0) { tablet = new Tablet(device_id, measurement_lst, datatype_lst, value_lst, timestamp_lst); tasks.Add(session_pool.InsertTabletAsync(tablet)); @@ -81,7 +81,7 @@ public async Task TestInsertTablet() var end_ms = DateTime.Now.Ticks / 10000; Console.WriteLine(string.Format("total tablet insert time is {0}", end_ms - start_ms)); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); res.ShowTableNames(); var res_count = 0; while (res.HasNext()) @@ -91,9 +91,9 @@ public async Task TestInsertTablet() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); - System.Diagnostics.Debug.Assert(res_count == fetch_size * processed_size); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + Console.WriteLine(res_count + " " + fetchSize * processedSize); + System.Diagnostics.Debug.Assert(res_count == fetchSize * processedSize); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertTablet Passed!"); @@ -101,22 +101,22 @@ public async Task TestInsertTablet() public async Task TestInsertTablets() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); var device_id = new List() { - string.Format("{0}.{1}", test_database_name, test_devices[1]), - string.Format("{0}.{1}", test_database_name, test_devices[2]) + string.Format("{0}.{1}", testDatabaseName, testDevices[1]), + string.Format("{0}.{1}", testDatabaseName, testDevices[2]) }; var measurements_lst = new List>() { - new() {test_measurements[1], test_measurements[2], test_measurements[3]}, - new() {test_measurements[1], test_measurements[2], test_measurements[3]} + new() {testMeasurements[1], testMeasurements[2], testMeasurements[3]}, + new() {testMeasurements[1], testMeasurements[2], testMeasurements[3]} }; var values_lst = new List>>() { @@ -148,7 +148,7 @@ public async Task TestInsertTablets() status = await session_pool.InsertTabletsAsync(tablets); // System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_devices[1]) + " where time<15"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -156,17 +156,17 @@ public async Task TestInsertTablets() var tasks = new List>(); // tablets = new List(); - for (var timestamp = 4; timestamp <= processed_size * fetch_size; timestamp++) + for (var timestamp = 4; timestamp <= processedSize * fetchSize; timestamp++) { - var local_device_id = string.Format("{0}.{1}", test_database_name, test_devices[1]); + var local_device_id = string.Format("{0}.{1}", testDatabaseName, testDevices[1]); var local_measurements = new List() - {test_measurements[1], test_measurements[2], test_measurements[3]}; + {testMeasurements[1], testMeasurements[2], testMeasurements[3]}; var local_value = new List>() { new() { "iotdb", true, (int)timestamp } }; var local_timestamp = new List { timestamp }; var local_data_type = new List { TSDataType.TEXT, TSDataType.BOOLEAN, TSDataType.INT32 }; var tablet = new Tablet(local_device_id, local_measurements, local_data_type, local_value, local_timestamp); tablets.Add(tablet); - if (timestamp % fetch_size == 0) + if (timestamp % fetchSize == 0) { tasks.Add(session_pool.InsertTabletsAsync(tablets)); tablets = new List() { }; @@ -175,7 +175,7 @@ public async Task TestInsertTablets() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_devices[1])); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1])); res.ShowTableNames(); var res_count = 0; while (res.HasNext()) @@ -185,24 +185,24 @@ public async Task TestInsertTablets() } await res.Close(); - Console.WriteLine(res_count + " " + fetch_size * processed_size); - System.Diagnostics.Debug.Assert(res_count == fetch_size * processed_size); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + Console.WriteLine(res_count + " " + fetchSize * processedSize); + System.Diagnostics.Debug.Assert(res_count == fetchSize * processedSize); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertTablets Passed!"); } public async Task TestInsertTabletWithNullValue() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); - var device_id = string.Format("{0}.{1}", test_database_name, test_device); - var measurements = new List() { test_measurements[1], test_measurements[2], test_measurements[3] }; + await session_pool.DeleteDatabaseAsync(testDatabaseName); + var device_id = string.Format("{0}.{1}", testDatabaseName, testDevice); + var measurements = new List() { testMeasurements[1], testMeasurements[2], testMeasurements[3] }; var values = new List>() { new List() {null, true, (int) 12}, new List() {"c#", null, (int) 13}, @@ -214,7 +214,7 @@ public async Task TestInsertTabletWithNullValue() status = await session_pool.InsertTabletAsync(tablet); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); res.ShowTableNames(); var res_count = 0; while (res.HasNext()) @@ -224,7 +224,7 @@ public async Task TestInsertTabletWithNullValue() } await res.Close(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertTabletsWithNullValue Passed!"); @@ -232,14 +232,14 @@ public async Task TestInsertTabletWithNullValue() public async Task TestInsertTabletWithAllType() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); - var device_id = string.Format("{0}.{1}", test_database_name, test_device); + await session_pool.DeleteDatabaseAsync(testDatabaseName); + var device_id = string.Format("{0}.{1}", testDatabaseName, testDevice); var measurements = new List { "boolean_measurement", @@ -277,7 +277,7 @@ public async Task TestInsertTabletWithAllType() System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); res.ShowTableNames(); var res_count = 0; while (res.HasNext()) @@ -287,7 +287,7 @@ public async Task TestInsertTabletWithAllType() } await res.Close(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestInsertTabletWithAllType Passed!"); diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.Template.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.Template.cs index 5e0af66..1d1d84d 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.Template.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.Template.cs @@ -28,20 +28,20 @@ public partial class SessionPoolTest { public async Task TestCreateAndDropSchemaTemplate() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); var status = 0; - await session_pool.DropSchemaTemplateAsync(test_template_name); + await session_pool.DropSchemaTemplateAsync(testTemplateName); - MeasurementNode node1 = new MeasurementNode(test_measurements[1], TSDataType.INT32, TSEncoding.PLAIN, Compressor.SNAPPY); - MeasurementNode node2 = new MeasurementNode(test_measurements[2], TSDataType.INT64, TSEncoding.PLAIN, Compressor.SNAPPY); - MeasurementNode node3 = new MeasurementNode(test_measurements[3], TSDataType.DOUBLE, TSEncoding.PLAIN, Compressor.SNAPPY); - MeasurementNode node4 = new MeasurementNode(test_measurements[4], TSDataType.FLOAT, TSEncoding.PLAIN, Compressor.SNAPPY); + MeasurementNode node1 = new MeasurementNode(testMeasurements[1], TSDataType.INT32, TSEncoding.PLAIN, Compressor.SNAPPY); + MeasurementNode node2 = new MeasurementNode(testMeasurements[2], TSDataType.INT64, TSEncoding.PLAIN, Compressor.SNAPPY); + MeasurementNode node3 = new MeasurementNode(testMeasurements[3], TSDataType.DOUBLE, TSEncoding.PLAIN, Compressor.SNAPPY); + MeasurementNode node4 = new MeasurementNode(testMeasurements[4], TSDataType.FLOAT, TSEncoding.PLAIN, Compressor.SNAPPY); - Template template = new Template(test_template_name); + Template template = new Template(testTemplateName); template.addToTemplate(node1); template.addToTemplate(node2); template.addToTemplate(node3); @@ -54,31 +54,31 @@ public async Task TestCreateAndDropSchemaTemplate() { Console.WriteLine("template name :\t{0}", t); } - status = await session_pool.DropSchemaTemplateAsync(test_template_name); + status = await session_pool.DropSchemaTemplateAsync(testTemplateName); System.Diagnostics.Debug.Assert(status == 0); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.Close(); Console.WriteLine("TestCreateAndDropSchemaTemplate Passed!"); } public async Task TestSetAndUnsetSchemaTemplate() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); var status = 0; - await session_pool.DeleteDatabaseAsync(test_database_name); - await session_pool.UnsetSchemaTemplateAsync(string.Format("{0}.{1}", test_database_name, test_device), "template"); - await session_pool.DropSchemaTemplateAsync(test_template_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); + await session_pool.UnsetSchemaTemplateAsync(string.Format("{0}.{1}", testDatabaseName, testDevice), "template"); + await session_pool.DropSchemaTemplateAsync(testTemplateName); - MeasurementNode node1 = new MeasurementNode(test_measurements[1], TSDataType.INT32, TSEncoding.PLAIN, Compressor.SNAPPY); - MeasurementNode node2 = new MeasurementNode(test_measurements[2], TSDataType.INT64, TSEncoding.PLAIN, Compressor.SNAPPY); - MeasurementNode node3 = new MeasurementNode(test_measurements[3], TSDataType.DOUBLE, TSEncoding.PLAIN, Compressor.SNAPPY); - MeasurementNode node4 = new MeasurementNode(test_measurements[4], TSDataType.FLOAT, TSEncoding.PLAIN, Compressor.SNAPPY); + MeasurementNode node1 = new MeasurementNode(testMeasurements[1], TSDataType.INT32, TSEncoding.PLAIN, Compressor.SNAPPY); + MeasurementNode node2 = new MeasurementNode(testMeasurements[2], TSDataType.INT64, TSEncoding.PLAIN, Compressor.SNAPPY); + MeasurementNode node3 = new MeasurementNode(testMeasurements[3], TSDataType.DOUBLE, TSEncoding.PLAIN, Compressor.SNAPPY); + MeasurementNode node4 = new MeasurementNode(testMeasurements[4], TSDataType.FLOAT, TSEncoding.PLAIN, Compressor.SNAPPY); - Template template = new Template(test_template_name); + Template template = new Template(testTemplateName); template.addToTemplate(node1); template.addToTemplate(node2); template.addToTemplate(node3); @@ -86,16 +86,16 @@ public async Task TestSetAndUnsetSchemaTemplate() status = await session_pool.CreateSchemaTemplateAsync(template); System.Diagnostics.Debug.Assert(status == 0); - status = await session_pool.SetSchemaTemplateAsync(test_template_name, string.Format("{0}.{1}", test_database_name, test_device)); - var paths = await session_pool.ShowPathsTemplateSetOnAsync(test_template_name); + status = await session_pool.SetSchemaTemplateAsync(testTemplateName, string.Format("{0}.{1}", testDatabaseName, testDevice)); + var paths = await session_pool.ShowPathsTemplateSetOnAsync(testTemplateName); foreach (var p in paths) { Console.WriteLine("path :\t{0}", p); } - status = await session_pool.UnsetSchemaTemplateAsync(string.Format("{0}.{1}", test_database_name, test_device), test_template_name); - status = await session_pool.DropSchemaTemplateAsync(test_template_name); + status = await session_pool.UnsetSchemaTemplateAsync(string.Format("{0}.{1}", testDatabaseName, testDevice), testTemplateName); + status = await session_pool.DropSchemaTemplateAsync(testTemplateName); System.Diagnostics.Debug.Assert(status == 0); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.Close(); Console.WriteLine("TestSetAndUnsetSchemaTemplate Passed!"); } diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.TestNetwork.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.TestNetwork.cs index a0bc278..8588066 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.TestNetwork.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.TestNetwork.cs @@ -28,104 +28,104 @@ public partial class SessionPoolTest { public async Task TestTestInsertRecord() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); int status; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), TSDataType.TEXT, + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.BOOLEAN, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[3]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[3]), TSDataType.INT32, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); var measures = new List { - test_measurements[1], test_measurements[2], test_measurements[3] + testMeasurements[1], testMeasurements[2], testMeasurements[3] }; var values = new List { "test_text", true, (int)123 }; var tasks = new List>(); var start_ms = DateTime.Now.Ticks / 10000; - for (var timestamp = 1; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 1; timestamp <= fetchSize * processedSize; timestamp++) { var rowRecord = new RowRecord(timestamp, values, measures); var task = session_pool.TestInsertRecordAsync( - string.Format("{0}.{1}", test_database_name, test_device), rowRecord); + string.Format("{0}.{1}", testDatabaseName, testDevice), rowRecord); tasks.Add(task); } Task.WaitAll(tasks.ToArray()); var end_ms = DateTime.Now.Ticks / 10000; Console.WriteLine(string.Format("total insert record time is {0}", end_ms - start_ms)); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.Close(); Console.WriteLine("TestTestInsertRecordAsync Passed"); } public async Task TestTestInsertRecords() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); var status = 0; - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.BOOLEAN, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.INT32, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[3]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[3]), TSDataType.INT64, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[4]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[4]), TSDataType.DOUBLE, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[5]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[5]), TSDataType.FLOAT, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[6]), TSDataType.TEXT, + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[6]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); System.Diagnostics.Debug.Assert(status == 0); var device_id = new List() { }; - for (var i = 0; i < 3; i++) device_id.Add(string.Format("{0}.{1}", test_database_name, test_device)); + for (var i = 0; i < 3; i++) device_id.Add(string.Format("{0}.{1}", testDatabaseName, testDevice)); var measurements_lst = new List>() { }; - measurements_lst.Add(new List() { test_measurements[1], test_measurements[2] }); + measurements_lst.Add(new List() { testMeasurements[1], testMeasurements[2] }); measurements_lst.Add(new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4] }); measurements_lst.Add(new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4], - test_measurements[5], - test_measurements[6] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4], + testMeasurements[5], + testMeasurements[6] }); var values_lst = new List>() { }; values_lst.Add(new List() { true, (int)123 }); @@ -143,7 +143,7 @@ public async Task TestTestInsertRecords() status = await session_pool.TestInsertRecordsAsync(device_id, rowRecords); // System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -153,12 +153,12 @@ public async Task TestTestInsertRecords() device_id = new List() { }; rowRecords = new List() { }; var tasks = new List>(); - for (var timestamp = 4; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 4; timestamp <= fetchSize * processedSize; timestamp++) { - device_id.Add(string.Format("{0}.{1}", test_database_name, test_device)); + device_id.Add(string.Format("{0}.{1}", testDatabaseName, testDevice)); rowRecords.Add(new RowRecord(timestamp, new List() { true, (int)123 }, - new List() { test_measurements[1], test_measurements[2] })); - if (timestamp % fetch_size == 0) + new List() { testMeasurements[1], testMeasurements[2] })); + if (timestamp % fetchSize == 0) { tasks.Add(session_pool.TestInsertRecordsAsync(device_id, rowRecords)); device_id = new List() { }; @@ -168,9 +168,9 @@ public async Task TestTestInsertRecords() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); res.ShowTableNames(); - var record_count = fetch_size * processed_size; + var record_count = fetchSize * processedSize; var res_count = 0; while (res.HasNext()) { @@ -181,7 +181,7 @@ public async Task TestTestInsertRecords() await res.Close(); System.Diagnostics.Debug.Assert(res_count == 0); System.Diagnostics.Debug.Assert(status == 0); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestTestInsertRecords Passed!"); @@ -189,18 +189,18 @@ public async Task TestTestInsertRecords() public async Task TestTestInsertTablet() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); - var device_id = string.Format("{0}.{1}", test_database_name, test_device); + await session_pool.DeleteDatabaseAsync(testDatabaseName); + var device_id = string.Format("{0}.{1}", testDatabaseName, testDevice); var measurement_lst = new List - { test_measurements[1], - test_measurements[2], - test_measurements[3] + { testMeasurements[1], + testMeasurements[2], + testMeasurements[3] }; var value_lst = new List> { @@ -213,7 +213,7 @@ public async Task TestTestInsertTablet() status = await session_pool.TestInsertTabletAsync(tablet); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<15"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); @@ -223,11 +223,11 @@ public async Task TestTestInsertTablet() timestamp_lst = new List() { }; var tasks = new List>(); var start_ms = DateTime.Now.Ticks / 10000; - for (var timestamp = 4; timestamp <= fetch_size * processed_size; timestamp++) + for (var timestamp = 4; timestamp <= fetchSize * processedSize; timestamp++) { timestamp_lst.Add(timestamp); value_lst.Add(new List() { "iotdb", true, (int)timestamp }); - if (timestamp % (fetch_size / 32) == 0) + if (timestamp % (fetchSize / 32) == 0) { tablet = new Tablet(device_id, measurement_lst, datatype_lst, value_lst, timestamp_lst); tasks.Add(session_pool.TestInsertTabletAsync(tablet)); @@ -240,7 +240,7 @@ public async Task TestTestInsertTablet() var end_ms = DateTime.Now.Ticks / 10000; Console.WriteLine(string.Format("total tablet insert time is {0}", end_ms - start_ms)); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device)); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice)); res.ShowTableNames(); var res_count = 0; while (res.HasNext()) @@ -251,7 +251,7 @@ public async Task TestTestInsertTablet() await res.Close(); System.Diagnostics.Debug.Assert(res_count == 0); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestTestInsertTablet Passed!"); @@ -259,22 +259,22 @@ public async Task TestTestInsertTablet() public async Task TestTestInsertTablets() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); var device_id = new List() { - string.Format("{0}.{1}", test_database_name, test_devices[1]), - string.Format("{0}.{1}", test_database_name, test_devices[2]) + string.Format("{0}.{1}", testDatabaseName, testDevices[1]), + string.Format("{0}.{1}", testDatabaseName, testDevices[2]) }; var measurements_lst = new List>() { - new() {test_measurements[1], test_measurements[2], test_measurements[3]}, - new() {test_measurements[1], test_measurements[2], test_measurements[3]} + new() {testMeasurements[1], testMeasurements[2], testMeasurements[3]}, + new() {testMeasurements[1], testMeasurements[2], testMeasurements[3]} }; var values_lst = new List>>() { @@ -306,7 +306,7 @@ public async Task TestTestInsertTablets() status = await session_pool.TestInsertTabletsAsync(tablets); // System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_devices[1]) + " where time<15"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); @@ -314,17 +314,17 @@ public async Task TestTestInsertTablets() // large data test var tasks = new List>(); - for (var timestamp = 4; timestamp <= processed_size * fetch_size; timestamp++) + for (var timestamp = 4; timestamp <= processedSize * fetchSize; timestamp++) { - var local_device_id = string.Format("{0}.{1}", test_database_name, test_devices[1]); + var local_device_id = string.Format("{0}.{1}", testDatabaseName, testDevices[1]); var local_measurements = new List() - {test_measurements[1], test_measurements[2], test_measurements[3]}; + {testMeasurements[1], testMeasurements[2], testMeasurements[3]}; var local_value = new List>() { new() { "iotdb", true, (int)timestamp } }; var local_timestamp = new List { timestamp }; var local_data_type = new List { TSDataType.TEXT, TSDataType.BOOLEAN, TSDataType.INT32 }; var tablet = new Tablet(local_device_id, local_measurements, local_data_type, local_value, local_timestamp); tablets.Add(tablet); - if (timestamp % fetch_size == 0) + if (timestamp % fetchSize == 0) { tasks.Add(session_pool.TestInsertTabletsAsync(tablets)); tablets = new List() { }; @@ -333,7 +333,7 @@ public async Task TestTestInsertTablets() Task.WaitAll(tasks.ToArray()); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_devices[1])); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1])); res.ShowTableNames(); var res_count = 0; while (res.HasNext()) @@ -344,7 +344,7 @@ public async Task TestTestInsertTablets() await res.Close(); System.Diagnostics.Debug.Assert(res_count == 0); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestTestInsertTablets Passed!"); diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.TimeSeries.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.TimeSeries.cs index 92ba363..32be49a 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.TimeSeries.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.TimeSeries.cs @@ -30,15 +30,15 @@ public partial class SessionPoolTest public async Task TestCreateMultiTimeSeries() { // by Luzhan - var session_pool = new SessionPool(host, port, user, passwd, pool_size); + var session_pool = new SessionPool(host, port, username, password, poolSize); await session_pool.Open(false); var status = 0; if (debug) session_pool.OpenDebugMode(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); var measurement_lst = new List { 1, 2, 3, 4, 5, 6 }; var ts_path_lst = new List(measurement_lst.ConvertAll( - (measurement) => string.Format("{0}.{1}.{2}{3}", test_database_name, test_device, test_measurement, measurement))); + (measurement) => string.Format("{0}.{1}.{2}{3}", testDatabaseName, testDevice, testMeasurement, measurement))); var data_type_lst = new List() { TSDataType.BOOLEAN, TSDataType.INT32, TSDataType.INT64, TSDataType.FLOAT, TSDataType.DOUBLE, @@ -57,7 +57,7 @@ public async Task TestCreateMultiTimeSeries() status = await session_pool.CreateMultiTimeSeriesAsync(ts_path_lst, data_type_lst, encoding_lst, compressor_lst); System.Diagnostics.Debug.Assert(status == 0); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestCreateMultiTimeSeries Passed!"); @@ -65,15 +65,15 @@ public async Task TestCreateMultiTimeSeries() public async Task TestDeleteTimeSeries() { - var session_pool = new SessionPool(host, port, user, passwd, pool_size); + var session_pool = new SessionPool(host, port, username, password, poolSize); await session_pool.Open(false); var status = 0; if (debug) session_pool.OpenDebugMode(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); var measurement_lst = new List { 1, 2, 3, 4, 5, 6 }; var ts_path_lst = new List(measurement_lst.ConvertAll( - (measurement) => string.Format("{0}.{1}.{2}{3}", test_database_name, test_device, test_measurement, measurement))); + (measurement) => string.Format("{0}.{1}.{2}{3}", testDatabaseName, testDevice, testMeasurement, measurement))); var data_type_lst = new List() { TSDataType.BOOLEAN, TSDataType.INT32, TSDataType.INT64, TSDataType.FLOAT, TSDataType.DOUBLE, @@ -95,57 +95,57 @@ public async Task TestDeleteTimeSeries() status = await session_pool.DeleteTimeSeriesAsync(ts_path_lst); System.Diagnostics.Debug.Assert(status == 0); Console.WriteLine("TestDeleteTimeSeries Passed!"); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.Close(); } public async Task TestCreateTimeSeries() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.BOOLEAN, TSEncoding.PLAIN, Compressor.SNAPPY) == 0); System.Diagnostics.Debug.Assert(await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.INT32, TSEncoding.PLAIN, Compressor.SNAPPY) == 0); System.Diagnostics.Debug.Assert(await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[3]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[3]), TSDataType.INT64, TSEncoding.PLAIN, Compressor.SNAPPY) == 0); System.Diagnostics.Debug.Assert(await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[4]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[4]), TSDataType.FLOAT, TSEncoding.PLAIN, Compressor.SNAPPY) == 0); System.Diagnostics.Debug.Assert(await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[5]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[5]), TSDataType.DOUBLE, TSEncoding.PLAIN, Compressor.SNAPPY) == 0); System.Diagnostics.Debug.Assert(await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[6]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[6]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY) == 0); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.Close(); Console.WriteLine("TestCreateTimeSeries Passed!"); } public async Task TestCreateAlignedTimeseries() { - var session_pool = new SessionPool(host, port, user, passwd, pool_size); + var session_pool = new SessionPool(host, port, username, password, poolSize); await session_pool.Open(false); var status = 0; if (debug) session_pool.OpenDebugMode(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); - string prefixPath = string.Format("{0}.{1}", test_database_name, test_device); + string prefixPath = string.Format("{0}.{1}", testDatabaseName, testDevice); var measurement_lst = new List() { - test_measurements[1], - test_measurements[2], - test_measurements[3], - test_measurements[4], - test_measurements[5], - test_measurements[6] + testMeasurements[1], + testMeasurements[2], + testMeasurements[3], + testMeasurements[4], + testMeasurements[5], + testMeasurements[6] }; var data_type_lst = new List() { @@ -165,29 +165,29 @@ public async Task TestCreateAlignedTimeseries() status = await session_pool.CreateAlignedTimeseriesAsync(prefixPath, measurement_lst, data_type_lst, encoding_lst, compressor_lst); System.Diagnostics.Debug.Assert(status == 0); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestCreateAlignedTimeSeries Passed!"); } public async Task TestCheckTimeSeriesExists() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.BOOLEAN, TSEncoding.PLAIN, Compressor.SNAPPY); var ifExist_1 = await session_pool.CheckTimeSeriesExistsAsync( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1])); + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1])); var ifExist_2 = await session_pool.CheckTimeSeriesExistsAsync( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2])); + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2])); System.Diagnostics.Debug.Assert(ifExist_1 == true && ifExist_2 == false); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestCheckTimeSeriesExists Passed!"); diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs index 754c632..030429a 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs @@ -33,31 +33,31 @@ public partial class SessionPoolTest { public string host = "localhost"; public int port = 6667; - public string user = "root"; - public string passwd = "root"; - public List node_urls = new(); - public int fetch_size = 500; - public int processed_size = 4; + public string username = "root"; + public string password = "root"; + public List nodeUrls = new(); + public int fetchSize = 500; + public int processedSize = 4; public bool debug = false; - private int pool_size = 2; - public static string test_template_name = "TEST_CSHARP_CLIENT_TEMPLATE_97209"; - public static string test_database_name = "root.TEST_CSHARP_CLIENT_GROUP_97209"; - public static string test_device = "TEST_CSHARP_CLIENT_DEVICE"; - public static string test_measurement = "TEST_CSHARP_CLIENT_TS"; - public static List device_count = new List() { 0, 1, 2, 3 }; - public static List measurement_count = new List() { 0, 1, 2, 3, 4, 5, 6 }; - public static List test_devices = new List( - device_count.ConvertAll(x => test_device + x.ToString()).ToArray() + private int poolSize = 2; + public static string testTemplateName = "TEST_CSHARP_CLIENT_TEMPLATE_97209"; + public static string testDatabaseName = "root.TEST_CSHARP_CLIENT_GROUP_97209"; + public static string testDevice = "TEST_CSHARP_CLIENT_DEVICE"; + public static string testMeasurement = "TEST_CSHARP_CLIENT_TS"; + public static List deviceCount = new List() { 0, 1, 2, 3 }; + public static List measurementCount = new List() { 0, 1, 2, 3, 4, 5, 6 }; + public static List testDevices = new List( + deviceCount.ConvertAll(x => testDevice + x.ToString()).ToArray() ); - public List test_measurements = new List( - measurement_count.ConvertAll(x => test_measurement + x.ToString()).ToArray() + public List testMeasurements = new List( + measurementCount.ConvertAll(x => testMeasurement + x.ToString()).ToArray() ); public SessionPoolTest(string _host = "localhost") { host = _host; - node_urls.Add(host + ":" + port); + nodeUrls.Add(host + ":" + port); } public async Task Test() @@ -146,7 +146,7 @@ public async Task Test() } public async Task TestOpenWithNodeUrls() { - var session_pool = new SessionPool(node_urls, 8); + var session_pool = new SessionPool(nodeUrls, 8); await session_pool.Open(false); Debug.Assert(session_pool.IsOpen()); if (debug) session_pool.OpenDebugMode(); @@ -170,21 +170,21 @@ public async Task TestOpenWith2NodeUrls() } public async Task TestOpenWithNodeUrlsAndInsertOneRecord() { - var session_pool = new SessionPool(node_urls, 8); + var session_pool = new SessionPool(nodeUrls, 8); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); var status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[0]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[0]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); - var rowRecord = new RowRecord(1668404120807, new() { "1111111", "22222", "333333" }, new() { test_measurements[0], test_measurements[1], test_measurements[2] }); - status = await session_pool.InsertRecordsAsync(new List() { string.Format("{0}.{1}", test_database_name, test_device) }, new List() { rowRecord }); + var rowRecord = new RowRecord(1668404120807, new() { "1111111", "22222", "333333" }, new() { testMeasurements[0], testMeasurements[1], testMeasurements[2] }); + status = await session_pool.InsertRecordsAsync(new List() { string.Format("{0}.{1}", testDatabaseName, testDevice) }, new List() { rowRecord }); Debug.Assert(status == 0); Console.WriteLine("TestOpenWithNodeUrlsAndInsertOneRecord Passed!"); } @@ -193,26 +193,26 @@ public async Task TestInsertOneRecord() var session_pool = new SessionPool(host, port, 1); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); var status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[0]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[0]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.SNAPPY); - var rowRecord = new RowRecord(1668404120807, new() { "1111111", "22222", "333333" }, new() { test_measurements[0], test_measurements[1], test_measurements[2] }); - status = await session_pool.InsertRecordsAsync(new List() { string.Format("{0}.{1}", test_database_name, test_device) }, new List() { rowRecord }); + var rowRecord = new RowRecord(1668404120807, new() { "1111111", "22222", "333333" }, new() { testMeasurements[0], testMeasurements[1], testMeasurements[2] }); + status = await session_pool.InsertRecordsAsync(new List() { string.Format("{0}.{1}", testDatabaseName, testDevice) }, new List() { rowRecord }); } public async Task TestGetTimeZone() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); - await session_pool.DeleteDatabaseAsync(test_database_name); + 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"); @@ -224,35 +224,35 @@ public async Task TestGetTimeZone() public async Task TestCreateAndDeleteDatabase() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert( - await session_pool.CreateDatabase(test_database_name) == 0); + await session_pool.CreateDatabase(testDatabaseName) == 0); System.Diagnostics.Debug.Assert( - await session_pool.DeleteDatabaseAsync(test_database_name) == 0); + await session_pool.DeleteDatabaseAsync(testDatabaseName) == 0); await session_pool.Close(); Console.WriteLine("TestSetAndDeleteStorageGroup Passed!"); } public async Task TestDeleteDatabase() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); - await session_pool.CreateDatabase(string.Format("{0}{1}", test_database_name, "_01")); - await session_pool.CreateDatabase(string.Format("{0}{1}", test_database_name, "_02")); - await session_pool.CreateDatabase(string.Format("{0}{1}", test_database_name, "_03")); - await session_pool.CreateDatabase(string.Format("{0}{1}", test_database_name, "_04")); + await session_pool.CreateDatabase(string.Format("{0}{1}", testDatabaseName, "_01")); + await session_pool.CreateDatabase(string.Format("{0}{1}", testDatabaseName, "_02")); + await session_pool.CreateDatabase(string.Format("{0}{1}", testDatabaseName, "_03")); + await session_pool.CreateDatabase(string.Format("{0}{1}", testDatabaseName, "_04")); var database_names = new List() { }; - database_names.Add(string.Format("{0}{1}", test_database_name, "_01")); - database_names.Add(string.Format("{0}{1}", test_database_name, "_02")); - database_names.Add(string.Format("{0}{1}", test_database_name, "_03")); - database_names.Add(string.Format("{0}{1}", test_database_name, "_04")); + database_names.Add(string.Format("{0}{1}", testDatabaseName, "_01")); + database_names.Add(string.Format("{0}{1}", testDatabaseName, "_02")); + database_names.Add(string.Format("{0}{1}", testDatabaseName, "_03")); + database_names.Add(string.Format("{0}{1}", testDatabaseName, "_04")); System.Diagnostics.Debug.Assert(await session_pool.DeleteDatabasesAsync(database_names) == 0); await session_pool.Close(); Console.WriteLine("TestDeleteStorageGroups Passed!"); @@ -261,11 +261,11 @@ public async Task TestDeleteDatabase() public async Task TestSetTimeZone() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); - await session_pool.DeleteDatabaseAsync(test_database_name); + await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); await session_pool.SetTimeZone("GMT+8:00"); System.Diagnostics.Debug.Assert(await session_pool.GetTimeZone() == "GMT+8:00"); @@ -275,63 +275,63 @@ public async Task TestSetTimeZone() public async Task TestDeleteData() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), TSDataType.TEXT, + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), TSDataType.TEXT, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), TSDataType.BOOLEAN, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.CreateTimeSeries( - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[3]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[3]), TSDataType.INT32, TSEncoding.PLAIN, Compressor.UNCOMPRESSED); System.Diagnostics.Debug.Assert(status == 0); var measures = new List { - test_measurements[1], test_measurements[2], test_measurements[3] + testMeasurements[1], testMeasurements[2], testMeasurements[3] }; var values = new List { "test_text", true, (int)123 }; status = await session_pool.InsertRecordAsync( - string.Format("{0}.{1}", test_database_name, test_device), new RowRecord(1, values, measures)); + string.Format("{0}.{1}", testDatabaseName, testDevice), new RowRecord(1, values, measures)); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.InsertRecordAsync( - string.Format("{0}.{1}", test_database_name, test_device), new RowRecord(2, values, measures)); + string.Format("{0}.{1}", testDatabaseName, testDevice), new RowRecord(2, values, measures)); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.InsertRecordAsync( - string.Format("{0}.{1}", test_database_name, test_device), new RowRecord(3, values, measures)); + string.Format("{0}.{1}", testDatabaseName, testDevice), new RowRecord(3, values, measures)); System.Diagnostics.Debug.Assert(status == 0); status = await session_pool.InsertRecordAsync( - string.Format("{0}.{1}", test_database_name, test_device), new RowRecord(4, values, measures)); + string.Format("{0}.{1}", testDatabaseName, testDevice), new RowRecord(4, values, measures)); System.Diagnostics.Debug.Assert(status == 0); var res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); var ts_path_lst = new List() { - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[1]), - string.Format("{0}.{1}.{2}", test_database_name, test_device, test_measurements[2]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[1]), + string.Format("{0}.{1}.{2}", testDatabaseName, testDevice, testMeasurements[2]), }; await session_pool.DeleteDataAsync(ts_path_lst, 2, 3); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestDeleteData Passed!"); @@ -339,37 +339,37 @@ public async Task TestDeleteData() public async Task TestNonSql() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.ExecuteNonQueryStatementAsync( - "create timeseries " + string.Format("{0}.{1}", test_database_name, test_device) + ".status with datatype=BOOLEAN,encoding=PLAIN"); + "create timeseries " + string.Format("{0}.{1}", testDatabaseName, testDevice) + ".status with datatype=BOOLEAN,encoding=PLAIN"); await session_pool.ExecuteNonQueryStatementAsync( - "create timeseries " + string.Format("{0}.{1}", test_database_name, test_device) + ".temperature with datatype=FLOAT,encoding=PLAIN"); + "create timeseries " + string.Format("{0}.{1}", testDatabaseName, testDevice) + ".temperature with datatype=FLOAT,encoding=PLAIN"); await session_pool.ExecuteNonQueryStatementAsync( - "create timeseries " + string.Format("{0}.{1}", test_database_name, test_device) + ".hardware with datatype=TEXT,encoding=PLAIN"); + "create timeseries " + string.Format("{0}.{1}", testDatabaseName, testDevice) + ".hardware with datatype=TEXT,encoding=PLAIN"); status = await session_pool.ExecuteNonQueryStatementAsync( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, temperature, hardware) VALUES (4, false, 20, 'yxl')"); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, temperature, hardware) VALUES (4, false, 20, 'yxl')"); System.Diagnostics.Debug.Assert(status == 0); await session_pool.ExecuteNonQueryStatementAsync( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, temperature, hardware) VALUES (5, true, 12, 'myy')"); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, temperature, hardware) VALUES (5, true, 12, 'myy')"); await session_pool.ExecuteNonQueryStatementAsync( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, temperature, hardware) VALUES (6, true, 21, 'lz')"); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, temperature, hardware) VALUES (6, true, 21, 'lz')"); await session_pool.ExecuteNonQueryStatementAsync( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, hardware) VALUES (7, true,'lz')"); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, hardware) VALUES (7, true,'lz')"); await session_pool.ExecuteNonQueryStatementAsync( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, hardware) VALUES (7, true,'lz')"); + "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}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("TestNonSql Passed"); @@ -384,31 +384,31 @@ public async Task TestNonSqlBy_ADO() await cnt.OpenAsync(); var session_pool = cnt.SessionPool; System.Diagnostics.Debug.Assert(cnt.State == System.Data.ConnectionState.Open); - var status = await session_pool.DeleteDatabaseAsync(test_database_name); + var status = await session_pool.DeleteDatabaseAsync(testDatabaseName); await cnt.CreateCommand( - "create timeseries " + string.Format("{0}.{1}", test_database_name, test_device) + ".status with datatype=BOOLEAN,encoding=PLAIN").ExecuteNonQueryAsync(); + "create timeseries " + string.Format("{0}.{1}", testDatabaseName, testDevice) + ".status with datatype=BOOLEAN,encoding=PLAIN").ExecuteNonQueryAsync(); await cnt.CreateCommand( - "create timeseries " + string.Format("{0}.{1}", test_database_name, test_device) + ".temperature with datatype=FLOAT,encoding=PLAIN").ExecuteNonQueryAsync(); + "create timeseries " + string.Format("{0}.{1}", testDatabaseName, testDevice) + ".temperature with datatype=FLOAT,encoding=PLAIN").ExecuteNonQueryAsync(); await cnt.CreateCommand( - "create timeseries " + string.Format("{0}.{1}", test_database_name, test_device) + ".hardware with datatype=TEXT,encoding=PLAIN").ExecuteNonQueryAsync(); + "create timeseries " + string.Format("{0}.{1}", testDatabaseName, testDevice) + ".hardware with datatype=TEXT,encoding=PLAIN").ExecuteNonQueryAsync(); status = await cnt.CreateCommand( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, temperature, hardware) VALUES (3, false, 20, '1yxl')").ExecuteNonQueryAsync(); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, temperature, hardware) VALUES (3, false, 20, '1yxl')").ExecuteNonQueryAsync(); status = await cnt.CreateCommand( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, temperature, hardware) VALUES (4, false, 20, 'yxl')").ExecuteNonQueryAsync(); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, temperature, hardware) VALUES (4, false, 20, 'yxl')").ExecuteNonQueryAsync(); System.Diagnostics.Debug.Assert(status == 0); await cnt.CreateCommand( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, temperature, hardware) VALUES (5, true, 12, 'myy')").ExecuteNonQueryAsync(); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, temperature, hardware) VALUES (5, true, 12, 'myy')").ExecuteNonQueryAsync(); await cnt.CreateCommand( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, temperature, hardware) VALUES (6, true, 21, 'lz')").ExecuteNonQueryAsync(); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, temperature, hardware) VALUES (6, true, 21, 'lz')").ExecuteNonQueryAsync(); await cnt.CreateCommand( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, hardware) VALUES (7, true,'lz')").ExecuteNonQueryAsync(); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, hardware) VALUES (7, true,'lz')").ExecuteNonQueryAsync(); await cnt.CreateCommand( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, hardware) VALUES (7, true,'lz')").ExecuteNonQueryAsync(); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, hardware) VALUES (7, true,'lz')").ExecuteNonQueryAsync(); var reader = await cnt.CreateCommand( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10").ExecuteReaderAsync(); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10").ExecuteReaderAsync(); ConsoleTableBuilder.From(reader.ToDataTable()).WithFormatter(0, fc => $"{fc:yyyy-MM-dd HH:mm:ss.fff}").WithFormat(ConsoleTableBuilderFormat.Default).ExportAndWriteLine(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); await cnt.CloseAsync(); System.Diagnostics.Debug.Assert(status == 0); @@ -418,29 +418,29 @@ await cnt.CreateCommand( public async Task TestSqlQuery() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); await session_pool.ExecuteNonQueryStatementAsync( - "create timeseries " + string.Format("{0}.{1}", test_database_name, test_device) + ".status with datatype=BOOLEAN,encoding=PLAIN"); + "create timeseries " + string.Format("{0}.{1}", testDatabaseName, testDevice) + ".status with datatype=BOOLEAN,encoding=PLAIN"); await session_pool.ExecuteNonQueryStatementAsync( - "create timeseries " + string.Format("{0}.{1}", test_database_name, test_device) + ".temperature with datatype=FLOAT,encoding=PLAIN"); + "create timeseries " + string.Format("{0}.{1}", testDatabaseName, testDevice) + ".temperature with datatype=FLOAT,encoding=PLAIN"); await session_pool.ExecuteNonQueryStatementAsync( - "create timeseries " + string.Format("{0}.{1}", test_database_name, test_device) + ".hardware with datatype=TEXT,encoding=PLAIN"); + "create timeseries " + string.Format("{0}.{1}", testDatabaseName, testDevice) + ".hardware with datatype=TEXT,encoding=PLAIN"); await session_pool.ExecuteNonQueryStatementAsync( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, temperature, hardware) VALUES (4, false, 20, 'yxl')"); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, temperature, hardware) VALUES (4, false, 20, 'yxl')"); await session_pool.ExecuteNonQueryStatementAsync( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, temperature, hardware) VALUES (5, true, 12, 'myy')"); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, temperature, hardware) VALUES (5, true, 12, 'myy')"); await session_pool.ExecuteNonQueryStatementAsync( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, temperature, hardware) VALUES (6, true, 21, 'lz')"); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, temperature, hardware) VALUES (6, true, 21, 'lz')"); await session_pool.ExecuteNonQueryStatementAsync( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, hardware) VALUES (7, true,'lz')"); + "insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, hardware) VALUES (7, true,'lz')"); await session_pool.ExecuteNonQueryStatementAsync( - "insert into " + string.Format("{0}.{1}", test_database_name, test_device) + "(timestamp, status, hardware) VALUES (7, true,'lz')"); + "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(); @@ -467,28 +467,28 @@ await session_pool.ExecuteNonQueryStatementAsync( await res.Close(); Console.WriteLine("SELECT sql Passed"); res = await session_pool.ExecuteQueryStatementAsync( - "select * from " + string.Format("{0}.{1}", test_database_name, test_device) + " where time<10"); + "select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("SELECT sql Passed"); } public async Task TestRawDataQuery() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); - var device_id = string.Format("{0}.{1}", test_database_name, test_device); - var measurements = new List { test_measurements[0], test_measurements[1] }; + var device_id = string.Format("{0}.{1}", testDatabaseName, testDevice); + var measurements = new List { testMeasurements[0], testMeasurements[1] }; var data_type_lst = new List { TSDataType.BOOLEAN, TSDataType.FLOAT }; var encoding_lst = new List { TSEncoding.PLAIN, TSEncoding.PLAIN }; var compressor_lst = new List { Compressor.SNAPPY, Compressor.SNAPPY }; @@ -497,7 +497,7 @@ public async Task TestRawDataQuery() var records = new List(); var values = new List() { true, 20.0f }; var device_id_lst = new List() { }; - for (int i = 1; i <= fetch_size * processed_size; i++) + for (int i = 1; i <= fetchSize * processedSize; i++) { var record = new RowRecord(i, values, measurements); records.Add(record); @@ -506,36 +506,36 @@ public async Task TestRawDataQuery() status = await session_pool.InsertAlignedRecordsAsync(device_id_lst, records); System.Diagnostics.Debug.Assert(status == 0); - var paths = new List() { string.Format("{0}.{1}", device_id, test_measurements[0]), string.Format("{0}.{1}", device_id, test_measurements[1]) }; + 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.ExecuteRawDataQuery(paths, 10, fetch_size * processed_size); + var res = await session_pool.ExecuteRawDataQuery(paths, 10, fetchSize * processedSize); var count = 0; while (res.HasNext()) { var record = res.Next(); count++; } - Console.WriteLine(count + " " + (fetch_size * processed_size - 10)); - System.Diagnostics.Debug.Assert(count == fetch_size * processed_size - 10); + Console.WriteLine(count + " " + (fetchSize * processedSize - 10)); + System.Diagnostics.Debug.Assert(count == fetchSize * processedSize - 10); await res.Close(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("RawDataQuery Passed"); } public async Task TestLastDataQuery() { - var session_pool = new SessionPool(host, port, pool_size); + var session_pool = new SessionPool(host, port, poolSize); var status = 0; await session_pool.Open(false); if (debug) session_pool.OpenDebugMode(); System.Diagnostics.Debug.Assert(session_pool.IsOpen()); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); - var device_id = string.Format("{0}.{1}", test_database_name, test_device); - var measurements = new List { test_measurements[0], test_measurements[1] }; + var device_id = string.Format("{0}.{1}", testDatabaseName, testDevice); + var measurements = new List { testMeasurements[0], testMeasurements[1] }; var data_type_lst = new List { TSDataType.BOOLEAN, TSDataType.FLOAT }; var encoding_lst = new List { TSEncoding.PLAIN, TSEncoding.PLAIN }; var compressor_lst = new List { Compressor.SNAPPY, Compressor.SNAPPY }; @@ -544,7 +544,7 @@ public async Task TestLastDataQuery() var records = new List(); var values = new List() { true, 20.0f }; var device_id_lst = new List() { }; - for (int i = 1; i <= fetch_size * processed_size; i++) + for (int i = 1; i <= fetchSize * processedSize; i++) { var record = new RowRecord(i, values, measurements); records.Add(record); @@ -553,9 +553,9 @@ public async Task TestLastDataQuery() status = await session_pool.InsertAlignedRecordsAsync(device_id_lst, records); System.Diagnostics.Debug.Assert(status == 0); - var paths = new List() { string.Format("{0}.{1}", device_id, test_measurements[0]), string.Format("{0}.{1}", device_id, test_measurements[1]) }; + 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.ExecuteLastDataQueryAsync(paths, fetch_size * processed_size - 10); + var res = await session_pool.ExecuteLastDataQueryAsync(paths, fetchSize * processedSize - 10); var count = 0; while (res.HasNext()) { @@ -563,11 +563,11 @@ public async Task TestLastDataQuery() Console.WriteLine(record); count++; } - Console.WriteLine(count + " " + (fetch_size * processed_size - 10)); + Console.WriteLine(count + " " + (fetchSize * processedSize - 10)); System.Diagnostics.Debug.Assert(count == 2); await res.Close(); - status = await session_pool.DeleteDatabaseAsync(test_database_name); + status = await session_pool.DeleteDatabaseAsync(testDatabaseName); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); Console.WriteLine("LastDataQuery Passed"); diff --git a/samples/Apache.IoTDB.Samples/TableSessionPoolTest.cs b/samples/Apache.IoTDB.Samples/TableSessionPoolTest.cs new file mode 100644 index 0000000..c0ef0ec --- /dev/null +++ b/samples/Apache.IoTDB.Samples/TableSessionPoolTest.cs @@ -0,0 +1,182 @@ +/* + * 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.Threading.Tasks; +using Apache.IoTDB.DataStructure; + +namespace Apache.IoTDB.Samples; + +public class TableSessionPoolTest +{ + private readonly SessionPoolTest sessionPoolTest; + + public TableSessionPoolTest(SessionPoolTest sessionPoolTest) + { + this.sessionPoolTest = sessionPoolTest; + } + + public async Task Test() + { + await TestCleanup(); + + await TestSelectAndInsert(); + await TestUseDatabase(); + // await TestCleanup(); + } + + + public async Task TestSelectAndInsert() + { + var tableSessionPool = new TableSessionPool.Builder() + .SetNodeUrls(sessionPoolTest.nodeUrls) + .SetUsername(sessionPoolTest.username) + .SetPassword(sessionPoolTest.password) + .SetFetchSize(1024) + .Build(); + + await tableSessionPool.Open(false); + + if (sessionPoolTest.debug) tableSessionPool.OpenDebugMode(); + + + await tableSessionPool.ExecuteNonQueryStatementAsync("CREATE DATABASE test1"); + await tableSessionPool.ExecuteNonQueryStatementAsync("CREATE DATABASE test2"); + + await tableSessionPool.ExecuteNonQueryStatementAsync("use test2"); + + // or use full qualified table name + await tableSessionPool.ExecuteNonQueryStatementAsync( + "create table test1.table1(region_id STRING TAG, plant_id STRING TAG, device_id STRING TAG, model STRING ATTRIBUTE, temperature FLOAT FIELD, humidity DOUBLE FIELD) with (TTL=3600000)"); + + await tableSessionPool.ExecuteNonQueryStatementAsync( + "create table table2(region_id STRING TAG, plant_id STRING TAG, color STRING ATTRIBUTE, temperature FLOAT FIELD, speed DOUBLE FIELD) with (TTL=6600000)"); + + // show tables from current database + var res = await tableSessionPool.ExecuteQueryStatementAsync("SHOW TABLES"); + res.ShowTableNames(); + while (res.HasNext()) Console.WriteLine(res.Next()); + await res.Close(); + + // show tables by specifying another database + // using SHOW tables FROM + res = await tableSessionPool.ExecuteQueryStatementAsync("SHOW TABLES FROM test1"); + res.ShowTableNames(); + while (res.HasNext()) Console.WriteLine(res.Next()); + await res.Close(); + + var tableName = "testTable1"; + List columnNames = + new List { + "region_id", + "plant_id", + "device_id", + "model", + "temperature", + "humidity" }; + List dataTypes = + new List{ + TSDataType.STRING, + TSDataType.STRING, + TSDataType.STRING, + TSDataType.STRING, + TSDataType.FLOAT, + TSDataType.DOUBLE}; + List columnCategories = + new List{ + ColumnCategory.TAG, + ColumnCategory.TAG, + ColumnCategory.TAG, + ColumnCategory.ATTRIBUTE, + ColumnCategory.FIELD, + ColumnCategory.FIELD}; + var values = new List> { }; + var timestamps = new List { }; + for (long timestamp = 0; timestamp < 100; timestamp++) + { + timestamps.Add(timestamp); + values.Add(new List { "1", "5", "3", "A", 1.23F + timestamp, 111.1 + timestamp }); + } + var tablet = new Tablet(tableName, columnNames, columnCategories, dataTypes, values, timestamps); + + await tableSessionPool.InsertAsync(tablet); + + + res = await tableSessionPool.ExecuteQueryStatementAsync("select * from testTable1 " + + "where region_id = '1' and plant_id in ('3', '5') and device_id = '3'"); + res.ShowTableNames(); + while (res.HasNext()) Console.WriteLine(res.Next()); + await res.Close(); + + await tableSessionPool.Close(); + } + + + public async Task TestUseDatabase() + { + var tableSessionPool = new TableSessionPool.Builder() + .SetNodeUrls(sessionPoolTest.nodeUrls) + .SetUsername(sessionPoolTest.username) + .SetPassword(sessionPoolTest.password) + .SetDatabase("test1") + .SetFetchSize(1024) + .Build(); + + await tableSessionPool.Open(false); + + if (sessionPoolTest.debug) tableSessionPool.OpenDebugMode(); + + + // show tables from current database + var res = await tableSessionPool.ExecuteQueryStatementAsync("SHOW TABLES"); + res.ShowTableNames(); + while (res.HasNext()) Console.WriteLine(res.Next()); + await res.Close(); + + await tableSessionPool.ExecuteNonQueryStatementAsync("use test2"); + + // show tables from current database + res = await tableSessionPool.ExecuteQueryStatementAsync("SHOW TABLES"); + res.ShowTableNames(); + while (res.HasNext()) Console.WriteLine(res.Next()); + await res.Close(); + + await tableSessionPool.Close(); + } + + public async Task TestCleanup() + { + var tableSessionPool = new TableSessionPool.Builder() + .SetNodeUrls(sessionPoolTest.nodeUrls) + .SetUsername(sessionPoolTest.username) + .SetPassword(sessionPoolTest.password) + .SetFetchSize(1024) + .Build(); + + await tableSessionPool.Open(false); + + if (sessionPoolTest.debug) tableSessionPool.OpenDebugMode(); + + await tableSessionPool.ExecuteNonQueryStatementAsync("drop database test1"); + await tableSessionPool.ExecuteNonQueryStatementAsync("drop database test2"); + + await tableSessionPool.Close(); + } +} diff --git a/src/Apache.IoTDB/DataStructure/Tablet.cs b/src/Apache.IoTDB/DataStructure/Tablet.cs index 3a19a94..b6e2ca1 100644 --- a/src/Apache.IoTDB/DataStructure/Tablet.cs +++ b/src/Apache.IoTDB/DataStructure/Tablet.cs @@ -47,9 +47,10 @@ public class Tablet private readonly List _timestamps; private readonly List> _values; - public string DeviceId { get; } + public string InsertTargetName { get; } public List Measurements { get; } public List DataTypes { get; } + public List ColumnCategories { get; } public BitMap[] BitMaps; public int RowNumber { get; } public int ColNumber { get; } @@ -92,7 +93,7 @@ public Tablet( _timestamps = timestamps; } - DeviceId = deviceId; + InsertTargetName = deviceId; Measurements = measurements; DataTypes = dataTypes; RowNumber = timestamps.Count; @@ -110,6 +111,71 @@ public Tablet( } } } + + public Tablet( + string tableName, + List columnNames, + List columnCategories, + List dataTypes, + List> values, + List timestamps) + { + if (timestamps.Count != values.Count) + { + throw new Exception( + $"Input error. Timestamps.Count({timestamps.Count}) does not equal to Values.Count({values.Count}).", + null); + } + + if (columnNames.Count != dataTypes.Count) + { + throw new Exception( + $"Input error. ColumnNames.Count({columnNames.Count}) does not equal to DataTypes.Count({dataTypes.Count}).", + null); + } + if (columnNames.Count != columnCategories.Count) + { + throw new Exception( + $"Input error. ColumnNames.Count({columnNames.Count}) does not equal to ColumnCategories.Count({columnCategories.Count}).", + null); + } + + if (!_utilFunctions.IsSorted(timestamps)) + { + var sorted = timestamps + .Select((x, index) => (timestamp: x, values: values[index])) + .OrderBy(x => x.timestamp).ToList(); + + _timestamps = sorted.Select(x => x.timestamp).ToList(); + _values = sorted.Select(x => x.values).ToList(); + } + else + { + _values = values; + _timestamps = timestamps; + } + + InsertTargetName = tableName; + Measurements = columnNames; + ColumnCategories = columnCategories; + DataTypes = dataTypes; + RowNumber = timestamps.Count; + ColNumber = columnNames.Count; + + // reset bitmap + if (BitMaps != null) + { + foreach (var bitmap in BitMaps) + { + if (bitmap != null) + { + bitmap.reset(); + } + } + } + } + + [Obsolete("Deprecated, use the constructor with List instead")] public Tablet( string deviceId, List measurements, @@ -137,7 +203,7 @@ public Tablet( _timestamps = timestamps; } - DeviceId = deviceId; + InsertTargetName = deviceId; Measurements = measurements; RowNumber = timestamps.Count; ColNumber = measurements.Count; @@ -222,6 +288,13 @@ public List GetDataTypes() return dataTypeValues; } + public List GetColumnColumnCategories() + { + var columnCategories = ColumnCategories.ConvertAll(x => (sbyte)x); + + return columnCategories; + } + private int EstimateBufferSize() { var estimateSize = 0; diff --git a/src/Apache.IoTDB/IoTDBConstants.cs b/src/Apache.IoTDB/IoTDBConstants.cs index 5faac76..7dddd72 100644 --- a/src/Apache.IoTDB/IoTDBConstants.cs +++ b/src/Apache.IoTDB/IoTDBConstants.cs @@ -72,6 +72,12 @@ public enum TemplateQueryType SHOW_SET_TEMPLATES, SHOW_USING_TEMPLATES } + public enum ColumnCategory + { + TAG, + FIELD, + ATTRIBUTE + } public class TsFileConstant { @@ -90,4 +96,8 @@ public class TsFileConstant private TsFileConstant() { } } + public class IoTDBConstant { + public static string TREE_SQL_DIALECT = "tree"; + public static string TABLE_SQL_DIALECT = "table"; + } } \ No newline at end of file diff --git a/src/Apache.IoTDB/SessionPool.Builder.cs b/src/Apache.IoTDB/SessionPool.Builder.cs new file mode 100644 index 0000000..91c0a48 --- /dev/null +++ b/src/Apache.IoTDB/SessionPool.Builder.cs @@ -0,0 +1,139 @@ +/* + * 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; + +namespace Apache.IoTDB; + +public partial class SessionPool +{ + public class Builder + { + private string _host = "localhost"; + private int _port = 6667; + private string _username = "root"; + private string _password = "root"; + private int _fetchSize = 1024; + private string _zoneId = "UTC+08:00"; + private int _poolSize = 8; + private bool _enableRpcCompression = false; + private int _connectionTimeoutInMs = 500; + private string _sqlDialect = IoTDBConstant.TREE_SQL_DIALECT; + private string _database = ""; + private List _nodeUrls = new List(); + + public Builder SetHost(string host) + { + _host = host; + return this; + } + + public Builder SetPort(int port) + { + _port = port; + return this; + } + + public Builder SetUsername(string username) + { + _username = username; + return this; + } + + public Builder SetPassword(string password) + { + _password = password; + return this; + } + + public Builder SetFetchSize(int fetchSize) + { + _fetchSize = fetchSize; + return this; + } + + public Builder SetZoneId(string zoneId) + { + _zoneId = zoneId; + return this; + } + + public Builder SetPoolSize(int poolSize) + { + _poolSize = poolSize; + return this; + } + + public Builder SetEnableRpcCompression(bool enableRpcCompression) + { + _enableRpcCompression = enableRpcCompression; + return this; + } + + public Builder SetConnectionTimeoutInMs(int timeout) + { + _connectionTimeoutInMs = timeout; + return this; + } + + public Builder setNodeUrl(List nodeUrls) + { + _nodeUrls = nodeUrls; + return this; + } + + protected internal Builder SetSqlDialect(string sqlDialect) + { + _sqlDialect = sqlDialect; + return this; + } + + protected internal Builder SetDatabase(string database) + { + _database = database; + return this; + } + + public Builder() + { + _host = "localhost"; + _port = 6667; + _username = "root"; + _password = "root"; + _fetchSize = 1024; + _zoneId = "UTC+08:00"; + _poolSize = 8; + _enableRpcCompression = false; + _connectionTimeoutInMs = 500; + _sqlDialect = IoTDBConstant.TREE_SQL_DIALECT; + _database = ""; + } + + public SessionPool Build() + { + // if nodeUrls is not empty, use nodeUrls to create session pool + if (_nodeUrls.Count > 0) + { + return new SessionPool(_nodeUrls, _username, _password, _fetchSize, _zoneId, _poolSize, _enableRpcCompression, _connectionTimeoutInMs, _sqlDialect, _database); + } + return new SessionPool(_host, _port, _username, _password, _fetchSize, _zoneId, _poolSize, _enableRpcCompression, _connectionTimeoutInMs, _sqlDialect, _database); + } + } +} diff --git a/src/Apache.IoTDB/SessionPool.cs b/src/Apache.IoTDB/SessionPool.cs index 6dfda4c..2d78048 100644 --- a/src/Apache.IoTDB/SessionPool.cs +++ b/src/Apache.IoTDB/SessionPool.cs @@ -35,1653 +35,1739 @@ namespace Apache.IoTDB { - public class SessionPool : IDisposable - { - private static readonly TSProtocolVersion ProtocolVersion = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; - - private readonly string _username; - private readonly string _password; - private bool _enableRpcCompression; - private string _zoneId; - private readonly List _nodeUrls = new(); - private readonly List _endPoints = new(); - private readonly string _host; - private readonly int _port; - private readonly int _fetchSize; - private readonly int _timeout; - private readonly int _poolSize = 4; - private readonly Utils _utilFunctions = new(); - private const int RetryNum = 3; - private bool _debugMode; - private bool _isClose = true; - private ConcurrentClientQueue _clients; - private ILogger _logger; - public delegate Task AsyncOperation(Client client); - - - public SessionPool(string host, int port, int poolSize) - : this(host, port, "root", "root", 1024, "UTC+08:00", poolSize, true, 60) - { - } + public partial class SessionPool : IDisposable + { + private static readonly TSProtocolVersion ProtocolVersion = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; + + private readonly string _username; + private readonly string _password; + private bool _enableRpcCompression; + private string _zoneId; + private readonly List _nodeUrls = new(); + private readonly List _endPoints = new(); + private readonly string _host; + private readonly int _port; + private readonly int _fetchSize; + /// + /// _timeout is the amount of time a Session will wait for a send operation to complete successfully. + /// + private readonly int _timeout; + private readonly int _poolSize = 4; + private readonly string _sqlDialect = IoTDBConstant.TREE_SQL_DIALECT; + private string _database; + private readonly Utils _utilFunctions = new(); + private const int RetryNum = 3; + private bool _debugMode; + private bool _isClose = true; + private ConcurrentClientQueue _clients; + private ILogger _logger; + public delegate Task AsyncOperation(Client client); + + + public SessionPool(string host, int port, int poolSize) + : this(host, port, "root", "root", 1024, "UTC+08:00", poolSize, true, 60) + { + } - public SessionPool(string host, int port, string username, string password) - : this(host, port, username, password, 1024, "UTC+08:00", 8, true, 60) - { - } + public SessionPool(string host, int port, string username, string password) + : this(host, port, username, password, 1024, "UTC+08:00", 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) - { + public SessionPool(string host, int port, string username, string password, int fetchSize) + : this(host, port, username, password, fetchSize, "UTC+08:00", 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, "UTC+08:00", 8, true, 60) + { + } + public SessionPool(string host, int port, string username, string password, int fetchSize, string zoneId, int poolSize, bool enableRpcCompression, int timeout) + : this(host, port, username, password, fetchSize, zoneId, poolSize, enableRpcCompression, timeout, IoTDBConstant.TREE_SQL_DIALECT, "") + { + } + protected internal SessionPool(string host, int port, string username, string password, int fetchSize, string zoneId, int poolSize, bool enableRpcCompression, int timeout, string sqlDialect, string database) + { + _host = host; + _port = port; + _username = username; + _password = password; + _zoneId = zoneId; + _fetchSize = fetchSize; + _debugMode = false; + _poolSize = poolSize; + _enableRpcCompression = enableRpcCompression; + _timeout = timeout; + _sqlDialect = sqlDialect; + _database = database; + } + /// + /// Initializes a new instance of the class. + /// + /// 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) + { + } + public SessionPool(List nodeUrls, string username, string password) + : this(nodeUrls, username, password, 1024, "UTC+08:00", 8, true, 60) + { + } + public SessionPool(List nodeUrls, string username, string password, int fetchSize) + : this(nodeUrls, username, password, fetchSize, "UTC+08:00", 8, true, 60) + { + } + public SessionPool(List nodeUrls, string username, string password, int fetchSize, string zoneId) + : this(nodeUrls, username, password, fetchSize, zoneId, 8, true, 60) + { + } + public SessionPool(List nodeUrls, string username, string password, int fetchSize, string zoneId, int poolSize, bool enableRpcCompression, int timeout) + : this(nodeUrls, username, password, fetchSize, zoneId, poolSize, enableRpcCompression, timeout, IoTDBConstant.TREE_SQL_DIALECT, "") + { + + } + protected internal SessionPool(List nodeUrls, string username, string password, int fetchSize, string zoneId, int poolSize, bool enableRpcCompression, int timeout, string sqlDialect, string database) + { + if (nodeUrls.Count == 0) + { + throw new ArgumentException("nodeUrls shouldn't be empty."); + } + _nodeUrls = nodeUrls; + _endPoints = _utilFunctions.ParseSeedNodeUrls(nodeUrls); + _username = username; + _password = password; + _zoneId = zoneId; + _fetchSize = fetchSize; + _debugMode = false; + _poolSize = poolSize; + _enableRpcCompression = enableRpcCompression; + _timeout = timeout; + _sqlDialect = sqlDialect; + _database = database; + } + public async Task ExecuteClientOperationAsync(AsyncOperation operation, string errMsg, bool retryOnFailure = true) + { + Client client = _clients.Take(); + try + { + var resp = await operation(client); + return resp; + } + catch (TException ex) + { + if (retryOnFailure) + { + try + { + client = await Reconnect(client); + return await operation(client); + } + catch (TException retryEx) + { + throw new TException(errMsg, retryEx); + } + } + else + { + throw new TException(errMsg, ex); + } + } + catch (Exception ex) + { + if (retryOnFailure) + { + try + { + client = await Reconnect(client); + return await operation(client); + } + catch (TException retryEx) + { + throw new TException(errMsg, retryEx); + } + } + else + { + throw new TException(errMsg, ex); + } + } + finally + { + _clients.Add(client); + } + } + /// + /// Gets or sets the amount of time a Session will wait for a send operation to complete successfully. + /// + /// The send time-out value, in milliseconds. The default is 10000. + public int TimeOut { get; set; } = 10000; + + ILoggerFactory factory; + private bool disposedValue; + + public void OpenDebugMode(Action configure) + { + _debugMode = true; + factory = LoggerFactory.Create(configure); + _logger = factory.CreateLogger(nameof(Apache.IoTDB)); + } + + public void CloseDebugMode() + { + _debugMode = false; + } + + public async Task Open(bool enableRpcCompression, CancellationToken cancellationToken = default) + { + _enableRpcCompression = enableRpcCompression; + await Open(cancellationToken); + } + + public async Task Open(CancellationToken cancellationToken = default) + { + _clients = new ConcurrentClientQueue(); + _clients.Timeout = _timeout * 5; + + if (_nodeUrls.Count == 0) + { + for (var index = 0; index < _poolSize; index++) + { + try + { + _clients.Add(await CreateAndOpen(_host, _port, _enableRpcCompression, _timeout, _sqlDialect, _database, cancellationToken)); + } + catch (Exception e) + { + if (_debugMode) + { + _logger.LogWarning(e, "Currently connecting to {0}:{1} failed", _host, _port); + } + } + } + } + else + { + int startIndex = 0; + for (var index = 0; index < _poolSize; index++) + { + bool isConnected = false; + for (int i = 0; i < _endPoints.Count; i++) + { + var endPointIndex = (startIndex + i) % _endPoints.Count; + var endPoint = _endPoints[endPointIndex]; + try + { + var client = await CreateAndOpen(endPoint.Ip, endPoint.Port, _enableRpcCompression, _timeout, _sqlDialect, _database, cancellationToken); + _clients.Add(client); + isConnected = true; + startIndex = (endPointIndex + 1) % _endPoints.Count; + break; + } + catch (Exception e) + { + if (_debugMode) + { + _logger.LogWarning(e, "Currently connecting to {0}:{1} failed", endPoint.Ip, endPoint.Port); + } + } + } + if (!isConnected) // current client could not connect to any endpoint + { + throw new TException("Error occurs when opening session pool. Could not connect to any server", null); + } + } + } + + if (_clients.ClientQueue.Count != _poolSize) + { + throw new TException(string.Format("Error occurs when opening session pool. Client pool size is not equal to the expected size. Client pool size: {0}, expected size: {1}, Please check the server status", _clients.ClientQueue.Count, _poolSize), null); + } + _isClose = false; + } + + + public async Task Reconnect(Client originalClient = null, CancellationToken cancellationToken = default) + { + originalClient?.Transport.Close(); + + if (_nodeUrls.Count == 0) + { + for (int attempt = 1; attempt <= RetryNum; attempt++) + { + try + { + var client = await CreateAndOpen(_host, _port, _enableRpcCompression, _timeout, _sqlDialect, _database, cancellationToken); + return client; + } + catch (Exception e) + { + if (_debugMode) + { + _logger.LogWarning(e, "Attempt reconnecting to {0}:{1} failed", _host, _port); + } + } } - public SessionPool(string host, int port, string username, string password, int fetchSize, string zoneId, int poolSize, bool enableRpcCompression, int timeout) + } + else + { + int startIndex = _endPoints.FindIndex(x => x.Ip == originalClient.EndPoint.Ip && x.Port == originalClient.EndPoint.Port); + if (startIndex == -1) { - _host = host; - _port = port; - _username = username; - _password = password; - _zoneId = zoneId; - _fetchSize = fetchSize; - _debugMode = false; - _poolSize = poolSize; - _enableRpcCompression = enableRpcCompression; - _timeout = timeout; + throw new ArgumentException($"The original client is not in the list of endpoints. Original client: {originalClient.EndPoint.Ip}:{originalClient.EndPoint.Port}"); } - /// - /// Initializes a new instance of the class. - /// - /// 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) + + for (int attempt = 1; attempt <= RetryNum; attempt++) { + for (int i = 0; i < _endPoints.Count; i++) + { + int j = (startIndex + i) % _endPoints.Count; + try + { + var client = await CreateAndOpen(_endPoints[j].Ip, _endPoints[j].Port, _enableRpcCompression, _timeout, _sqlDialect, _database, cancellationToken); + return client; + } + catch (Exception e) + { + if (_debugMode) + { + _logger.LogWarning(e, "Attempt connecting to {0}:{1} failed", _endPoints[j].Ip, _endPoints[j].Port); + } + } + } } - public SessionPool(List nodeUrls, string username, string password) - : this(nodeUrls, username, password, 1024, "UTC+08:00", 8, true, 60) + } + + throw new TException("Error occurs when reconnecting session pool. Could not connect to any server", null); + } + + + public bool IsOpen() => !_isClose; + + public async Task Close() + { + if (_isClose) + { + return; + } + + foreach (var client in _clients.ClientQueue.AsEnumerable()) + { + var closeSessionRequest = new TSCloseSessionReq(client.SessionId); + try { + await client.ServiceClient.closeSessionAsync(closeSessionRequest); } - public SessionPool(List nodeUrls, string username, string password, int fetchSize) - : this(nodeUrls, username, password, fetchSize, "UTC+08:00", 8, true, 60) + catch (TException e) { + throw new TException("Error occurs when closing session at server. Maybe server is down", e); } - public SessionPool(List nodeUrls, string username, string password, int fetchSize, string zoneId) - : this(nodeUrls, username, password, fetchSize, zoneId, 8, true, 60) + finally { + _isClose = true; + + client.Transport?.Close(); } - public SessionPool(List nodeUrls, string username, string password, int fetchSize, string zoneId, int poolSize, bool enableRpcCompression, int timeout) + } + } + + public async Task SetTimeZone(string zoneId) + { + _zoneId = zoneId; + + foreach (var client in _clients.ClientQueue.AsEnumerable()) + { + var req = new TSSetTimeZoneReq(client.SessionId, zoneId); + try { - if (nodeUrls.Count == 0) - { - throw new ArgumentException("nodeUrls shouldn't be empty."); - } - _nodeUrls = nodeUrls; - _endPoints = _utilFunctions.ParseSeedNodeUrls(nodeUrls); - _username = username; - _password = password; - _zoneId = zoneId; - _fetchSize = fetchSize; - _debugMode = false; - _poolSize = poolSize; - _enableRpcCompression = enableRpcCompression; - _timeout = timeout; + var resp = await client.ServiceClient.setTimeZoneAsync(req); + if (_debugMode) + { + _logger.LogInformation("setting time zone_id as {0}, server message:{1}", zoneId, resp.Message); + } } - public async Task ExecuteClientOperationAsync(AsyncOperation operation, string errMsg, bool retryOnFailure = true) + catch (TException e) { - Client client = _clients.Take(); - try - { - var resp = await operation(client); - return resp; - } - catch (TException ex) - { - if (retryOnFailure) - { - try{ - client = await Reconnect(client); - return await operation(client); - } catch (TException retryEx) - { - throw new TException(errMsg, retryEx); - } - } - else - { - throw new TException(errMsg, ex); - } - } - catch (Exception ex) - { - if (retryOnFailure) - { - try{ - client = await Reconnect(client); - return await operation(client); - } catch (TException retryEx) - { - throw new TException(errMsg, retryEx); - } - } - else - { - throw new TException(errMsg, ex); - } - } - finally - { - _clients.Add(client); - } + throw new TException("could not set time zone", e); } - /// - /// Gets or sets the amount of time a Session will wait for a send operation to complete successfully. - /// - /// The send time-out value, in milliseconds. The default is 10000. - public int TimeOut { get; set; } = 10000; + } + } + + public async Task GetTimeZone() + { + if (_zoneId != "") + { + return _zoneId; + } + + var client = _clients.Take(); + + try + { + var response = await client.ServiceClient.getTimeZoneAsync(client.SessionId); + + return response?.TimeZone; + } + catch (TException e) + { + throw new TException("could not get time zone", e); + } + finally + { + _clients.Add(client); + } + } - ILoggerFactory factory; - private bool disposedValue; + private async Task CreateAndOpen(string host, int port, bool enableRpcCompression, int timeout, string sqlDialect, string database, CancellationToken cancellationToken = default) + { + var tcpClient = new TcpClient(host, port); + tcpClient.SendTimeout = timeout; + tcpClient.ReceiveTimeout = timeout; + var transport = new TFramedTransport(new TSocketTransport(tcpClient, null)); - public void OpenDebugMode(Action configure) - { - _debugMode = true; - factory = LoggerFactory.Create(configure); - _logger = factory.CreateLogger(nameof(Apache.IoTDB)); - } + if (!transport.IsOpen) + { + await transport.OpenAsync(cancellationToken); + } + + var client = enableRpcCompression ? + new IClientRPCService.Client(new TCompactProtocol(transport)) : + new IClientRPCService.Client(new TBinaryProtocol(transport)); + + var openReq = new TSOpenSessionReq(ProtocolVersion, _zoneId, _username) + { + Password = _password, + }; + if (openReq.Configuration == null) + { + openReq.Configuration = new Dictionary(); + } + openReq.Configuration.Add("sql_dialect", sqlDialect); + if (!String.IsNullOrEmpty(database)) + { + openReq.Configuration.Add("db", database); + } + + try + { + var openResp = await client.openSessionAsync(openReq, cancellationToken); - public void CloseDebugMode() + if (openResp.ServerProtocolVersion != ProtocolVersion) { - _debugMode = false; + throw new TException($"Protocol Differ, Client version is {ProtocolVersion} but Server version is {openResp.ServerProtocolVersion}", null); } - public async Task Open(bool enableRpcCompression, CancellationToken cancellationToken = default) + if (openResp.ServerProtocolVersion == 0) { - _enableRpcCompression = enableRpcCompression; - await Open(cancellationToken); + throw new TException("Protocol not supported", null); } - public async Task Open(CancellationToken cancellationToken = default) - { - _clients = new ConcurrentClientQueue(); - _clients.Timeout = _timeout * 5; + var sessionId = openResp.SessionId; + var statementId = await client.requestStatementIdAsync(sessionId, cancellationToken); + + var endpoint = new TEndPoint(host, port); + + var returnClient = new Client( + client, + sessionId, + statementId, + transport, + endpoint); + + return returnClient; + } + catch (Exception) + { + transport.Close(); + + throw; + } + } + + public async Task CreateDatabase(string dbName) + { + return await ExecuteClientOperationAsync( + async client => + { + var status = await client.ServiceClient.setStorageGroupAsync(client.SessionId, dbName); - if (_nodeUrls.Count == 0) + if (_debugMode) { - for (var index = 0; index < _poolSize; index++) - { - try - { - _clients.Add(await CreateAndOpen(_host, _port, _enableRpcCompression, _timeout, cancellationToken)); - } - catch (Exception e) - { - if (_debugMode) - { - _logger.LogWarning(e, "Currently connecting to {0}:{1} failed", _host, _port); - } - } - } + _logger.LogInformation("create database {0} successfully, server message is {1}", dbName, status.Message); } - else + + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when creating database" + ); + } + + [Obsolete("This method is deprecated, please use createDatabase instead.")] + public async Task SetStorageGroup(string groupName) + { + return await ExecuteClientOperationAsync( + async client => + { + var status = await client.ServiceClient.setStorageGroupAsync(client.SessionId, groupName); + if (_debugMode) { - int startIndex = 0; - for (var index = 0; index < _poolSize; index++) - { - bool isConnected = false; - for (int i = 0; i < _endPoints.Count; i++) - { - var endPointIndex = (startIndex + i) % _endPoints.Count; - var endPoint = _endPoints[endPointIndex]; - try - { - var client = await CreateAndOpen(endPoint.Ip, endPoint.Port, _enableRpcCompression, _timeout, cancellationToken); - _clients.Add(client); - isConnected = true; - startIndex = (endPointIndex + 1) % _endPoints.Count; - break; - } - catch (Exception e) - { - if (_debugMode) - { - _logger.LogWarning(e, "Currently connecting to {0}:{1} failed", endPoint.Ip, endPoint.Port); - } - } - } - if (!isConnected) // current client could not connect to any endpoint - { - throw new TException("Error occurs when opening session pool. Could not connect to any server", null); - } - } + _logger.LogInformation("set storage group {0} successfully, server message is {1}", groupName, status.Message); } - - if (_clients.ClientQueue.Count != _poolSize) + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when setting storage group" + ); + } + public async Task CreateTimeSeries( + string tsPath, + TSDataType dataType, + TSEncoding encoding, + Compressor compressor) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSCreateTimeseriesReq( + client.SessionId, + tsPath, + (int)dataType, + (int)encoding, + (int)compressor); + + var status = await client.ServiceClient.createTimeseriesAsync(req); + + if (_debugMode) { - throw new TException(string.Format("Error occurs when opening session pool. Client pool size is not equal to the expected size. Client pool size: {0}, expected size: {1}, Please check the server status", _clients.ClientQueue.Count, _poolSize), null); + _logger.LogInformation("creating time series {0} successfully, server message is {1}", tsPath, status.Message); } - _isClose = false; - } + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when creating time series" + ); + } + public async Task CreateAlignedTimeseriesAsync( + string prefixPath, + List measurements, + List dataTypeLst, + List encodingLst, + List compressorLst) + { + return await ExecuteClientOperationAsync( + async client => + { + var dataTypes = dataTypeLst.ConvertAll(x => (int)x); + var encodings = encodingLst.ConvertAll(x => (int)x); + var compressors = compressorLst.ConvertAll(x => (int)x); + + var req = new TSCreateAlignedTimeseriesReq( + client.SessionId, + prefixPath, + measurements, + dataTypes, + encodings, + compressors); + + var status = await client.ServiceClient.createAlignedTimeseriesAsync(req); + + if (_debugMode) + { + _logger.LogInformation("creating aligned time series {0} successfully, server message is {1}", prefixPath, status.Message); + } - public async Task Reconnect(Client originalClient = null, CancellationToken cancellationToken = default) - { - originalClient?.Transport.Close(); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when creating aligned time series" + ); + } + public async Task DeleteDatabaseAsync(string dbName) + { + return await ExecuteClientOperationAsync( + async client => + { + var status = await client.ServiceClient.deleteStorageGroupsAsync(client.SessionId, new List { dbName }); - if (_nodeUrls.Count == 0) + if (_debugMode) { - for (int attempt = 1; attempt <= RetryNum; attempt++) - { - try - { - var client = await CreateAndOpen(_host, _port, _enableRpcCompression, _timeout, cancellationToken); - return client; - } - catch (Exception e) - { - if (_debugMode) - { - _logger.LogWarning(e, "Attempt reconnecting to {0}:{1} failed", _host, _port); - } - } - } + _logger.LogInformation("delete database {0} successfully, server message is {1}", dbName, status.Message); } - else - { - int startIndex = _endPoints.FindIndex(x => x.Ip == originalClient.EndPoint.Ip && x.Port == originalClient.EndPoint.Port); - if (startIndex == -1) - { - throw new ArgumentException($"The original client is not in the list of endpoints. Original client: {originalClient.EndPoint.Ip}:{originalClient.EndPoint.Port}"); - } - for (int attempt = 1; attempt <= RetryNum; attempt++) - { - for (int i = 0; i < _endPoints.Count; i++) - { - int j = (startIndex + i) % _endPoints.Count; - try - { - var client = await CreateAndOpen(_endPoints[j].Ip, _endPoints[j].Port, _enableRpcCompression, _timeout, cancellationToken); - return client; - } - catch (Exception e) - { - if (_debugMode) - { - _logger.LogWarning(e, "Attempt connecting to {0}:{1} failed", _endPoints[j].Ip, _endPoints[j].Port); - } - } - } - } + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when deleting database" + ); + } + [Obsolete("This method is deprecated, please use DeleteDatabaseAsync instead.")] + public async Task DeleteStorageGroupAsync(string groupName) + { + return await ExecuteClientOperationAsync( + async client => + { + var status = await client.ServiceClient.deleteStorageGroupsAsync(client.SessionId, new List { groupName }); + + if (_debugMode) + { + _logger.LogInformation("delete storage group {0} successfully, server message is {1}", groupName, status.Message); } - throw new TException("Error occurs when reconnecting session pool. Could not connect to any server", null); - } + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when deleting storage group" + ); + } + public async Task DeleteDatabasesAsync(List dbNames) + { + return await ExecuteClientOperationAsync( + async client => + { + var status = await client.ServiceClient.deleteStorageGroupsAsync(client.SessionId, dbNames); + if (_debugMode) + { + _logger.LogInformation("delete database(s) {0} successfully, server message is {1}", dbNames, status.Message); + } - public bool IsOpen() => !_isClose; + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when deleting database(s)" + ); + } + [Obsolete("This method is deprecated, please use DeleteDatabasesAsync instead.")] + public async Task DeleteStorageGroupsAsync(List groupNames) + { + return await ExecuteClientOperationAsync( + async client => + { + var status = await client.ServiceClient.deleteStorageGroupsAsync(client.SessionId, groupNames); - public async Task Close() - { - if (_isClose) + if (_debugMode) { - return; + _logger.LogInformation("delete storage group(s) {0} successfully, server message is {1}", groupNames, status.Message); } - foreach (var client in _clients.ClientQueue.AsEnumerable()) - { - var closeSessionRequest = new TSCloseSessionReq(client.SessionId); - try - { - await client.ServiceClient.closeSessionAsync(closeSessionRequest); - } - catch (TException e) - { - throw new TException("Error occurs when closing session at server. Maybe server is down", e); - } - finally - { - _isClose = true; + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when deleting storage group(s)" + ); + } + public async Task CreateMultiTimeSeriesAsync( + List tsPathLst, + List dataTypeLst, + List encodingLst, + List compressorLst) + { + return await ExecuteClientOperationAsync( + async client => + { + var dataTypes = dataTypeLst.ConvertAll(x => (int)x); + var encodings = encodingLst.ConvertAll(x => (int)x); + var compressors = compressorLst.ConvertAll(x => (int)x); - client.Transport?.Close(); - } - } - } + var req = new TSCreateMultiTimeseriesReq(client.SessionId, tsPathLst, dataTypes, encodings, compressors); - public async Task SetTimeZone(string zoneId) - { - _zoneId = zoneId; + var status = await client.ServiceClient.createMultiTimeseriesAsync(req); - foreach (var client in _clients.ClientQueue.AsEnumerable()) + if (_debugMode) { - var req = new TSSetTimeZoneReq(client.SessionId, zoneId); - try - { - var resp = await client.ServiceClient.setTimeZoneAsync(req); - if (_debugMode) - { - _logger.LogInformation("setting time zone_id as {0}, server message:{1}", zoneId, resp.Message); - } - } - catch (TException e) - { - throw new TException("could not set time zone", e); - } + _logger.LogInformation("creating multiple time series {0}, server message is {1}", tsPathLst, status.Message); } - } - public async Task GetTimeZone() - { - if (_zoneId != "") + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when creating multiple time series" + ); + } + public async Task DeleteTimeSeriesAsync(List pathList) + { + return await ExecuteClientOperationAsync( + async client => + { + var status = await client.ServiceClient.deleteTimeseriesAsync(client.SessionId, pathList); + + if (_debugMode) { - return _zoneId; + _logger.LogInformation("deleting multiple time series {0}, server message is {1}", pathList, status.Message); } - var client = _clients.Take(); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when deleting multiple time series" + ); + } - try - { - var response = await client.ServiceClient.getTimeZoneAsync(client.SessionId); + public async Task DeleteTimeSeriesAsync(string tsPath) + { + return await DeleteTimeSeriesAsync(new List { tsPath }); + } - return response?.TimeZone; - } - catch (TException e) - { - throw new TException("could not get time zone", e); - } - finally + public async Task CheckTimeSeriesExistsAsync(string tsPath) + { + // TBD by dalong + try + { + var sql = "SHOW TIMESERIES " + tsPath; + var sessionDataset = await ExecuteQueryStatementAsync(sql); + return sessionDataset.HasNext(); + } + catch (TException e) + { + throw new TException("could not check if certain time series exists", e); + } + } + public async Task DeleteDataAsync(List tsPathLst, long startTime, long endTime) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSDeleteDataReq(client.SessionId, tsPathLst, startTime, endTime); + + var status = await client.ServiceClient.deleteDataAsync(req); + + if (_debugMode) { - _clients.Add(client); + _logger.LogInformation( + "delete data from {0}, server message is {1}", + tsPathLst, + status.Message); } - } - private async Task CreateAndOpen(string host, int port, bool enableRpcCompression, int timeout, CancellationToken cancellationToken = default) - { - var tcpClient = new TcpClient(host, port); - tcpClient.SendTimeout = timeout; - tcpClient.ReceiveTimeout = timeout; - var transport = new TFramedTransport(new TSocketTransport(tcpClient, null)); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when deleting data" + ); + } + public async Task InsertRecordAsync(string deviceId, RowRecord record) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSInsertRecordReq(client.SessionId, deviceId, record.Measurements, record.ToBytes(), record.Timestamps); - if (!transport.IsOpen) + var status = await client.ServiceClient.insertRecordAsync(req); + + if (_debugMode) { - await transport.OpenAsync(cancellationToken); + _logger.LogInformation("insert one record to device {0}, server message: {1}", deviceId, status.Message); } - var client = enableRpcCompression ? - new IClientRPCService.Client(new TCompactProtocol(transport)) : - new IClientRPCService.Client(new TBinaryProtocol(transport)); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting record" + ); + } + public async Task InsertAlignedRecordAsync(string deviceId, RowRecord record) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSInsertRecordReq(client.SessionId, deviceId, record.Measurements, record.ToBytes(), record.Timestamps); + req.IsAligned = true; + // ASSERT that the insert plan is aligned + System.Diagnostics.Debug.Assert(req.IsAligned == true); - var openReq = new TSOpenSessionReq(ProtocolVersion, _zoneId, _username) - { - Password = _password, - }; + var status = await client.ServiceClient.insertRecordAsync(req); - try + if (_debugMode) { - var openResp = await client.openSessionAsync(openReq, cancellationToken); + _logger.LogInformation("insert one record to device {0}, server message: {1}", deviceId, status.Message); + } - if (openResp.ServerProtocolVersion != ProtocolVersion) - { - throw new TException($"Protocol Differ, Client version is {ProtocolVersion} but Server version is {openResp.ServerProtocolVersion}", null); - } + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting record" + ); + } - if (openResp.ServerProtocolVersion == 0) - { - throw new TException("Protocol not supported", null); - } + public TSInsertStringRecordReq GenInsertStrRecordReq(string deviceId, List measurements, + List values, long timestamp, long sessionId, bool isAligned = false) + { + if (values.Count() != measurements.Count()) + { + throw new ArgumentException("length of data types does not equal to length of values!"); + } + + return new TSInsertStringRecordReq(sessionId, deviceId, measurements, values, timestamp) + { + IsAligned = isAligned + }; + } + public TSInsertStringRecordsReq GenInsertStringRecordsReq(List deviceIds, List> measurementsList, + List> valuesList, List timestamps, long sessionId, bool isAligned = false) + { + if (valuesList.Count() != measurementsList.Count()) + { + throw new ArgumentException("length of data types does not equal to length of values!"); + } + + return new TSInsertStringRecordsReq(sessionId, deviceIds, measurementsList, valuesList, timestamps) + { + IsAligned = isAligned + }; + } - var sessionId = openResp.SessionId; - var statementId = await client.requestStatementIdAsync(sessionId, cancellationToken); + public TSInsertRecordsReq GenInsertRecordsReq(List deviceId, List rowRecords, + long sessionId) + { + var measurementLst = rowRecords.Select(x => x.Measurements).ToList(); + var timestampLst = rowRecords.Select(x => x.Timestamps).ToList(); + var valuesLstInBytes = rowRecords.Select(row => row.ToBytes()).ToList(); - var endpoint = new TEndPoint(host, port); + return new TSInsertRecordsReq(sessionId, deviceId, measurementLst, valuesLstInBytes, timestampLst); + } + public async Task InsertStringRecordAsync(string deviceId, List measurements, List values, + long timestamp) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertStrRecordReq(deviceId, measurements, values, timestamp, client.SessionId); - var returnClient = new Client( - client, - sessionId, - statementId, - transport, - endpoint); + var status = await client.ServiceClient.insertStringRecordAsync(req); - return returnClient; - } - catch (Exception) + if (_debugMode) { - transport.Close(); - - throw; + _logger.LogInformation("insert one string record to device {0}, server message: {1}", deviceId, status.Message); } - } - public async Task CreateDatabase(string dbName) - { - return await ExecuteClientOperationAsync( - async client => - { - var status = await client.ServiceClient.setStorageGroupAsync(client.SessionId, dbName); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting a string record" + ); + } + public async Task InsertAlignedStringRecordAsync(string deviceId, List measurements, List values, + long timestamp) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertStrRecordReq(deviceId, measurements, values, timestamp, client.SessionId, true); - if (_debugMode) - { - _logger.LogInformation("create database {0} successfully, server message is {1}", dbName, status.Message); - } + var status = await client.ServiceClient.insertStringRecordAsync(req); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when creating database" - ); - } + if (_debugMode) + { + _logger.LogInformation("insert one record to device {0}, server message: {1}", deviceId, status.Message); + } - [Obsolete("This method is deprecated, please use createDatabase instead.")] - public async Task SetStorageGroup(string groupName) - { - return await ExecuteClientOperationAsync( - async client => - { - var status = await client.ServiceClient.setStorageGroupAsync(client.SessionId, groupName); - if (_debugMode) - { - _logger.LogInformation("set storage group {0} successfully, server message is {1}", groupName, status.Message); - } - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when setting storage group" - ); - } - public async Task CreateTimeSeries( - string tsPath, - TSDataType dataType, - TSEncoding encoding, - Compressor compressor) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSCreateTimeseriesReq( - client.SessionId, - tsPath, - (int)dataType, - (int)encoding, - (int)compressor); - - var status = await client.ServiceClient.createTimeseriesAsync(req); - - if (_debugMode) - { - _logger.LogInformation("creating time series {0} successfully, server message is {1}", tsPath, status.Message); - } - - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when creating time series" - ); - } - public async Task CreateAlignedTimeseriesAsync( - string prefixPath, - List measurements, - List dataTypeLst, - List encodingLst, - List compressorLst) - { - return await ExecuteClientOperationAsync( - async client => - { - var dataTypes = dataTypeLst.ConvertAll(x => (int)x); - var encodings = encodingLst.ConvertAll(x => (int)x); - var compressors = compressorLst.ConvertAll(x => (int)x); - - var req = new TSCreateAlignedTimeseriesReq( - client.SessionId, - prefixPath, - measurements, - dataTypes, - encodings, - compressors); - - var status = await client.ServiceClient.createAlignedTimeseriesAsync(req); - - if (_debugMode) - { - _logger.LogInformation("creating aligned time series {0} successfully, server message is {1}", prefixPath, status.Message); - } - - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when creating aligned time series" - ); - } - public async Task DeleteDatabaseAsync(string dbName) - { - return await ExecuteClientOperationAsync( - async client => - { - var status = await client.ServiceClient.deleteStorageGroupsAsync(client.SessionId, new List { dbName }); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting a string record" + ); + } + public async Task InsertStringRecordsAsync(List deviceIds, List> measurements, List> values, + List timestamps) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertStringRecordsReq(deviceIds, measurements, values, timestamps, client.SessionId); - if (_debugMode) - { - _logger.LogInformation("delete database {0} successfully, server message is {1}", dbName, status.Message); - } + var status = await client.ServiceClient.insertStringRecordsAsync(req); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when deleting database" - ); - } - [Obsolete("This method is deprecated, please use DeleteDatabaseAsync instead.")] - public async Task DeleteStorageGroupAsync(string groupName) - { - return await ExecuteClientOperationAsync( - async client => - { - var status = await client.ServiceClient.deleteStorageGroupsAsync(client.SessionId, new List { groupName }); + if (_debugMode) + { + _logger.LogInformation("insert string records to devices {0}, server message: {1}", deviceIds, status.Message); + } - if (_debugMode) - { - _logger.LogInformation("delete storage group {0} successfully, server message is {1}", groupName, status.Message); - } + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting string records" + ); + } + public async Task InsertAlignedStringRecordsAsync(List deviceIds, List> measurements, List> values, + List timestamps) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertStringRecordsReq(deviceIds, measurements, values, timestamps, client.SessionId, true); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when deleting storage group" - ); - } - public async Task DeleteDatabasesAsync(List dbNames) - { - return await ExecuteClientOperationAsync( - async client => - { - var status = await client.ServiceClient.deleteStorageGroupsAsync(client.SessionId, dbNames); + var status = await client.ServiceClient.insertStringRecordsAsync(req); - if (_debugMode) - { - _logger.LogInformation("delete database(s) {0} successfully, server message is {1}", dbNames, status.Message); - } + if (_debugMode) + { + _logger.LogInformation("insert string records to devices {0}, server message: {1}", deviceIds, status.Message); + } - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when deleting database(s)" - ); - } - [Obsolete("This method is deprecated, please use DeleteDatabasesAsync instead.")] - public async Task DeleteStorageGroupsAsync(List groupNames) - { - return await ExecuteClientOperationAsync( - async client => - { - var status = await client.ServiceClient.deleteStorageGroupsAsync(client.SessionId, groupNames); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting string records" + ); + } + public async Task InsertRecordsAsync(List deviceId, List rowRecords) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertRecordsReq(deviceId, rowRecords, client.SessionId); - if (_debugMode) - { - _logger.LogInformation("delete storage group(s) {0} successfully, server message is {1}", groupNames, status.Message); - } + var status = await client.ServiceClient.insertRecordsAsync(req); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when deleting storage group(s)" - ); - } - public async Task CreateMultiTimeSeriesAsync( - List tsPathLst, - List dataTypeLst, - List encodingLst, - List compressorLst) - { - return await ExecuteClientOperationAsync( - async client => - { - var dataTypes = dataTypeLst.ConvertAll(x => (int)x); - var encodings = encodingLst.ConvertAll(x => (int)x); - var compressors = compressorLst.ConvertAll(x => (int)x); + if (_debugMode) + { + _logger.LogInformation("insert multiple records to devices {0}, server message: {1}", deviceId, status.Message); + } - var req = new TSCreateMultiTimeseriesReq(client.SessionId, tsPathLst, dataTypes, encodings, compressors); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting records" + ); + } + public async Task InsertAlignedRecordsAsync(List deviceId, List rowRecords) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertRecordsReq(deviceId, rowRecords, client.SessionId); + req.IsAligned = true; + // ASSERT that the insert plan is aligned + System.Diagnostics.Debug.Assert(req.IsAligned == true); - var status = await client.ServiceClient.createMultiTimeseriesAsync(req); + var status = await client.ServiceClient.insertRecordsAsync(req); - if (_debugMode) - { - _logger.LogInformation("creating multiple time series {0}, server message is {1}", tsPathLst, status.Message); - } + if (_debugMode) + { + _logger.LogInformation("insert multiple records to devices {0}, server message: {1}", deviceId, status.Message); + } - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when creating multiple time series" - ); - } - public async Task DeleteTimeSeriesAsync(List pathList) - { - return await ExecuteClientOperationAsync( - async client => - { - var status = await client.ServiceClient.deleteTimeseriesAsync(client.SessionId, pathList); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting records" + ); + } + public TSInsertTabletReq GenInsertTabletReq(Tablet tablet, long sessionId) + { + return new TSInsertTabletReq( + sessionId, + tablet.InsertTargetName, + tablet.Measurements, + tablet.GetBinaryValues(), + tablet.GetBinaryTimestamps(), + tablet.GetDataTypes(), + tablet.RowNumber); + } + public async Task InsertTabletAsync(Tablet tablet) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertTabletReq(tablet, client.SessionId); - if (_debugMode) - { - _logger.LogInformation("deleting multiple time series {0}, server message is {1}", pathList, status.Message); - } + var status = await client.ServiceClient.insertTabletAsync(req); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when deleting multiple time series" - ); - } + if (_debugMode) + { + _logger.LogInformation("insert one tablet to device {0}, server message: {1}", tablet.InsertTargetName, status.Message); + } - public async Task DeleteTimeSeriesAsync(string tsPath) - { - return await DeleteTimeSeriesAsync(new List { tsPath }); - } + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting tablet" + ); + } + public async Task InsertAlignedTabletAsync(Tablet tablet) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertTabletReq(tablet, client.SessionId); + req.IsAligned = true; - public async Task CheckTimeSeriesExistsAsync(string tsPath) - { - // TBD by dalong - try + var status = await client.ServiceClient.insertTabletAsync(req); + + if (_debugMode) { - var sql = "SHOW TIMESERIES " + tsPath; - var sessionDataset = await ExecuteQueryStatementAsync(sql); - return sessionDataset.HasNext(); + _logger.LogInformation("insert one aligned tablet to device {0}, server message: {1}", tablet.InsertTargetName, status.Message); } - catch (TException e) + + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting aligned tablet" + ); + } + + protected internal async Task InsertRelationalTabletAsync(Tablet tablet) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertTabletReq(tablet, client.SessionId); + req.ColumnCategories = tablet.GetColumnColumnCategories(); + req.WriteToTable = true; + + var status = await client.ServiceClient.insertTabletAsync(req); + + if (_debugMode) { - throw new TException("could not check if certain time series exists", e); + _logger.LogInformation("insert one tablet to table {0}, server message: {1}", tablet.InsertTargetName, status.Message); } - } - public async Task DeleteDataAsync(List tsPathLst, long startTime, long endTime) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSDeleteDataReq(client.SessionId, tsPathLst, startTime, endTime); - - var status = await client.ServiceClient.deleteDataAsync(req); - - if (_debugMode) - { - _logger.LogInformation( - "delete data from {0}, server message is {1}", - tsPathLst, - status.Message); - } - - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when deleting data" - ); - } - public async Task InsertRecordAsync(string deviceId, RowRecord record) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSInsertRecordReq(client.SessionId, deviceId, record.Measurements, record.ToBytes(), record.Timestamps); - var status = await client.ServiceClient.insertRecordAsync(req); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting tablet" + ); + } - if (_debugMode) - { - _logger.LogInformation("insert one record to device {0}, server message: {1}", deviceId, status.Message); - } + public TSInsertTabletsReq GenInsertTabletsReq(List tabletLst, long sessionId) + { + var deviceIdLst = new List(); + var measurementsLst = new List>(); + var valuesLst = new List(); + var timestampsLst = new List(); + var typeLst = new List>(); + var sizeLst = new List(); + + foreach (var tablet in tabletLst) + { + var dataTypeValues = tablet.GetDataTypes(); + deviceIdLst.Add(tablet.InsertTargetName); + measurementsLst.Add(tablet.Measurements); + valuesLst.Add(tablet.GetBinaryValues()); + timestampsLst.Add(tablet.GetBinaryTimestamps()); + typeLst.Add(dataTypeValues); + sizeLst.Add(tablet.RowNumber); + } + + return new TSInsertTabletsReq( + sessionId, + deviceIdLst, + measurementsLst, + valuesLst, + timestampsLst, + typeLst, + sizeLst); + } - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting record" - ); - } - public async Task InsertAlignedRecordAsync(string deviceId, RowRecord record) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSInsertRecordReq(client.SessionId, deviceId, record.Measurements, record.ToBytes(), record.Timestamps); - req.IsAligned = true; - // ASSERT that the insert plan is aligned - System.Diagnostics.Debug.Assert(req.IsAligned == true); - - var status = await client.ServiceClient.insertRecordAsync(req); - - if (_debugMode) - { - _logger.LogInformation("insert one record to device {0}, server message: {1}", deviceId, status.Message); - } - - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting record" - ); - } + public async Task InsertTabletsAsync(List tabletLst) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertTabletsReq(tabletLst, client.SessionId); - public TSInsertStringRecordReq GenInsertStrRecordReq(string deviceId, List measurements, - List values, long timestamp, long sessionId, bool isAligned = false) - { - if (values.Count() != measurements.Count()) + var status = await client.ServiceClient.insertTabletsAsync(req); + + if (_debugMode) { - throw new ArgumentException("length of data types does not equal to length of values!"); + _logger.LogInformation("insert multiple tablets, message: {0}", status.Message); } - return new TSInsertStringRecordReq(sessionId, deviceId, measurements, values, timestamp) - { - IsAligned = isAligned - }; - } - public TSInsertStringRecordsReq GenInsertStringRecordsReq(List deviceIds, List> measurementsList, - List> valuesList, List timestamps, long sessionId, bool isAligned = false) - { - if (valuesList.Count() != measurementsList.Count()) + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting tablets" + ); + } + public async Task InsertAlignedTabletsAsync(List tabletLst) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertTabletsReq(tabletLst, client.SessionId); + req.IsAligned = true; + + var status = await client.ServiceClient.insertTabletsAsync(req); + + if (_debugMode) { - throw new ArgumentException("length of data types does not equal to length of values!"); + _logger.LogInformation("insert multiple aligned tablets, message: {0}", status.Message); } - return new TSInsertStringRecordsReq(sessionId, deviceIds, measurementsList, valuesList, timestamps) + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting aligned tablets" + ); + } + + public async Task InsertRecordsOfOneDeviceAsync(string deviceId, List rowRecords) + { + var sortedRowRecords = rowRecords.OrderBy(x => x.Timestamps).ToList(); + return await InsertRecordsOfOneDeviceSortedAsync(deviceId, sortedRowRecords); + } + public async Task InsertAlignedRecordsOfOneDeviceAsync(string deviceId, List rowRecords) + { + var sortedRowRecords = rowRecords.OrderBy(x => x.Timestamps).ToList(); + return await InsertAlignedRecordsOfOneDeviceSortedAsync(deviceId, sortedRowRecords); + } + public async Task InsertStringRecordsOfOneDeviceAsync(string deviceId, List timestamps, + List> measurementsList, List> valuesList) + { + var joined = timestamps.Zip(measurementsList, (t, m) => new { t, m }) + .Zip(valuesList, (tm, v) => new { tm.t, tm.m, v }) + .OrderBy(x => x.t); + + var sortedTimestamps = joined.Select(x => x.t).ToList(); + var sortedMeasurementsList = joined.Select(x => x.m).ToList(); + var sortedValuesList = joined.Select(x => x.v).ToList(); + + return await InsertStringRecordsOfOneDeviceSortedAsync(deviceId, sortedTimestamps, sortedMeasurementsList, sortedValuesList, false); + } + public async Task InsertAlignedStringRecordsOfOneDeviceAsync(string deviceId, List timestamps, + List> measurementsList, List> valuesList) + { + var joined = timestamps.Zip(measurementsList, (t, m) => new { t, m }) + .Zip(valuesList, (tm, v) => new { tm.t, tm.m, v }) + .OrderBy(x => x.t); + + var sortedTimestamps = joined.Select(x => x.t).ToList(); + var sortedMeasurementsList = joined.Select(x => x.m).ToList(); + var sortedValuesList = joined.Select(x => x.v).ToList(); + + return await InsertStringRecordsOfOneDeviceSortedAsync(deviceId, sortedTimestamps, sortedMeasurementsList, sortedValuesList, true); + } + public async Task InsertStringRecordsOfOneDeviceSortedAsync(string deviceId, List timestamps, + List> measurementsList, List> valuesList, bool isAligned) + { + return await ExecuteClientOperationAsync( + async client => + { + if (!_utilFunctions.IsSorted(timestamps)) { - IsAligned = isAligned - }; - } + throw new ArgumentException("insert string records of one device error: timestamp not sorted"); + } - public TSInsertRecordsReq GenInsertRecordsReq(List deviceId, List rowRecords, - long sessionId) - { - var measurementLst = rowRecords.Select(x => x.Measurements).ToList(); - var timestampLst = rowRecords.Select(x => x.Timestamps).ToList(); - var valuesLstInBytes = rowRecords.Select(row => row.ToBytes()).ToList(); + var req = GenInsertStringRecordsOfOneDeviceReq(deviceId, timestamps, measurementsList, valuesList, client.SessionId, isAligned); - return new TSInsertRecordsReq(sessionId, deviceId, measurementLst, valuesLstInBytes, timestampLst); - } - public async Task InsertStringRecordAsync(string deviceId, List measurements, List values, - long timestamp) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertStrRecordReq(deviceId, measurements, values, timestamp, client.SessionId); + var status = await client.ServiceClient.insertStringRecordsOfOneDeviceAsync(req); - var status = await client.ServiceClient.insertStringRecordAsync(req); + if (_debugMode) + { + _logger.LogInformation("insert string records of one device, message: {0}", status.Message); + } - if (_debugMode) - { - _logger.LogInformation("insert one string record to device {0}, server message: {1}", deviceId, status.Message); - } + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting string records of one device" + ); + } + private TSInsertStringRecordsOfOneDeviceReq GenInsertStringRecordsOfOneDeviceReq(string deviceId, + List timestamps, List> measurementsList, List> valuesList, + long sessionId, bool isAligned = false) + { + return new TSInsertStringRecordsOfOneDeviceReq( + sessionId, + deviceId, + measurementsList, + valuesList, + timestamps) + { + IsAligned = isAligned + }; + } + private TSInsertRecordsOfOneDeviceReq GenInsertRecordsOfOneDeviceRequest( + string deviceId, + List records, + long sessionId) + { + var values = records.Select(row => row.ToBytes()); + var measurementsLst = records.Select(x => x.Measurements).ToList(); + var timestampLst = records.Select(x => x.Timestamps).ToList(); + + return new TSInsertRecordsOfOneDeviceReq( + sessionId, + deviceId, + measurementsLst, + values.ToList(), + timestampLst); + } + public async Task InsertRecordsOfOneDeviceSortedAsync(string deviceId, List rowRecords) + { + return await ExecuteClientOperationAsync( + async client => + { + var timestampLst = rowRecords.Select(x => x.Timestamps).ToList(); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting a string record" - ); - } - public async Task InsertAlignedStringRecordAsync(string deviceId, List measurements, List values, - long timestamp) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertStrRecordReq(deviceId, measurements, values, timestamp, client.SessionId, true); + if (!_utilFunctions.IsSorted(timestampLst)) + { + throw new ArgumentException("insert records of one device error: timestamp not sorted"); + } - var status = await client.ServiceClient.insertStringRecordAsync(req); + var req = GenInsertRecordsOfOneDeviceRequest(deviceId, rowRecords, client.SessionId); - if (_debugMode) - { - _logger.LogInformation("insert one record to device {0}, server message: {1}", deviceId, status.Message); - } + var status = await client.ServiceClient.insertRecordsOfOneDeviceAsync(req); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting a string record" - ); - } - public async Task InsertStringRecordsAsync(List deviceIds, List> measurements, List> values, - List timestamps) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertStringRecordsReq(deviceIds, measurements, values, timestamps, client.SessionId); + if (_debugMode) + { + _logger.LogInformation("insert records of one device, message: {0}", status.Message); + } - var status = await client.ServiceClient.insertStringRecordsAsync(req); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting records of one device" + ); + } + public async Task InsertAlignedRecordsOfOneDeviceSortedAsync(string deviceId, List rowRecords) + { + return await ExecuteClientOperationAsync( + async client => + { + var timestampLst = rowRecords.Select(x => x.Timestamps).ToList(); - if (_debugMode) - { - _logger.LogInformation("insert string records to devices {0}, server message: {1}", deviceIds, status.Message); - } + if (!_utilFunctions.IsSorted(timestampLst)) + { + throw new ArgumentException("insert records of one device error: timestamp not sorted"); + } - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting string records" - ); - } - public async Task InsertAlignedStringRecordsAsync(List deviceIds, List> measurements, List> values, - List timestamps) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertStringRecordsReq(deviceIds, measurements, values, timestamps, client.SessionId, true); + var req = GenInsertRecordsOfOneDeviceRequest(deviceId, rowRecords, client.SessionId); + req.IsAligned = true; - var status = await client.ServiceClient.insertStringRecordsAsync(req); + var status = await client.ServiceClient.insertRecordsOfOneDeviceAsync(req); - if (_debugMode) - { - _logger.LogInformation("insert string records to devices {0}, server message: {1}", deviceIds, status.Message); - } + if (_debugMode) + { + _logger.LogInformation("insert aligned records of one device, message: {0}", status.Message); + } - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting string records" - ); - } - public async Task InsertRecordsAsync(List deviceId, List rowRecords) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertRecordsReq(deviceId, rowRecords, client.SessionId); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when inserting aligned records of one device" + ); + } + public async Task TestInsertRecordAsync(string deviceId, RowRecord record) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSInsertRecordReq( + client.SessionId, + deviceId, + record.Measurements, + record.ToBytes(), + record.Timestamps); + + var status = await client.ServiceClient.testInsertRecordAsync(req); + + if (_debugMode) + { + _logger.LogInformation("insert one record to device {0}, server message: {1}", deviceId, status.Message); + } - var status = await client.ServiceClient.insertRecordsAsync(req); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when test inserting one record" + ); + } + public async Task TestInsertRecordsAsync(List deviceId, List rowRecords) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertRecordsReq(deviceId, rowRecords, client.SessionId); - if (_debugMode) - { - _logger.LogInformation("insert multiple records to devices {0}, server message: {1}", deviceId, status.Message); - } + var status = await client.ServiceClient.testInsertRecordsAsync(req); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting records" - ); - } - public async Task InsertAlignedRecordsAsync(List deviceId, List rowRecords) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertRecordsReq(deviceId, rowRecords, client.SessionId); - req.IsAligned = true; - // ASSERT that the insert plan is aligned - System.Diagnostics.Debug.Assert(req.IsAligned == true); - - var status = await client.ServiceClient.insertRecordsAsync(req); - - if (_debugMode) - { - _logger.LogInformation("insert multiple records to devices {0}, server message: {1}", deviceId, status.Message); - } - - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting records" - ); - } - public TSInsertTabletReq GenInsertTabletReq(Tablet tablet, long sessionId) - { - return new TSInsertTabletReq( - sessionId, - tablet.DeviceId, - tablet.Measurements, - tablet.GetBinaryValues(), - tablet.GetBinaryTimestamps(), - tablet.GetDataTypes(), - tablet.RowNumber); - } - public async Task InsertTabletAsync(Tablet tablet) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertTabletReq(tablet, client.SessionId); + if (_debugMode) + { + _logger.LogInformation("insert multiple records to devices {0}, server message: {1}", deviceId, status.Message); + } - var status = await client.ServiceClient.insertTabletAsync(req); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when test inserting multiple records" + ); + } + public async Task TestInsertTabletAsync(Tablet tablet) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertTabletReq(tablet, client.SessionId); - if (_debugMode) - { - _logger.LogInformation("insert one tablet to device {0}, server message: {1}", tablet.DeviceId, status.Message); - } + var status = await client.ServiceClient.testInsertTabletAsync(req); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting tablet" - ); - } - public async Task InsertAlignedTabletAsync(Tablet tablet) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertTabletReq(tablet, client.SessionId); - req.IsAligned = true; + if (_debugMode) + { + _logger.LogInformation("insert one tablet to device {0}, server message: {1}", tablet.InsertTargetName, status.Message); + } - var status = await client.ServiceClient.insertTabletAsync(req); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when test inserting one tablet" + ); + } + public async Task TestInsertTabletsAsync(List tabletLst) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = GenInsertTabletsReq(tabletLst, client.SessionId); - if (_debugMode) - { - _logger.LogInformation("insert one aligned tablet to device {0}, server message: {1}", tablet.DeviceId, status.Message); - } + var status = await client.ServiceClient.testInsertTabletsAsync(req); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting aligned tablet" - ); - } + if (_debugMode) + { + _logger.LogInformation("insert multiple tablets, message: {0}", status.Message); + } - public TSInsertTabletsReq GenInsertTabletsReq(List tabletLst, long sessionId) - { - var deviceIdLst = new List(); - var measurementsLst = new List>(); - var valuesLst = new List(); - var timestampsLst = new List(); - var typeLst = new List>(); - var sizeLst = new List(); - - foreach (var tablet in tabletLst) - { - var dataTypeValues = tablet.GetDataTypes(); - deviceIdLst.Add(tablet.DeviceId); - measurementsLst.Add(tablet.Measurements); - valuesLst.Add(tablet.GetBinaryValues()); - timestampsLst.Add(tablet.GetBinaryTimestamps()); - typeLst.Add(dataTypeValues); - sizeLst.Add(tablet.RowNumber); - } - - return new TSInsertTabletsReq( - sessionId, - deviceIdLst, - measurementsLst, - valuesLst, - timestampsLst, - typeLst, - sizeLst); - } + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when test inserting multiple tablets" + ); + } - public async Task InsertTabletsAsync(List tabletLst) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertTabletsReq(tabletLst, client.SessionId); + public async Task ExecuteQueryStatementAsync(string sql) + { + // default timeout is 60s + return await ExecuteQueryStatementAsync(sql, 60 * 1000); + } - var status = await client.ServiceClient.insertTabletsAsync(req); + public async Task ExecuteQueryStatementAsync(string sql, long timeoutInMs) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSExecuteStatementReq(client.SessionId, sql, client.StatementId) + { + FetchSize = _fetchSize, + Timeout = timeoutInMs + }; - if (_debugMode) - { - _logger.LogInformation("insert multiple tablets, message: {0}", status.Message); - } + var resp = await client.ServiceClient.executeQueryStatementAsync(req); + var status = resp.Status; - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting tablets" - ); - } - public async Task InsertAlignedTabletsAsync(List tabletLst) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertTabletsReq(tabletLst, client.SessionId); - req.IsAligned = true; + if (_utilFunctions.VerifySuccess(status) == -1) + { + throw new Exception(string.Format("execute query failed, sql: {0}, message: {1}", sql, status.Message)); + } + + return new SessionDataSet(sql, resp, _clients, client.StatementId) + { + FetchSize = _fetchSize, + }; + }, + errMsg: "Error occurs when executing query statement" + ); + } - var status = await client.ServiceClient.insertTabletsAsync(req); + public async Task ExecuteStatementAsync(string sql, long timeout) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSExecuteStatementReq(client.SessionId, sql, client.StatementId) + { + FetchSize = _fetchSize, + Timeout = timeout + }; - if (_debugMode) - { - _logger.LogInformation("insert multiple aligned tablets, message: {0}", status.Message); - } + var resp = await client.ServiceClient.executeStatementAsync(req); + var status = resp.Status; - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting aligned tablets" - ); - } + if (_utilFunctions.VerifySuccess(status) == -1) + { + throw new Exception(string.Format("execute query failed, sql: {0}, message: {1}", sql, status.Message)); + } - public async Task InsertRecordsOfOneDeviceAsync(string deviceId, List rowRecords) - { - var sortedRowRecords = rowRecords.OrderBy(x => x.Timestamps).ToList(); - return await InsertRecordsOfOneDeviceSortedAsync(deviceId, sortedRowRecords); - } - public async Task InsertAlignedRecordsOfOneDeviceAsync(string deviceId, List rowRecords) - { - var sortedRowRecords = rowRecords.OrderBy(x => x.Timestamps).ToList(); - return await InsertAlignedRecordsOfOneDeviceSortedAsync(deviceId, sortedRowRecords); - } - public async Task InsertStringRecordsOfOneDeviceAsync(string deviceId, List timestamps, - List> measurementsList, List> valuesList) - { - var joined = timestamps.Zip(measurementsList, (t, m) => new { t, m }) - .Zip(valuesList, (tm, v) => new { tm.t, tm.m, v }) - .OrderBy(x => x.t); + return new SessionDataSet(sql, resp, _clients, client.StatementId) + { + FetchSize = _fetchSize, + }; + }, + errMsg: "Error occurs when executing query statement" + ); + } - var sortedTimestamps = joined.Select(x => x.t).ToList(); - var sortedMeasurementsList = joined.Select(x => x.m).ToList(); - var sortedValuesList = joined.Select(x => x.v).ToList(); - return await InsertStringRecordsOfOneDeviceSortedAsync(deviceId, sortedTimestamps, sortedMeasurementsList, sortedValuesList, false); - } - public async Task InsertAlignedStringRecordsOfOneDeviceAsync(string deviceId, List timestamps, - List> measurementsList, List> valuesList) - { - var joined = timestamps.Zip(measurementsList, (t, m) => new { t, m }) - .Zip(valuesList, (tm, v) => new { tm.t, tm.m, v }) - .OrderBy(x => x.t); + public async Task ExecuteNonQueryStatementAsync(string sql) + { + return await ExecuteClientOperationAsync( + async client => + { + String previousDB = _database; + var req = new TSExecuteStatementReq(client.SessionId, sql, client.StatementId); - var sortedTimestamps = joined.Select(x => x.t).ToList(); - var sortedMeasurementsList = joined.Select(x => x.m).ToList(); - var sortedValuesList = joined.Select(x => x.v).ToList(); + var resp = await client.ServiceClient.executeUpdateStatementAsync(req); + var status = resp.Status; - return await InsertStringRecordsOfOneDeviceSortedAsync(deviceId, sortedTimestamps, sortedMeasurementsList, sortedValuesList, true); - } - public async Task InsertStringRecordsOfOneDeviceSortedAsync(string deviceId, List timestamps, - List> measurementsList, List> valuesList, bool isAligned) - { - return await ExecuteClientOperationAsync( - async client => + if (resp.__isset.database) + { + this._database = resp.Database; + } + if (_database != previousDB) + { + // all client should switch to the same database + foreach (var c in _clients.ClientQueue) + { + try{ + if (c != client) + { + var switchReq = new TSExecuteStatementReq(c.SessionId, sql, c.StatementId); + await c.ServiceClient.executeUpdateStatementAsync(switchReq); + } + } + catch (Exception e) { - if (!_utilFunctions.IsSorted(timestamps)) - { - throw new ArgumentException("insert string records of one device error: timestamp not sorted"); - } + _logger.LogError("switch database from {0} to {1} failed for {2}, error: {3}", previousDB, _database, c.SessionId, e.Message); + } + } + _logger.LogInformation("switch database from {0} to {1}", previousDB, _database); + } - var req = GenInsertStringRecordsOfOneDeviceReq(deviceId, timestamps, measurementsList, valuesList, client.SessionId, isAligned); + if (_debugMode) + { + _logger.LogInformation("execute non-query statement {0} message: {1}", sql, status.Message); + } - var status = await client.ServiceClient.insertStringRecordsOfOneDeviceAsync(req); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when executing non-query statement" + ); + } + public async Task ExecuteRawDataQuery(List paths, long startTime, long endTime) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSRawDataQueryReq(client.SessionId, paths, startTime, endTime, client.StatementId) + { + FetchSize = _fetchSize, + EnableRedirectQuery = false + }; - if (_debugMode) - { - _logger.LogInformation("insert string records of one device, message: {0}", status.Message); - } + var resp = await client.ServiceClient.executeRawDataQueryAsync(req); + var status = resp.Status; - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting string records of one device" - ); - } - private TSInsertStringRecordsOfOneDeviceReq GenInsertStringRecordsOfOneDeviceReq(string deviceId, - List timestamps, List> measurementsList, List> valuesList, - long sessionId, bool isAligned = false) - { - return new TSInsertStringRecordsOfOneDeviceReq( - sessionId, - deviceId, - measurementsList, - valuesList, - timestamps) - { - IsAligned = isAligned - }; - } - private TSInsertRecordsOfOneDeviceReq GenInsertRecordsOfOneDeviceRequest( - string deviceId, - List records, - long sessionId) - { - var values = records.Select(row => row.ToBytes()); - var measurementsLst = records.Select(x => x.Measurements).ToList(); - var timestampLst = records.Select(x => x.Timestamps).ToList(); - - return new TSInsertRecordsOfOneDeviceReq( - sessionId, - deviceId, - measurementsLst, - values.ToList(), - timestampLst); - } - public async Task InsertRecordsOfOneDeviceSortedAsync(string deviceId, List rowRecords) - { - return await ExecuteClientOperationAsync( - async client => - { - var timestampLst = rowRecords.Select(x => x.Timestamps).ToList(); + if (_utilFunctions.VerifySuccess(status) == -1) + { + throw new Exception(string.Format("execute raw data query failed, message: {0}", status.Message)); + } - if (!_utilFunctions.IsSorted(timestampLst)) - { - throw new ArgumentException("insert records of one device error: timestamp not sorted"); - } + return new SessionDataSet("", resp, _clients, client.StatementId) + { + FetchSize = _fetchSize, + }; + }, + errMsg: "Error occurs when executing raw data query" + ); + } + public async Task ExecuteLastDataQueryAsync(List paths, long lastTime) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSLastDataQueryReq(client.SessionId, paths, lastTime, client.StatementId) + { + FetchSize = _fetchSize, + EnableRedirectQuery = false + }; - var req = GenInsertRecordsOfOneDeviceRequest(deviceId, rowRecords, client.SessionId); + var resp = await client.ServiceClient.executeLastDataQueryAsync(req); + var status = resp.Status; - var status = await client.ServiceClient.insertRecordsOfOneDeviceAsync(req); + if (_utilFunctions.VerifySuccess(status) == -1) + { + throw new Exception(string.Format("execute last data query failed, message: {0}", status.Message)); + } - if (_debugMode) - { - _logger.LogInformation("insert records of one device, message: {0}", status.Message); - } + return new SessionDataSet("", resp, _clients, client.StatementId) + { + FetchSize = _fetchSize, + }; + }, + errMsg: "Error occurs when executing last data query" + ); + } + [Obsolete("This method is obsolete. Use SQL instead.", false)] + public async Task CreateSchemaTemplateAsync(Template template) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSCreateSchemaTemplateReq(client.SessionId, template.Name, template.ToBytes()); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting records of one device" - ); - } - public async Task InsertAlignedRecordsOfOneDeviceSortedAsync(string deviceId, List rowRecords) - { - return await ExecuteClientOperationAsync( - async client => - { - var timestampLst = rowRecords.Select(x => x.Timestamps).ToList(); + var status = await client.ServiceClient.createSchemaTemplateAsync(req); - if (!_utilFunctions.IsSorted(timestampLst)) - { - throw new ArgumentException("insert records of one device error: timestamp not sorted"); - } + if (_debugMode) + { + _logger.LogInformation("create schema template {0} message: {1}", template.Name, status.Message); + } - var req = GenInsertRecordsOfOneDeviceRequest(deviceId, rowRecords, client.SessionId); - req.IsAligned = true; + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when creating schema template" + ); + } - var status = await client.ServiceClient.insertRecordsOfOneDeviceAsync(req); + [Obsolete("This method is obsolete. Use SQL instead.", false)] + public async Task DropSchemaTemplateAsync(string templateName) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSDropSchemaTemplateReq(client.SessionId, templateName); - if (_debugMode) - { - _logger.LogInformation("insert aligned records of one device, message: {0}", status.Message); - } + var status = await client.ServiceClient.dropSchemaTemplateAsync(req); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when inserting aligned records of one device" - ); - } - public async Task TestInsertRecordAsync(string deviceId, RowRecord record) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSInsertRecordReq( - client.SessionId, - deviceId, - record.Measurements, - record.ToBytes(), - record.Timestamps); - - var status = await client.ServiceClient.testInsertRecordAsync(req); - - if (_debugMode) - { - _logger.LogInformation("insert one record to device {0}, server message: {1}", deviceId, status.Message); - } - - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when test inserting one record" - ); - } - public async Task TestInsertRecordsAsync(List deviceId, List rowRecords) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertRecordsReq(deviceId, rowRecords, client.SessionId); + if (_debugMode) + { + _logger.LogInformation("drop schema template {0} message: {1}", templateName, status.Message); + } - var status = await client.ServiceClient.testInsertRecordsAsync(req); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when dropping schema template" + ); + } + [Obsolete("This method is obsolete. Use SQL instead.", false)] + public async Task SetSchemaTemplateAsync(string templateName, string prefixPath) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSSetSchemaTemplateReq(client.SessionId, templateName, prefixPath); - if (_debugMode) - { - _logger.LogInformation("insert multiple records to devices {0}, server message: {1}", deviceId, status.Message); - } + var status = await client.ServiceClient.setSchemaTemplateAsync(req); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when test inserting multiple records" - ); - } - public async Task TestInsertTabletAsync(Tablet tablet) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertTabletReq(tablet, client.SessionId); + if (_debugMode) + { + _logger.LogInformation("set schema template {0} message: {1}", templateName, status.Message); + } - var status = await client.ServiceClient.testInsertTabletAsync(req); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when setting schema template" + ); + } + [Obsolete("This method is obsolete. Use SQL instead.", false)] + public async Task UnsetSchemaTemplateAsync(string prefixPath, string templateName) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSUnsetSchemaTemplateReq(client.SessionId, prefixPath, templateName); - if (_debugMode) - { - _logger.LogInformation("insert one tablet to device {0}, server message: {1}", tablet.DeviceId, status.Message); - } + var status = await client.ServiceClient.unsetSchemaTemplateAsync(req); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when test inserting one tablet" - ); - } - public async Task TestInsertTabletsAsync(List tabletLst) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = GenInsertTabletsReq(tabletLst, client.SessionId); + if (_debugMode) + { + _logger.LogInformation("unset schema template {0} message: {1}", templateName, status.Message); + } - var status = await client.ServiceClient.testInsertTabletsAsync(req); + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when unsetting schema template" + ); + } + [Obsolete("This method is obsolete. Use SQL instead.", false)] + public async Task DeleteNodeInTemplateAsync(string templateName, string path) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSPruneSchemaTemplateReq(client.SessionId, templateName, path); - if (_debugMode) - { - _logger.LogInformation("insert multiple tablets, message: {0}", status.Message); - } + var status = await client.ServiceClient.pruneSchemaTemplateAsync(req); - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when test inserting multiple tablets" - ); - } + if (_debugMode) + { + _logger.LogInformation("delete node in template {0} message: {1}", templateName, status.Message); + } - public async Task ExecuteQueryStatementAsync(string sql) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSExecuteStatementReq(client.SessionId, sql, client.StatementId) - { - FetchSize = _fetchSize - }; - - var resp = await client.ServiceClient.executeQueryStatementAsync(req); - var status = resp.Status; - - if (_utilFunctions.VerifySuccess(status) == -1) - { - throw new Exception(string.Format("execute query failed, sql: {0}, message: {1}", sql, status.Message)); - } - - return new SessionDataSet(sql, resp, _clients, client.StatementId) - { - FetchSize = _fetchSize, - }; - }, - errMsg: "Error occurs when executing query statement" - ); - } - public async Task ExecuteStatementAsync(string sql, long timeout) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSExecuteStatementReq(client.SessionId, sql, client.StatementId) - { - FetchSize = _fetchSize, - Timeout = timeout - }; - - var resp = await client.ServiceClient.executeStatementAsync(req); - var status = resp.Status; - - if (_utilFunctions.VerifySuccess(status) == -1) - { - throw new Exception(string.Format("execute query failed, sql: {0}, message: {1}", sql, status.Message)); - } - - return new SessionDataSet(sql, resp, _clients, client.StatementId) - { - FetchSize = _fetchSize, - }; - }, - errMsg: "Error occurs when executing query statement" - ); - } + return _utilFunctions.VerifySuccess(status); + }, + errMsg: "Error occurs when deleting node in template" + ); + } + [Obsolete("This method is obsolete. Use SQL instead.", false)] + public async Task CountMeasurementsInTemplateAsync(string name) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSQueryTemplateReq(client.SessionId, name, (int)TemplateQueryType.COUNT_MEASUREMENTS); + var resp = await client.ServiceClient.querySchemaTemplateAsync(req); + var status = resp.Status; - public async Task ExecuteNonQueryStatementAsync(string sql) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSExecuteStatementReq(client.SessionId, sql, client.StatementId); + if (_debugMode) + { + _logger.LogInformation("count measurements in template {0} message: {1}", name, status.Message); + } - var resp = await client.ServiceClient.executeUpdateStatementAsync(req); - var status = resp.Status; + if (_utilFunctions.VerifySuccess(status) == -1) + { + throw new Exception(string.Format("count measurements in template failed, template name: {0}, message: {1}", name, status.Message)); + } + return resp.Count; + }, + errMsg: "Error occurs when counting measurements in template" + ); + } + [Obsolete("This method is obsolete. Use SQL instead.", false)] + public async Task IsMeasurementInTemplateAsync(string templateName, string path) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSQueryTemplateReq(client.SessionId, templateName, (int)TemplateQueryType.IS_MEASUREMENT); + req.Measurement = path; - if (_debugMode) - { - _logger.LogInformation("execute non-query statement {0} message: {1}", sql, status.Message); - } + var resp = await client.ServiceClient.querySchemaTemplateAsync(req); + var status = resp.Status; - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when executing non-query statement" - ); - } - public async Task ExecuteRawDataQuery(List paths, long startTime, long endTime) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSRawDataQueryReq(client.SessionId, paths, startTime, endTime, client.StatementId) - { - FetchSize = _fetchSize, - EnableRedirectQuery = false - }; - - var resp = await client.ServiceClient.executeRawDataQueryAsync(req); - var status = resp.Status; - - if (_utilFunctions.VerifySuccess(status) == -1) - { - throw new Exception(string.Format("execute raw data query failed, message: {0}", status.Message)); - } - - return new SessionDataSet("", resp, _clients, client.StatementId) - { - FetchSize = _fetchSize, - }; - }, - errMsg: "Error occurs when executing raw data query" - ); - } - public async Task ExecuteLastDataQueryAsync(List paths, long lastTime) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSLastDataQueryReq(client.SessionId, paths, lastTime, client.StatementId) - { - FetchSize = _fetchSize, - EnableRedirectQuery = false - }; - - var resp = await client.ServiceClient.executeLastDataQueryAsync(req); - var status = resp.Status; - - if (_utilFunctions.VerifySuccess(status) == -1) - { - throw new Exception(string.Format("execute last data query failed, message: {0}", status.Message)); - } - - return new SessionDataSet("", resp, _clients, client.StatementId) - { - FetchSize = _fetchSize, - }; - }, - errMsg: "Error occurs when executing last data query" - ); - } - [Obsolete("This method is obsolete. Use SQL instead.", false)] - public async Task CreateSchemaTemplateAsync(Template template) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSCreateSchemaTemplateReq(client.SessionId, template.Name, template.ToBytes()); + if (_debugMode) + { + _logger.LogInformation("is measurement in template {0} message: {1}", templateName, status.Message); + } - var status = await client.ServiceClient.createSchemaTemplateAsync(req); + if (_utilFunctions.VerifySuccess(status) == -1) + { + throw new Exception(string.Format("is measurement in template failed, template name: {0}, message: {1}", templateName, status.Message)); + } + return resp.Result; + }, + errMsg: "Error occurs when checking measurement in template" + ); + } + [Obsolete("This method is obsolete. Use SQL instead.", false)] + public async Task IsPathExistInTemplateAsync(string templateName, string path) + { + return await ExecuteClientOperationAsync( + async client => + { + var req = new TSQueryTemplateReq(client.SessionId, templateName, (int)TemplateQueryType.PATH_EXIST); + req.Measurement = path; - if (_debugMode) - { - _logger.LogInformation("create schema template {0} message: {1}", template.Name, status.Message); - } + var resp = await client.ServiceClient.querySchemaTemplateAsync(req); + var status = resp.Status; - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when creating schema template" - ); - } + if (_debugMode) + { + _logger.LogInformation("is path exist in template {0} message: {1}", templateName, status.Message); + } - [Obsolete("This method is obsolete. Use SQL instead.", false)] - public async Task DropSchemaTemplateAsync(string templateName) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSDropSchemaTemplateReq(client.SessionId, templateName); + if (_utilFunctions.VerifySuccess(status) == -1) + { + throw new Exception(string.Format("is path exist in template failed, template name: {0}, message: {1}", templateName, status.Message)); + } + return resp.Result; + }, + errMsg: "Error occurs when checking path exist in template" + ); + } + [Obsolete("This method is obsolete. Use SQL instead.", false)] + public async Task> ShowMeasurementsInTemplateAsync(string templateName, string pattern = "") + { + return await ExecuteClientOperationAsync>( + async client => + { + var req = new TSQueryTemplateReq(client.SessionId, templateName, (int)TemplateQueryType.SHOW_MEASUREMENTS); + req.Measurement = pattern; - var status = await client.ServiceClient.dropSchemaTemplateAsync(req); + var resp = await client.ServiceClient.querySchemaTemplateAsync(req); + var status = resp.Status; - if (_debugMode) - { - _logger.LogInformation("drop schema template {0} message: {1}", templateName, status.Message); - } + if (_debugMode) + { + _logger.LogInformation("get measurements in template {0} message: {1}", templateName, status.Message); + } - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when dropping schema template" - ); - } - [Obsolete("This method is obsolete. Use SQL instead.", false)] - public async Task SetSchemaTemplateAsync(string templateName, string prefixPath) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSSetSchemaTemplateReq(client.SessionId, templateName, prefixPath); + if (_utilFunctions.VerifySuccess(status) == -1) + { + throw new Exception(string.Format("show measurements in template failed, template name: {0}, pattern: {1}, message: {2}", templateName, pattern, status.Message)); + } + return resp.Measurements; + }, + errMsg: "Error occurs when showing measurements in template" + ); + } + [Obsolete("This method is obsolete. Use SQL instead.", false)] + public async Task> ShowAllTemplatesAsync() + { + return await ExecuteClientOperationAsync>( + async client => + { + var req = new TSQueryTemplateReq(client.SessionId, "", (int)TemplateQueryType.SHOW_TEMPLATES); - var status = await client.ServiceClient.setSchemaTemplateAsync(req); + var resp = await client.ServiceClient.querySchemaTemplateAsync(req); + var status = resp.Status; - if (_debugMode) - { - _logger.LogInformation("set schema template {0} message: {1}", templateName, status.Message); - } + if (_debugMode) + { + _logger.LogInformation("get all templates message: {0}", status.Message); + } - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when setting schema template" - ); - } - [Obsolete("This method is obsolete. Use SQL instead.", false)] - public async Task UnsetSchemaTemplateAsync(string prefixPath, string templateName) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSUnsetSchemaTemplateReq(client.SessionId, prefixPath, templateName); + if (_utilFunctions.VerifySuccess(status) == -1) + { + throw new Exception(string.Format("show all templates failed, message: {0}", status.Message)); + } + return resp.Measurements; + }, + errMsg: "Error occurs when getting all templates" + ); + } - var status = await client.ServiceClient.unsetSchemaTemplateAsync(req); + [Obsolete("This method is obsolete. Use SQL instead.", false)] + public async Task> ShowPathsTemplateSetOnAsync(string templateName) + { + return await ExecuteClientOperationAsync>( + async client => + { + var req = new TSQueryTemplateReq(client.SessionId, templateName, (int)TemplateQueryType.SHOW_SET_TEMPLATES); - if (_debugMode) - { - _logger.LogInformation("unset schema template {0} message: {1}", templateName, status.Message); - } + var resp = await client.ServiceClient.querySchemaTemplateAsync(req); + var status = resp.Status; - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when unsetting schema template" - ); - } - [Obsolete("This method is obsolete. Use SQL instead.", false)] - public async Task DeleteNodeInTemplateAsync(string templateName, string path) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSPruneSchemaTemplateReq(client.SessionId, templateName, path); + if (_debugMode) + { + _logger.LogInformation("get paths template set on {0} message: {1}", templateName, status.Message); + } - var status = await client.ServiceClient.pruneSchemaTemplateAsync(req); + if (_utilFunctions.VerifySuccess(status) == -1) + { + throw new Exception(string.Format("show paths template set on failed, template name: {0}, message: {1}", templateName, status.Message)); + } + return resp.Measurements; + }, + errMsg: "Error occurs when getting paths template set on" + ); + } + [Obsolete("This method is obsolete. Use SQL instead.", false)] + public async Task> ShowPathsTemplateUsingOnAsync(string templateName) + { + return await ExecuteClientOperationAsync>( + async client => + { + var req = new TSQueryTemplateReq(client.SessionId, templateName, (int)TemplateQueryType.SHOW_USING_TEMPLATES); - if (_debugMode) - { - _logger.LogInformation("delete node in template {0} message: {1}", templateName, status.Message); - } + var resp = await client.ServiceClient.querySchemaTemplateAsync(req); + var status = resp.Status; - return _utilFunctions.VerifySuccess(status); - }, - errMsg: "Error occurs when deleting node in template" - ); - } - [Obsolete("This method is obsolete. Use SQL instead.", false)] - public async Task CountMeasurementsInTemplateAsync(string name) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSQueryTemplateReq(client.SessionId, name, (int)TemplateQueryType.COUNT_MEASUREMENTS); - - var resp = await client.ServiceClient.querySchemaTemplateAsync(req); - var status = resp.Status; - - if (_debugMode) - { - _logger.LogInformation("count measurements in template {0} message: {1}", name, status.Message); - } - - if (_utilFunctions.VerifySuccess(status) == -1) - { - throw new Exception(string.Format("count measurements in template failed, template name: {0}, message: {1}", name, status.Message)); - } - return resp.Count; - }, - errMsg: "Error occurs when counting measurements in template" - ); - } - [Obsolete("This method is obsolete. Use SQL instead.", false)] - public async Task IsMeasurementInTemplateAsync(string templateName, string path) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSQueryTemplateReq(client.SessionId, templateName, (int)TemplateQueryType.IS_MEASUREMENT); - req.Measurement = path; - - var resp = await client.ServiceClient.querySchemaTemplateAsync(req); - var status = resp.Status; - - if (_debugMode) - { - _logger.LogInformation("is measurement in template {0} message: {1}", templateName, status.Message); - } - - if (_utilFunctions.VerifySuccess(status) == -1) - { - throw new Exception(string.Format("is measurement in template failed, template name: {0}, message: {1}", templateName, status.Message)); - } - return resp.Result; - }, - errMsg: "Error occurs when checking measurement in template" - ); - } - [Obsolete("This method is obsolete. Use SQL instead.", false)] - public async Task IsPathExistInTemplateAsync(string templateName, string path) - { - return await ExecuteClientOperationAsync( - async client => - { - var req = new TSQueryTemplateReq(client.SessionId, templateName, (int)TemplateQueryType.PATH_EXIST); - req.Measurement = path; - - var resp = await client.ServiceClient.querySchemaTemplateAsync(req); - var status = resp.Status; - - if (_debugMode) - { - _logger.LogInformation("is path exist in template {0} message: {1}", templateName, status.Message); - } - - if (_utilFunctions.VerifySuccess(status) == -1) - { - throw new Exception(string.Format("is path exist in template failed, template name: {0}, message: {1}", templateName, status.Message)); - } - return resp.Result; - }, - errMsg: "Error occurs when checking path exist in template" - ); - } - [Obsolete("This method is obsolete. Use SQL instead.", false)] - public async Task> ShowMeasurementsInTemplateAsync(string templateName, string pattern = "") - { - return await ExecuteClientOperationAsync>( - async client => - { - var req = new TSQueryTemplateReq(client.SessionId, templateName, (int)TemplateQueryType.SHOW_MEASUREMENTS); - req.Measurement = pattern; - - var resp = await client.ServiceClient.querySchemaTemplateAsync(req); - var status = resp.Status; - - if (_debugMode) - { - _logger.LogInformation("get measurements in template {0} message: {1}", templateName, status.Message); - } - - if (_utilFunctions.VerifySuccess(status) == -1) - { - throw new Exception(string.Format("show measurements in template failed, template name: {0}, pattern: {1}, message: {2}", templateName, pattern, status.Message)); - } - return resp.Measurements; - }, - errMsg: "Error occurs when showing measurements in template" - ); - } - [Obsolete("This method is obsolete. Use SQL instead.", false)] - public async Task> ShowAllTemplatesAsync() - { - return await ExecuteClientOperationAsync>( - async client => - { - var req = new TSQueryTemplateReq(client.SessionId, "", (int)TemplateQueryType.SHOW_TEMPLATES); - - var resp = await client.ServiceClient.querySchemaTemplateAsync(req); - var status = resp.Status; - - if (_debugMode) - { - _logger.LogInformation("get all templates message: {0}", status.Message); - } - - if (_utilFunctions.VerifySuccess(status) == -1) - { - throw new Exception(string.Format("show all templates failed, message: {0}", status.Message)); - } - return resp.Measurements; - }, - errMsg: "Error occurs when getting all templates" - ); - } + if (_debugMode) + { + _logger.LogInformation("get paths template using on {0} message: {1}", templateName, status.Message); + } - [Obsolete("This method is obsolete. Use SQL instead.", false)] - public async Task> ShowPathsTemplateSetOnAsync(string templateName) - { - return await ExecuteClientOperationAsync>( - async client => - { - var req = new TSQueryTemplateReq(client.SessionId, templateName, (int)TemplateQueryType.SHOW_SET_TEMPLATES); - - var resp = await client.ServiceClient.querySchemaTemplateAsync(req); - var status = resp.Status; - - if (_debugMode) - { - _logger.LogInformation("get paths template set on {0} message: {1}", templateName, status.Message); - } - - if (_utilFunctions.VerifySuccess(status) == -1) - { - throw new Exception(string.Format("show paths template set on failed, template name: {0}, message: {1}", templateName, status.Message)); - } - return resp.Measurements; - }, - errMsg: "Error occurs when getting paths template set on" - ); - } - [Obsolete("This method is obsolete. Use SQL instead.", false)] - public async Task> ShowPathsTemplateUsingOnAsync(string templateName) - { - return await ExecuteClientOperationAsync>( - async client => - { - var req = new TSQueryTemplateReq(client.SessionId, templateName, (int)TemplateQueryType.SHOW_USING_TEMPLATES); - - var resp = await client.ServiceClient.querySchemaTemplateAsync(req); - var status = resp.Status; - - if (_debugMode) - { - _logger.LogInformation("get paths template using on {0} message: {1}", templateName, status.Message); - } - - if (_utilFunctions.VerifySuccess(status) == -1) - { - throw new Exception(string.Format("show paths template using on failed, template name: {0}, message: {1}", templateName, status.Message)); - } - return resp.Measurements; - }, - errMsg: "Error occurs when getting paths template using on" - ); - } + if (_utilFunctions.VerifySuccess(status) == -1) + { + throw new Exception(string.Format("show paths template using on failed, template name: {0}, message: {1}", templateName, status.Message)); + } + return resp.Measurements; + }, + errMsg: "Error occurs when getting paths template using on" + ); + } - protected virtual void Dispose(bool disposing) + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) { - if (!disposedValue) - { - if (disposing) - { #if NET461_OR_GREATER || NETSTANDARD2_0 #else - _clients.ClientQueue.Clear(); + _clients.ClientQueue.Clear(); #endif - } - _clients = null; - disposedValue = true; - } } + _clients = null; + disposedValue = true; + } + } - public void Dispose() - { - Dispose(disposing: true); - GC.SuppressFinalize(this); - } + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); } + } } \ No newline at end of file diff --git a/src/Apache.IoTDB/TableSessionPool.Builder.cs b/src/Apache.IoTDB/TableSessionPool.Builder.cs new file mode 100644 index 0000000..f1321c9 --- /dev/null +++ b/src/Apache.IoTDB/TableSessionPool.Builder.cs @@ -0,0 +1,146 @@ +/* + * 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.Threading.Tasks; +using Apache.IoTDB.DataStructure; + +namespace Apache.IoTDB; + +public partial class TableSessionPool +{ + public class Builder + { + private string _host = "localhost"; + private int _port = 6667; + private string _username = "root"; + private string _password = "root"; + private int _fetchSize = 1024; + private string _zoneId = "UTC+08:00"; + private int _poolSize = 8; + private bool _enableRpcCompression = false; + private int _connectionTimeoutInMs = 500; + private string _sqlDialect = IoTDBConstant.TREE_SQL_DIALECT; + private string _database = ""; + private List _nodeUrls = new List(); + + public Builder SetHost(string host) + { + _host = host; + return this; + } + + public Builder SetPort(int port) + { + _port = port; + return this; + } + + public Builder SetUsername(string username) + { + _username = username; + return this; + } + + public Builder SetPassword(string password) + { + _password = password; + return this; + } + + public Builder SetFetchSize(int fetchSize) + { + _fetchSize = fetchSize; + return this; + } + + public Builder SetZoneId(string zoneId) + { + _zoneId = zoneId; + return this; + } + + public Builder SetPoolSize(int poolSize) + { + _poolSize = poolSize; + return this; + } + + public Builder SetEnableRpcCompression(bool enableRpcCompression) + { + _enableRpcCompression = enableRpcCompression; + return this; + } + + public Builder SetSetConnectionTimeoutInMs(int timeout) + { + _connectionTimeoutInMs = timeout; + return this; + } + + public Builder SetNodeUrls(List nodeUrls) + { + _nodeUrls = nodeUrls; + return this; + } + + protected internal Builder SetSqlDialect(string sqlDialect) + { + _sqlDialect = sqlDialect; + return this; + } + + public Builder SetDatabase(string database) + { + _database = database; + return this; + } + + public Builder() + { + _host = "localhost"; + _port = 6667; + _username = "root"; + _password = "root"; + _fetchSize = 1024; + _zoneId = "UTC+08:00"; + _poolSize = 8; + _enableRpcCompression = false; + _connectionTimeoutInMs = 500; + _sqlDialect = IoTDBConstant.TABLE_SQL_DIALECT; + _database = ""; + } + + public TableSessionPool Build() + { + SessionPool sessionPool; + // if nodeUrls is not empty, use nodeUrls to create session pool + if (_nodeUrls.Count > 0) + { + sessionPool = new SessionPool(_nodeUrls, _username, _password, _fetchSize, _zoneId, _poolSize, _enableRpcCompression, _connectionTimeoutInMs, _sqlDialect, _database); + } + else + { + sessionPool = new SessionPool(_host, _port, _username, _password, _fetchSize, _zoneId, _poolSize, _enableRpcCompression, _connectionTimeoutInMs, _sqlDialect, _database); + } + return new TableSessionPool(sessionPool); + } + } +} diff --git a/src/Apache.IoTDB/TableSessionPool.cs b/src/Apache.IoTDB/TableSessionPool.cs new file mode 100644 index 0000000..589e989 --- /dev/null +++ b/src/Apache.IoTDB/TableSessionPool.cs @@ -0,0 +1,72 @@ +/* + * 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.Threading; +using System.Threading.Tasks; +using Apache.IoTDB.DataStructure; +using Microsoft.Extensions.Logging; + +namespace Apache.IoTDB; + +public partial class TableSessionPool +{ + private SessionPool sessionPool; + + TableSessionPool(SessionPool sessionPool) + { + this.sessionPool = sessionPool; + } + + public async Task Open(bool enableRpcCompression, CancellationToken cancellationToken = default) + { + await sessionPool.Open(enableRpcCompression, cancellationToken); + } + + public async Task Open(CancellationToken cancellationToken = default) + { + await sessionPool.Open(cancellationToken); + } + + public async Task InsertAsync(Tablet tablet) { + return await sessionPool.InsertRelationalTabletAsync(tablet); + } + + public async Task ExecuteNonQueryStatementAsync(string sql){ + return await sessionPool.ExecuteNonQueryStatementAsync(sql); + } + + public async Task ExecuteQueryStatementAsync(string sql){ + return await sessionPool.ExecuteQueryStatementAsync(sql); + } + + public async Task ExecuteQueryStatementAsync(string sql, long timeoutInMs) { + return await sessionPool.ExecuteQueryStatementAsync(sql, timeoutInMs); + } + + public void OpenDebugMode(Action configure) + { + sessionPool.OpenDebugMode(configure); + } + + public async Task Close() { + await sessionPool.Close(); + } +} From 5b70f934cddffdb45887aede44a904dd06b52cda Mon Sep 17 00:00:00 2001 From: CritasWang Date: Tue, 18 Feb 2025 10:21:51 +0800 Subject: [PATCH 3/3] update iotdb-version --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index df2b2c8..37c6d1b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: ipv4_address: 172.18.0.2 iotdb: - image: apache/iotdb:1.3.3-datanode + image: apache/iotdb:2.0.1-beta-datanode restart: always container_name: iotdb-dn-1 depends_on: @@ -39,7 +39,7 @@ services: - dn_seed_config_node=iotdb-confignode-1:22277 iotdb-confignode-1: - image: apache/iotdb:1.3.3-confignode + image: apache/iotdb:2.0.1-beta-confignode restart: always container_name: iotdb-cn-1 healthcheck: