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

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)")
@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class CreateDatabaseRequest implements org.apache.thrift.TBase<CreateDatabaseRequest, CreateDatabaseRequest._Fields>, java.io.Serializable, Cloneable, Comparable<CreateDatabaseRequest> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CreateDatabaseRequest");

  private static final org.apache.thrift.protocol.TField DATABASE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("databaseName", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (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 PARAMETERS_FIELD_DESC = new org.apache.thrift.protocol.TField("parameters", org.apache.thrift.protocol.TType.MAP, (short)4);
  private static final org.apache.thrift.protocol.TField PRIVILEGES_FIELD_DESC = new org.apache.thrift.protocol.TField("privileges", org.apache.thrift.protocol.TType.STRUCT, (short)5);
  private static final org.apache.thrift.protocol.TField OWNER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerName", org.apache.thrift.protocol.TType.STRING, (short)6);
  private static final org.apache.thrift.protocol.TField OWNER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerType", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)8);
  private static final org.apache.thrift.protocol.TField CREATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("createTime", org.apache.thrift.protocol.TType.I32, (short)9);
  private static final org.apache.thrift.protocol.TField MANAGED_LOCATION_URI_FIELD_DESC = new org.apache.thrift.protocol.TField("managedLocationUri", org.apache.thrift.protocol.TType.STRING, (short)10);
  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.STRING, (short)11);
  private static final org.apache.thrift.protocol.TField DATA_CONNECTOR_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("dataConnectorName", org.apache.thrift.protocol.TType.STRING, (short)12);

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

  private @org.apache.thrift.annotation.Nullable java.lang.String databaseName; // required
  private @org.apache.thrift.annotation.Nullable java.lang.String description; // optional
  private @org.apache.thrift.annotation.Nullable java.lang.String locationUri; // optional
  private @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> parameters; // optional
  private @org.apache.thrift.annotation.Nullable PrincipalPrivilegeSet privileges; // optional
  private @org.apache.thrift.annotation.Nullable java.lang.String ownerName; // optional
  private @org.apache.thrift.annotation.Nullable PrincipalType ownerType; // optional
  private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional
  private int createTime; // optional
  private @org.apache.thrift.annotation.Nullable java.lang.String managedLocationUri; // optional
  private @org.apache.thrift.annotation.Nullable java.lang.String type; // optional
  private @org.apache.thrift.annotation.Nullable java.lang.String dataConnectorName; // 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 {
    DATABASE_NAME((short)1, "databaseName"),
    DESCRIPTION((short)2, "description"),
    LOCATION_URI((short)3, "locationUri"),
    PARAMETERS((short)4, "parameters"),
    PRIVILEGES((short)5, "privileges"),
    OWNER_NAME((short)6, "ownerName"),
    /**
     * 
     * @see PrincipalType
     */
    OWNER_TYPE((short)7, "ownerType"),
    CATALOG_NAME((short)8, "catalogName"),
    CREATE_TIME((short)9, "createTime"),
    MANAGED_LOCATION_URI((short)10, "managedLocationUri"),
    TYPE((short)11, "type"),
    DATA_CONNECTOR_NAME((short)12, "dataConnectorName");

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

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

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // DATABASE_NAME
          return DATABASE_NAME;
        case 2: // DESCRIPTION
          return DESCRIPTION;
        case 3: // LOCATION_URI
          return LOCATION_URI;
        case 4: // PARAMETERS
          return PARAMETERS;
        case 5: // PRIVILEGES
          return PRIVILEGES;
        case 6: // OWNER_NAME
          return OWNER_NAME;
        case 7: // OWNER_TYPE
          return OWNER_TYPE;
        case 8: // CATALOG_NAME
          return CATALOG_NAME;
        case 9: // CREATE_TIME
          return CREATE_TIME;
        case 10: // MANAGED_LOCATION_URI
          return MANAGED_LOCATION_URI;
        case 11: // TYPE
          return TYPE;
        case 12: // DATA_CONNECTOR_NAME
          return DATA_CONNECTOR_NAME;
        default:
          return null;
      }
    }

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

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

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

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

    public short getThriftFieldId() {
      return _thriftId;
    }

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

  // isset id assignments
  private static final int __CREATETIME_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.DESCRIPTION,_Fields.LOCATION_URI,_Fields.PARAMETERS,_Fields.PRIVILEGES,_Fields.OWNER_NAME,_Fields.OWNER_TYPE,_Fields.CATALOG_NAME,_Fields.CREATE_TIME,_Fields.MANAGED_LOCATION_URI,_Fields.TYPE,_Fields.DATA_CONNECTOR_NAME};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.DATABASE_NAME, new org.apache.thrift.meta_data.FieldMetaData("databaseName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    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.PARAMETERS, new org.apache.thrift.meta_data.FieldMetaData("parameters", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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.PRIVILEGES, new org.apache.thrift.meta_data.FieldMetaData("privileges", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PrincipalPrivilegeSet.class)));
    tmpMap.put(_Fields.OWNER_NAME, new org.apache.thrift.meta_data.FieldMetaData("ownerName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.OWNER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("ownerType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PrincipalType.class)));
    tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CREATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("createTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.MANAGED_LOCATION_URI, new org.apache.thrift.meta_data.FieldMetaData("managedLocationUri", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DATA_CONNECTOR_NAME, new org.apache.thrift.meta_data.FieldMetaData("dataConnectorName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CreateDatabaseRequest.class, metaDataMap);
  }

  public CreateDatabaseRequest() {
  }

  public CreateDatabaseRequest(
    java.lang.String databaseName)
  {
    this();
    this.databaseName = databaseName;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public CreateDatabaseRequest(CreateDatabaseRequest other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetDatabaseName()) {
      this.databaseName = other.databaseName;
    }
    if (other.isSetDescription()) {
      this.description = other.description;
    }
    if (other.isSetLocationUri()) {
      this.locationUri = other.locationUri;
    }
    if (other.isSetParameters()) {
      java.util.Map<java.lang.String,java.lang.String> __this__parameters = new java.util.HashMap<java.lang.String,java.lang.String>(other.parameters);
      this.parameters = __this__parameters;
    }
    if (other.isSetPrivileges()) {
      this.privileges = new PrincipalPrivilegeSet(other.privileges);
    }
    if (other.isSetOwnerName()) {
      this.ownerName = other.ownerName;
    }
    if (other.isSetOwnerType()) {
      this.ownerType = other.ownerType;
    }
    if (other.isSetCatalogName()) {
      this.catalogName = other.catalogName;
    }
    this.createTime = other.createTime;
    if (other.isSetManagedLocationUri()) {
      this.managedLocationUri = other.managedLocationUri;
    }
    if (other.isSetType()) {
      this.type = other.type;
    }
    if (other.isSetDataConnectorName()) {
      this.dataConnectorName = other.dataConnectorName;
    }
  }

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

  @Override
  public void clear() {
    this.databaseName = null;
    this.description = null;
    this.locationUri = null;
    this.parameters = null;
    this.privileges = null;
    this.ownerName = null;
    this.ownerType = null;
    this.catalogName = null;
    setCreateTimeIsSet(false);
    this.createTime = 0;
    this.managedLocationUri = null;
    this.type = null;
    this.dataConnectorName = null;
  }

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

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

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

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

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

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

  public void setDescription(@org.apache.thrift.annotation.Nullable java.lang.String description) {
    this.description = description;
  }

  public void unsetDescription() {
    this.description = null;
  }

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

  public void setDescriptionIsSet(boolean value) {
    if (!value) {
      this.description = null;
    }
  }

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

  public void setLocationUri(@org.apache.thrift.annotation.Nullable java.lang.String locationUri) {
    this.locationUri = locationUri;
  }

  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 int getParametersSize() {
    return (this.parameters == null) ? 0 : this.parameters.size();
  }

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

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

  public void setParameters(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.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;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public PrincipalPrivilegeSet getPrivileges() {
    return this.privileges;
  }

  public void setPrivileges(@org.apache.thrift.annotation.Nullable PrincipalPrivilegeSet privileges) {
    this.privileges = privileges;
  }

  public void unsetPrivileges() {
    this.privileges = null;
  }

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

  public void setPrivilegesIsSet(boolean value) {
    if (!value) {
      this.privileges = null;
    }
  }

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

  public void setOwnerName(@org.apache.thrift.annotation.Nullable java.lang.String ownerName) {
    this.ownerName = ownerName;
  }

  public void unsetOwnerName() {
    this.ownerName = null;
  }

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

  public void setOwnerNameIsSet(boolean value) {
    if (!value) {
      this.ownerName = null;
    }
  }

  /**
   * 
   * @see PrincipalType
   */
  @org.apache.thrift.annotation.Nullable
  public PrincipalType getOwnerType() {
    return this.ownerType;
  }

  /**
   * 
   * @see PrincipalType
   */
  public void setOwnerType(@org.apache.thrift.annotation.Nullable PrincipalType ownerType) {
    this.ownerType = ownerType;
  }

  public void unsetOwnerType() {
    this.ownerType = null;
  }

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

  public void setOwnerTypeIsSet(boolean value) {
    if (!value) {
      this.ownerType = null;
    }
  }

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

  public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) {
    this.catalogName = catalogName;
  }

  public void unsetCatalogName() {
    this.catalogName = null;
  }

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

  public void setCatalogNameIsSet(boolean value) {
    if (!value) {
      this.catalogName = null;
    }
  }

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

  public void setCreateTime(int createTime) {
    this.createTime = createTime;
    setCreateTimeIsSet(true);
  }

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

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

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

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

  public void setManagedLocationUri(@org.apache.thrift.annotation.Nullable java.lang.String managedLocationUri) {
    this.managedLocationUri = managedLocationUri;
  }

  public void unsetManagedLocationUri() {
    this.managedLocationUri = null;
  }

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

  public void setManagedLocationUriIsSet(boolean value) {
    if (!value) {
      this.managedLocationUri = null;
    }
  }

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

  public void setType(@org.apache.thrift.annotation.Nullable java.lang.String type) {
    this.type = type;
  }

  public void unsetType() {
    this.type = null;
  }

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

  public void setTypeIsSet(boolean value) {
    if (!value) {
      this.type = null;
    }
  }

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

  public void setDataConnectorName(@org.apache.thrift.annotation.Nullable java.lang.String dataConnectorName) {
    this.dataConnectorName = dataConnectorName;
  }

  public void unsetDataConnectorName() {
    this.dataConnectorName = null;
  }

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

  public void setDataConnectorNameIsSet(boolean value) {
    if (!value) {
      this.dataConnectorName = null;
    }
  }

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

    case DESCRIPTION:
      if (value == null) {
        unsetDescription();
      } else {
        setDescription((java.lang.String)value);
      }
      break;

    case LOCATION_URI:
      if (value == null) {
        unsetLocationUri();
      } else {
        setLocationUri((java.lang.String)value);
      }
      break;

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

    case PRIVILEGES:
      if (value == null) {
        unsetPrivileges();
      } else {
        setPrivileges((PrincipalPrivilegeSet)value);
      }
      break;

    case OWNER_NAME:
      if (value == null) {
        unsetOwnerName();
      } else {
        setOwnerName((java.lang.String)value);
      }
      break;

    case OWNER_TYPE:
      if (value == null) {
        unsetOwnerType();
      } else {
        setOwnerType((PrincipalType)value);
      }
      break;

    case CATALOG_NAME:
      if (value == null) {
        unsetCatalogName();
      } else {
        setCatalogName((java.lang.String)value);
      }
      break;

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

    case MANAGED_LOCATION_URI:
      if (value == null) {
        unsetManagedLocationUri();
      } else {
        setManagedLocationUri((java.lang.String)value);
      }
      break;

    case TYPE:
      if (value == null) {
        unsetType();
      } else {
        setType((java.lang.String)value);
      }
      break;

    case DATA_CONNECTOR_NAME:
      if (value == null) {
        unsetDataConnectorName();
      } else {
        setDataConnectorName((java.lang.String)value);
      }
      break;

    }
  }

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

    case DESCRIPTION:
      return getDescription();

    case LOCATION_URI:
      return getLocationUri();

    case PARAMETERS:
      return getParameters();

    case PRIVILEGES:
      return getPrivileges();

    case OWNER_NAME:
      return getOwnerName();

    case OWNER_TYPE:
      return getOwnerType();

    case CATALOG_NAME:
      return getCatalogName();

    case CREATE_TIME:
      return getCreateTime();

    case MANAGED_LOCATION_URI:
      return getManagedLocationUri();

    case TYPE:
      return getType();

    case DATA_CONNECTOR_NAME:
      return getDataConnectorName();

    }
    throw new java.lang.IllegalStateException();
  }

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

    switch (field) {
    case DATABASE_NAME:
      return isSetDatabaseName();
    case DESCRIPTION:
      return isSetDescription();
    case LOCATION_URI:
      return isSetLocationUri();
    case PARAMETERS:
      return isSetParameters();
    case PRIVILEGES:
      return isSetPrivileges();
    case OWNER_NAME:
      return isSetOwnerName();
    case OWNER_TYPE:
      return isSetOwnerType();
    case CATALOG_NAME:
      return isSetCatalogName();
    case CREATE_TIME:
      return isSetCreateTime();
    case MANAGED_LOCATION_URI:
      return isSetManagedLocationUri();
    case TYPE:
      return isSetType();
    case DATA_CONNECTOR_NAME:
      return isSetDataConnectorName();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

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

    boolean this_present_description = true && this.isSetDescription();
    boolean that_present_description = true && that.isSetDescription();
    if (this_present_description || that_present_description) {
      if (!(this_present_description && that_present_description))
        return false;
      if (!this.description.equals(that.description))
        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_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_privileges = true && this.isSetPrivileges();
    boolean that_present_privileges = true && that.isSetPrivileges();
    if (this_present_privileges || that_present_privileges) {
      if (!(this_present_privileges && that_present_privileges))
        return false;
      if (!this.privileges.equals(that.privileges))
        return false;
    }

    boolean this_present_ownerName = true && this.isSetOwnerName();
    boolean that_present_ownerName = true && that.isSetOwnerName();
    if (this_present_ownerName || that_present_ownerName) {
      if (!(this_present_ownerName && that_present_ownerName))
        return false;
      if (!this.ownerName.equals(that.ownerName))
        return false;
    }

    boolean this_present_ownerType = true && this.isSetOwnerType();
    boolean that_present_ownerType = true && that.isSetOwnerType();
    if (this_present_ownerType || that_present_ownerType) {
      if (!(this_present_ownerType && that_present_ownerType))
        return false;
      if (!this.ownerType.equals(that.ownerType))
        return false;
    }

    boolean this_present_catalogName = true && this.isSetCatalogName();
    boolean that_present_catalogName = true && that.isSetCatalogName();
    if (this_present_catalogName || that_present_catalogName) {
      if (!(this_present_catalogName && that_present_catalogName))
        return false;
      if (!this.catalogName.equals(that.catalogName))
        return false;
    }

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

    boolean this_present_managedLocationUri = true && this.isSetManagedLocationUri();
    boolean that_present_managedLocationUri = true && that.isSetManagedLocationUri();
    if (this_present_managedLocationUri || that_present_managedLocationUri) {
      if (!(this_present_managedLocationUri && that_present_managedLocationUri))
        return false;
      if (!this.managedLocationUri.equals(that.managedLocationUri))
        return false;
    }

    boolean this_present_type = true && this.isSetType();
    boolean that_present_type = true && that.isSetType();
    if (this_present_type || that_present_type) {
      if (!(this_present_type && that_present_type))
        return false;
      if (!this.type.equals(that.type))
        return false;
    }

    boolean this_present_dataConnectorName = true && this.isSetDataConnectorName();
    boolean that_present_dataConnectorName = true && that.isSetDataConnectorName();
    if (this_present_dataConnectorName || that_present_dataConnectorName) {
      if (!(this_present_dataConnectorName && that_present_dataConnectorName))
        return false;
      if (!this.dataConnectorName.equals(that.dataConnectorName))
        return false;
    }

    return true;
  }

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

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

    hashCode = hashCode * 8191 + ((isSetDescription()) ? 131071 : 524287);
    if (isSetDescription())
      hashCode = hashCode * 8191 + description.hashCode();

    hashCode = hashCode * 8191 + ((isSetLocationUri()) ? 131071 : 524287);
    if (isSetLocationUri())
      hashCode = hashCode * 8191 + locationUri.hashCode();

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

    hashCode = hashCode * 8191 + ((isSetPrivileges()) ? 131071 : 524287);
    if (isSetPrivileges())
      hashCode = hashCode * 8191 + privileges.hashCode();

    hashCode = hashCode * 8191 + ((isSetOwnerName()) ? 131071 : 524287);
    if (isSetOwnerName())
      hashCode = hashCode * 8191 + ownerName.hashCode();

    hashCode = hashCode * 8191 + ((isSetOwnerType()) ? 131071 : 524287);
    if (isSetOwnerType())
      hashCode = hashCode * 8191 + ownerType.getValue();

    hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287);
    if (isSetCatalogName())
      hashCode = hashCode * 8191 + catalogName.hashCode();

    hashCode = hashCode * 8191 + ((isSetCreateTime()) ? 131071 : 524287);
    if (isSetCreateTime())
      hashCode = hashCode * 8191 + createTime;

    hashCode = hashCode * 8191 + ((isSetManagedLocationUri()) ? 131071 : 524287);
    if (isSetManagedLocationUri())
      hashCode = hashCode * 8191 + managedLocationUri.hashCode();

    hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287);
    if (isSetType())
      hashCode = hashCode * 8191 + type.hashCode();

    hashCode = hashCode * 8191 + ((isSetDataConnectorName()) ? 131071 : 524287);
    if (isSetDataConnectorName())
      hashCode = hashCode * 8191 + dataConnectorName.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetDatabaseName(), other.isSetDatabaseName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDatabaseName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.databaseName, other.databaseName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDescription(), other.isSetDescription());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDescription()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetLocationUri(), 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 = java.lang.Boolean.compare(isSetParameters(), other.isSetParameters());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParameters()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameters, other.parameters);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPrivileges(), other.isSetPrivileges());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPrivileges()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privileges, other.privileges);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetOwnerName(), other.isSetOwnerName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOwnerName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ownerName, other.ownerName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetOwnerType(), other.isSetOwnerType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOwnerType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ownerType, other.ownerType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCatalogName(), other.isSetCatalogName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCatalogName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCreateTime(), other.isSetCreateTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreateTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createTime, other.createTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetManagedLocationUri(), other.isSetManagedLocationUri());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetManagedLocationUri()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.managedLocationUri, other.managedLocationUri);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetType(), other.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDataConnectorName(), other.isSetDataConnectorName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDataConnectorName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataConnectorName, other.dataConnectorName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

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

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

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

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

    sb.append("databaseName:");
    if (this.databaseName == null) {
      sb.append("null");
    } else {
      sb.append(this.databaseName);
    }
    first = false;
    if (isSetDescription()) {
      if (!first) sb.append(", ");
      sb.append("description:");
      if (this.description == null) {
        sb.append("null");
      } else {
        sb.append(this.description);
      }
      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 (isSetParameters()) {
      if (!first) sb.append(", ");
      sb.append("parameters:");
      if (this.parameters == null) {
        sb.append("null");
      } else {
        sb.append(this.parameters);
      }
      first = false;
    }
    if (isSetPrivileges()) {
      if (!first) sb.append(", ");
      sb.append("privileges:");
      if (this.privileges == null) {
        sb.append("null");
      } else {
        sb.append(this.privileges);
      }
      first = false;
    }
    if (isSetOwnerName()) {
      if (!first) sb.append(", ");
      sb.append("ownerName:");
      if (this.ownerName == null) {
        sb.append("null");
      } else {
        sb.append(this.ownerName);
      }
      first = false;
    }
    if (isSetOwnerType()) {
      if (!first) sb.append(", ");
      sb.append("ownerType:");
      if (this.ownerType == null) {
        sb.append("null");
      } else {
        sb.append(this.ownerType);
      }
      first = false;
    }
    if (isSetCatalogName()) {
      if (!first) sb.append(", ");
      sb.append("catalogName:");
      if (this.catalogName == null) {
        sb.append("null");
      } else {
        sb.append(this.catalogName);
      }
      first = false;
    }
    if (isSetCreateTime()) {
      if (!first) sb.append(", ");
      sb.append("createTime:");
      sb.append(this.createTime);
      first = false;
    }
    if (isSetManagedLocationUri()) {
      if (!first) sb.append(", ");
      sb.append("managedLocationUri:");
      if (this.managedLocationUri == null) {
        sb.append("null");
      } else {
        sb.append(this.managedLocationUri);
      }
      first = false;
    }
    if (isSetType()) {
      if (!first) sb.append(", ");
      sb.append("type:");
      if (this.type == null) {
        sb.append("null");
      } else {
        sb.append(this.type);
      }
      first = false;
    }
    if (isSetDataConnectorName()) {
      if (!first) sb.append(", ");
      sb.append("dataConnectorName:");
      if (this.dataConnectorName == null) {
        sb.append("null");
      } else {
        sb.append(this.dataConnectorName);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (!isSetDatabaseName()) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'databaseName' is unset! Struct:" + toString());
    }

    // check for sub-struct validity
    if (privileges != null) {
      privileges.validate();
    }
  }

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

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

  private static class CreateDatabaseRequestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public CreateDatabaseRequestStandardScheme getScheme() {
      return new CreateDatabaseRequestStandardScheme();
    }
  }

  private static class CreateDatabaseRequestStandardScheme extends org.apache.thrift.scheme.StandardScheme<CreateDatabaseRequest> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, CreateDatabaseRequest 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: // DATABASE_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.databaseName = iprot.readString();
              struct.setDatabaseNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // DESCRIPTION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.description = iprot.readString();
              struct.setDescriptionIsSet(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: // PARAMETERS
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map1268 = iprot.readMapBegin();
                struct.parameters = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map1268.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key1269;
                @org.apache.thrift.annotation.Nullable java.lang.String _val1270;
                for (int _i1271 = 0; _i1271 < _map1268.size; ++_i1271)
                {
                  _key1269 = iprot.readString();
                  _val1270 = iprot.readString();
                  struct.parameters.put(_key1269, _val1270);
                }
                iprot.readMapEnd();
              }
              struct.setParametersIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // PRIVILEGES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.privileges = new PrincipalPrivilegeSet();
              struct.privileges.read(iprot);
              struct.setPrivilegesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // OWNER_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.ownerName = iprot.readString();
              struct.setOwnerNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // OWNER_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.ownerType = org.apache.hadoop.hive.metastore.api.PrincipalType.findByValue(iprot.readI32());
              struct.setOwnerTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // CATALOG_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.catalogName = iprot.readString();
              struct.setCatalogNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // CREATE_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.createTime = iprot.readI32();
              struct.setCreateTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // MANAGED_LOCATION_URI
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.managedLocationUri = iprot.readString();
              struct.setManagedLocationUriIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.type = iprot.readString();
              struct.setTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // DATA_CONNECTOR_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.dataConnectorName = iprot.readString();
              struct.setDataConnectorNameIsSet(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();
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.databaseName != null) {
        oprot.writeFieldBegin(DATABASE_NAME_FIELD_DESC);
        oprot.writeString(struct.databaseName);
        oprot.writeFieldEnd();
      }
      if (struct.description != null) {
        if (struct.isSetDescription()) {
          oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
          oprot.writeString(struct.description);
          oprot.writeFieldEnd();
        }
      }
      if (struct.locationUri != null) {
        if (struct.isSetLocationUri()) {
          oprot.writeFieldBegin(LOCATION_URI_FIELD_DESC);
          oprot.writeString(struct.locationUri);
          oprot.writeFieldEnd();
        }
      }
      if (struct.parameters != null) {
        if (struct.isSetParameters()) {
          oprot.writeFieldBegin(PARAMETERS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.parameters.size()));
            for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter1272 : struct.parameters.entrySet())
            {
              oprot.writeString(_iter1272.getKey());
              oprot.writeString(_iter1272.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.privileges != null) {
        if (struct.isSetPrivileges()) {
          oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC);
          struct.privileges.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.ownerName != null) {
        if (struct.isSetOwnerName()) {
          oprot.writeFieldBegin(OWNER_NAME_FIELD_DESC);
          oprot.writeString(struct.ownerName);
          oprot.writeFieldEnd();
        }
      }
      if (struct.ownerType != null) {
        if (struct.isSetOwnerType()) {
          oprot.writeFieldBegin(OWNER_TYPE_FIELD_DESC);
          oprot.writeI32(struct.ownerType.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.catalogName != null) {
        if (struct.isSetCatalogName()) {
          oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC);
          oprot.writeString(struct.catalogName);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetCreateTime()) {
        oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC);
        oprot.writeI32(struct.createTime);
        oprot.writeFieldEnd();
      }
      if (struct.managedLocationUri != null) {
        if (struct.isSetManagedLocationUri()) {
          oprot.writeFieldBegin(MANAGED_LOCATION_URI_FIELD_DESC);
          oprot.writeString(struct.managedLocationUri);
          oprot.writeFieldEnd();
        }
      }
      if (struct.type != null) {
        if (struct.isSetType()) {
          oprot.writeFieldBegin(TYPE_FIELD_DESC);
          oprot.writeString(struct.type);
          oprot.writeFieldEnd();
        }
      }
      if (struct.dataConnectorName != null) {
        if (struct.isSetDataConnectorName()) {
          oprot.writeFieldBegin(DATA_CONNECTOR_NAME_FIELD_DESC);
          oprot.writeString(struct.dataConnectorName);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class CreateDatabaseRequestTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public CreateDatabaseRequestTupleScheme getScheme() {
      return new CreateDatabaseRequestTupleScheme();
    }
  }

  private static class CreateDatabaseRequestTupleScheme extends org.apache.thrift.scheme.TupleScheme<CreateDatabaseRequest> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, CreateDatabaseRequest struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeString(struct.databaseName);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetDescription()) {
        optionals.set(0);
      }
      if (struct.isSetLocationUri()) {
        optionals.set(1);
      }
      if (struct.isSetParameters()) {
        optionals.set(2);
      }
      if (struct.isSetPrivileges()) {
        optionals.set(3);
      }
      if (struct.isSetOwnerName()) {
        optionals.set(4);
      }
      if (struct.isSetOwnerType()) {
        optionals.set(5);
      }
      if (struct.isSetCatalogName()) {
        optionals.set(6);
      }
      if (struct.isSetCreateTime()) {
        optionals.set(7);
      }
      if (struct.isSetManagedLocationUri()) {
        optionals.set(8);
      }
      if (struct.isSetType()) {
        optionals.set(9);
      }
      if (struct.isSetDataConnectorName()) {
        optionals.set(10);
      }
      oprot.writeBitSet(optionals, 11);
      if (struct.isSetDescription()) {
        oprot.writeString(struct.description);
      }
      if (struct.isSetLocationUri()) {
        oprot.writeString(struct.locationUri);
      }
      if (struct.isSetParameters()) {
        {
          oprot.writeI32(struct.parameters.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter1273 : struct.parameters.entrySet())
          {
            oprot.writeString(_iter1273.getKey());
            oprot.writeString(_iter1273.getValue());
          }
        }
      }
      if (struct.isSetPrivileges()) {
        struct.privileges.write(oprot);
      }
      if (struct.isSetOwnerName()) {
        oprot.writeString(struct.ownerName);
      }
      if (struct.isSetOwnerType()) {
        oprot.writeI32(struct.ownerType.getValue());
      }
      if (struct.isSetCatalogName()) {
        oprot.writeString(struct.catalogName);
      }
      if (struct.isSetCreateTime()) {
        oprot.writeI32(struct.createTime);
      }
      if (struct.isSetManagedLocationUri()) {
        oprot.writeString(struct.managedLocationUri);
      }
      if (struct.isSetType()) {
        oprot.writeString(struct.type);
      }
      if (struct.isSetDataConnectorName()) {
        oprot.writeString(struct.dataConnectorName);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, CreateDatabaseRequest struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.databaseName = iprot.readString();
      struct.setDatabaseNameIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(11);
      if (incoming.get(0)) {
        struct.description = iprot.readString();
        struct.setDescriptionIsSet(true);
      }
      if (incoming.get(1)) {
        struct.locationUri = iprot.readString();
        struct.setLocationUriIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TMap _map1274 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING); 
          struct.parameters = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map1274.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key1275;
          @org.apache.thrift.annotation.Nullable java.lang.String _val1276;
          for (int _i1277 = 0; _i1277 < _map1274.size; ++_i1277)
          {
            _key1275 = iprot.readString();
            _val1276 = iprot.readString();
            struct.parameters.put(_key1275, _val1276);
          }
        }
        struct.setParametersIsSet(true);
      }
      if (incoming.get(3)) {
        struct.privileges = new PrincipalPrivilegeSet();
        struct.privileges.read(iprot);
        struct.setPrivilegesIsSet(true);
      }
      if (incoming.get(4)) {
        struct.ownerName = iprot.readString();
        struct.setOwnerNameIsSet(true);
      }
      if (incoming.get(5)) {
        struct.ownerType = org.apache.hadoop.hive.metastore.api.PrincipalType.findByValue(iprot.readI32());
        struct.setOwnerTypeIsSet(true);
      }
      if (incoming.get(6)) {
        struct.catalogName = iprot.readString();
        struct.setCatalogNameIsSet(true);
      }
      if (incoming.get(7)) {
        struct.createTime = iprot.readI32();
        struct.setCreateTimeIsSet(true);
      }
      if (incoming.get(8)) {
        struct.managedLocationUri = iprot.readString();
        struct.setManagedLocationUriIsSet(true);
      }
      if (incoming.get(9)) {
        struct.type = iprot.readString();
        struct.setTypeIsSet(true);
      }
      if (incoming.get(10)) {
        struct.dataConnectorName = iprot.readString();
        struct.setDataConnectorNameIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}

