- void cleanupExpiredCohortEntries() {
- maybeProcessNextCohortEntry();
- }
-
- @VisibleForTesting
- void setCohortDecorator(CohortDecorator cohortDecorator) {
- this.cohortDecorator = cohortDecorator;
- }
-
- static class CohortEntry {
- private final String transactionID;
- private ShardDataTreeCohort cohort;
- private final ReadWriteShardDataTreeTransaction transaction;
- private RuntimeException lastBatchedModificationsException;
- private ActorRef replySender;
- private Shard shard;
- private boolean doImmediateCommit;
- private final Stopwatch lastAccessTimer = Stopwatch.createStarted();
- private int totalBatchedModificationsReceived;
-
- CohortEntry(String transactionID, ReadWriteShardDataTreeTransaction transaction) {
- this.transaction = Preconditions.checkNotNull(transaction);
- this.transactionID = transactionID;
- }
-
- CohortEntry(String transactionID, ShardDataTreeCohort cohort,
- MutableCompositeModification compositeModification) {
- this.transactionID = transactionID;
- this.cohort = cohort;
- this.transaction = null;
- }
-
- CohortEntry(String transactionID, ShardDataTreeCohort cohort) {
- this.transactionID = transactionID;
- this.cohort = cohort;
- this.transaction = null;
- }
-
- void updateLastAccessTime() {
- lastAccessTimer.reset();
- lastAccessTimer.start();
- }
-
- String getTransactionID() {
- return transactionID;
- }
-
- ShardDataTreeCohort getCohort() {
- return cohort;
- }
-
- int getTotalBatchedModificationsReceived() {
- return totalBatchedModificationsReceived;
- }