- /**
- * Returns the cohort entry for the Tx commit currently in progress if the given transaction ID
- * matches the current entry.
- *
- * @param transactionID the ID of the transaction
- * @return the current CohortEntry or null if the given transaction ID does not match the
- * current entry.
- */
- public CohortEntry getCohortEntryIfCurrent(String transactionID) {
- if(isCurrentTransaction(transactionID)) {
- return currentCohortEntry;
- }
-
- return null;
- }
-
- public CohortEntry getCurrentCohortEntry() {
- return currentCohortEntry;
- }
-
- public CohortEntry getAndRemoveCohortEntry(String transactionID) {
- return cohortCache.remove(transactionID);
- }
-
- public boolean isCurrentTransaction(String transactionID) {
- return currentCohortEntry != null &&
- currentCohortEntry.getTransactionID().equals(transactionID);
- }
-
- /**
- * This method is called when a transaction is complete, successful or not. If the given
- * given transaction ID matches the current in-progress transaction, the next cohort entry,
- * if any, is dequeued and processed.
- *
- * @param transactionID the ID of the completed transaction
- * @param removeCohortEntry if true the CohortEntry for the transaction is also removed from
- * the cache.
- */
- public void currentTransactionComplete(String transactionID, boolean removeCohortEntry) {
- if(removeCohortEntry) {
- cohortCache.remove(transactionID);
- }
-
- if(isCurrentTransaction(transactionID)) {
- currentCohortEntry = null;
-
- log.debug("{}: currentTransactionComplete: {}", name, transactionID);
-
- maybeProcessNextCohortEntry();
+ @SuppressWarnings("checkstyle:IllegalCatch")
+ void handleAbort(final Identifier transactionID, final ActorRef sender, final Shard shard) {
+ CohortEntry cohortEntry = cohortCache.remove(transactionID);
+ if (cohortEntry == null) {
+ return;