@Override public void startTx(Transaction tx) { super.startTx(tx); this.transaction = tx; }
@Override public boolean rollbackTx() throws Exception { rollbackPartitionOperations(); this.tx = null; return super.rollbackTx(); }
@Override public boolean commitTx() throws Exception { this.tx = null; return super.commitTx(); }
@Override public void postTxCommit() { super.postTxCommit(); this.tx = null; }
@Override public String getName() { return super.getName(); }
@Override public String getTransactionAwareName() { if (active) { throw new DataSetException("misbehaving"); } return super.getTransactionAwareName(); } }
@Override public void postTxCommit() { // simply delete the quarantine directory for this transaction try { Location quarantine = getQuarantineLocation(); if (quarantine.exists()) { boolean deleteSuccess = quarantine.delete(true); if (!deleteSuccess) { throw new DataSetException(String.format("Error deleting quarantine location %s.", quarantine)); } } } catch (IOException e) { throw new DataSetException(String.format("Error deleting quarantine location for tx %s.", tx.getWritePointer()), e); } this.tx = null; super.postTxCommit(); }
@Override public void startTx(Transaction tx) { super.startTx(tx); scheduleIds.clear(); }
@Override public boolean rollbackTx() throws Exception { this.tx = null; return super.rollbackTx(); }
@Override public boolean commitTx() throws Exception { currentTx = null; return super.commitTx(); }
@Override public void postTxCommit() { // simply delete the quarantine directory for this transaction try { Location quarantine = getQuarantineLocation(); if (quarantine.exists()) { boolean deleteSuccess = quarantine.delete(true); if (!deleteSuccess) { throw new DataSetException(String.format("Error deleting quarantine location %s.", quarantine)); } } } catch (IOException e) { throw new DataSetException(String.format("Error deleting quarantine location for tx %s.", tx.getWritePointer()), e); } this.tx = null; super.postTxCommit(); }
@Override public void startTx(Transaction tx) { operationsInThisTx.clear(); super.startTx(tx); this.tx = tx; }
@Override public boolean rollbackTx() throws Exception { this.tx = null; return super.rollbackTx(); }
@Override public boolean commitTx() throws Exception { if (!super.commitTx()) { return false; } // Publish a notification if there was new partition added. RuntimeProgramContext runtimeProgramContext = getRuntimeProgramContext(); if (runtimeProgramContext != null && !operationsInThisTx.isEmpty()) { List<PartitionKey> newPartitions = Lists.newArrayList( Iterables.transform(Iterables.filter(operationsInThisTx, AddPartitionOperation.class), OP_TO_KEY)); // Only fire notification if there is new partition added if (!newPartitions.isEmpty()) { runtimeProgramContext.notifyNewPartitions(newPartitions); } } return true; }
@Override public void startTx(Transaction tx) { super.startTx(tx); scheduleIds.clear(); }
@Override public boolean rollbackTx() throws Exception { currentTx = null; return super.rollbackTx(); }
@Override public boolean commitTx() throws Exception { if (!super.commitTx()) { return false; } // Publish a notification if there was new partition added. RuntimeProgramContext runtimeProgramContext = getRuntimeProgramContext(); if (runtimeProgramContext != null && !operationsInThisTx.isEmpty()) { List<PartitionKey> newPartitions = Lists.newArrayList( Iterables.transform(Iterables.filter(operationsInThisTx, AddPartitionOperation.class), OP_TO_KEY)); // Only fire notification if there is new partition added if (!newPartitions.isEmpty()) { runtimeProgramContext.notifyNewPartitions(newPartitions); } } return true; }
@Override public void startTx(Transaction tx) { operationsInThisTx.clear(); super.startTx(tx); this.tx = tx; }
@Override public boolean rollbackTx() throws Exception { rollbackPartitionOperations(); this.tx = null; return super.rollbackTx(); }
@Override public boolean commitTx() throws Exception { if (active) { throw new DataSetException("misbehaving"); } return super.commitTx(); }