import org.opendaylight.controller.cluster.datastore.modification.MutableCompositeModification;
import org.opendaylight.controller.cluster.datastore.modification.WriteModification;
import org.opendaylight.controller.cluster.datastore.persisted.CommitTransactionPayload;
-import org.opendaylight.controller.cluster.datastore.persisted.PreBoronShardDataTreeSnapshot;
+import org.opendaylight.controller.cluster.datastore.persisted.MetadataShardDataTreeSnapshot;
import org.opendaylight.controller.cluster.datastore.persisted.ShardSnapshotState;
import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
import org.opendaylight.controller.cluster.raft.TestActorFactory;
BatchedModifications batched = newBatchedModifications(nextTransactionId(), id, node, true, true, 1);
DataTreeModification modification = store.getDataTree().takeSnapshot().newModification();
batched.apply(modification);
- store.notifyListeners(store.commit(modification));
+ store.notifyListeners(commitTransaction(store.getDataTree(), modification));
}
public static void writeToStore(final DataTree store, final YangInstanceIdentifier id,
DataTreeModification modification = store.getDataTree().takeSnapshot().newModification();
batched.apply(modification);
- store.notifyListeners(store.commit(modification));
+ store.notifyListeners(commitTransaction(store.getDataTree(), modification));
}
DataTree setupInMemorySnapshotStore() throws DataValidationFailedException {
final NormalizedNode<?, ?> root = readStore(testStore, YangInstanceIdentifier.EMPTY);
InMemorySnapshotStore.addSnapshot(shardID.toString(), Snapshot.create(
- new ShardSnapshotState(new PreBoronShardDataTreeSnapshot(root)),
+ new ShardSnapshotState(new MetadataShardDataTreeSnapshot(root)),
Collections.<ReplicatedLogEntry>emptyList(), 0, 1, -1, -1, 1, null, null));
return testStore;
}
return mockCandidate;
}
- static void commitTransaction(final DataTree store, final DataTreeModification modification)
+ static DataTreeCandidate commitTransaction(final DataTree store, final DataTreeModification modification)
throws DataValidationFailedException {
modification.ready();
store.validate(modification);
- store.commit(store.prepare(modification));
+ final DataTreeCandidate candidate = store.prepare(modification);
+ store.commit(candidate);
+ return candidate;
}
@SuppressWarnings("serial")