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

io.snappydata.thrift.CatalogStorage Maven / Gradle / Ivy

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

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

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

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2019-08-09")
public class CatalogStorage 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("CatalogStorage");

  private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)1);
  private static final org.apache.thrift.protocol.TField COMPRESSED_FIELD_DESC = new org.apache.thrift.protocol.TField("compressed", org.apache.thrift.protocol.TType.BOOL, (short)2);
  private static final org.apache.thrift.protocol.TField LOCATION_URI_FIELD_DESC = new org.apache.thrift.protocol.TField("locationUri", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField INPUT_FORMAT_FIELD_DESC = new org.apache.thrift.protocol.TField("inputFormat", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField OUTPUT_FORMAT_FIELD_DESC = new org.apache.thrift.protocol.TField("outputFormat", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField SERDE_FIELD_DESC = new org.apache.thrift.protocol.TField("serde", org.apache.thrift.protocol.TType.STRING, (short)6);

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

  public Map properties; // required
  public boolean compressed; // required
  public String locationUri; // optional
  public String inputFormat; // optional
  public String outputFormat; // optional
  public String serde; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    PROPERTIES((short)1, "properties"),
    COMPRESSED((short)2, "compressed"),
    LOCATION_URI((short)3, "locationUri"),
    INPUT_FORMAT((short)4, "inputFormat"),
    OUTPUT_FORMAT((short)5, "outputFormat"),
    SERDE((short)6, "serde");

    private static final Map byName = new HashMap();

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

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // PROPERTIES
          return PROPERTIES;
        case 2: // COMPRESSED
          return COMPRESSED;
        case 3: // LOCATION_URI
          return LOCATION_URI;
        case 4: // INPUT_FORMAT
          return INPUT_FORMAT;
        case 5: // OUTPUT_FORMAT
          return OUTPUT_FORMAT;
        case 6: // SERDE
          return SERDE;
        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 byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.LOCATION_URI,_Fields.INPUT_FORMAT,_Fields.OUTPUT_FORMAT,_Fields.SERDE};
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        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))));
    tmpMap.put(_Fields.COMPRESSED, new org.apache.thrift.meta_data.FieldMetaData("compressed", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.LOCATION_URI, new org.apache.thrift.meta_data.FieldMetaData("locationUri", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.INPUT_FORMAT, new org.apache.thrift.meta_data.FieldMetaData("inputFormat", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.OUTPUT_FORMAT, new org.apache.thrift.meta_data.FieldMetaData("outputFormat", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SERDE, new org.apache.thrift.meta_data.FieldMetaData("serde", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CatalogStorage.class, metaDataMap);
  }

  public CatalogStorage() {
  }

  public CatalogStorage(
    Map properties,
    boolean compressed)
  {
    this();
    this.properties = properties;
    this.compressed = compressed;
    setCompressedIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public CatalogStorage(CatalogStorage other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetProperties()) {
      Map __this__properties = new HashMap(other.properties);
      this.properties = __this__properties;
    }
    this.compressed = other.compressed;
    if (other.isSetLocationUri()) {
      this.locationUri = other.locationUri;
    }
    if (other.isSetInputFormat()) {
      this.inputFormat = other.inputFormat;
    }
    if (other.isSetOutputFormat()) {
      this.outputFormat = other.outputFormat;
    }
    if (other.isSetSerde()) {
      this.serde = other.serde;
    }
  }

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

  @Override
  public void clear() {
    this.properties = null;
    setCompressedIsSet(false);
    this.compressed = false;
    this.locationUri = null;
    this.inputFormat = null;
    this.outputFormat = null;
    this.serde = null;
  }

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

  public void putToProperties(String key, String val) {
    if (this.properties == null) {
      this.properties = new HashMap();
    }
    this.properties.put(key, val);
  }

  public Map getProperties() {
    return this.properties;
  }

  public CatalogStorage setProperties(Map properties) {
    this.properties = properties;
    return this;
  }

  public void unsetProperties() {
    this.properties = null;
  }

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

  public void setPropertiesIsSet(boolean value) {
    if (!value) {
      this.properties = null;
    }
  }

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

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

  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 String getLocationUri() {
    return this.locationUri;
  }

  public CatalogStorage setLocationUri(String locationUri) {
    this.locationUri = locationUri;
    return this;
  }

  public void unsetLocationUri() {
    this.locationUri = null;
  }

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

  public void setLocationUriIsSet(boolean value) {
    if (!value) {
      this.locationUri = null;
    }
  }

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

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

  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 CatalogStorage setOutputFormat(String outputFormat) {
    this.outputFormat = outputFormat;
    return this;
  }

  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 String getSerde() {
    return this.serde;
  }

  public CatalogStorage setSerde(String serde) {
    this.serde = serde;
    return this;
  }

  public void unsetSerde() {
    this.serde = null;
  }

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

  public void setSerdeIsSet(boolean value) {
    if (!value) {
      this.serde = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case PROPERTIES:
      if (value == null) {
        unsetProperties();
      } else {
        setProperties((Map)value);
      }
      break;

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

    case LOCATION_URI:
      if (value == null) {
        unsetLocationUri();
      } else {
        setLocationUri((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 SERDE:
      if (value == null) {
        unsetSerde();
      } else {
        setSerde((String)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case PROPERTIES:
      return getProperties();

    case COMPRESSED:
      return isCompressed();

    case LOCATION_URI:
      return getLocationUri();

    case INPUT_FORMAT:
      return getInputFormat();

    case OUTPUT_FORMAT:
      return getOutputFormat();

    case SERDE:
      return getSerde();

    }
    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 PROPERTIES:
      return isSetProperties();
    case COMPRESSED:
      return isSetCompressed();
    case LOCATION_URI:
      return isSetLocationUri();
    case INPUT_FORMAT:
      return isSetInputFormat();
    case OUTPUT_FORMAT:
      return isSetOutputFormat();
    case SERDE:
      return isSetSerde();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_properties = true && this.isSetProperties();
    boolean that_present_properties = true && that.isSetProperties();
    if (this_present_properties || that_present_properties) {
      if (!(this_present_properties && that_present_properties))
        return false;
      if (!this.properties.equals(that.properties))
        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_locationUri = true && this.isSetLocationUri();
    boolean that_present_locationUri = true && that.isSetLocationUri();
    if (this_present_locationUri || that_present_locationUri) {
      if (!(this_present_locationUri && that_present_locationUri))
        return false;
      if (!this.locationUri.equals(that.locationUri))
        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_serde = true && this.isSetSerde();
    boolean that_present_serde = true && that.isSetSerde();
    if (this_present_serde || that_present_serde) {
      if (!(this_present_serde && that_present_serde))
        return false;
      if (!this.serde.equals(that.serde))
        return false;
    }

    return true;
  }

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

    boolean present_properties = true && (isSetProperties());
    list.add(present_properties);
    if (present_properties)
      list.add(properties);

    boolean present_compressed = true;
    list.add(present_compressed);
    if (present_compressed)
      list.add(compressed);

    boolean present_locationUri = true && (isSetLocationUri());
    list.add(present_locationUri);
    if (present_locationUri)
      list.add(locationUri);

    boolean present_inputFormat = true && (isSetInputFormat());
    list.add(present_inputFormat);
    if (present_inputFormat)
      list.add(inputFormat);

    boolean present_outputFormat = true && (isSetOutputFormat());
    list.add(present_outputFormat);
    if (present_outputFormat)
      list.add(outputFormat);

    boolean present_serde = true && (isSetSerde());
    list.add(present_serde);
    if (present_serde)
      list.add(serde);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetProperties()).compareTo(other.isSetProperties());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProperties()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCompressed()).compareTo(other.isSetCompressed());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCompressed()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compressed, other.compressed);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLocationUri()).compareTo(other.isSetLocationUri());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLocationUri()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.locationUri, other.locationUri);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInputFormat()).compareTo(other.isSetInputFormat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInputFormat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inputFormat, other.inputFormat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOutputFormat()).compareTo(other.isSetOutputFormat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOutputFormat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.outputFormat, other.outputFormat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSerde()).compareTo(other.isSetSerde());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSerde()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serde, other.serde);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

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

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

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

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

    sb.append("properties:");
    if (this.properties == null) {
      sb.append("null");
    } else {
      sb.append(this.properties);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("compressed:");
    sb.append(this.compressed);
    first = false;
    if (isSetLocationUri()) {
      if (!first) sb.append(", ");
      sb.append("locationUri:");
      if (this.locationUri == null) {
        sb.append("null");
      } else {
        sb.append(this.locationUri);
      }
      first = false;
    }
    if (isSetInputFormat()) {
      if (!first) sb.append(", ");
      sb.append("inputFormat:");
      if (this.inputFormat == null) {
        sb.append("null");
      } else {
        sb.append(this.inputFormat);
      }
      first = false;
    }
    if (isSetOutputFormat()) {
      if (!first) sb.append(", ");
      sb.append("outputFormat:");
      if (this.outputFormat == null) {
        sb.append("null");
      } else {
        sb.append(this.outputFormat);
      }
      first = false;
    }
    if (isSetSerde()) {
      if (!first) sb.append(", ");
      sb.append("serde:");
      if (this.serde == null) {
        sb.append("null");
      } else {
        sb.append(this.serde);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (properties == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'properties' was not present! Struct: " + toString());
    }
    // alas, we cannot check 'compressed' because it's a primitive and you chose the non-beans generator.
    // check for sub-struct validity
  }

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

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

  private static class CatalogStorageStandardSchemeFactory implements SchemeFactory {
    public CatalogStorageStandardScheme getScheme() {
      return new CatalogStorageStandardScheme();
    }
  }

  private static class CatalogStorageStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, CatalogStorage 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: // PROPERTIES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map278 = iprot.readMapBegin();
                struct.properties = new HashMap(2*_map278.size);
                String _key279;
                String _val280;
                for (int _i281 = 0; _i281 < _map278.size; ++_i281)
                {
                  _key279 = iprot.readString();
                  _val280 = iprot.readString();
                  struct.properties.put(_key279, _val280);
                }
                iprot.readMapEnd();
              }
              struct.setPropertiesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // COMPRESSED
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.compressed = iprot.readBool();
              struct.setCompressedIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LOCATION_URI
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.locationUri = iprot.readString();
              struct.setLocationUriIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // INPUT_FORMAT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.inputFormat = iprot.readString();
              struct.setInputFormatIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // OUTPUT_FORMAT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.outputFormat = iprot.readString();
              struct.setOutputFormatIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // SERDE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.serde = iprot.readString();
              struct.setSerdeIsSet(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
      if (!struct.isSetCompressed()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'compressed' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.properties != null) {
        oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.properties.size()));
          for (Map.Entry _iter282 : struct.properties.entrySet())
          {
            oprot.writeString(_iter282.getKey());
            oprot.writeString(_iter282.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(COMPRESSED_FIELD_DESC);
      oprot.writeBool(struct.compressed);
      oprot.writeFieldEnd();
      if (struct.locationUri != null) {
        if (struct.isSetLocationUri()) {
          oprot.writeFieldBegin(LOCATION_URI_FIELD_DESC);
          oprot.writeString(struct.locationUri);
          oprot.writeFieldEnd();
        }
      }
      if (struct.inputFormat != null) {
        if (struct.isSetInputFormat()) {
          oprot.writeFieldBegin(INPUT_FORMAT_FIELD_DESC);
          oprot.writeString(struct.inputFormat);
          oprot.writeFieldEnd();
        }
      }
      if (struct.outputFormat != null) {
        if (struct.isSetOutputFormat()) {
          oprot.writeFieldBegin(OUTPUT_FORMAT_FIELD_DESC);
          oprot.writeString(struct.outputFormat);
          oprot.writeFieldEnd();
        }
      }
      if (struct.serde != null) {
        if (struct.isSetSerde()) {
          oprot.writeFieldBegin(SERDE_FIELD_DESC);
          oprot.writeString(struct.serde);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class CatalogStorageTupleSchemeFactory implements SchemeFactory {
    public CatalogStorageTupleScheme getScheme() {
      return new CatalogStorageTupleScheme();
    }
  }

  private static class CatalogStorageTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, CatalogStorage struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      {
        oprot.writeI32(struct.properties.size());
        for (Map.Entry _iter283 : struct.properties.entrySet())
        {
          oprot.writeString(_iter283.getKey());
          oprot.writeString(_iter283.getValue());
        }
      }
      oprot.writeBool(struct.compressed);
      BitSet optionals = new BitSet();
      if (struct.isSetLocationUri()) {
        optionals.set(0);
      }
      if (struct.isSetInputFormat()) {
        optionals.set(1);
      }
      if (struct.isSetOutputFormat()) {
        optionals.set(2);
      }
      if (struct.isSetSerde()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetLocationUri()) {
        oprot.writeString(struct.locationUri);
      }
      if (struct.isSetInputFormat()) {
        oprot.writeString(struct.inputFormat);
      }
      if (struct.isSetOutputFormat()) {
        oprot.writeString(struct.outputFormat);
      }
      if (struct.isSetSerde()) {
        oprot.writeString(struct.serde);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, CatalogStorage struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      {
        org.apache.thrift.protocol.TMap _map284 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
        struct.properties = new HashMap(2*_map284.size);
        String _key285;
        String _val286;
        for (int _i287 = 0; _i287 < _map284.size; ++_i287)
        {
          _key285 = iprot.readString();
          _val286 = iprot.readString();
          struct.properties.put(_key285, _val286);
        }
      }
      struct.setPropertiesIsSet(true);
      struct.compressed = iprot.readBool();
      struct.setCompressedIsSet(true);
      BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.locationUri = iprot.readString();
        struct.setLocationUriIsSet(true);
      }
      if (incoming.get(1)) {
        struct.inputFormat = iprot.readString();
        struct.setInputFormatIsSet(true);
      }
      if (incoming.get(2)) {
        struct.outputFormat = iprot.readString();
        struct.setOutputFormatIsSet(true);
      }
      if (incoming.get(3)) {
        struct.serde = iprot.readString();
        struct.setSerdeIsSet(true);
      }
    }
  }

}