All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.uber.cadence.DescribeHistoryHostResponse Maven / Gradle / Ivy

There is a newer version: 3.12.5
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.uber.cadence;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2019-06-18")
public class DescribeHistoryHostResponse implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DescribeHistoryHostResponse");

  private static final org.apache.thrift.protocol.TField NUMBER_OF_SHARDS_FIELD_DESC = new org.apache.thrift.protocol.TField("numberOfShards", org.apache.thrift.protocol.TType.I32, (short)10);
  private static final org.apache.thrift.protocol.TField SHARD_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("shardIDs", org.apache.thrift.protocol.TType.LIST, (short)20);
  private static final org.apache.thrift.protocol.TField DOMAIN_CACHE_FIELD_DESC = new org.apache.thrift.protocol.TField("domainCache", org.apache.thrift.protocol.TType.STRUCT, (short)30);
  private static final org.apache.thrift.protocol.TField SHARD_CONTROLLER_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("shardControllerStatus", org.apache.thrift.protocol.TType.STRING, (short)40);
  private static final org.apache.thrift.protocol.TField ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("address", org.apache.thrift.protocol.TType.STRING, (short)50);

  private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new DescribeHistoryHostResponseStandardSchemeFactory());
    schemes.put(TupleScheme.class, new DescribeHistoryHostResponseTupleSchemeFactory());
  }

  public int numberOfShards; // optional
  public List shardIDs; // optional
  public DomainCacheInfo domainCache; // optional
  public String shardControllerStatus; // optional
  public String address; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    NUMBER_OF_SHARDS((short)10, "numberOfShards"),
    SHARD_IDS((short)20, "shardIDs"),
    DOMAIN_CACHE((short)30, "domainCache"),
    SHARD_CONTROLLER_STATUS((short)40, "shardControllerStatus"),
    ADDRESS((short)50, "address");

    private static final Map byName = new HashMap();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 10: // NUMBER_OF_SHARDS
          return NUMBER_OF_SHARDS;
        case 20: // SHARD_IDS
          return SHARD_IDS;
        case 30: // DOMAIN_CACHE
          return DOMAIN_CACHE;
        case 40: // SHARD_CONTROLLER_STATUS
          return SHARD_CONTROLLER_STATUS;
        case 50: // ADDRESS
          return ADDRESS;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __NUMBEROFSHARDS_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.NUMBER_OF_SHARDS,_Fields.SHARD_IDS,_Fields.DOMAIN_CACHE,_Fields.SHARD_CONTROLLER_STATUS,_Fields.ADDRESS};
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.NUMBER_OF_SHARDS, new org.apache.thrift.meta_data.FieldMetaData("numberOfShards", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.SHARD_IDS, new org.apache.thrift.meta_data.FieldMetaData("shardIDs", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
    tmpMap.put(_Fields.DOMAIN_CACHE, new org.apache.thrift.meta_data.FieldMetaData("domainCache", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "DomainCacheInfo")));
    tmpMap.put(_Fields.SHARD_CONTROLLER_STATUS, new org.apache.thrift.meta_data.FieldMetaData("shardControllerStatus", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("address", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DescribeHistoryHostResponse.class, metaDataMap);
  }

  public DescribeHistoryHostResponse() {
  }

  /**
   * Performs a deep copy on other.
   */
  public DescribeHistoryHostResponse(DescribeHistoryHostResponse other) {
    __isset_bitfield = other.__isset_bitfield;
    this.numberOfShards = other.numberOfShards;
    if (other.isSetShardIDs()) {
      List __this__shardIDs = new ArrayList(other.shardIDs);
      this.shardIDs = __this__shardIDs;
    }
    if (other.isSetDomainCache()) {
      this.domainCache = other.domainCache;
    }
    if (other.isSetShardControllerStatus()) {
      this.shardControllerStatus = other.shardControllerStatus;
    }
    if (other.isSetAddress()) {
      this.address = other.address;
    }
  }

  public DescribeHistoryHostResponse deepCopy() {
    return new DescribeHistoryHostResponse(this);
  }

  @Override
  public void clear() {
    setNumberOfShardsIsSet(false);
    this.numberOfShards = 0;
    this.shardIDs = null;
    this.domainCache = null;
    this.shardControllerStatus = null;
    this.address = null;
  }

  public int getNumberOfShards() {
    return this.numberOfShards;
  }

  public DescribeHistoryHostResponse setNumberOfShards(int numberOfShards) {
    this.numberOfShards = numberOfShards;
    setNumberOfShardsIsSet(true);
    return this;
  }

  public void unsetNumberOfShards() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUMBEROFSHARDS_ISSET_ID);
  }

  /** Returns true if field numberOfShards is set (has been assigned a value) and false otherwise */
  public boolean isSetNumberOfShards() {
    return EncodingUtils.testBit(__isset_bitfield, __NUMBEROFSHARDS_ISSET_ID);
  }

  public void setNumberOfShardsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUMBEROFSHARDS_ISSET_ID, value);
  }

  public int getShardIDsSize() {
    return (this.shardIDs == null) ? 0 : this.shardIDs.size();
  }

  public java.util.Iterator getShardIDsIterator() {
    return (this.shardIDs == null) ? null : this.shardIDs.iterator();
  }

  public void addToShardIDs(int elem) {
    if (this.shardIDs == null) {
      this.shardIDs = new ArrayList();
    }
    this.shardIDs.add(elem);
  }

  public List getShardIDs() {
    return this.shardIDs;
  }

  public DescribeHistoryHostResponse setShardIDs(List shardIDs) {
    this.shardIDs = shardIDs;
    return this;
  }

  public void unsetShardIDs() {
    this.shardIDs = null;
  }

  /** Returns true if field shardIDs is set (has been assigned a value) and false otherwise */
  public boolean isSetShardIDs() {
    return this.shardIDs != null;
  }

  public void setShardIDsIsSet(boolean value) {
    if (!value) {
      this.shardIDs = null;
    }
  }

  public DomainCacheInfo getDomainCache() {
    return this.domainCache;
  }

  public DescribeHistoryHostResponse setDomainCache(DomainCacheInfo domainCache) {
    this.domainCache = domainCache;
    return this;
  }

  public void unsetDomainCache() {
    this.domainCache = null;
  }

  /** Returns true if field domainCache is set (has been assigned a value) and false otherwise */
  public boolean isSetDomainCache() {
    return this.domainCache != null;
  }

  public void setDomainCacheIsSet(boolean value) {
    if (!value) {
      this.domainCache = null;
    }
  }

  public String getShardControllerStatus() {
    return this.shardControllerStatus;
  }

  public DescribeHistoryHostResponse setShardControllerStatus(String shardControllerStatus) {
    this.shardControllerStatus = shardControllerStatus;
    return this;
  }

  public void unsetShardControllerStatus() {
    this.shardControllerStatus = null;
  }

  /** Returns true if field shardControllerStatus is set (has been assigned a value) and false otherwise */
  public boolean isSetShardControllerStatus() {
    return this.shardControllerStatus != null;
  }

  public void setShardControllerStatusIsSet(boolean value) {
    if (!value) {
      this.shardControllerStatus = null;
    }
  }

  public String getAddress() {
    return this.address;
  }

  public DescribeHistoryHostResponse setAddress(String address) {
    this.address = address;
    return this;
  }

  public void unsetAddress() {
    this.address = null;
  }

  /** Returns true if field address is set (has been assigned a value) and false otherwise */
  public boolean isSetAddress() {
    return this.address != null;
  }

  public void setAddressIsSet(boolean value) {
    if (!value) {
      this.address = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case NUMBER_OF_SHARDS:
      if (value == null) {
        unsetNumberOfShards();
      } else {
        setNumberOfShards((Integer)value);
      }
      break;

    case SHARD_IDS:
      if (value == null) {
        unsetShardIDs();
      } else {
        setShardIDs((List)value);
      }
      break;

    case DOMAIN_CACHE:
      if (value == null) {
        unsetDomainCache();
      } else {
        setDomainCache((DomainCacheInfo)value);
      }
      break;

    case SHARD_CONTROLLER_STATUS:
      if (value == null) {
        unsetShardControllerStatus();
      } else {
        setShardControllerStatus((String)value);
      }
      break;

    case ADDRESS:
      if (value == null) {
        unsetAddress();
      } else {
        setAddress((String)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case NUMBER_OF_SHARDS:
      return getNumberOfShards();

    case SHARD_IDS:
      return getShardIDs();

    case DOMAIN_CACHE:
      return getDomainCache();

    case SHARD_CONTROLLER_STATUS:
      return getShardControllerStatus();

    case ADDRESS:
      return getAddress();

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case NUMBER_OF_SHARDS:
      return isSetNumberOfShards();
    case SHARD_IDS:
      return isSetShardIDs();
    case DOMAIN_CACHE:
      return isSetDomainCache();
    case SHARD_CONTROLLER_STATUS:
      return isSetShardControllerStatus();
    case ADDRESS:
      return isSetAddress();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof DescribeHistoryHostResponse)
      return this.equals((DescribeHistoryHostResponse)that);
    return false;
  }

  public boolean equals(DescribeHistoryHostResponse that) {
    if (that == null)
      return false;

    boolean this_present_numberOfShards = true && this.isSetNumberOfShards();
    boolean that_present_numberOfShards = true && that.isSetNumberOfShards();
    if (this_present_numberOfShards || that_present_numberOfShards) {
      if (!(this_present_numberOfShards && that_present_numberOfShards))
        return false;
      if (this.numberOfShards != that.numberOfShards)
        return false;
    }

    boolean this_present_shardIDs = true && this.isSetShardIDs();
    boolean that_present_shardIDs = true && that.isSetShardIDs();
    if (this_present_shardIDs || that_present_shardIDs) {
      if (!(this_present_shardIDs && that_present_shardIDs))
        return false;
      if (!this.shardIDs.equals(that.shardIDs))
        return false;
    }

    boolean this_present_domainCache = true && this.isSetDomainCache();
    boolean that_present_domainCache = true && that.isSetDomainCache();
    if (this_present_domainCache || that_present_domainCache) {
      if (!(this_present_domainCache && that_present_domainCache))
        return false;
      if (!this.domainCache.equals(that.domainCache))
        return false;
    }

    boolean this_present_shardControllerStatus = true && this.isSetShardControllerStatus();
    boolean that_present_shardControllerStatus = true && that.isSetShardControllerStatus();
    if (this_present_shardControllerStatus || that_present_shardControllerStatus) {
      if (!(this_present_shardControllerStatus && that_present_shardControllerStatus))
        return false;
      if (!this.shardControllerStatus.equals(that.shardControllerStatus))
        return false;
    }

    boolean this_present_address = true && this.isSetAddress();
    boolean that_present_address = true && that.isSetAddress();
    if (this_present_address || that_present_address) {
      if (!(this_present_address && that_present_address))
        return false;
      if (!this.address.equals(that.address))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List list = new ArrayList();

    boolean present_numberOfShards = true && (isSetNumberOfShards());
    list.add(present_numberOfShards);
    if (present_numberOfShards)
      list.add(numberOfShards);

    boolean present_shardIDs = true && (isSetShardIDs());
    list.add(present_shardIDs);
    if (present_shardIDs)
      list.add(shardIDs);

    boolean present_domainCache = true && (isSetDomainCache());
    list.add(present_domainCache);
    if (present_domainCache)
      list.add(domainCache);

    boolean present_shardControllerStatus = true && (isSetShardControllerStatus());
    list.add(present_shardControllerStatus);
    if (present_shardControllerStatus)
      list.add(shardControllerStatus);

    boolean present_address = true && (isSetAddress());
    list.add(present_address);
    if (present_address)
      list.add(address);

    return list.hashCode();
  }

  @Override
  public int compareTo(DescribeHistoryHostResponse other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetNumberOfShards()).compareTo(other.isSetNumberOfShards());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNumberOfShards()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numberOfShards, other.numberOfShards);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetShardIDs()).compareTo(other.isSetShardIDs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetShardIDs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shardIDs, other.shardIDs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDomainCache()).compareTo(other.isSetDomainCache());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDomainCache()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domainCache, other.domainCache);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetShardControllerStatus()).compareTo(other.isSetShardControllerStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetShardControllerStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shardControllerStatus, other.shardControllerStatus);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAddress()).compareTo(other.isSetAddress());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAddress()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address, other.address);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("DescribeHistoryHostResponse(");
    boolean first = true;

    if (isSetNumberOfShards()) {
      sb.append("numberOfShards:");
      sb.append(this.numberOfShards);
      first = false;
    }
    if (isSetShardIDs()) {
      if (!first) sb.append(", ");
      sb.append("shardIDs:");
      if (this.shardIDs == null) {
        sb.append("null");
      } else {
        sb.append(this.shardIDs);
      }
      first = false;
    }
    if (isSetDomainCache()) {
      if (!first) sb.append(", ");
      sb.append("domainCache:");
      if (this.domainCache == null) {
        sb.append("null");
      } else {
        sb.append(this.domainCache);
      }
      first = false;
    }
    if (isSetShardControllerStatus()) {
      if (!first) sb.append(", ");
      sb.append("shardControllerStatus:");
      if (this.shardControllerStatus == null) {
        sb.append("null");
      } else {
        sb.append(this.shardControllerStatus);
      }
      first = false;
    }
    if (isSetAddress()) {
      if (!first) sb.append(", ");
      sb.append("address:");
      if (this.address == null) {
        sb.append("null");
      } else {
        sb.append(this.address);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class DescribeHistoryHostResponseStandardSchemeFactory implements SchemeFactory {
    public DescribeHistoryHostResponseStandardScheme getScheme() {
      return new DescribeHistoryHostResponseStandardScheme();
    }
  }

  private static class DescribeHistoryHostResponseStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, DescribeHistoryHostResponse struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 10: // NUMBER_OF_SHARDS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.numberOfShards = iprot.readI32();
              struct.setNumberOfShardsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // SHARD_IDS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list122 = iprot.readListBegin();
                struct.shardIDs = new ArrayList(_list122.size);
                int _elem123;
                for (int _i124 = 0; _i124 < _list122.size; ++_i124)
                {
                  _elem123 = iprot.readI32();
                  struct.shardIDs.add(_elem123);
                }
                iprot.readListEnd();
              }
              struct.setShardIDsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 30: // DOMAIN_CACHE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.domainCache = new DomainCacheInfo();
              struct.domainCache.read(iprot);
              struct.setDomainCacheIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 40: // SHARD_CONTROLLER_STATUS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.shardControllerStatus = iprot.readString();
              struct.setShardControllerStatusIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 50: // ADDRESS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.address = iprot.readString();
              struct.setAddressIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, DescribeHistoryHostResponse struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetNumberOfShards()) {
        oprot.writeFieldBegin(NUMBER_OF_SHARDS_FIELD_DESC);
        oprot.writeI32(struct.numberOfShards);
        oprot.writeFieldEnd();
      }
      if (struct.shardIDs != null) {
        if (struct.isSetShardIDs()) {
          oprot.writeFieldBegin(SHARD_IDS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.shardIDs.size()));
            for (int _iter125 : struct.shardIDs)
            {
              oprot.writeI32(_iter125);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.domainCache != null) {
        if (struct.isSetDomainCache()) {
          oprot.writeFieldBegin(DOMAIN_CACHE_FIELD_DESC);
          struct.domainCache.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.shardControllerStatus != null) {
        if (struct.isSetShardControllerStatus()) {
          oprot.writeFieldBegin(SHARD_CONTROLLER_STATUS_FIELD_DESC);
          oprot.writeString(struct.shardControllerStatus);
          oprot.writeFieldEnd();
        }
      }
      if (struct.address != null) {
        if (struct.isSetAddress()) {
          oprot.writeFieldBegin(ADDRESS_FIELD_DESC);
          oprot.writeString(struct.address);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class DescribeHistoryHostResponseTupleSchemeFactory implements SchemeFactory {
    public DescribeHistoryHostResponseTupleScheme getScheme() {
      return new DescribeHistoryHostResponseTupleScheme();
    }
  }

  private static class DescribeHistoryHostResponseTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, DescribeHistoryHostResponse struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetNumberOfShards()) {
        optionals.set(0);
      }
      if (struct.isSetShardIDs()) {
        optionals.set(1);
      }
      if (struct.isSetDomainCache()) {
        optionals.set(2);
      }
      if (struct.isSetShardControllerStatus()) {
        optionals.set(3);
      }
      if (struct.isSetAddress()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetNumberOfShards()) {
        oprot.writeI32(struct.numberOfShards);
      }
      if (struct.isSetShardIDs()) {
        {
          oprot.writeI32(struct.shardIDs.size());
          for (int _iter126 : struct.shardIDs)
          {
            oprot.writeI32(_iter126);
          }
        }
      }
      if (struct.isSetDomainCache()) {
        struct.domainCache.write(oprot);
      }
      if (struct.isSetShardControllerStatus()) {
        oprot.writeString(struct.shardControllerStatus);
      }
      if (struct.isSetAddress()) {
        oprot.writeString(struct.address);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, DescribeHistoryHostResponse struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.numberOfShards = iprot.readI32();
        struct.setNumberOfShardsIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list127 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
          struct.shardIDs = new ArrayList(_list127.size);
          int _elem128;
          for (int _i129 = 0; _i129 < _list127.size; ++_i129)
          {
            _elem128 = iprot.readI32();
            struct.shardIDs.add(_elem128);
          }
        }
        struct.setShardIDsIsSet(true);
      }
      if (incoming.get(2)) {
        struct.domainCache = new DomainCacheInfo();
        struct.domainCache.read(iprot);
        struct.setDomainCacheIsSet(true);
      }
      if (incoming.get(3)) {
        struct.shardControllerStatus = iprot.readString();
        struct.setShardControllerStatusIsSet(true);
      }
      if (incoming.get(4)) {
        struct.address = iprot.readString();
        struct.setAddressIsSet(true);
      }
    }
  }

}