private static final AtomicInteger NEXT_SHARD_NUM = new AtomicInteger();
+ protected static final int HEARTBEAT_MILLIS = 100;
+
protected final ShardIdentifier shardID = ShardIdentifier.create("inventory", MemberName.forName("member-1"),
"config" + NEXT_SHARD_NUM.getAndIncrement());
protected final Builder dataStoreContextBuilder = DatastoreContext.newBuilder()
- .shardJournalRecoveryLogBatchSize(3).shardSnapshotBatchCount(5000).shardHeartbeatIntervalInMillis(100);
+ .shardJournalRecoveryLogBatchSize(3).shardSnapshotBatchCount(5000)
+ .shardHeartbeatIntervalInMillis(HEARTBEAT_MILLIS);
protected final TestActorFactory actorFactory = new TestActorFactory(getSystem());
}
public static void writeToStore(final ShardDataTree store, final YangInstanceIdentifier id,
- final NormalizedNode<?,?> node) throws Exception {
+ final NormalizedNode<?,?> node) throws DataValidationFailedException {
BatchedModifications batched = newBatchedModifications(nextTransactionId(), id, node, true, true, 1);
DataTreeModification modification = store.getDataTree().takeSnapshot().newModification();
batched.apply(modification);
}
public void mergeToStore(final ShardDataTree store, final YangInstanceIdentifier id,
- final NormalizedNode<?,?> node) throws Exception {
+ final NormalizedNode<?,?> node) throws DataValidationFailedException {
final BatchedModifications batched = new BatchedModifications(nextTransactionId(), CURRENT_VERSION);
batched.addModification(new MergeModification(id, node));
batched.setReady(true);