@Test public void testTransactionCommitWithSubsequentExpiredCohortEntry() { dataStoreContextBuilder.shardTransactionCommitTimeoutInSeconds(1); final ShardTestKit testKit = new ShardTestKit(getSystem()); final TestActorRef<Shard> shard = actorFactory.createTestActor( newShardProps().withDispatcher(Dispatchers.DefaultDispatcherId()), "testTransactionCommitWithSubsequentExpiredCohortEntry"); ShardTestKit.waitUntilLeader(shard); final Duration duration = Duration.ofSeconds(5); final ShardDataTree dataStore = shard.underlyingActor().getDataStore(); final TransactionIdentifier transactionID1 = nextTransactionId(); shard.tell(prepareBatchedModifications(transactionID1, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME), false), testKit.getRef()); testKit.expectMsgClass(duration, ReadyTransactionReply.class); shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), testKit.getRef()); testKit.expectMsgClass(duration, CanCommitTransactionReply.class); final TransactionIdentifier transactionID2 = nextTransactionId(); shard.tell(prepareBatchedModifications(transactionID2, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME), false), testKit.getRef()); testKit.expectMsgClass(duration, ReadyTransactionReply.class); final TransactionIdentifier transactionID3 = nextTransactionId(); final DataTreeModification modification3 = dataStore.newModification(); new WriteModification(TestModel.TEST2_PATH, ImmutableNodes.containerNode(TestModel.TEST2_QNAME)) .apply(modification3); modification3.ready(); final ReadyLocalTransaction readyMessage = new ReadyLocalTransaction(transactionID3, modification3, true, Optional.empty()); shard.tell(readyMessage, testKit.getRef()); shard.tell(new CommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), testKit.getRef()); testKit.expectMsgClass(duration, CommitTransactionReply.class); testKit.expectMsgClass(duration, CommitTransactionReply.class); final NormalizedNode<?, ?> node = readStore(shard, TestModel.TEST2_PATH); assertNotNull(TestModel.TEST2_PATH + " not found", node); }
@VisibleForTesting public ShardDataTree getDataStore() { return store; }
Shard extends RaftActor { @VisibleForTesting public ShardDataTree getDataStore() { return store; } }
Shard extends RaftActor { @VisibleForTesting public ShardDataTree getDataStore() { return store; } protected  Shard(final AbstractBuilder<?, ?> builder); }
Shard extends RaftActor { @VisibleForTesting public ShardDataTree getDataStore() { return store; } protected  Shard(final AbstractBuilder<?, ?> builder); @Override void postStop(); int getPendingTxCommitQueueSize(); int getCohortCacheSize(); @Override @VisibleForTesting RaftActorSnapshotCohort getRaftActorSnapshotCohort(); Collection<?> convertPendingTransactionsToMessages(); @Override String persistenceId(); DatastoreContext getDatastoreContext(); @VisibleForTesting ShardDataTree getDataStore(); static Builder builder(); }
Shard extends RaftActor { @VisibleForTesting public ShardDataTree getDataStore() { return store; } protected  Shard(final AbstractBuilder<?, ?> builder); @Override void postStop(); int getPendingTxCommitQueueSize(); int getCohortCacheSize(); @Override @VisibleForTesting RaftActorSnapshotCohort getRaftActorSnapshotCohort(); Collection<?> convertPendingTransactionsToMessages(); @Override String persistenceId(); DatastoreContext getDatastoreContext(); @VisibleForTesting ShardDataTree getDataStore(); static Builder builder(); static final String DEFAULT_NAME; }