public void Read(TProtocol iprot) { iprot.IncrementRecursionDepth(); try { bool isset_serverName = false; bool isset_regionInfo = false; TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.Struct) { ServerName = new TServerName(); ServerName.Read(iprot); isset_serverName = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.Struct) { RegionInfo = new THRegionInfo(); RegionInfo.Read(iprot); isset_regionInfo = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); if (!isset_serverName) { throw new TProtocolException(TProtocolException.INVALID_DATA); } if (!isset_regionInfo) { throw new TProtocolException(TProtocolException.INVALID_DATA); } } finally { iprot.DecrementRecursionDepth(); } }
public THRegionLocation(TServerName serverName, THRegionInfo regionInfo) : this() { this.ServerName = serverName; this.RegionInfo = regionInfo; }