/** * Performs a deep copy on <i>other</i>. */ public AbortTxnRequest(AbortTxnRequest other) { __isset_bitfield = other.__isset_bitfield; this.txnid = other.txnid; if (other.isSetReplPolicy()) { this.replPolicy = other.replPolicy; } }
public boolean equals(AbortTxnRequest that) { if (that == null) return false; boolean this_present_txnid = true; boolean that_present_txnid = true; 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_replPolicy = true && this.isSetReplPolicy(); boolean that_present_replPolicy = true && that.isSetReplPolicy(); if (this_present_replPolicy || that_present_replPolicy) { if (!(this_present_replPolicy && that_present_replPolicy)) return false; if (!this.replPolicy.equals(that.replPolicy)) return false; } return true; }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_txnid = true; list.add(present_txnid); if (present_txnid) list.add(txnid); boolean present_replPolicy = true && (isSetReplPolicy()); list.add(present_replPolicy); if (present_replPolicy) list.add(replPolicy); return list.hashCode(); }
/** 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 TXNID: return isSetTxnid(); case REPL_POLICY: return isSetReplPolicy(); } throw new IllegalStateException(); }
@Override public String toString() { StringBuilder sb = new StringBuilder("AbortTxnRequest("); boolean first = true; sb.append("txnid:"); sb.append(this.txnid); first = false; if (isSetReplPolicy()) { if (!first) sb.append(", "); sb.append("replPolicy:"); if (this.replPolicy == null) { sb.append("null"); } else { sb.append(this.replPolicy); } first = false; } sb.append(")"); return sb.toString(); }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, AbortTxnRequest struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI64(struct.txnid); BitSet optionals = new BitSet(); if (struct.isSetReplPolicy()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetReplPolicy()) { oprot.writeString(struct.replPolicy); } }
public void write(org.apache.thrift.protocol.TProtocol oprot, AbortTxnRequest struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(TXNID_FIELD_DESC); oprot.writeI64(struct.txnid); oprot.writeFieldEnd(); if (struct.replPolicy != null) { if (struct.isSetReplPolicy()) { oprot.writeFieldBegin(REPL_POLICY_FIELD_DESC); oprot.writeString(struct.replPolicy); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public int compareTo(AbortTxnRequest other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; 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(isSetReplPolicy()).compareTo(other.isSetReplPolicy()); if (lastComparison != 0) { return lastComparison; } if (isSetReplPolicy()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.replPolicy, other.replPolicy); if (lastComparison != 0) { return lastComparison; } } return 0; }
stmt = dbConn.createStatement(); if (rqst.isSetReplPolicy()) { sourceTxnId = rqst.getTxnid(); List<Long> targetTxnIds = getTargetTxnIdList(rqst.getReplPolicy(), TxnStatus status = findTxnState(txnid,stmt); if(status == TxnStatus.ABORTED) { if (rqst.isSetReplPolicy()) { if (rqst.isSetReplPolicy()) { deleteReplTxnMapEntry(dbConn, sourceTxnId, rqst.getReplPolicy());