public void add(TransactionLogRecord record) { Object key = record.getKey(); // there should be just one tx log for the same key. so if there is older we are removing it if (key != null) { TransactionLogRecord removed = recordMap.remove(key); if (removed != null) { recordList.remove(removed); } } recordList.add(record); if (key != null) { recordMap.put(key, record); } }
public void commitAsync(NodeEngine nodeEngine, ExecutionCallback callback) { for (TransactionLogRecord record : recordList) { invokeAsync(nodeEngine, callback, record, record.newCommitOperation()); } }
public void rollbackAsync(NodeEngine nodeEngine, ExecutionCallback callback) { for (TransactionLogRecord record : recordList) { invokeAsync(nodeEngine, callback, record, record.newRollbackOperation()); } }
public List<Future> prepare(NodeEngine nodeEngine) { List<Future> futures = new ArrayList<Future>(size()); for (TransactionLogRecord record : recordList) { Future future = invoke(nodeEngine, record, record.newPrepareOperation()); futures.add(future); } return futures; }
public List<Future> prepare(NodeEngine nodeEngine) { List<Future> futures = new ArrayList<Future>(size()); for (TransactionLogRecord record : recordList) { Future future = invoke(nodeEngine, record, record.newPrepareOperation()); futures.add(future); } return futures; }
public void commitAsync(NodeEngine nodeEngine, ExecutionCallback callback) { for (TransactionLogRecord record : recordList) { invokeAsync(nodeEngine, callback, record, record.newCommitOperation()); } }
public void rollbackAsync(NodeEngine nodeEngine, ExecutionCallback callback) { for (TransactionLogRecord record : recordList) { invokeAsync(nodeEngine, callback, record, record.newRollbackOperation()); } }
public void add(TransactionLogRecord record) { Object key = record.getKey(); // there should be just one tx log for the same key. so if there is older we are removing it if (key != null) { TransactionLogRecord removed = recordMap.remove(key); if (removed != null) { recordList.remove(removed); } } recordList.add(record); if (key != null) { recordMap.put(key, record); } }
public List<Future> commit(NodeEngine nodeEngine) { List<Future> futures = new ArrayList<Future>(size()); for (TransactionLogRecord record : recordList) { Future future = invoke(nodeEngine, record, record.newCommitOperation()); futures.add(future); } return futures; }
public List<Future> rollback(NodeEngine nodeEngine) { List<Future> futures = new ArrayList<Future>(size()); ListIterator<TransactionLogRecord> iterator = recordList.listIterator(size()); while (iterator.hasPrevious()) { TransactionLogRecord record = iterator.previous(); Future future = invoke(nodeEngine, record, record.newRollbackOperation()); futures.add(future); } return futures; }
public List<Future> commit(NodeEngine nodeEngine) { List<Future> futures = new ArrayList<Future>(size()); for (TransactionLogRecord record : recordList) { Future future = invoke(nodeEngine, record, record.newCommitOperation()); futures.add(future); } return futures; }
public List<Future> rollback(NodeEngine nodeEngine) { List<Future> futures = new ArrayList<Future>(size()); ListIterator<TransactionLogRecord> iterator = recordList.listIterator(size()); while (iterator.hasPrevious()) { TransactionLogRecord record = iterator.previous(); Future future = invoke(nodeEngine, record, record.newRollbackOperation()); futures.add(future); } return futures; }