src/Apache.IoTDB/Rpc/Generated/TSCreateMultiTimeseriesReq.cs (681 lines of code) (raw):
/**
* Autogenerated by Thrift Compiler (0.14.2)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Thrift;
using Thrift.Collections;
using Thrift.Protocol;
using Thrift.Protocol.Entities;
using Thrift.Protocol.Utilities;
using Thrift.Transport;
using Thrift.Transport.Client;
using Thrift.Transport.Server;
using Thrift.Processor;
#pragma warning disable IDE0079 // remove unnecessary pragmas
#pragma warning disable IDE1006 // parts of the code use IDL spelling
public partial class TSCreateMultiTimeseriesReq : TBase
{
private List<Dictionary<string, string>> _propsList;
private List<Dictionary<string, string>> _tagsList;
private List<Dictionary<string, string>> _attributesList;
private List<string> _measurementAliasList;
public long SessionId { get; set; }
public List<string> Paths { get; set; }
public List<int> DataTypes { get; set; }
public List<int> Encodings { get; set; }
public List<int> Compressors { get; set; }
public List<Dictionary<string, string>> PropsList
{
get
{
return _propsList;
}
set
{
__isset.propsList = true;
this._propsList = value;
}
}
public List<Dictionary<string, string>> TagsList
{
get
{
return _tagsList;
}
set
{
__isset.tagsList = true;
this._tagsList = value;
}
}
public List<Dictionary<string, string>> AttributesList
{
get
{
return _attributesList;
}
set
{
__isset.attributesList = true;
this._attributesList = value;
}
}
public List<string> MeasurementAliasList
{
get
{
return _measurementAliasList;
}
set
{
__isset.measurementAliasList = true;
this._measurementAliasList = value;
}
}
public Isset __isset;
public struct Isset
{
public bool propsList;
public bool tagsList;
public bool attributesList;
public bool measurementAliasList;
}
public TSCreateMultiTimeseriesReq()
{
}
public TSCreateMultiTimeseriesReq(long sessionId, List<string> paths, List<int> dataTypes, List<int> encodings, List<int> compressors) : this()
{
this.SessionId = sessionId;
this.Paths = paths;
this.DataTypes = dataTypes;
this.Encodings = encodings;
this.Compressors = compressors;
}
public TSCreateMultiTimeseriesReq DeepCopy()
{
var tmp330 = new TSCreateMultiTimeseriesReq();
tmp330.SessionId = this.SessionId;
if((Paths != null))
{
tmp330.Paths = this.Paths.DeepCopy();
}
if((DataTypes != null))
{
tmp330.DataTypes = this.DataTypes.DeepCopy();
}
if((Encodings != null))
{
tmp330.Encodings = this.Encodings.DeepCopy();
}
if((Compressors != null))
{
tmp330.Compressors = this.Compressors.DeepCopy();
}
if((PropsList != null) && __isset.propsList)
{
tmp330.PropsList = this.PropsList.DeepCopy();
}
tmp330.__isset.propsList = this.__isset.propsList;
if((TagsList != null) && __isset.tagsList)
{
tmp330.TagsList = this.TagsList.DeepCopy();
}
tmp330.__isset.tagsList = this.__isset.tagsList;
if((AttributesList != null) && __isset.attributesList)
{
tmp330.AttributesList = this.AttributesList.DeepCopy();
}
tmp330.__isset.attributesList = this.__isset.attributesList;
if((MeasurementAliasList != null) && __isset.measurementAliasList)
{
tmp330.MeasurementAliasList = this.MeasurementAliasList.DeepCopy();
}
tmp330.__isset.measurementAliasList = this.__isset.measurementAliasList;
return tmp330;
}
public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
{
iprot.IncrementRecursionDepth();
try
{
bool isset_sessionId = false;
bool isset_paths = false;
bool isset_dataTypes = false;
bool isset_encodings = false;
bool isset_compressors = false;
TField field;
await iprot.ReadStructBeginAsync(cancellationToken);
while (true)
{
field = await iprot.ReadFieldBeginAsync(cancellationToken);
if (field.Type == TType.Stop)
{
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.I64)
{
SessionId = await iprot.ReadI64Async(cancellationToken);
isset_sessionId = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 2:
if (field.Type == TType.List)
{
{
TList _list331 = await iprot.ReadListBeginAsync(cancellationToken);
Paths = new List<string>(_list331.Count);
for(int _i332 = 0; _i332 < _list331.Count; ++_i332)
{
string _elem333;
_elem333 = await iprot.ReadStringAsync(cancellationToken);
Paths.Add(_elem333);
}
await iprot.ReadListEndAsync(cancellationToken);
}
isset_paths = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 3:
if (field.Type == TType.List)
{
{
TList _list334 = await iprot.ReadListBeginAsync(cancellationToken);
DataTypes = new List<int>(_list334.Count);
for(int _i335 = 0; _i335 < _list334.Count; ++_i335)
{
int _elem336;
_elem336 = await iprot.ReadI32Async(cancellationToken);
DataTypes.Add(_elem336);
}
await iprot.ReadListEndAsync(cancellationToken);
}
isset_dataTypes = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 4:
if (field.Type == TType.List)
{
{
TList _list337 = await iprot.ReadListBeginAsync(cancellationToken);
Encodings = new List<int>(_list337.Count);
for(int _i338 = 0; _i338 < _list337.Count; ++_i338)
{
int _elem339;
_elem339 = await iprot.ReadI32Async(cancellationToken);
Encodings.Add(_elem339);
}
await iprot.ReadListEndAsync(cancellationToken);
}
isset_encodings = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 5:
if (field.Type == TType.List)
{
{
TList _list340 = await iprot.ReadListBeginAsync(cancellationToken);
Compressors = new List<int>(_list340.Count);
for(int _i341 = 0; _i341 < _list340.Count; ++_i341)
{
int _elem342;
_elem342 = await iprot.ReadI32Async(cancellationToken);
Compressors.Add(_elem342);
}
await iprot.ReadListEndAsync(cancellationToken);
}
isset_compressors = true;
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 6:
if (field.Type == TType.List)
{
{
TList _list343 = await iprot.ReadListBeginAsync(cancellationToken);
PropsList = new List<Dictionary<string, string>>(_list343.Count);
for(int _i344 = 0; _i344 < _list343.Count; ++_i344)
{
Dictionary<string, string> _elem345;
{
TMap _map346 = await iprot.ReadMapBeginAsync(cancellationToken);
_elem345 = new Dictionary<string, string>(_map346.Count);
for(int _i347 = 0; _i347 < _map346.Count; ++_i347)
{
string _key348;
string _val349;
_key348 = await iprot.ReadStringAsync(cancellationToken);
_val349 = await iprot.ReadStringAsync(cancellationToken);
_elem345[_key348] = _val349;
}
await iprot.ReadMapEndAsync(cancellationToken);
}
PropsList.Add(_elem345);
}
await iprot.ReadListEndAsync(cancellationToken);
}
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 7:
if (field.Type == TType.List)
{
{
TList _list350 = await iprot.ReadListBeginAsync(cancellationToken);
TagsList = new List<Dictionary<string, string>>(_list350.Count);
for(int _i351 = 0; _i351 < _list350.Count; ++_i351)
{
Dictionary<string, string> _elem352;
{
TMap _map353 = await iprot.ReadMapBeginAsync(cancellationToken);
_elem352 = new Dictionary<string, string>(_map353.Count);
for(int _i354 = 0; _i354 < _map353.Count; ++_i354)
{
string _key355;
string _val356;
_key355 = await iprot.ReadStringAsync(cancellationToken);
_val356 = await iprot.ReadStringAsync(cancellationToken);
_elem352[_key355] = _val356;
}
await iprot.ReadMapEndAsync(cancellationToken);
}
TagsList.Add(_elem352);
}
await iprot.ReadListEndAsync(cancellationToken);
}
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 8:
if (field.Type == TType.List)
{
{
TList _list357 = await iprot.ReadListBeginAsync(cancellationToken);
AttributesList = new List<Dictionary<string, string>>(_list357.Count);
for(int _i358 = 0; _i358 < _list357.Count; ++_i358)
{
Dictionary<string, string> _elem359;
{
TMap _map360 = await iprot.ReadMapBeginAsync(cancellationToken);
_elem359 = new Dictionary<string, string>(_map360.Count);
for(int _i361 = 0; _i361 < _map360.Count; ++_i361)
{
string _key362;
string _val363;
_key362 = await iprot.ReadStringAsync(cancellationToken);
_val363 = await iprot.ReadStringAsync(cancellationToken);
_elem359[_key362] = _val363;
}
await iprot.ReadMapEndAsync(cancellationToken);
}
AttributesList.Add(_elem359);
}
await iprot.ReadListEndAsync(cancellationToken);
}
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
case 9:
if (field.Type == TType.List)
{
{
TList _list364 = await iprot.ReadListBeginAsync(cancellationToken);
MeasurementAliasList = new List<string>(_list364.Count);
for(int _i365 = 0; _i365 < _list364.Count; ++_i365)
{
string _elem366;
_elem366 = await iprot.ReadStringAsync(cancellationToken);
MeasurementAliasList.Add(_elem366);
}
await iprot.ReadListEndAsync(cancellationToken);
}
}
else
{
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
}
break;
default:
await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
break;
}
await iprot.ReadFieldEndAsync(cancellationToken);
}
await iprot.ReadStructEndAsync(cancellationToken);
if (!isset_sessionId)
{
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
if (!isset_paths)
{
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
if (!isset_dataTypes)
{
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
if (!isset_encodings)
{
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
if (!isset_compressors)
{
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
}
finally
{
iprot.DecrementRecursionDepth();
}
}
public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
{
oprot.IncrementRecursionDepth();
try
{
var struc = new TStruct("TSCreateMultiTimeseriesReq");
await oprot.WriteStructBeginAsync(struc, cancellationToken);
var field = new TField();
field.Name = "sessionId";
field.Type = TType.I64;
field.ID = 1;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
await oprot.WriteI64Async(SessionId, cancellationToken);
await oprot.WriteFieldEndAsync(cancellationToken);
if((Paths != null))
{
field.Name = "paths";
field.Type = TType.List;
field.ID = 2;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.String, Paths.Count), cancellationToken);
foreach (string _iter367 in Paths)
{
await oprot.WriteStringAsync(_iter367, cancellationToken);
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((DataTypes != null))
{
field.Name = "dataTypes";
field.Type = TType.List;
field.ID = 3;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.I32, DataTypes.Count), cancellationToken);
foreach (int _iter368 in DataTypes)
{
await oprot.WriteI32Async(_iter368, cancellationToken);
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((Encodings != null))
{
field.Name = "encodings";
field.Type = TType.List;
field.ID = 4;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.I32, Encodings.Count), cancellationToken);
foreach (int _iter369 in Encodings)
{
await oprot.WriteI32Async(_iter369, cancellationToken);
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((Compressors != null))
{
field.Name = "compressors";
field.Type = TType.List;
field.ID = 5;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.I32, Compressors.Count), cancellationToken);
foreach (int _iter370 in Compressors)
{
await oprot.WriteI32Async(_iter370, cancellationToken);
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((PropsList != null) && __isset.propsList)
{
field.Name = "propsList";
field.Type = TType.List;
field.ID = 6;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.Map, PropsList.Count), cancellationToken);
foreach (Dictionary<string, string> _iter371 in PropsList)
{
{
await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter371.Count), cancellationToken);
foreach (string _iter372 in _iter371.Keys)
{
await oprot.WriteStringAsync(_iter372, cancellationToken);
await oprot.WriteStringAsync(_iter371[_iter372], cancellationToken);
}
await oprot.WriteMapEndAsync(cancellationToken);
}
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((TagsList != null) && __isset.tagsList)
{
field.Name = "tagsList";
field.Type = TType.List;
field.ID = 7;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.Map, TagsList.Count), cancellationToken);
foreach (Dictionary<string, string> _iter373 in TagsList)
{
{
await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter373.Count), cancellationToken);
foreach (string _iter374 in _iter373.Keys)
{
await oprot.WriteStringAsync(_iter374, cancellationToken);
await oprot.WriteStringAsync(_iter373[_iter374], cancellationToken);
}
await oprot.WriteMapEndAsync(cancellationToken);
}
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((AttributesList != null) && __isset.attributesList)
{
field.Name = "attributesList";
field.Type = TType.List;
field.ID = 8;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.Map, AttributesList.Count), cancellationToken);
foreach (Dictionary<string, string> _iter375 in AttributesList)
{
{
await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.String, _iter375.Count), cancellationToken);
foreach (string _iter376 in _iter375.Keys)
{
await oprot.WriteStringAsync(_iter376, cancellationToken);
await oprot.WriteStringAsync(_iter375[_iter376], cancellationToken);
}
await oprot.WriteMapEndAsync(cancellationToken);
}
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
if((MeasurementAliasList != null) && __isset.measurementAliasList)
{
field.Name = "measurementAliasList";
field.Type = TType.List;
field.ID = 9;
await oprot.WriteFieldBeginAsync(field, cancellationToken);
{
await oprot.WriteListBeginAsync(new TList(TType.String, MeasurementAliasList.Count), cancellationToken);
foreach (string _iter377 in MeasurementAliasList)
{
await oprot.WriteStringAsync(_iter377, cancellationToken);
}
await oprot.WriteListEndAsync(cancellationToken);
}
await oprot.WriteFieldEndAsync(cancellationToken);
}
await oprot.WriteFieldStopAsync(cancellationToken);
await oprot.WriteStructEndAsync(cancellationToken);
}
finally
{
oprot.DecrementRecursionDepth();
}
}
public override bool Equals(object that)
{
if (!(that is TSCreateMultiTimeseriesReq other)) return false;
if (ReferenceEquals(this, other)) return true;
return System.Object.Equals(SessionId, other.SessionId)
&& TCollections.Equals(Paths, other.Paths)
&& TCollections.Equals(DataTypes, other.DataTypes)
&& TCollections.Equals(Encodings, other.Encodings)
&& TCollections.Equals(Compressors, other.Compressors)
&& ((__isset.propsList == other.__isset.propsList) && ((!__isset.propsList) || (TCollections.Equals(PropsList, other.PropsList))))
&& ((__isset.tagsList == other.__isset.tagsList) && ((!__isset.tagsList) || (TCollections.Equals(TagsList, other.TagsList))))
&& ((__isset.attributesList == other.__isset.attributesList) && ((!__isset.attributesList) || (TCollections.Equals(AttributesList, other.AttributesList))))
&& ((__isset.measurementAliasList == other.__isset.measurementAliasList) && ((!__isset.measurementAliasList) || (TCollections.Equals(MeasurementAliasList, other.MeasurementAliasList))));
}
public override int GetHashCode() {
int hashcode = 157;
unchecked {
hashcode = (hashcode * 397) + SessionId.GetHashCode();
if((Paths != null))
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(Paths);
}
if((DataTypes != null))
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(DataTypes);
}
if((Encodings != null))
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(Encodings);
}
if((Compressors != null))
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(Compressors);
}
if((PropsList != null) && __isset.propsList)
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(PropsList);
}
if((TagsList != null) && __isset.tagsList)
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(TagsList);
}
if((AttributesList != null) && __isset.attributesList)
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(AttributesList);
}
if((MeasurementAliasList != null) && __isset.measurementAliasList)
{
hashcode = (hashcode * 397) + TCollections.GetHashCode(MeasurementAliasList);
}
}
return hashcode;
}
public override string ToString()
{
var sb = new StringBuilder("TSCreateMultiTimeseriesReq(");
sb.Append(", SessionId: ");
SessionId.ToString(sb);
if((Paths != null))
{
sb.Append(", Paths: ");
Paths.ToString(sb);
}
if((DataTypes != null))
{
sb.Append(", DataTypes: ");
DataTypes.ToString(sb);
}
if((Encodings != null))
{
sb.Append(", Encodings: ");
Encodings.ToString(sb);
}
if((Compressors != null))
{
sb.Append(", Compressors: ");
Compressors.ToString(sb);
}
if((PropsList != null) && __isset.propsList)
{
sb.Append(", PropsList: ");
PropsList.ToString(sb);
}
if((TagsList != null) && __isset.tagsList)
{
sb.Append(", TagsList: ");
TagsList.ToString(sb);
}
if((AttributesList != null) && __isset.attributesList)
{
sb.Append(", AttributesList: ");
AttributesList.ToString(sb);
}
if((MeasurementAliasList != null) && __isset.measurementAliasList)
{
sb.Append(", MeasurementAliasList: ");
MeasurementAliasList.ToString(sb);
}
sb.Append(')');
return sb.ToString();
}
}