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

org.apache.hudi.metaserver.thrift.Table Maven / Gradle / Ivy

There is a newer version: 1.0.0-beta2
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.12.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.hudi.metaserver.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2023-09-27")
public class Table 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("Table");

  private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField DATABASE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("databaseName", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField CREATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("createTime", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("location", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField TABLE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("tableType", org.apache.thrift.protocol.TType.STRING, (short)6);
  private static final org.apache.thrift.protocol.TField PARTITION_KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("partitionKeys", org.apache.thrift.protocol.TType.LIST, (short)7);
  private static final org.apache.thrift.protocol.TField PARAMETERS_FIELD_DESC = new org.apache.thrift.protocol.TField("parameters", org.apache.thrift.protocol.TType.MAP, (short)8);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TableStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TableTupleSchemeFactory();

  public @org.apache.thrift.annotation.Nullable java.lang.String tableName; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String databaseName; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String owner; // required
  public long createTime; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String location; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String tableType; // required
  public @org.apache.thrift.annotation.Nullable java.util.List partitionKeys; // required
  public @org.apache.thrift.annotation.Nullable java.util.Map parameters; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    TABLE_NAME((short)1, "tableName"),
    DATABASE_NAME((short)2, "databaseName"),
    OWNER((short)3, "owner"),
    CREATE_TIME((short)4, "createTime"),
    LOCATION((short)5, "location"),
    TABLE_TYPE((short)6, "tableType"),
    PARTITION_KEYS((short)7, "partitionKeys"),
    PARAMETERS((short)8, "parameters");

    private static final java.util.Map byName = new java.util.HashMap();

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

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // TABLE_NAME
          return TABLE_NAME;
        case 2: // DATABASE_NAME
          return DATABASE_NAME;
        case 3: // OWNER
          return OWNER;
        case 4: // CREATE_TIME
          return CREATE_TIME;
        case 5: // LOCATION
          return LOCATION;
        case 6: // TABLE_TYPE
          return TABLE_TYPE;
        case 7: // PARTITION_KEYS
          return PARTITION_KEYS;
        case 8: // PARAMETERS
          return PARAMETERS;
        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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

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

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __CREATETIME_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DATABASE_NAME, new org.apache.thrift.meta_data.FieldMetaData("databaseName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.OWNER, new org.apache.thrift.meta_data.FieldMetaData("owner", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CREATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("createTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.LOCATION, new org.apache.thrift.meta_data.FieldMetaData("location", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TABLE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("tableType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PARTITION_KEYS, new org.apache.thrift.meta_data.FieldMetaData("partitionKeys", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        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.STRUCT            , "FieldSchema"))));
    tmpMap.put(_Fields.PARAMETERS, new org.apache.thrift.meta_data.FieldMetaData("parameters", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Table.class, metaDataMap);
  }

  public Table() {
  }

  public Table(
    java.lang.String tableName,
    java.lang.String databaseName,
    java.lang.String owner,
    long createTime,
    java.lang.String location,
    java.lang.String tableType,
    java.util.List partitionKeys,
    java.util.Map parameters)
  {
    this();
    this.tableName = tableName;
    this.databaseName = databaseName;
    this.owner = owner;
    this.createTime = createTime;
    setCreateTimeIsSet(true);
    this.location = location;
    this.tableType = tableType;
    this.partitionKeys = partitionKeys;
    this.parameters = parameters;
  }

  /**
   * Performs a deep copy on other.
   */
  public Table(Table other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetTableName()) {
      this.tableName = other.tableName;
    }
    if (other.isSetDatabaseName()) {
      this.databaseName = other.databaseName;
    }
    if (other.isSetOwner()) {
      this.owner = other.owner;
    }
    this.createTime = other.createTime;
    if (other.isSetLocation()) {
      this.location = other.location;
    }
    if (other.isSetTableType()) {
      this.tableType = other.tableType;
    }
    if (other.isSetPartitionKeys()) {
      java.util.List __this__partitionKeys = new java.util.ArrayList(other.partitionKeys.size());
      for (FieldSchema other_element : other.partitionKeys) {
        __this__partitionKeys.add(new FieldSchema(other_element));
      }
      this.partitionKeys = __this__partitionKeys;
    }
    if (other.isSetParameters()) {
      java.util.Map __this__parameters = new java.util.HashMap(other.parameters);
      this.parameters = __this__parameters;
    }
  }

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

  @Override
  public void clear() {
    this.tableName = null;
    this.databaseName = null;
    this.owner = null;
    setCreateTimeIsSet(false);
    this.createTime = 0;
    this.location = null;
    this.tableType = null;
    this.partitionKeys = null;
    this.parameters = null;
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getTableName() {
    return this.tableName;
  }

  public Table setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) {
    this.tableName = tableName;
    return this;
  }

  public void unsetTableName() {
    this.tableName = null;
  }

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

  public void setTableNameIsSet(boolean value) {
    if (!value) {
      this.tableName = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getDatabaseName() {
    return this.databaseName;
  }

  public Table setDatabaseName(@org.apache.thrift.annotation.Nullable java.lang.String databaseName) {
    this.databaseName = databaseName;
    return this;
  }

  public void unsetDatabaseName() {
    this.databaseName = null;
  }

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

  public void setDatabaseNameIsSet(boolean value) {
    if (!value) {
      this.databaseName = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getOwner() {
    return this.owner;
  }

  public Table setOwner(@org.apache.thrift.annotation.Nullable java.lang.String owner) {
    this.owner = owner;
    return this;
  }

  public void unsetOwner() {
    this.owner = null;
  }

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

  public void setOwnerIsSet(boolean value) {
    if (!value) {
      this.owner = null;
    }
  }

  public long getCreateTime() {
    return this.createTime;
  }

  public Table setCreateTime(long createTime) {
    this.createTime = createTime;
    setCreateTimeIsSet(true);
    return this;
  }

  public void unsetCreateTime() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CREATETIME_ISSET_ID);
  }

  /** Returns true if field createTime is set (has been assigned a value) and false otherwise */
  public boolean isSetCreateTime() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CREATETIME_ISSET_ID);
  }

  public void setCreateTimeIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CREATETIME_ISSET_ID, value);
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getLocation() {
    return this.location;
  }

  public Table setLocation(@org.apache.thrift.annotation.Nullable java.lang.String location) {
    this.location = location;
    return this;
  }

  public void unsetLocation() {
    this.location = null;
  }

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

  public void setLocationIsSet(boolean value) {
    if (!value) {
      this.location = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getTableType() {
    return this.tableType;
  }

  public Table setTableType(@org.apache.thrift.annotation.Nullable java.lang.String tableType) {
    this.tableType = tableType;
    return this;
  }

  public void unsetTableType() {
    this.tableType = null;
  }

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

  public void setTableTypeIsSet(boolean value) {
    if (!value) {
      this.tableType = null;
    }
  }

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

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator getPartitionKeysIterator() {
    return (this.partitionKeys == null) ? null : this.partitionKeys.iterator();
  }

  public void addToPartitionKeys(FieldSchema elem) {
    if (this.partitionKeys == null) {
      this.partitionKeys = new java.util.ArrayList();
    }
    this.partitionKeys.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List getPartitionKeys() {
    return this.partitionKeys;
  }

  public Table setPartitionKeys(@org.apache.thrift.annotation.Nullable java.util.List partitionKeys) {
    this.partitionKeys = partitionKeys;
    return this;
  }

  public void unsetPartitionKeys() {
    this.partitionKeys = null;
  }

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

  public void setPartitionKeysIsSet(boolean value) {
    if (!value) {
      this.partitionKeys = null;
    }
  }

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

  public void putToParameters(java.lang.String key, java.lang.String val) {
    if (this.parameters == null) {
      this.parameters = new java.util.HashMap();
    }
    this.parameters.put(key, val);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Map getParameters() {
    return this.parameters;
  }

  public Table setParameters(@org.apache.thrift.annotation.Nullable java.util.Map parameters) {
    this.parameters = parameters;
    return this;
  }

  public void unsetParameters() {
    this.parameters = null;
  }

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

  public void setParametersIsSet(boolean value) {
    if (!value) {
      this.parameters = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case TABLE_NAME:
      if (value == null) {
        unsetTableName();
      } else {
        setTableName((java.lang.String)value);
      }
      break;

    case DATABASE_NAME:
      if (value == null) {
        unsetDatabaseName();
      } else {
        setDatabaseName((java.lang.String)value);
      }
      break;

    case OWNER:
      if (value == null) {
        unsetOwner();
      } else {
        setOwner((java.lang.String)value);
      }
      break;

    case CREATE_TIME:
      if (value == null) {
        unsetCreateTime();
      } else {
        setCreateTime((java.lang.Long)value);
      }
      break;

    case LOCATION:
      if (value == null) {
        unsetLocation();
      } else {
        setLocation((java.lang.String)value);
      }
      break;

    case TABLE_TYPE:
      if (value == null) {
        unsetTableType();
      } else {
        setTableType((java.lang.String)value);
      }
      break;

    case PARTITION_KEYS:
      if (value == null) {
        unsetPartitionKeys();
      } else {
        setPartitionKeys((java.util.List)value);
      }
      break;

    case PARAMETERS:
      if (value == null) {
        unsetParameters();
      } else {
        setParameters((java.util.Map)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case TABLE_NAME:
      return getTableName();

    case DATABASE_NAME:
      return getDatabaseName();

    case OWNER:
      return getOwner();

    case CREATE_TIME:
      return getCreateTime();

    case LOCATION:
      return getLocation();

    case TABLE_TYPE:
      return getTableType();

    case PARTITION_KEYS:
      return getPartitionKeys();

    case PARAMETERS:
      return getParameters();

    }
    throw new java.lang.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 java.lang.IllegalArgumentException();
    }

    switch (field) {
    case TABLE_NAME:
      return isSetTableName();
    case DATABASE_NAME:
      return isSetDatabaseName();
    case OWNER:
      return isSetOwner();
    case CREATE_TIME:
      return isSetCreateTime();
    case LOCATION:
      return isSetLocation();
    case TABLE_TYPE:
      return isSetTableType();
    case PARTITION_KEYS:
      return isSetPartitionKeys();
    case PARAMETERS:
      return isSetParameters();
    }
    throw new java.lang.IllegalStateException();
  }

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

  public boolean equals(Table that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_tableName = true && this.isSetTableName();
    boolean that_present_tableName = true && that.isSetTableName();
    if (this_present_tableName || that_present_tableName) {
      if (!(this_present_tableName && that_present_tableName))
        return false;
      if (!this.tableName.equals(that.tableName))
        return false;
    }

    boolean this_present_databaseName = true && this.isSetDatabaseName();
    boolean that_present_databaseName = true && that.isSetDatabaseName();
    if (this_present_databaseName || that_present_databaseName) {
      if (!(this_present_databaseName && that_present_databaseName))
        return false;
      if (!this.databaseName.equals(that.databaseName))
        return false;
    }

    boolean this_present_owner = true && this.isSetOwner();
    boolean that_present_owner = true && that.isSetOwner();
    if (this_present_owner || that_present_owner) {
      if (!(this_present_owner && that_present_owner))
        return false;
      if (!this.owner.equals(that.owner))
        return false;
    }

    boolean this_present_createTime = true;
    boolean that_present_createTime = true;
    if (this_present_createTime || that_present_createTime) {
      if (!(this_present_createTime && that_present_createTime))
        return false;
      if (this.createTime != that.createTime)
        return false;
    }

    boolean this_present_location = true && this.isSetLocation();
    boolean that_present_location = true && that.isSetLocation();
    if (this_present_location || that_present_location) {
      if (!(this_present_location && that_present_location))
        return false;
      if (!this.location.equals(that.location))
        return false;
    }

    boolean this_present_tableType = true && this.isSetTableType();
    boolean that_present_tableType = true && that.isSetTableType();
    if (this_present_tableType || that_present_tableType) {
      if (!(this_present_tableType && that_present_tableType))
        return false;
      if (!this.tableType.equals(that.tableType))
        return false;
    }

    boolean this_present_partitionKeys = true && this.isSetPartitionKeys();
    boolean that_present_partitionKeys = true && that.isSetPartitionKeys();
    if (this_present_partitionKeys || that_present_partitionKeys) {
      if (!(this_present_partitionKeys && that_present_partitionKeys))
        return false;
      if (!this.partitionKeys.equals(that.partitionKeys))
        return false;
    }

    boolean this_present_parameters = true && this.isSetParameters();
    boolean that_present_parameters = true && that.isSetParameters();
    if (this_present_parameters || that_present_parameters) {
      if (!(this_present_parameters && that_present_parameters))
        return false;
      if (!this.parameters.equals(that.parameters))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287);
    if (isSetTableName())
      hashCode = hashCode * 8191 + tableName.hashCode();

    hashCode = hashCode * 8191 + ((isSetDatabaseName()) ? 131071 : 524287);
    if (isSetDatabaseName())
      hashCode = hashCode * 8191 + databaseName.hashCode();

    hashCode = hashCode * 8191 + ((isSetOwner()) ? 131071 : 524287);
    if (isSetOwner())
      hashCode = hashCode * 8191 + owner.hashCode();

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(createTime);

    hashCode = hashCode * 8191 + ((isSetLocation()) ? 131071 : 524287);
    if (isSetLocation())
      hashCode = hashCode * 8191 + location.hashCode();

    hashCode = hashCode * 8191 + ((isSetTableType()) ? 131071 : 524287);
    if (isSetTableType())
      hashCode = hashCode * 8191 + tableType.hashCode();

    hashCode = hashCode * 8191 + ((isSetPartitionKeys()) ? 131071 : 524287);
    if (isSetPartitionKeys())
      hashCode = hashCode * 8191 + partitionKeys.hashCode();

    hashCode = hashCode * 8191 + ((isSetParameters()) ? 131071 : 524287);
    if (isSetParameters())
      hashCode = hashCode * 8191 + parameters.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTableName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetDatabaseName()).compareTo(other.isSetDatabaseName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDatabaseName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.databaseName, other.databaseName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetOwner()).compareTo(other.isSetOwner());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOwner()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, other.owner);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetCreateTime()).compareTo(other.isSetCreateTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreateTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createTime, other.createTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetLocation()).compareTo(other.isSetLocation());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLocation()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.location, other.location);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetTableType()).compareTo(other.isSetTableType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTableType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableType, other.tableType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetPartitionKeys()).compareTo(other.isSetPartitionKeys());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartitionKeys()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partitionKeys, other.partitionKeys);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetParameters()).compareTo(other.isSetParameters());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParameters()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameters, other.parameters);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

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

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

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("Table(");
    boolean first = true;

    sb.append("tableName:");
    if (this.tableName == null) {
      sb.append("null");
    } else {
      sb.append(this.tableName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("databaseName:");
    if (this.databaseName == null) {
      sb.append("null");
    } else {
      sb.append(this.databaseName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("owner:");
    if (this.owner == null) {
      sb.append("null");
    } else {
      sb.append(this.owner);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("createTime:");
    sb.append(this.createTime);
    first = false;
    if (!first) sb.append(", ");
    sb.append("location:");
    if (this.location == null) {
      sb.append("null");
    } else {
      sb.append(this.location);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("tableType:");
    if (this.tableType == null) {
      sb.append("null");
    } else {
      sb.append(this.tableType);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("partitionKeys:");
    if (this.partitionKeys == null) {
      sb.append("null");
    } else {
      sb.append(this.partitionKeys);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("parameters:");
    if (this.parameters == null) {
      sb.append("null");
    } else {
      sb.append(this.parameters);
    }
    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, java.lang.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 TableStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TableStandardScheme getScheme() {
      return new TableStandardScheme();
    }
  }

  private static class TableStandardScheme extends org.apache.thrift.scheme.StandardScheme
{ public void read(org.apache.thrift.protocol.TProtocol iprot, Table 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 1: // TABLE_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.tableName = iprot.readString(); struct.setTableNameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // DATABASE_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.databaseName = iprot.readString(); struct.setDatabaseNameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // OWNER if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.owner = iprot.readString(); struct.setOwnerIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // CREATE_TIME if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.createTime = iprot.readI64(); struct.setCreateTimeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // LOCATION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.location = iprot.readString(); struct.setLocationIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // TABLE_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.tableType = iprot.readString(); struct.setTableTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // PARTITION_KEYS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); struct.partitionKeys = new java.util.ArrayList(_list0.size); @org.apache.thrift.annotation.Nullable FieldSchema _elem1; for (int _i2 = 0; _i2 < _list0.size; ++_i2) { _elem1 = new FieldSchema(); _elem1.read(iprot); struct.partitionKeys.add(_elem1); } iprot.readListEnd(); } struct.setPartitionKeysIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // PARAMETERS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map3 = iprot.readMapBegin(); struct.parameters = new java.util.HashMap(2*_map3.size); @org.apache.thrift.annotation.Nullable java.lang.String _key4; @org.apache.thrift.annotation.Nullable java.lang.String _val5; for (int _i6 = 0; _i6 < _map3.size; ++_i6) { _key4 = iprot.readString(); _val5 = iprot.readString(); struct.parameters.put(_key4, _val5); } iprot.readMapEnd(); } struct.setParametersIsSet(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, Table struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.tableName != null) { oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); oprot.writeString(struct.tableName); oprot.writeFieldEnd(); } if (struct.databaseName != null) { oprot.writeFieldBegin(DATABASE_NAME_FIELD_DESC); oprot.writeString(struct.databaseName); oprot.writeFieldEnd(); } if (struct.owner != null) { oprot.writeFieldBegin(OWNER_FIELD_DESC); oprot.writeString(struct.owner); oprot.writeFieldEnd(); } oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC); oprot.writeI64(struct.createTime); oprot.writeFieldEnd(); if (struct.location != null) { oprot.writeFieldBegin(LOCATION_FIELD_DESC); oprot.writeString(struct.location); oprot.writeFieldEnd(); } if (struct.tableType != null) { oprot.writeFieldBegin(TABLE_TYPE_FIELD_DESC); oprot.writeString(struct.tableType); oprot.writeFieldEnd(); } if (struct.partitionKeys != null) { oprot.writeFieldBegin(PARTITION_KEYS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.partitionKeys.size())); for (FieldSchema _iter7 : struct.partitionKeys) { _iter7.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.parameters != null) { oprot.writeFieldBegin(PARAMETERS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.parameters.size())); for (java.util.Map.Entry _iter8 : struct.parameters.entrySet()) { oprot.writeString(_iter8.getKey()); oprot.writeString(_iter8.getValue()); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TableTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TableTupleScheme getScheme() { return new TableTupleScheme(); } } private static class TableTupleScheme extends org.apache.thrift.scheme.TupleScheme
{ @Override public void write(org.apache.thrift.protocol.TProtocol prot, Table struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetTableName()) { optionals.set(0); } if (struct.isSetDatabaseName()) { optionals.set(1); } if (struct.isSetOwner()) { optionals.set(2); } if (struct.isSetCreateTime()) { optionals.set(3); } if (struct.isSetLocation()) { optionals.set(4); } if (struct.isSetTableType()) { optionals.set(5); } if (struct.isSetPartitionKeys()) { optionals.set(6); } if (struct.isSetParameters()) { optionals.set(7); } oprot.writeBitSet(optionals, 8); if (struct.isSetTableName()) { oprot.writeString(struct.tableName); } if (struct.isSetDatabaseName()) { oprot.writeString(struct.databaseName); } if (struct.isSetOwner()) { oprot.writeString(struct.owner); } if (struct.isSetCreateTime()) { oprot.writeI64(struct.createTime); } if (struct.isSetLocation()) { oprot.writeString(struct.location); } if (struct.isSetTableType()) { oprot.writeString(struct.tableType); } if (struct.isSetPartitionKeys()) { { oprot.writeI32(struct.partitionKeys.size()); for (FieldSchema _iter9 : struct.partitionKeys) { _iter9.write(oprot); } } } if (struct.isSetParameters()) { { oprot.writeI32(struct.parameters.size()); for (java.util.Map.Entry _iter10 : struct.parameters.entrySet()) { oprot.writeString(_iter10.getKey()); oprot.writeString(_iter10.getValue()); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, Table struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(8); if (incoming.get(0)) { struct.tableName = iprot.readString(); struct.setTableNameIsSet(true); } if (incoming.get(1)) { struct.databaseName = iprot.readString(); struct.setDatabaseNameIsSet(true); } if (incoming.get(2)) { struct.owner = iprot.readString(); struct.setOwnerIsSet(true); } if (incoming.get(3)) { struct.createTime = iprot.readI64(); struct.setCreateTimeIsSet(true); } if (incoming.get(4)) { struct.location = iprot.readString(); struct.setLocationIsSet(true); } if (incoming.get(5)) { struct.tableType = iprot.readString(); struct.setTableTypeIsSet(true); } if (incoming.get(6)) { { org.apache.thrift.protocol.TList _list11 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.partitionKeys = new java.util.ArrayList(_list11.size); @org.apache.thrift.annotation.Nullable FieldSchema _elem12; for (int _i13 = 0; _i13 < _list11.size; ++_i13) { _elem12 = new FieldSchema(); _elem12.read(iprot); struct.partitionKeys.add(_elem12); } } struct.setPartitionKeysIsSet(true); } if (incoming.get(7)) { { org.apache.thrift.protocol.TMap _map14 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.parameters = new java.util.HashMap(2*_map14.size); @org.apache.thrift.annotation.Nullable java.lang.String _key15; @org.apache.thrift.annotation.Nullable java.lang.String _val16; for (int _i17 = 0; _i17 < _map14.size; ++_i17) { _key15 = iprot.readString(); _val16 = iprot.readString(); struct.parameters.put(_key15, _val16); } } struct.setParametersIsSet(true); } } } private static S scheme(org.apache.thrift.protocol.TProtocol proto) { return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); } }