src/java/org/apache/cassandra/db/transaction/BatchMutateTransactionUtil.java
/**
     * @param check
     * @return map from transactionId to commitTime, or Long.MIN_VALUE if it's not yet committed
     */
@param check
@return map from transactionId to commitTime, or Long.MIN_VALUE if it's not yet committed
@param check @return map from transactionId to commitTime or Long . MIN_VALUE if it ' s not yet committed
public static Map<Long, Long> checkTransactions(CheckTransactionMessage check)
    {
        if (check.transactionIds.size() == 1 && check.transactionIds.iterator().next().equals(TransactionProxy.FAKE_PENDING_TRANSACTION_ID)) {
            logger.trace("Responding to checkTransaction for fake tranasaction, time={}", check.checkTime);
            Map<Long, Long> transactionIdToChecked = new HashMap<Long, Long>(check.transactionIds.size());
            transactionIdToChecked.put(TransactionProxy.FAKE_PENDING_TRANSACTION_ID, 0L);
            return transactionIdToChecked;
        }
        long checkTime = check.checkTime;
        Map<Long, Long> transactionIdToChecked = new HashMap<Long, Long>(check.transactionIds.size());
        for (Long transactionId : check.transactionIds) {
            BatchMutateTransactionCoordinator coordinator = BatchMutateTransactionCoordinator.findCoordinator(transactionId);
            Long commitTime;
            if (coordinator != null) {
                commitTime = coordinator.localCommitTime();
            } else {
                commitTime = transactionIdToLocalCommitTime.get(transactionId);
            }
            if (commitTime == null || commitTime > checkTime) {
                commitTime = Long.MIN_VALUE;
            }
            transactionIdToChecked.put(transactionId, commitTime);
        }
        return transactionIdToChecked;
    }
public static Map < Long , Long > checkTransactions ( CheckTransactionMessage check ) { if ( check . transactionIds . size ( ) == 1 && check . transactionIds . iterator ( ) . next ( ) . equals ( TransactionProxy . FAKE_PENDING_TRANSACTION_ID ) ) { logger . trace ( "Responding to checkTransaction for fake tranasaction, time={}" , check . checkTime ) ; Map < Long , Long > transactionIdToChecked = new HashMap < Long , Long > ( check . transactionIds . size ( ) ) ; transactionIdToChecked . put ( TransactionProxy . FAKE_PENDING_TRANSACTION_ID , 0L ) ; return transactionIdToChecked ; } long checkTime = check . checkTime ; Map < Long , Long > transactionIdToChecked = new HashMap < Long , Long > ( check . transactionIds . size ( ) ) ; for ( Long transactionId : check . transactionIds ) { BatchMutateTransactionCoordinator coordinator = BatchMutateTransactionCoordinator . findCoordinator ( transactionId ) ; Long commitTime ; if ( coordinator != null ) { commitTime = coordinator . localCommitTime ( ) ; } else { commitTime = transactionIdToLocalCommitTime . get ( transactionId ) ; } if ( commitTime == null || commitTime > checkTime ) { commitTime = Long . MIN_VALUE ; } transactionIdToChecked . put ( transactionId , commitTime ) ; } return transactionIdToChecked ; }
@param check
 @return map from transactionId to commitTime, or Long.MIN_VALUE if it's not yet committed
@param check @return map from transactionId to commitTime or Long . MIN_VALUE if it ' s not yet committed
// Special Case: A forced checkTransaction, just return true in this case //WL TODO: Could reduce the number of checkTransaction needed by returning the commitTime no matter what, if we know what it is //if commitTime after checkTime, set the value to null to signal this