Example #1
0
 /** 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;
   }
 }
Example #2
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, ShowLocksResponseElement struct)
     throws 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);
   }
 }
Example #3
0
  @Override
  public int compareTo(ShowLocksResponseElement other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetLockid()).compareTo(other.isSetLockid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLockid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lockid, other.lockid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDbname()).compareTo(other.isSetDbname());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDbname()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dbname, other.dbname);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTablename()).compareTo(other.isSetTablename());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTablename()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tablename, other.tablename);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPartname()).compareTo(other.isSetPartname());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartname()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partname, other.partname);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetState()).compareTo(other.isSetState());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetState()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state, other.state);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetType()).compareTo(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 = Boolean.valueOf(isSetTxnid()).compareTo(other.isSetTxnid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTxnid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnid, other.txnid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastheartbeat()).compareTo(other.isSetLastheartbeat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastheartbeat()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.lastheartbeat, other.lastheartbeat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAcquiredat()).compareTo(other.isSetAcquiredat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAcquiredat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acquiredat, other.acquiredat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUser()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetHostname()).compareTo(other.isSetHostname());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHostname()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hostname, other.hostname);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Example #4
0
  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;
  }
Example #5
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, ShowLocksResponseElement struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.lockid = iprot.readI64();
   struct.setLockidIsSet(true);
   struct.dbname = iprot.readString();
   struct.setDbnameIsSet(true);
   struct.state = org.apache.hadoop.hive.metastore.api.LockState.findByValue(iprot.readI32());
   struct.setStateIsSet(true);
   struct.type = org.apache.hadoop.hive.metastore.api.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);
   }
 }
Example #6
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, ShowLocksResponseElement struct)
        throws 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();
    }
Example #7
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, ShowLocksResponseElement 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: // LOCKID
         if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
           struct.lockid = iprot.readI64();
           struct.setLockidIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // DBNAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.dbname = iprot.readString();
           struct.setDbnameIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // TABLENAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.tablename = iprot.readString();
           struct.setTablenameIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // PARTNAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.partname = iprot.readString();
           struct.setPartnameIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5: // STATE
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.state =
               org.apache.hadoop.hive.metastore.api.LockState.findByValue(iprot.readI32());
           struct.setStateIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 6: // TYPE
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.type =
               org.apache.hadoop.hive.metastore.api.LockType.findByValue(iprot.readI32());
           struct.setTypeIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 7: // TXNID
         if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
           struct.txnid = iprot.readI64();
           struct.setTxnidIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 8: // LASTHEARTBEAT
         if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
           struct.lastheartbeat = iprot.readI64();
           struct.setLastheartbeatIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 9: // ACQUIREDAT
         if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
           struct.acquiredat = iprot.readI64();
           struct.setAcquiredatIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 10: // USER
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.user = iprot.readString();
           struct.setUserIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 11: // HOSTNAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.hostname = iprot.readString();
           struct.setHostnameIsSet(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();
 }