public AbortTxnRequest deepCopy() { return new AbortTxnRequest(this); }
@Override public void abort_txn(AbortTxnRequest rqst) throws TException { getTxnHandler().abortTxn(rqst); if (listeners != null && !listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.ABORT_TXN, new AbortTxnEvent(rqst.getTxnid(), this)); } }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof AbortTxnRequest) return this.equals((AbortTxnRequest)that); return false; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case TXNID: if (value == null) { unsetTxnid(); } else { setTxnid((Long)value); } break; case REPL_POLICY: if (value == null) { unsetReplPolicy(); } else { setReplPolicy((String)value); } break; } }
public Object getFieldValue(_Fields field) { switch (field) { case TXNID: return getTxnid(); case REPL_POLICY: return getReplPolicy(); } 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 TXNID: return isSetTxnid(); case REPL_POLICY: return isSetReplPolicy(); } throw new IllegalStateException(); }
@Override public void replRollbackTxn(long srcTxnId, String replPolicy) throws NoSuchTxnException, TException { AbortTxnRequest rqst = new AbortTxnRequest(srcTxnId); rqst.setReplPolicy(replPolicy); client.abort_txn(rqst); }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetTxnid()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'txnid' is unset! Struct:" + toString()); } // check for sub-struct validity }
@Override @RetrySemantics.Idempotent public void abortTxn(AbortTxnRequest rqst) throws NoSuchTxnException, MetaException, TxnAbortedException { long txnid = rqst.getTxnid(); long sourceTxnId = -1; try { stmt = dbConn.createStatement(); if (rqst.isSetReplPolicy()) { sourceTxnId = rqst.getTxnid(); List<Long> targetTxnIds = getTargetTxnIdList(rqst.getReplPolicy(), Collections.singletonList(sourceTxnId), dbConn); if (targetTxnIds.isEmpty()) { " and repl policy " + rqst.getReplPolicy()); return; TxnStatus status = findTxnState(txnid,stmt); if(status == TxnStatus.ABORTED) { if (rqst.isSetReplPolicy()) { deleteReplTxnMapEntry(dbConn, sourceTxnId, rqst.getReplPolicy()); if (rqst.isSetReplPolicy()) { deleteReplTxnMapEntry(dbConn, sourceTxnId, rqst.getReplPolicy());
@Override public void clear() { setTxnidIsSet(false); this.txnid = 0; this.replPolicy = null; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case TXNID: if (value == null) { unsetTxnid(); } else { setTxnid((Long)value); } break; } }
public void read(org.apache.thrift.protocol.TProtocol iprot, AbortTxnRequest 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: // 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; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); }
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); if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.replPolicy = iprot.readString(); struct.setReplPolicyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
/** 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(); } throw new IllegalStateException(); }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, AbortTxnRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.txnid = iprot.readI64(); struct.setTxnidIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.replPolicy = iprot.readString(); struct.setReplPolicyIsSet(true); } } }
@Override public void replRollbackTxn(long srcTxnId, String replPolicy) throws NoSuchTxnException, TException { AbortTxnRequest rqst = new AbortTxnRequest(srcTxnId); rqst.setReplPolicy(replPolicy); client.abort_txn(rqst); }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetTxnid()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'txnid' is unset! Struct:" + toString()); } // check for sub-struct validity }
public AbortTxnRequest( long txnid) { this(); this.txnid = txnid; setTxnidIsSet(true); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case TXNID: if (value == null) { unsetTxnid(); } else { setTxnid((Long)value); } break; } }