| /** |
| * Autogenerated by Thrift Compiler (0.14.1) |
| * |
| * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| * @generated |
| */ |
| using System; |
| using System.Collections; |
| using System.Collections.Generic; |
| using System.Text; |
| using System.IO; |
| using System.Linq; |
| using System.Threading; |
| using System.Threading.Tasks; |
| using Microsoft.Extensions.Logging; |
| using Thrift; |
| using Thrift.Collections; |
| |
| using Thrift.Protocol; |
| using Thrift.Protocol.Entities; |
| using Thrift.Protocol.Utilities; |
| using Thrift.Transport; |
| using Thrift.Transport.Client; |
| using Thrift.Transport.Server; |
| using Thrift.Processor; |
| |
| |
| #pragma warning disable IDE0079 // remove unnecessary pragmas |
| #pragma warning disable IDE1006 // parts of the code use IDL spelling |
| |
| |
| public partial class TNodeLocations : TBase |
| { |
| private List<TConfigNodeLocation> _configNodeLocations; |
| private List<TDataNodeLocation> _dataNodeLocations; |
| |
| public List<TConfigNodeLocation> ConfigNodeLocations |
| { |
| get |
| { |
| return _configNodeLocations; |
| } |
| set |
| { |
| __isset.configNodeLocations = true; |
| this._configNodeLocations = value; |
| } |
| } |
| |
| public List<TDataNodeLocation> DataNodeLocations |
| { |
| get |
| { |
| return _dataNodeLocations; |
| } |
| set |
| { |
| __isset.dataNodeLocations = true; |
| this._dataNodeLocations = value; |
| } |
| } |
| |
| |
| public Isset __isset; |
| public struct Isset |
| { |
| public bool configNodeLocations; |
| public bool dataNodeLocations; |
| } |
| |
| public TNodeLocations() |
| { |
| } |
| |
| public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) |
| { |
| iprot.IncrementRecursionDepth(); |
| try |
| { |
| TField field; |
| await iprot.ReadStructBeginAsync(cancellationToken); |
| while (true) |
| { |
| field = await iprot.ReadFieldBeginAsync(cancellationToken); |
| if (field.Type == TType.Stop) |
| { |
| break; |
| } |
| |
| switch (field.ID) |
| { |
| case 1: |
| if (field.Type == TType.List) |
| { |
| { |
| TList _list98 = await iprot.ReadListBeginAsync(cancellationToken); |
| ConfigNodeLocations = new List<TConfigNodeLocation>(_list98.Count); |
| for(int _i99 = 0; _i99 < _list98.Count; ++_i99) |
| { |
| TConfigNodeLocation _elem100; |
| _elem100 = new TConfigNodeLocation(); |
| await _elem100.ReadAsync(iprot, cancellationToken); |
| ConfigNodeLocations.Add(_elem100); |
| } |
| await iprot.ReadListEndAsync(cancellationToken); |
| } |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 2: |
| if (field.Type == TType.List) |
| { |
| { |
| TList _list101 = await iprot.ReadListBeginAsync(cancellationToken); |
| DataNodeLocations = new List<TDataNodeLocation>(_list101.Count); |
| for(int _i102 = 0; _i102 < _list101.Count; ++_i102) |
| { |
| TDataNodeLocation _elem103; |
| _elem103 = new TDataNodeLocation(); |
| await _elem103.ReadAsync(iprot, cancellationToken); |
| DataNodeLocations.Add(_elem103); |
| } |
| 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); |
| } |
| finally |
| { |
| iprot.DecrementRecursionDepth(); |
| } |
| } |
| |
| public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) |
| { |
| oprot.IncrementRecursionDepth(); |
| try |
| { |
| var struc = new TStruct("TNodeLocations"); |
| await oprot.WriteStructBeginAsync(struc, cancellationToken); |
| var field = new TField(); |
| if((ConfigNodeLocations != null) && __isset.configNodeLocations) |
| { |
| field.Name = "configNodeLocations"; |
| field.Type = TType.List; |
| field.ID = 1; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| { |
| await oprot.WriteListBeginAsync(new TList(TType.Struct, ConfigNodeLocations.Count), cancellationToken); |
| foreach (TConfigNodeLocation _iter104 in ConfigNodeLocations) |
| { |
| await _iter104.WriteAsync(oprot, cancellationToken); |
| } |
| await oprot.WriteListEndAsync(cancellationToken); |
| } |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| if((DataNodeLocations != null) && __isset.dataNodeLocations) |
| { |
| field.Name = "dataNodeLocations"; |
| field.Type = TType.List; |
| field.ID = 2; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| { |
| await oprot.WriteListBeginAsync(new TList(TType.Struct, DataNodeLocations.Count), cancellationToken); |
| foreach (TDataNodeLocation _iter105 in DataNodeLocations) |
| { |
| await _iter105.WriteAsync(oprot, 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 TNodeLocations other)) return false; |
| if (ReferenceEquals(this, other)) return true; |
| return ((__isset.configNodeLocations == other.__isset.configNodeLocations) && ((!__isset.configNodeLocations) || (TCollections.Equals(ConfigNodeLocations, other.ConfigNodeLocations)))) |
| && ((__isset.dataNodeLocations == other.__isset.dataNodeLocations) && ((!__isset.dataNodeLocations) || (TCollections.Equals(DataNodeLocations, other.DataNodeLocations)))); |
| } |
| |
| public override int GetHashCode() { |
| int hashcode = 157; |
| unchecked { |
| if((ConfigNodeLocations != null) && __isset.configNodeLocations) |
| { |
| hashcode = (hashcode * 397) + TCollections.GetHashCode(ConfigNodeLocations); |
| } |
| if((DataNodeLocations != null) && __isset.dataNodeLocations) |
| { |
| hashcode = (hashcode * 397) + TCollections.GetHashCode(DataNodeLocations); |
| } |
| } |
| return hashcode; |
| } |
| |
| public override string ToString() |
| { |
| var sb = new StringBuilder("TNodeLocations("); |
| int tmp106 = 0; |
| if((ConfigNodeLocations != null) && __isset.configNodeLocations) |
| { |
| if(0 < tmp106++) { sb.Append(", "); } |
| sb.Append("ConfigNodeLocations: "); |
| ConfigNodeLocations.ToString(sb); |
| } |
| if((DataNodeLocations != null) && __isset.dataNodeLocations) |
| { |
| if(0 < tmp106++) { sb.Append(", "); } |
| sb.Append("DataNodeLocations: "); |
| DataNodeLocations.ToString(sb); |
| } |
| sb.Append(')'); |
| return sb.ToString(); |
| } |
| } |
| |