Package org.apache.hadoop.hive.metastore.api

Source Code of org.apache.hadoop.hive.metastore.api.StorageDescriptor$StorageDescriptorStandardScheme

/**
* Autogenerated by Thrift Compiler (0.9.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*  @generated
*/
package org.apache.hadoop.hive.metastore.api;

import com.facebook.presto.hive.shaded.org.apache.commons.lang.builder.HashCodeBuilder;
import com.facebook.presto.hive.shaded.org.apache.thrift.scheme.IScheme;
import com.facebook.presto.hive.shaded.org.apache.thrift.scheme.SchemeFactory;
import com.facebook.presto.hive.shaded.org.apache.thrift.scheme.StandardScheme;

import com.facebook.presto.hive.shaded.org.apache.thrift.scheme.TupleScheme;
import com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TTupleProtocol;
import com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolException;
import com.facebook.presto.hive.shaded.org.apache.thrift.EncodingUtils;
import com.facebook.presto.hive.shaded.org.apache.thrift.TException;
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 com.facebook.presto.hive.shaded.org.slf4j.Logger;
import com.facebook.presto.hive.shaded.org.slf4j.LoggerFactory;

public class StorageDescriptor implements com.facebook.presto.hive.shaded.org.apache.thrift.TBase<StorageDescriptor, StorageDescriptor._Fields>, java.io.Serializable, Cloneable {
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TStruct STRUCT_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TStruct("StorageDescriptor");

  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField COLS_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("cols", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.LIST, (short)1);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField LOCATION_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("location", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField INPUT_FORMAT_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("inputFormat", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField OUTPUT_FORMAT_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("outputFormat", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField COMPRESSED_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("compressed", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.BOOL, (short)5);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField NUM_BUCKETS_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("numBuckets", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I32, (short)6);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField SERDE_INFO_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("serdeInfo", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, (short)7);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField BUCKET_COLS_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("bucketCols", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.LIST, (short)8);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField SORT_COLS_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("sortCols", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.LIST, (short)9);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField PARAMETERS_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("parameters", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.MAP, (short)10);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField SKEWED_INFO_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("skewedInfo", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, (short)11);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField STORED_AS_SUB_DIRECTORIES_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("storedAsSubDirectories", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.BOOL, (short)12);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new StorageDescriptorStandardSchemeFactory());
    schemes.put(TupleScheme.class, new StorageDescriptorTupleSchemeFactory());
  }

  private List<FieldSchema> cols; // required
  private String location; // required
  private String inputFormat; // required
  private String outputFormat; // required
  private boolean compressed; // required
  private int numBuckets; // required
  private SerDeInfo serdeInfo; // required
  private List<String> bucketCols; // required
  private List<Order> sortCols; // required
  private Map<String,String> parameters; // required
  private SkewedInfo skewedInfo; // optional
  private boolean storedAsSubDirectories; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements com.facebook.presto.hive.shaded.org.apache.thrift.TFieldIdEnum {
    COLS((short)1, "cols"),
    LOCATION((short)2, "location"),
    INPUT_FORMAT((short)3, "inputFormat"),
    OUTPUT_FORMAT((short)4, "outputFormat"),
    COMPRESSED((short)5, "compressed"),
    NUM_BUCKETS((short)6, "numBuckets"),
    SERDE_INFO((short)7, "serdeInfo"),
    BUCKET_COLS((short)8, "bucketCols"),
    SORT_COLS((short)9, "sortCols"),
    PARAMETERS((short)10, "parameters"),
    SKEWED_INFO((short)11, "skewedInfo"),
    STORED_AS_SUB_DIRECTORIES((short)12, "storedAsSubDirectories");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    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 1: // COLS
          return COLS;
        case 2: // LOCATION
          return LOCATION;
        case 3: // INPUT_FORMAT
          return INPUT_FORMAT;
        case 4: // OUTPUT_FORMAT
          return OUTPUT_FORMAT;
        case 5: // COMPRESSED
          return COMPRESSED;
        case 6: // NUM_BUCKETS
          return NUM_BUCKETS;
        case 7: // SERDE_INFO
          return SERDE_INFO;
        case 8: // BUCKET_COLS
          return BUCKET_COLS;
        case 9: // SORT_COLS
          return SORT_COLS;
        case 10: // PARAMETERS
          return PARAMETERS;
        case 11: // SKEWED_INFO
          return SKEWED_INFO;
        case 12: // STORED_AS_SUB_DIRECTORIES
          return STORED_AS_SUB_DIRECTORIES;
        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 __COMPRESSED_ISSET_ID = 0;
  private static final int __NUMBUCKETS_ISSET_ID = 1;
  private static final int __STOREDASSUBDIRECTORIES_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private _Fields optionals[] = {_Fields.SKEWED_INFO,_Fields.STORED_AS_SUB_DIRECTORIES};
  public static final Map<_Fields, com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.COLS, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("cols", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.DEFAULT,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.ListMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.LIST,
            new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.StructMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, FieldSchema.class))));
    tmpMap.put(_Fields.LOCATION, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("location", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.DEFAULT,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldValueMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.INPUT_FORMAT, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("inputFormat", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.DEFAULT,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldValueMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.OUTPUT_FORMAT, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("outputFormat", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.DEFAULT,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldValueMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.COMPRESSED, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("compressed", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.DEFAULT,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldValueMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.NUM_BUCKETS, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("numBuckets", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.DEFAULT,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldValueMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.SERDE_INFO, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("serdeInfo", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.DEFAULT,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.StructMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, SerDeInfo.class)));
    tmpMap.put(_Fields.BUCKET_COLS, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("bucketCols", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.DEFAULT,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.ListMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.LIST,
            new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldValueMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.SORT_COLS, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("sortCols", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.DEFAULT,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.ListMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.LIST,
            new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.StructMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, Order.class))));
    tmpMap.put(_Fields.PARAMETERS, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("parameters", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.DEFAULT,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.MapMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.MAP,
            new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldValueMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING),
            new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldValueMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.SKEWED_INFO, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("skewedInfo", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.StructMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, SkewedInfo.class)));
    tmpMap.put(_Fields.STORED_AS_SUB_DIRECTORIES, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("storedAsSubDirectories", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldValueMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StorageDescriptor.class, metaDataMap);
  }

  public StorageDescriptor() {
  }

  public StorageDescriptor(
    List<FieldSchema> cols,
    String location,
    String inputFormat,
    String outputFormat,
    boolean compressed,
    int numBuckets,
    SerDeInfo serdeInfo,
    List<String> bucketCols,
    List<Order> sortCols,
    Map<String,String> parameters)
  {
    this();
    this.cols = cols;
    this.location = location;
    this.inputFormat = inputFormat;
    this.outputFormat = outputFormat;
    this.compressed = compressed;
    setCompressedIsSet(true);
    this.numBuckets = numBuckets;
    setNumBucketsIsSet(true);
    this.serdeInfo = serdeInfo;
    this.bucketCols = bucketCols;
    this.sortCols = sortCols;
    this.parameters = parameters;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public StorageDescriptor(StorageDescriptor other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetCols()) {
      List<FieldSchema> __this__cols = new ArrayList<FieldSchema>();
      for (FieldSchema other_element : other.cols) {
        __this__cols.add(new FieldSchema(other_element));
      }
      this.cols = __this__cols;
    }
    if (other.isSetLocation()) {
      this.location = other.location;
    }
    if (other.isSetInputFormat()) {
      this.inputFormat = other.inputFormat;
    }
    if (other.isSetOutputFormat()) {
      this.outputFormat = other.outputFormat;
    }
    this.compressed = other.compressed;
    this.numBuckets = other.numBuckets;
    if (other.isSetSerdeInfo()) {
      this.serdeInfo = new SerDeInfo(other.serdeInfo);
    }
    if (other.isSetBucketCols()) {
      List<String> __this__bucketCols = new ArrayList<String>();
      for (String other_element : other.bucketCols) {
        __this__bucketCols.add(other_element);
      }
      this.bucketCols = __this__bucketCols;
    }
    if (other.isSetSortCols()) {
      List<Order> __this__sortCols = new ArrayList<Order>();
      for (Order other_element : other.sortCols) {
        __this__sortCols.add(new Order(other_element));
      }
      this.sortCols = __this__sortCols;
    }
    if (other.isSetParameters()) {
      Map<String,String> __this__parameters = new HashMap<String,String>();
      for (Map.Entry<String, String> other_element : other.parameters.entrySet()) {

        String other_element_key = other_element.getKey();
        String other_element_value = other_element.getValue();

        String __this__parameters_copy_key = other_element_key;

        String __this__parameters_copy_value = other_element_value;

        __this__parameters.put(__this__parameters_copy_key, __this__parameters_copy_value);
      }
      this.parameters = __this__parameters;
    }
    if (other.isSetSkewedInfo()) {
      this.skewedInfo = new SkewedInfo(other.skewedInfo);
    }
    this.storedAsSubDirectories = other.storedAsSubDirectories;
  }

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

  @Override
  public void clear() {
    this.cols = null;
    this.location = null;
    this.inputFormat = null;
    this.outputFormat = null;
    setCompressedIsSet(false);
    this.compressed = false;
    setNumBucketsIsSet(false);
    this.numBuckets = 0;
    this.serdeInfo = null;
    this.bucketCols = null;
    this.sortCols = null;
    this.parameters = null;
    this.skewedInfo = null;
    setStoredAsSubDirectoriesIsSet(false);
    this.storedAsSubDirectories = false;
  }

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

  public java.util.Iterator<FieldSchema> getColsIterator() {
    return (this.cols == null) ? null : this.cols.iterator();
  }

  public void addToCols(FieldSchema elem) {
    if (this.cols == null) {
      this.cols = new ArrayList<FieldSchema>();
    }
    this.cols.add(elem);
  }

  public List<FieldSchema> getCols() {
    return this.cols;
  }

  public void setCols(List<FieldSchema> cols) {
    this.cols = cols;
  }

  public void unsetCols() {
    this.cols = null;
  }

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

  public void setColsIsSet(boolean value) {
    if (!value) {
      this.cols = null;
    }
  }

  public String getLocation() {
    return this.location;
  }

  public void setLocation(String location) {
    this.location = location;
  }

  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;
    }
  }

  public String getInputFormat() {
    return this.inputFormat;
  }

  public void setInputFormat(String inputFormat) {
    this.inputFormat = inputFormat;
  }

  public void unsetInputFormat() {
    this.inputFormat = null;
  }

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

  public void setInputFormatIsSet(boolean value) {
    if (!value) {
      this.inputFormat = null;
    }
  }

  public String getOutputFormat() {
    return this.outputFormat;
  }

  public void setOutputFormat(String outputFormat) {
    this.outputFormat = outputFormat;
  }

  public void unsetOutputFormat() {
    this.outputFormat = null;
  }

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

  public void setOutputFormatIsSet(boolean value) {
    if (!value) {
      this.outputFormat = null;
    }
  }

  public boolean isCompressed() {
    return this.compressed;
  }

  public void setCompressed(boolean compressed) {
    this.compressed = compressed;
    setCompressedIsSet(true);
  }

  public void unsetCompressed() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COMPRESSED_ISSET_ID);
  }

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

  public void setCompressedIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COMPRESSED_ISSET_ID, value);
  }

  public int getNumBuckets() {
    return this.numBuckets;
  }

  public void setNumBuckets(int numBuckets) {
    this.numBuckets = numBuckets;
    setNumBucketsIsSet(true);
  }

  public void unsetNumBuckets() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUMBUCKETS_ISSET_ID);
  }

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

  public void setNumBucketsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUMBUCKETS_ISSET_ID, value);
  }

  public SerDeInfo getSerdeInfo() {
    return this.serdeInfo;
  }

  public void setSerdeInfo(SerDeInfo serdeInfo) {
    this.serdeInfo = serdeInfo;
  }

  public void unsetSerdeInfo() {
    this.serdeInfo = null;
  }

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

  public void setSerdeInfoIsSet(boolean value) {
    if (!value) {
      this.serdeInfo = null;
    }
  }

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

  public java.util.Iterator<String> getBucketColsIterator() {
    return (this.bucketCols == null) ? null : this.bucketCols.iterator();
  }

  public void addToBucketCols(String elem) {
    if (this.bucketCols == null) {
      this.bucketCols = new ArrayList<String>();
    }
    this.bucketCols.add(elem);
  }

  public List<String> getBucketCols() {
    return this.bucketCols;
  }

  public void setBucketCols(List<String> bucketCols) {
    this.bucketCols = bucketCols;
  }

  public void unsetBucketCols() {
    this.bucketCols = null;
  }

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

  public void setBucketColsIsSet(boolean value) {
    if (!value) {
      this.bucketCols = null;
    }
  }

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

  public java.util.Iterator<Order> getSortColsIterator() {
    return (this.sortCols == null) ? null : this.sortCols.iterator();
  }

  public void addToSortCols(Order elem) {
    if (this.sortCols == null) {
      this.sortCols = new ArrayList<Order>();
    }
    this.sortCols.add(elem);
  }

  public List<Order> getSortCols() {
    return this.sortCols;
  }

  public void setSortCols(List<Order> sortCols) {
    this.sortCols = sortCols;
  }

  public void unsetSortCols() {
    this.sortCols = null;
  }

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

  public void setSortColsIsSet(boolean value) {
    if (!value) {
      this.sortCols = null;
    }
  }

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

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

  public Map<String,String> getParameters() {
    return this.parameters;
  }

  public void setParameters(Map<String,String> parameters) {
    this.parameters = parameters;
  }

  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 SkewedInfo getSkewedInfo() {
    return this.skewedInfo;
  }

  public void setSkewedInfo(SkewedInfo skewedInfo) {
    this.skewedInfo = skewedInfo;
  }

  public void unsetSkewedInfo() {
    this.skewedInfo = null;
  }

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

  public void setSkewedInfoIsSet(boolean value) {
    if (!value) {
      this.skewedInfo = null;
    }
  }

  public boolean isStoredAsSubDirectories() {
    return this.storedAsSubDirectories;
  }

  public void setStoredAsSubDirectories(boolean storedAsSubDirectories) {
    this.storedAsSubDirectories = storedAsSubDirectories;
    setStoredAsSubDirectoriesIsSet(true);
  }

  public void unsetStoredAsSubDirectories() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STOREDASSUBDIRECTORIES_ISSET_ID);
  }

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

  public void setStoredAsSubDirectoriesIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STOREDASSUBDIRECTORIES_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case COLS:
      if (value == null) {
        unsetCols();
      } else {
        setCols((List<FieldSchema>)value);
      }
      break;

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

    case INPUT_FORMAT:
      if (value == null) {
        unsetInputFormat();
      } else {
        setInputFormat((String)value);
      }
      break;

    case OUTPUT_FORMAT:
      if (value == null) {
        unsetOutputFormat();
      } else {
        setOutputFormat((String)value);
      }
      break;

    case COMPRESSED:
      if (value == null) {
        unsetCompressed();
      } else {
        setCompressed((Boolean)value);
      }
      break;

    case NUM_BUCKETS:
      if (value == null) {
        unsetNumBuckets();
      } else {
        setNumBuckets((Integer)value);
      }
      break;

    case SERDE_INFO:
      if (value == null) {
        unsetSerdeInfo();
      } else {
        setSerdeInfo((SerDeInfo)value);
      }
      break;

    case BUCKET_COLS:
      if (value == null) {
        unsetBucketCols();
      } else {
        setBucketCols((List<String>)value);
      }
      break;

    case SORT_COLS:
      if (value == null) {
        unsetSortCols();
      } else {
        setSortCols((List<Order>)value);
      }
      break;

    case PARAMETERS:
      if (value == null) {
        unsetParameters();
      } else {
        setParameters((Map<String,String>)value);
      }
      break;

    case SKEWED_INFO:
      if (value == null) {
        unsetSkewedInfo();
      } else {
        setSkewedInfo((SkewedInfo)value);
      }
      break;

    case STORED_AS_SUB_DIRECTORIES:
      if (value == null) {
        unsetStoredAsSubDirectories();
      } else {
        setStoredAsSubDirectories((Boolean)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case COLS:
      return getCols();

    case LOCATION:
      return getLocation();

    case INPUT_FORMAT:
      return getInputFormat();

    case OUTPUT_FORMAT:
      return getOutputFormat();

    case COMPRESSED:
      return Boolean.valueOf(isCompressed());

    case NUM_BUCKETS:
      return Integer.valueOf(getNumBuckets());

    case SERDE_INFO:
      return getSerdeInfo();

    case BUCKET_COLS:
      return getBucketCols();

    case SORT_COLS:
      return getSortCols();

    case PARAMETERS:
      return getParameters();

    case SKEWED_INFO:
      return getSkewedInfo();

    case STORED_AS_SUB_DIRECTORIES:
      return Boolean.valueOf(isStoredAsSubDirectories());

    }
    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 COLS:
      return isSetCols();
    case LOCATION:
      return isSetLocation();
    case INPUT_FORMAT:
      return isSetInputFormat();
    case OUTPUT_FORMAT:
      return isSetOutputFormat();
    case COMPRESSED:
      return isSetCompressed();
    case NUM_BUCKETS:
      return isSetNumBuckets();
    case SERDE_INFO:
      return isSetSerdeInfo();
    case BUCKET_COLS:
      return isSetBucketCols();
    case SORT_COLS:
      return isSetSortCols();
    case PARAMETERS:
      return isSetParameters();
    case SKEWED_INFO:
      return isSetSkewedInfo();
    case STORED_AS_SUB_DIRECTORIES:
      return isSetStoredAsSubDirectories();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_cols = true && this.isSetCols();
    boolean that_present_cols = true && that.isSetCols();
    if (this_present_cols || that_present_cols) {
      if (!(this_present_cols && that_present_cols))
        return false;
      if (!this.cols.equals(that.cols))
        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_inputFormat = true && this.isSetInputFormat();
    boolean that_present_inputFormat = true && that.isSetInputFormat();
    if (this_present_inputFormat || that_present_inputFormat) {
      if (!(this_present_inputFormat && that_present_inputFormat))
        return false;
      if (!this.inputFormat.equals(that.inputFormat))
        return false;
    }

    boolean this_present_outputFormat = true && this.isSetOutputFormat();
    boolean that_present_outputFormat = true && that.isSetOutputFormat();
    if (this_present_outputFormat || that_present_outputFormat) {
      if (!(this_present_outputFormat && that_present_outputFormat))
        return false;
      if (!this.outputFormat.equals(that.outputFormat))
        return false;
    }

    boolean this_present_compressed = true;
    boolean that_present_compressed = true;
    if (this_present_compressed || that_present_compressed) {
      if (!(this_present_compressed && that_present_compressed))
        return false;
      if (this.compressed != that.compressed)
        return false;
    }

    boolean this_present_numBuckets = true;
    boolean that_present_numBuckets = true;
    if (this_present_numBuckets || that_present_numBuckets) {
      if (!(this_present_numBuckets && that_present_numBuckets))
        return false;
      if (this.numBuckets != that.numBuckets)
        return false;
    }

    boolean this_present_serdeInfo = true && this.isSetSerdeInfo();
    boolean that_present_serdeInfo = true && that.isSetSerdeInfo();
    if (this_present_serdeInfo || that_present_serdeInfo) {
      if (!(this_present_serdeInfo && that_present_serdeInfo))
        return false;
      if (!this.serdeInfo.equals(that.serdeInfo))
        return false;
    }

    boolean this_present_bucketCols = true && this.isSetBucketCols();
    boolean that_present_bucketCols = true && that.isSetBucketCols();
    if (this_present_bucketCols || that_present_bucketCols) {
      if (!(this_present_bucketCols && that_present_bucketCols))
        return false;
      if (!this.bucketCols.equals(that.bucketCols))
        return false;
    }

    boolean this_present_sortCols = true && this.isSetSortCols();
    boolean that_present_sortCols = true && that.isSetSortCols();
    if (this_present_sortCols || that_present_sortCols) {
      if (!(this_present_sortCols && that_present_sortCols))
        return false;
      if (!this.sortCols.equals(that.sortCols))
        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;
    }

    boolean this_present_skewedInfo = true && this.isSetSkewedInfo();
    boolean that_present_skewedInfo = true && that.isSetSkewedInfo();
    if (this_present_skewedInfo || that_present_skewedInfo) {
      if (!(this_present_skewedInfo && that_present_skewedInfo))
        return false;
      if (!this.skewedInfo.equals(that.skewedInfo))
        return false;
    }

    boolean this_present_storedAsSubDirectories = true && this.isSetStoredAsSubDirectories();
    boolean that_present_storedAsSubDirectories = true && that.isSetStoredAsSubDirectories();
    if (this_present_storedAsSubDirectories || that_present_storedAsSubDirectories) {
      if (!(this_present_storedAsSubDirectories && that_present_storedAsSubDirectories))
        return false;
      if (this.storedAsSubDirectories != that.storedAsSubDirectories)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder();

    boolean present_cols = true && (isSetCols());
    builder.append(present_cols);
    if (present_cols)
      builder.append(cols);

    boolean present_location = true && (isSetLocation());
    builder.append(present_location);
    if (present_location)
      builder.append(location);

    boolean present_inputFormat = true && (isSetInputFormat());
    builder.append(present_inputFormat);
    if (present_inputFormat)
      builder.append(inputFormat);

    boolean present_outputFormat = true && (isSetOutputFormat());
    builder.append(present_outputFormat);
    if (present_outputFormat)
      builder.append(outputFormat);

    boolean present_compressed = true;
    builder.append(present_compressed);
    if (present_compressed)
      builder.append(compressed);

    boolean present_numBuckets = true;
    builder.append(present_numBuckets);
    if (present_numBuckets)
      builder.append(numBuckets);

    boolean present_serdeInfo = true && (isSetSerdeInfo());
    builder.append(present_serdeInfo);
    if (present_serdeInfo)
      builder.append(serdeInfo);

    boolean present_bucketCols = true && (isSetBucketCols());
    builder.append(present_bucketCols);
    if (present_bucketCols)
      builder.append(bucketCols);

    boolean present_sortCols = true && (isSetSortCols());
    builder.append(present_sortCols);
    if (present_sortCols)
      builder.append(sortCols);

    boolean present_parameters = true && (isSetParameters());
    builder.append(present_parameters);
    if (present_parameters)
      builder.append(parameters);

    boolean present_skewedInfo = true && (isSetSkewedInfo());
    builder.append(present_skewedInfo);
    if (present_skewedInfo)
      builder.append(skewedInfo);

    boolean present_storedAsSubDirectories = true && (isSetStoredAsSubDirectories());
    builder.append(present_storedAsSubDirectories);
    if (present_storedAsSubDirectories)
      builder.append(storedAsSubDirectories);

    return builder.toHashCode();
  }

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

    int lastComparison = 0;
    StorageDescriptor typedOther = (StorageDescriptor)other;

    lastComparison = Boolean.valueOf(isSetCols()).compareTo(typedOther.isSetCols());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCols()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.cols, typedOther.cols);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLocation()).compareTo(typedOther.isSetLocation());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLocation()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.location, typedOther.location);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInputFormat()).compareTo(typedOther.isSetInputFormat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInputFormat()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.inputFormat, typedOther.inputFormat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOutputFormat()).compareTo(typedOther.isSetOutputFormat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOutputFormat()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.outputFormat, typedOther.outputFormat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCompressed()).compareTo(typedOther.isSetCompressed());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCompressed()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.compressed, typedOther.compressed);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetNumBuckets()).compareTo(typedOther.isSetNumBuckets());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNumBuckets()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.numBuckets, typedOther.numBuckets);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSerdeInfo()).compareTo(typedOther.isSetSerdeInfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSerdeInfo()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.serdeInfo, typedOther.serdeInfo);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBucketCols()).compareTo(typedOther.isSetBucketCols());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBucketCols()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.bucketCols, typedOther.bucketCols);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSortCols()).compareTo(typedOther.isSetSortCols());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSortCols()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.sortCols, typedOther.sortCols);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetParameters()).compareTo(typedOther.isSetParameters());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParameters()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.parameters, typedOther.parameters);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSkewedInfo()).compareTo(typedOther.isSetSkewedInfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSkewedInfo()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.skewedInfo, typedOther.skewedInfo);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStoredAsSubDirectories()).compareTo(typedOther.isSetStoredAsSubDirectories());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStoredAsSubDirectories()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.storedAsSubDirectories, typedOther.storedAsSubDirectories);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

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

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

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

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

    sb.append("cols:");
    if (this.cols == null) {
      sb.append("null");
    } else {
      sb.append(this.cols);
    }
    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("inputFormat:");
    if (this.inputFormat == null) {
      sb.append("null");
    } else {
      sb.append(this.inputFormat);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("outputFormat:");
    if (this.outputFormat == null) {
      sb.append("null");
    } else {
      sb.append(this.outputFormat);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("compressed:");
    sb.append(this.compressed);
    first = false;
    if (!first) sb.append(", ");
    sb.append("numBuckets:");
    sb.append(this.numBuckets);
    first = false;
    if (!first) sb.append(", ");
    sb.append("serdeInfo:");
    if (this.serdeInfo == null) {
      sb.append("null");
    } else {
      sb.append(this.serdeInfo);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("bucketCols:");
    if (this.bucketCols == null) {
      sb.append("null");
    } else {
      sb.append(this.bucketCols);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("sortCols:");
    if (this.sortCols == null) {
      sb.append("null");
    } else {
      sb.append(this.sortCols);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("parameters:");
    if (this.parameters == null) {
      sb.append("null");
    } else {
      sb.append(this.parameters);
    }
    first = false;
    if (isSetSkewedInfo()) {
      if (!first) sb.append(", ");
      sb.append("skewedInfo:");
      if (this.skewedInfo == null) {
        sb.append("null");
      } else {
        sb.append(this.skewedInfo);
      }
      first = false;
    }
    if (isSetStoredAsSubDirectories()) {
      if (!first) sb.append(", ");
      sb.append("storedAsSubDirectories:");
      sb.append(this.storedAsSubDirectories);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (serdeInfo != null) {
      serdeInfo.validate();
    }
    if (skewedInfo != null) {
      skewedInfo.validate();
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TCompactProtocol(new com.facebook.presto.hive.shaded.org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (com.facebook.presto.hive.shaded.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 com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TCompactProtocol(new com.facebook.presto.hive.shaded.org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (com.facebook.presto.hive.shaded.org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class StorageDescriptorStandardSchemeFactory implements SchemeFactory {
    public StorageDescriptorStandardScheme getScheme() {
      return new StorageDescriptorStandardScheme();
    }
  }

  private static class StorageDescriptorStandardScheme extends StandardScheme<StorageDescriptor> {

    public void read(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol iprot, StorageDescriptor struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // COLS
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.LIST) {
              {
                com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList _list156 = iprot.readListBegin();
                struct.cols = new ArrayList<FieldSchema>(_list156.size);
                for (int _i157 = 0; _i157 < _list156.size; ++_i157)
                {
                  FieldSchema _elem158; // required
                  _elem158 = new FieldSchema();
                  _elem158.read(iprot);
                  struct.cols.add(_elem158);
                }
                iprot.readListEnd();
              }
              struct.setColsIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // LOCATION
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING) {
              struct.location = iprot.readString();
              struct.setLocationIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // INPUT_FORMAT
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING) {
              struct.inputFormat = iprot.readString();
              struct.setInputFormatIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // OUTPUT_FORMAT
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING) {
              struct.outputFormat = iprot.readString();
              struct.setOutputFormatIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // COMPRESSED
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.BOOL) {
              struct.compressed = iprot.readBool();
              struct.setCompressedIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // NUM_BUCKETS
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I32) {
              struct.numBuckets = iprot.readI32();
              struct.setNumBucketsIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // SERDE_INFO
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT) {
              struct.serdeInfo = new SerDeInfo();
              struct.serdeInfo.read(iprot);
              struct.setSerdeInfoIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // BUCKET_COLS
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.LIST) {
              {
                com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList _list159 = iprot.readListBegin();
                struct.bucketCols = new ArrayList<String>(_list159.size);
                for (int _i160 = 0; _i160 < _list159.size; ++_i160)
                {
                  String _elem161; // required
                  _elem161 = iprot.readString();
                  struct.bucketCols.add(_elem161);
                }
                iprot.readListEnd();
              }
              struct.setBucketColsIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // SORT_COLS
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.LIST) {
              {
                com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList _list162 = iprot.readListBegin();
                struct.sortCols = new ArrayList<Order>(_list162.size);
                for (int _i163 = 0; _i163 < _list162.size; ++_i163)
                {
                  Order _elem164; // required
                  _elem164 = new Order();
                  _elem164.read(iprot);
                  struct.sortCols.add(_elem164);
                }
                iprot.readListEnd();
              }
              struct.setSortColsIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // PARAMETERS
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.MAP) {
              {
                com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TMap _map165 = iprot.readMapBegin();
                struct.parameters = new HashMap<String,String>(2*_map165.size);
                for (int _i166 = 0; _i166 < _map165.size; ++_i166)
                {
                  String _key167; // required
                  String _val168; // required
                  _key167 = iprot.readString();
                  _val168 = iprot.readString();
                  struct.parameters.put(_key167, _val168);
                }
                iprot.readMapEnd();
              }
              struct.setParametersIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // SKEWED_INFO
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT) {
              struct.skewedInfo = new SkewedInfo();
              struct.skewedInfo.read(iprot);
              struct.setSkewedInfoIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // STORED_AS_SUB_DIRECTORIES
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.BOOL) {
              struct.storedAsSubDirectories = iprot.readBool();
              struct.setStoredAsSubDirectoriesIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      struct.validate();
    }

    public void write(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol oprot, StorageDescriptor struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.cols != null) {
        oprot.writeFieldBegin(COLS_FIELD_DESC);
        {
          oprot.writeListBegin(new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, struct.cols.size()));
          for (FieldSchema _iter169 : struct.cols)
          {
            _iter169.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.location != null) {
        oprot.writeFieldBegin(LOCATION_FIELD_DESC);
        oprot.writeString(struct.location);
        oprot.writeFieldEnd();
      }
      if (struct.inputFormat != null) {
        oprot.writeFieldBegin(INPUT_FORMAT_FIELD_DESC);
        oprot.writeString(struct.inputFormat);
        oprot.writeFieldEnd();
      }
      if (struct.outputFormat != null) {
        oprot.writeFieldBegin(OUTPUT_FORMAT_FIELD_DESC);
        oprot.writeString(struct.outputFormat);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(COMPRESSED_FIELD_DESC);
      oprot.writeBool(struct.compressed);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(NUM_BUCKETS_FIELD_DESC);
      oprot.writeI32(struct.numBuckets);
      oprot.writeFieldEnd();
      if (struct.serdeInfo != null) {
        oprot.writeFieldBegin(SERDE_INFO_FIELD_DESC);
        struct.serdeInfo.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.bucketCols != null) {
        oprot.writeFieldBegin(BUCKET_COLS_FIELD_DESC);
        {
          oprot.writeListBegin(new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, struct.bucketCols.size()));
          for (String _iter170 : struct.bucketCols)
          {
            oprot.writeString(_iter170);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.sortCols != null) {
        oprot.writeFieldBegin(SORT_COLS_FIELD_DESC);
        {
          oprot.writeListBegin(new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, struct.sortCols.size()));
          for (Order _iter171 : struct.sortCols)
          {
            _iter171.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.parameters != null) {
        oprot.writeFieldBegin(PARAMETERS_FIELD_DESC);
        {
          oprot.writeMapBegin(new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TMap(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, struct.parameters.size()));
          for (Map.Entry<String, String> _iter172 : struct.parameters.entrySet())
          {
            oprot.writeString(_iter172.getKey());
            oprot.writeString(_iter172.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.skewedInfo != null) {
        if (struct.isSetSkewedInfo()) {
          oprot.writeFieldBegin(SKEWED_INFO_FIELD_DESC);
          struct.skewedInfo.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetStoredAsSubDirectories()) {
        oprot.writeFieldBegin(STORED_AS_SUB_DIRECTORIES_FIELD_DESC);
        oprot.writeBool(struct.storedAsSubDirectories);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class StorageDescriptorTupleSchemeFactory implements SchemeFactory {
    public StorageDescriptorTupleScheme getScheme() {
      return new StorageDescriptorTupleScheme();
    }
  }

  private static class StorageDescriptorTupleScheme extends TupleScheme<StorageDescriptor> {

    @Override
    public void write(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, StorageDescriptor struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetCols()) {
        optionals.set(0);
      }
      if (struct.isSetLocation()) {
        optionals.set(1);
      }
      if (struct.isSetInputFormat()) {
        optionals.set(2);
      }
      if (struct.isSetOutputFormat()) {
        optionals.set(3);
      }
      if (struct.isSetCompressed()) {
        optionals.set(4);
      }
      if (struct.isSetNumBuckets()) {
        optionals.set(5);
      }
      if (struct.isSetSerdeInfo()) {
        optionals.set(6);
      }
      if (struct.isSetBucketCols()) {
        optionals.set(7);
      }
      if (struct.isSetSortCols()) {
        optionals.set(8);
      }
      if (struct.isSetParameters()) {
        optionals.set(9);
      }
      if (struct.isSetSkewedInfo()) {
        optionals.set(10);
      }
      if (struct.isSetStoredAsSubDirectories()) {
        optionals.set(11);
      }
      oprot.writeBitSet(optionals, 12);
      if (struct.isSetCols()) {
        {
          oprot.writeI32(struct.cols.size());
          for (FieldSchema _iter173 : struct.cols)
          {
            _iter173.write(oprot);
          }
        }
      }
      if (struct.isSetLocation()) {
        oprot.writeString(struct.location);
      }
      if (struct.isSetInputFormat()) {
        oprot.writeString(struct.inputFormat);
      }
      if (struct.isSetOutputFormat()) {
        oprot.writeString(struct.outputFormat);
      }
      if (struct.isSetCompressed()) {
        oprot.writeBool(struct.compressed);
      }
      if (struct.isSetNumBuckets()) {
        oprot.writeI32(struct.numBuckets);
      }
      if (struct.isSetSerdeInfo()) {
        struct.serdeInfo.write(oprot);
      }
      if (struct.isSetBucketCols()) {
        {
          oprot.writeI32(struct.bucketCols.size());
          for (String _iter174 : struct.bucketCols)
          {
            oprot.writeString(_iter174);
          }
        }
      }
      if (struct.isSetSortCols()) {
        {
          oprot.writeI32(struct.sortCols.size());
          for (Order _iter175 : struct.sortCols)
          {
            _iter175.write(oprot);
          }
        }
      }
      if (struct.isSetParameters()) {
        {
          oprot.writeI32(struct.parameters.size());
          for (Map.Entry<String, String> _iter176 : struct.parameters.entrySet())
          {
            oprot.writeString(_iter176.getKey());
            oprot.writeString(_iter176.getValue());
          }
        }
      }
      if (struct.isSetSkewedInfo()) {
        struct.skewedInfo.write(oprot);
      }
      if (struct.isSetStoredAsSubDirectories()) {
        oprot.writeBool(struct.storedAsSubDirectories);
      }
    }

    @Override
    public void read(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, StorageDescriptor struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(12);
      if (incoming.get(0)) {
        {
          com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList _list177 = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.cols = new ArrayList<FieldSchema>(_list177.size);
          for (int _i178 = 0; _i178 < _list177.size; ++_i178)
          {
            FieldSchema _elem179; // required
            _elem179 = new FieldSchema();
            _elem179.read(iprot);
            struct.cols.add(_elem179);
          }
        }
        struct.setColsIsSet(true);
      }
      if (incoming.get(1)) {
        struct.location = iprot.readString();
        struct.setLocationIsSet(true);
      }
      if (incoming.get(2)) {
        struct.inputFormat = iprot.readString();
        struct.setInputFormatIsSet(true);
      }
      if (incoming.get(3)) {
        struct.outputFormat = iprot.readString();
        struct.setOutputFormatIsSet(true);
      }
      if (incoming.get(4)) {
        struct.compressed = iprot.readBool();
        struct.setCompressedIsSet(true);
      }
      if (incoming.get(5)) {
        struct.numBuckets = iprot.readI32();
        struct.setNumBucketsIsSet(true);
      }
      if (incoming.get(6)) {
        struct.serdeInfo = new SerDeInfo();
        struct.serdeInfo.read(iprot);
        struct.setSerdeInfoIsSet(true);
      }
      if (incoming.get(7)) {
        {
          com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList _list180 = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.bucketCols = new ArrayList<String>(_list180.size);
          for (int _i181 = 0; _i181 < _list180.size; ++_i181)
          {
            String _elem182; // required
            _elem182 = iprot.readString();
            struct.bucketCols.add(_elem182);
          }
        }
        struct.setBucketColsIsSet(true);
      }
      if (incoming.get(8)) {
        {
          com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList _list183 = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.sortCols = new ArrayList<Order>(_list183.size);
          for (int _i184 = 0; _i184 < _list183.size; ++_i184)
          {
            Order _elem185; // required
            _elem185 = new Order();
            _elem185.read(iprot);
            struct.sortCols.add(_elem185);
          }
        }
        struct.setSortColsIsSet(true);
      }
      if (incoming.get(9)) {
        {
          com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TMap _map186 = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TMap(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.parameters = new HashMap<String,String>(2*_map186.size);
          for (int _i187 = 0; _i187 < _map186.size; ++_i187)
          {
            String _key188; // required
            String _val189; // required
            _key188 = iprot.readString();
            _val189 = iprot.readString();
            struct.parameters.put(_key188, _val189);
          }
        }
        struct.setParametersIsSet(true);
      }
      if (incoming.get(10)) {
        struct.skewedInfo = new SkewedInfo();
        struct.skewedInfo.read(iprot);
        struct.setSkewedInfoIsSet(true);
      }
      if (incoming.get(11)) {
        struct.storedAsSubDirectories = iprot.readBool();
        struct.setStoredAsSubDirectoriesIsSet(true);
      }
    }
  }

}
TOP

Related Classes of org.apache.hadoop.hive.metastore.api.StorageDescriptor$StorageDescriptorStandardScheme

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.