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

Source Code of org.apache.hadoop.hive.metastore.api.ShowLocksResponseElement

/**
* 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 ShowLocksResponseElement implements com.facebook.presto.hive.shaded.org.apache.thrift.TBase<ShowLocksResponseElement, ShowLocksResponseElement._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("ShowLocksResponseElement");

  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField LOCKID_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("lockid", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I64, (short)1);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField DBNAME_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("dbname", 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 TABLENAME_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("tablename", 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 PARTNAME_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("partname", 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 STATE_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("state", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I32, (short)5);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("type", 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 TXNID_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("txnid", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I64, (short)7);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField LASTHEARTBEAT_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("lastheartbeat", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I64, (short)8);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField ACQUIREDAT_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("acquiredat", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I64, (short)9);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField USER_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("user", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, (short)10);
  private static final com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField HOSTNAME_FIELD_DESC = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TField("hostname", com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, (short)11);

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

  private long lockid; // required
  private String dbname; // required
  private String tablename; // optional
  private String partname; // optional
  private LockState state; // required
  private LockType type; // required
  private long txnid; // optional
  private long lastheartbeat; // required
  private long acquiredat; // optional
  private String user; // required
  private String hostname; // required

  /** 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 {
    LOCKID((short)1, "lockid"),
    DBNAME((short)2, "dbname"),
    TABLENAME((short)3, "tablename"),
    PARTNAME((short)4, "partname"),
    /**
     *
     * @see LockState
     */
    STATE((short)5, "state"),
    /**
     *
     * @see LockType
     */
    TYPE((short)6, "type"),
    TXNID((short)7, "txnid"),
    LASTHEARTBEAT((short)8, "lastheartbeat"),
    ACQUIREDAT((short)9, "acquiredat"),
    USER((short)10, "user"),
    HOSTNAME((short)11, "hostname");

    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: // LOCKID
          return LOCKID;
        case 2: // DBNAME
          return DBNAME;
        case 3: // TABLENAME
          return TABLENAME;
        case 4: // PARTNAME
          return PARTNAME;
        case 5: // STATE
          return STATE;
        case 6: // TYPE
          return TYPE;
        case 7: // TXNID
          return TXNID;
        case 8: // LASTHEARTBEAT
          return LASTHEARTBEAT;
        case 9: // ACQUIREDAT
          return ACQUIREDAT;
        case 10: // USER
          return USER;
        case 11: // HOSTNAME
          return HOSTNAME;
        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 __LOCKID_ISSET_ID = 0;
  private static final int __TXNID_ISSET_ID = 1;
  private static final int __LASTHEARTBEAT_ISSET_ID = 2;
  private static final int __ACQUIREDAT_ISSET_ID = 3;
  private byte __isset_bitfield = 0;
  private _Fields optionals[] = {_Fields.TABLENAME,_Fields.PARTNAME,_Fields.TXNID,_Fields.ACQUIREDAT};
  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.LOCKID, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("lockid", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.REQUIRED,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldValueMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DBNAME, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("dbname", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.REQUIRED,
        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.TABLENAME, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("tablename", 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.STRING)));
    tmpMap.put(_Fields.PARTNAME, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("partname", 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.STRING)));
    tmpMap.put(_Fields.STATE, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("state", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.REQUIRED,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.EnumMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.ENUM, LockState.class)));
    tmpMap.put(_Fields.TYPE, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("type", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.REQUIRED,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.EnumMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.ENUM, LockType.class)));
    tmpMap.put(_Fields.TXNID, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("txnid", 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.I64)));
    tmpMap.put(_Fields.LASTHEARTBEAT, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("lastheartbeat", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.REQUIRED,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldValueMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.ACQUIREDAT, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("acquiredat", 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.I64)));
    tmpMap.put(_Fields.USER, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("user", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.REQUIRED,
        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.HOSTNAME, new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData("hostname", com.facebook.presto.hive.shaded.org.apache.thrift.TFieldRequirementType.REQUIRED,
        new com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldValueMetaData(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    com.facebook.presto.hive.shaded.org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ShowLocksResponseElement.class, metaDataMap);
  }

  public ShowLocksResponseElement() {
  }

  public ShowLocksResponseElement(
    long lockid,
    String dbname,
    LockState state,
    LockType type,
    long lastheartbeat,
    String user,
    String hostname)
  {
    this();
    this.lockid = lockid;
    setLockidIsSet(true);
    this.dbname = dbname;
    this.state = state;
    this.type = type;
    this.lastheartbeat = lastheartbeat;
    setLastheartbeatIsSet(true);
    this.user = user;
    this.hostname = hostname;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public ShowLocksResponseElement(ShowLocksResponseElement other) {
    __isset_bitfield = other.__isset_bitfield;
    this.lockid = other.lockid;
    if (other.isSetDbname()) {
      this.dbname = other.dbname;
    }
    if (other.isSetTablename()) {
      this.tablename = other.tablename;
    }
    if (other.isSetPartname()) {
      this.partname = other.partname;
    }
    if (other.isSetState()) {
      this.state = other.state;
    }
    if (other.isSetType()) {
      this.type = other.type;
    }
    this.txnid = other.txnid;
    this.lastheartbeat = other.lastheartbeat;
    this.acquiredat = other.acquiredat;
    if (other.isSetUser()) {
      this.user = other.user;
    }
    if (other.isSetHostname()) {
      this.hostname = other.hostname;
    }
  }

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

  @Override
  public void clear() {
    setLockidIsSet(false);
    this.lockid = 0;
    this.dbname = null;
    this.tablename = null;
    this.partname = null;
    this.state = null;
    this.type = null;
    setTxnidIsSet(false);
    this.txnid = 0;
    setLastheartbeatIsSet(false);
    this.lastheartbeat = 0;
    setAcquiredatIsSet(false);
    this.acquiredat = 0;
    this.user = null;
    this.hostname = null;
  }

  public long getLockid() {
    return this.lockid;
  }

  public void setLockid(long lockid) {
    this.lockid = lockid;
    setLockidIsSet(true);
  }

  public void unsetLockid() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LOCKID_ISSET_ID);
  }

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

  public void setLockidIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LOCKID_ISSET_ID, value);
  }

  public String getDbname() {
    return this.dbname;
  }

  public void setDbname(String dbname) {
    this.dbname = dbname;
  }

  public void unsetDbname() {
    this.dbname = null;
  }

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

  public void setDbnameIsSet(boolean value) {
    if (!value) {
      this.dbname = null;
    }
  }

  public String getTablename() {
    return this.tablename;
  }

  public void setTablename(String tablename) {
    this.tablename = tablename;
  }

  public void unsetTablename() {
    this.tablename = null;
  }

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

  public void setTablenameIsSet(boolean value) {
    if (!value) {
      this.tablename = null;
    }
  }

  public String getPartname() {
    return this.partname;
  }

  public void setPartname(String partname) {
    this.partname = partname;
  }

  public void unsetPartname() {
    this.partname = null;
  }

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

  public void setPartnameIsSet(boolean value) {
    if (!value) {
      this.partname = null;
    }
  }

  /**
   *
   * @see LockState
   */
  public LockState getState() {
    return this.state;
  }

  /**
   *
   * @see LockState
   */
  public void setState(LockState state) {
    this.state = state;
  }

  public void unsetState() {
    this.state = null;
  }

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

  public void setStateIsSet(boolean value) {
    if (!value) {
      this.state = null;
    }
  }

  /**
   *
   * @see LockType
   */
  public LockType getType() {
    return this.type;
  }

  /**
   *
   * @see LockType
   */
  public void setType(LockType 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;
    }
  }

  public long getTxnid() {
    return this.txnid;
  }

  public void setTxnid(long txnid) {
    this.txnid = txnid;
    setTxnidIsSet(true);
  }

  public void unsetTxnid() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TXNID_ISSET_ID);
  }

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

  public void setTxnidIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TXNID_ISSET_ID, value);
  }

  public long getLastheartbeat() {
    return this.lastheartbeat;
  }

  public void setLastheartbeat(long lastheartbeat) {
    this.lastheartbeat = lastheartbeat;
    setLastheartbeatIsSet(true);
  }

  public void unsetLastheartbeat() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LASTHEARTBEAT_ISSET_ID);
  }

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

  public void setLastheartbeatIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTHEARTBEAT_ISSET_ID, value);
  }

  public long getAcquiredat() {
    return this.acquiredat;
  }

  public void setAcquiredat(long acquiredat) {
    this.acquiredat = acquiredat;
    setAcquiredatIsSet(true);
  }

  public void unsetAcquiredat() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ACQUIREDAT_ISSET_ID);
  }

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

  public void setAcquiredatIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ACQUIREDAT_ISSET_ID, value);
  }

  public String getUser() {
    return this.user;
  }

  public void setUser(String user) {
    this.user = user;
  }

  public void unsetUser() {
    this.user = null;
  }

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

  public void setUserIsSet(boolean value) {
    if (!value) {
      this.user = null;
    }
  }

  public String getHostname() {
    return this.hostname;
  }

  public void setHostname(String hostname) {
    this.hostname = hostname;
  }

  public void unsetHostname() {
    this.hostname = null;
  }

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

  public void setHostnameIsSet(boolean value) {
    if (!value) {
      this.hostname = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case LOCKID:
      if (value == null) {
        unsetLockid();
      } else {
        setLockid((Long)value);
      }
      break;

    case DBNAME:
      if (value == null) {
        unsetDbname();
      } else {
        setDbname((String)value);
      }
      break;

    case TABLENAME:
      if (value == null) {
        unsetTablename();
      } else {
        setTablename((String)value);
      }
      break;

    case PARTNAME:
      if (value == null) {
        unsetPartname();
      } else {
        setPartname((String)value);
      }
      break;

    case STATE:
      if (value == null) {
        unsetState();
      } else {
        setState((LockState)value);
      }
      break;

    case TYPE:
      if (value == null) {
        unsetType();
      } else {
        setType((LockType)value);
      }
      break;

    case TXNID:
      if (value == null) {
        unsetTxnid();
      } else {
        setTxnid((Long)value);
      }
      break;

    case LASTHEARTBEAT:
      if (value == null) {
        unsetLastheartbeat();
      } else {
        setLastheartbeat((Long)value);
      }
      break;

    case ACQUIREDAT:
      if (value == null) {
        unsetAcquiredat();
      } else {
        setAcquiredat((Long)value);
      }
      break;

    case USER:
      if (value == null) {
        unsetUser();
      } else {
        setUser((String)value);
      }
      break;

    case HOSTNAME:
      if (value == null) {
        unsetHostname();
      } else {
        setHostname((String)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case LOCKID:
      return Long.valueOf(getLockid());

    case DBNAME:
      return getDbname();

    case TABLENAME:
      return getTablename();

    case PARTNAME:
      return getPartname();

    case STATE:
      return getState();

    case TYPE:
      return getType();

    case TXNID:
      return Long.valueOf(getTxnid());

    case LASTHEARTBEAT:
      return Long.valueOf(getLastheartbeat());

    case ACQUIREDAT:
      return Long.valueOf(getAcquiredat());

    case USER:
      return getUser();

    case HOSTNAME:
      return getHostname();

    }
    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 LOCKID:
      return isSetLockid();
    case DBNAME:
      return isSetDbname();
    case TABLENAME:
      return isSetTablename();
    case PARTNAME:
      return isSetPartname();
    case STATE:
      return isSetState();
    case TYPE:
      return isSetType();
    case TXNID:
      return isSetTxnid();
    case LASTHEARTBEAT:
      return isSetLastheartbeat();
    case ACQUIREDAT:
      return isSetAcquiredat();
    case USER:
      return isSetUser();
    case HOSTNAME:
      return isSetHostname();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_lockid = true;
    boolean that_present_lockid = true;
    if (this_present_lockid || that_present_lockid) {
      if (!(this_present_lockid && that_present_lockid))
        return false;
      if (this.lockid != that.lockid)
        return false;
    }

    boolean this_present_dbname = true && this.isSetDbname();
    boolean that_present_dbname = true && that.isSetDbname();
    if (this_present_dbname || that_present_dbname) {
      if (!(this_present_dbname && that_present_dbname))
        return false;
      if (!this.dbname.equals(that.dbname))
        return false;
    }

    boolean this_present_tablename = true && this.isSetTablename();
    boolean that_present_tablename = true && that.isSetTablename();
    if (this_present_tablename || that_present_tablename) {
      if (!(this_present_tablename && that_present_tablename))
        return false;
      if (!this.tablename.equals(that.tablename))
        return false;
    }

    boolean this_present_partname = true && this.isSetPartname();
    boolean that_present_partname = true && that.isSetPartname();
    if (this_present_partname || that_present_partname) {
      if (!(this_present_partname && that_present_partname))
        return false;
      if (!this.partname.equals(that.partname))
        return false;
    }

    boolean this_present_state = true && this.isSetState();
    boolean that_present_state = true && that.isSetState();
    if (this_present_state || that_present_state) {
      if (!(this_present_state && that_present_state))
        return false;
      if (!this.state.equals(that.state))
        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_txnid = true && this.isSetTxnid();
    boolean that_present_txnid = true && that.isSetTxnid();
    if (this_present_txnid || that_present_txnid) {
      if (!(this_present_txnid && that_present_txnid))
        return false;
      if (this.txnid != that.txnid)
        return false;
    }

    boolean this_present_lastheartbeat = true;
    boolean that_present_lastheartbeat = true;
    if (this_present_lastheartbeat || that_present_lastheartbeat) {
      if (!(this_present_lastheartbeat && that_present_lastheartbeat))
        return false;
      if (this.lastheartbeat != that.lastheartbeat)
        return false;
    }

    boolean this_present_acquiredat = true && this.isSetAcquiredat();
    boolean that_present_acquiredat = true && that.isSetAcquiredat();
    if (this_present_acquiredat || that_present_acquiredat) {
      if (!(this_present_acquiredat && that_present_acquiredat))
        return false;
      if (this.acquiredat != that.acquiredat)
        return false;
    }

    boolean this_present_user = true && this.isSetUser();
    boolean that_present_user = true && that.isSetUser();
    if (this_present_user || that_present_user) {
      if (!(this_present_user && that_present_user))
        return false;
      if (!this.user.equals(that.user))
        return false;
    }

    boolean this_present_hostname = true && this.isSetHostname();
    boolean that_present_hostname = true && that.isSetHostname();
    if (this_present_hostname || that_present_hostname) {
      if (!(this_present_hostname && that_present_hostname))
        return false;
      if (!this.hostname.equals(that.hostname))
        return false;
    }

    return true;
  }

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

    boolean present_lockid = true;
    builder.append(present_lockid);
    if (present_lockid)
      builder.append(lockid);

    boolean present_dbname = true && (isSetDbname());
    builder.append(present_dbname);
    if (present_dbname)
      builder.append(dbname);

    boolean present_tablename = true && (isSetTablename());
    builder.append(present_tablename);
    if (present_tablename)
      builder.append(tablename);

    boolean present_partname = true && (isSetPartname());
    builder.append(present_partname);
    if (present_partname)
      builder.append(partname);

    boolean present_state = true && (isSetState());
    builder.append(present_state);
    if (present_state)
      builder.append(state.getValue());

    boolean present_type = true && (isSetType());
    builder.append(present_type);
    if (present_type)
      builder.append(type.getValue());

    boolean present_txnid = true && (isSetTxnid());
    builder.append(present_txnid);
    if (present_txnid)
      builder.append(txnid);

    boolean present_lastheartbeat = true;
    builder.append(present_lastheartbeat);
    if (present_lastheartbeat)
      builder.append(lastheartbeat);

    boolean present_acquiredat = true && (isSetAcquiredat());
    builder.append(present_acquiredat);
    if (present_acquiredat)
      builder.append(acquiredat);

    boolean present_user = true && (isSetUser());
    builder.append(present_user);
    if (present_user)
      builder.append(user);

    boolean present_hostname = true && (isSetHostname());
    builder.append(present_hostname);
    if (present_hostname)
      builder.append(hostname);

    return builder.toHashCode();
  }

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

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

    lastComparison = Boolean.valueOf(isSetLockid()).compareTo(typedOther.isSetLockid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLockid()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.lockid, typedOther.lockid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDbname()).compareTo(typedOther.isSetDbname());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDbname()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.dbname, typedOther.dbname);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTablename()).compareTo(typedOther.isSetTablename());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTablename()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.tablename, typedOther.tablename);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPartname()).compareTo(typedOther.isSetPartname());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartname()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.partname, typedOther.partname);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetState()).compareTo(typedOther.isSetState());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetState()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.state, typedOther.state);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTxnid()).compareTo(typedOther.isSetTxnid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTxnid()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.txnid, typedOther.txnid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastheartbeat()).compareTo(typedOther.isSetLastheartbeat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastheartbeat()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.lastheartbeat, typedOther.lastheartbeat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAcquiredat()).compareTo(typedOther.isSetAcquiredat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAcquiredat()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.acquiredat, typedOther.acquiredat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUser()).compareTo(typedOther.isSetUser());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUser()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.user, typedOther.user);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetHostname()).compareTo(typedOther.isSetHostname());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHostname()) {
      lastComparison = com.facebook.presto.hive.shaded.org.apache.thrift.TBaseHelper.compareTo(this.hostname, typedOther.hostname);
      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("ShowLocksResponseElement(");
    boolean first = true;

    sb.append("lockid:");
    sb.append(this.lockid);
    first = false;
    if (!first) sb.append(", ");
    sb.append("dbname:");
    if (this.dbname == null) {
      sb.append("null");
    } else {
      sb.append(this.dbname);
    }
    first = false;
    if (isSetTablename()) {
      if (!first) sb.append(", ");
      sb.append("tablename:");
      if (this.tablename == null) {
        sb.append("null");
      } else {
        sb.append(this.tablename);
      }
      first = false;
    }
    if (isSetPartname()) {
      if (!first) sb.append(", ");
      sb.append("partname:");
      if (this.partname == null) {
        sb.append("null");
      } else {
        sb.append(this.partname);
      }
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("state:");
    if (this.state == null) {
      sb.append("null");
    } else {
      sb.append(this.state);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("type:");
    if (this.type == null) {
      sb.append("null");
    } else {
      sb.append(this.type);
    }
    first = false;
    if (isSetTxnid()) {
      if (!first) sb.append(", ");
      sb.append("txnid:");
      sb.append(this.txnid);
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("lastheartbeat:");
    sb.append(this.lastheartbeat);
    first = false;
    if (isSetAcquiredat()) {
      if (!first) sb.append(", ");
      sb.append("acquiredat:");
      sb.append(this.acquiredat);
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("user:");
    if (this.user == null) {
      sb.append("null");
    } else {
      sb.append(this.user);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("hostname:");
    if (this.hostname == null) {
      sb.append("null");
    } else {
      sb.append(this.hostname);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
    // check for required fields
    if (!isSetLockid()) {
      throw new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolException("Required field 'lockid' is unset! Struct:" + toString());
    }

    if (!isSetDbname()) {
      throw new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolException("Required field 'dbname' is unset! Struct:" + toString());
    }

    if (!isSetState()) {
      throw new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolException("Required field 'state' is unset! Struct:" + toString());
    }

    if (!isSetType()) {
      throw new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolException("Required field 'type' is unset! Struct:" + toString());
    }

    if (!isSetLastheartbeat()) {
      throw new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolException("Required field 'lastheartbeat' is unset! Struct:" + toString());
    }

    if (!isSetUser()) {
      throw new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolException("Required field 'user' is unset! Struct:" + toString());
    }

    if (!isSetHostname()) {
      throw new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolException("Required field 'hostname' is unset! Struct:" + toString());
    }

    // check for sub-struct validity
  }

  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 ShowLocksResponseElementStandardSchemeFactory implements SchemeFactory {
    public ShowLocksResponseElementStandardScheme getScheme() {
      return new ShowLocksResponseElementStandardScheme();
    }
  }

  private static class ShowLocksResponseElementStandardScheme extends StandardScheme<ShowLocksResponseElement> {

    public void read(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol iprot, ShowLocksResponseElement 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: // LOCKID
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I64) {
              struct.lockid = iprot.readI64();
              struct.setLockidIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // DBNAME
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING) {
              struct.dbname = iprot.readString();
              struct.setDbnameIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TABLENAME
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING) {
              struct.tablename = iprot.readString();
              struct.setTablenameIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // PARTNAME
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING) {
              struct.partname = iprot.readString();
              struct.setPartnameIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // STATE
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I32) {
              struct.state = LockState.findByValue(iprot.readI32());
              struct.setStateIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // TYPE
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I32) {
              struct.type = LockType.findByValue(iprot.readI32());
              struct.setTypeIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // TXNID
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I64) {
              struct.txnid = iprot.readI64();
              struct.setTxnidIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // LASTHEARTBEAT
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I64) {
              struct.lastheartbeat = iprot.readI64();
              struct.setLastheartbeatIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // ACQUIREDAT
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I64) {
              struct.acquiredat = iprot.readI64();
              struct.setAcquiredatIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // USER
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING) {
              struct.user = iprot.readString();
              struct.setUserIsSet(true);
            } else {
              com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // HOSTNAME
            if (schemeField.type == com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING) {
              struct.hostname = iprot.readString();
              struct.setHostnameIsSet(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, ShowLocksResponseElement struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(LOCKID_FIELD_DESC);
      oprot.writeI64(struct.lockid);
      oprot.writeFieldEnd();
      if (struct.dbname != null) {
        oprot.writeFieldBegin(DBNAME_FIELD_DESC);
        oprot.writeString(struct.dbname);
        oprot.writeFieldEnd();
      }
      if (struct.tablename != null) {
        if (struct.isSetTablename()) {
          oprot.writeFieldBegin(TABLENAME_FIELD_DESC);
          oprot.writeString(struct.tablename);
          oprot.writeFieldEnd();
        }
      }
      if (struct.partname != null) {
        if (struct.isSetPartname()) {
          oprot.writeFieldBegin(PARTNAME_FIELD_DESC);
          oprot.writeString(struct.partname);
          oprot.writeFieldEnd();
        }
      }
      if (struct.state != null) {
        oprot.writeFieldBegin(STATE_FIELD_DESC);
        oprot.writeI32(struct.state.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(struct.type.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.isSetTxnid()) {
        oprot.writeFieldBegin(TXNID_FIELD_DESC);
        oprot.writeI64(struct.txnid);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(LASTHEARTBEAT_FIELD_DESC);
      oprot.writeI64(struct.lastheartbeat);
      oprot.writeFieldEnd();
      if (struct.isSetAcquiredat()) {
        oprot.writeFieldBegin(ACQUIREDAT_FIELD_DESC);
        oprot.writeI64(struct.acquiredat);
        oprot.writeFieldEnd();
      }
      if (struct.user != null) {
        oprot.writeFieldBegin(USER_FIELD_DESC);
        oprot.writeString(struct.user);
        oprot.writeFieldEnd();
      }
      if (struct.hostname != null) {
        oprot.writeFieldBegin(HOSTNAME_FIELD_DESC);
        oprot.writeString(struct.hostname);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ShowLocksResponseElementTupleSchemeFactory implements SchemeFactory {
    public ShowLocksResponseElementTupleScheme getScheme() {
      return new ShowLocksResponseElementTupleScheme();
    }
  }

  private static class ShowLocksResponseElementTupleScheme extends TupleScheme<ShowLocksResponseElement> {

    @Override
    public void write(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, ShowLocksResponseElement struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      oprot.writeI64(struct.lockid);
      oprot.writeString(struct.dbname);
      oprot.writeI32(struct.state.getValue());
      oprot.writeI32(struct.type.getValue());
      oprot.writeI64(struct.lastheartbeat);
      oprot.writeString(struct.user);
      oprot.writeString(struct.hostname);
      BitSet optionals = new BitSet();
      if (struct.isSetTablename()) {
        optionals.set(0);
      }
      if (struct.isSetPartname()) {
        optionals.set(1);
      }
      if (struct.isSetTxnid()) {
        optionals.set(2);
      }
      if (struct.isSetAcquiredat()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetTablename()) {
        oprot.writeString(struct.tablename);
      }
      if (struct.isSetPartname()) {
        oprot.writeString(struct.partname);
      }
      if (struct.isSetTxnid()) {
        oprot.writeI64(struct.txnid);
      }
      if (struct.isSetAcquiredat()) {
        oprot.writeI64(struct.acquiredat);
      }
    }

    @Override
    public void read(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, ShowLocksResponseElement struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      struct.lockid = iprot.readI64();
      struct.setLockidIsSet(true);
      struct.dbname = iprot.readString();
      struct.setDbnameIsSet(true);
      struct.state = LockState.findByValue(iprot.readI32());
      struct.setStateIsSet(true);
      struct.type = LockType.findByValue(iprot.readI32());
      struct.setTypeIsSet(true);
      struct.lastheartbeat = iprot.readI64();
      struct.setLastheartbeatIsSet(true);
      struct.user = iprot.readString();
      struct.setUserIsSet(true);
      struct.hostname = iprot.readString();
      struct.setHostnameIsSet(true);
      BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.tablename = iprot.readString();
        struct.setTablenameIsSet(true);
      }
      if (incoming.get(1)) {
        struct.partname = iprot.readString();
        struct.setPartnameIsSet(true);
      }
      if (incoming.get(2)) {
        struct.txnid = iprot.readI64();
        struct.setTxnidIsSet(true);
      }
      if (incoming.get(3)) {
        struct.acquiredat = iprot.readI64();
        struct.setAcquiredatIsSet(true);
      }
    }
  }

}
TOP

Related Classes of org.apache.hadoop.hive.metastore.api.ShowLocksResponseElement

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.