private void createBackupLog(String callerUuid, String txnId, boolean allowedDuringPassiveState) { TxBackupLog log = new TxBackupLog(Collections.<TransactionLogRecord>emptyList(), callerUuid, ACTIVE, -1, -1, allowedDuringPassiveState); if (txBackupLogs.putIfAbsent(txnId, log) != null) { throw new TransactionException("TxLog already exists!"); } }
public void replicaBackupLog(List<TransactionLogRecord> records, String callerUuid, String txnId, long timeoutMillis, long startTime) { TxBackupLog beginLog = txBackupLogs.get(txnId); if (beginLog == null) { throw new TransactionException("Could not find begin tx log!"); } if (beginLog.state != ACTIVE) { // the exception message is very strange throw new TransactionException("TxLog already exists!"); } TxBackupLog newTxBackupLog = new TxBackupLog(records, callerUuid, COMMITTING, timeoutMillis, startTime, beginLog.allowedDuringPassiveState); if (!txBackupLogs.replace(txnId, beginLog, newTxBackupLog)) { throw new TransactionException("TxLog already exists!"); } }
public void replicaBackupLog(List<TransactionLogRecord> records, String callerUuid, String txnId, long timeoutMillis, long startTime) { TxBackupLog beginLog = txBackupLogs.get(txnId); if (beginLog == null) { throw new TransactionException("Could not find begin tx log!"); } if (beginLog.state != ACTIVE) { // the exception message is very strange throw new TransactionException("TxLog already exists!"); } TxBackupLog newTxBackupLog = new TxBackupLog(records, callerUuid, COMMITTING, timeoutMillis, startTime, beginLog.allowedDuringPassiveState); if (!txBackupLogs.replace(txnId, beginLog, newTxBackupLog)) { throw new TransactionException("TxLog already exists!"); } }
private void createBackupLog(String callerUuid, String txnId, boolean allowedDuringPassiveState) { TxBackupLog log = new TxBackupLog(Collections.<TransactionLogRecord>emptyList(), callerUuid, ACTIVE, -1, -1, allowedDuringPassiveState); if (txBackupLogs.putIfAbsent(txnId, log) != null) { throw new TransactionException("TxLog already exists!"); } }