assertEquals("DatastoreSnapshotList size", 2, cloned.size());
assertDatastoreSnapshotEquals(legacyConfigSnapshot, cloned.get(0),
new org.opendaylight.controller.cluster.datastore.persisted.ShardManagerSnapshot(
- legacyShardManagerSnapshot.getShardList()),
+ legacyShardManagerSnapshot.getShardList(), Collections.emptyMap()),
Optional.of(legacyConfigRoot1), Optional.of(legacyConfigRoot2));
assertDatastoreSnapshotEquals(legacyOperSnapshot, cloned.get(1),
(org.opendaylight.controller.cluster.datastore.persisted.ShardManagerSnapshot)null,
}
@SuppressWarnings("unchecked")
- private void assertDatastoreSnapshotEquals(DatastoreSnapshot legacy,
- org.opendaylight.controller.cluster.datastore.persisted.DatastoreSnapshot actual,
- org.opendaylight.controller.cluster.datastore.persisted.ShardManagerSnapshot expShardMgrSnapshot,
- Optional<NormalizedNode<?, ?>>... shardRoots) throws IOException {
+ private static void assertDatastoreSnapshotEquals(final DatastoreSnapshot legacy,
+ final org.opendaylight.controller.cluster.datastore.persisted.DatastoreSnapshot actual,
+ final org.opendaylight.controller.cluster.datastore.persisted.ShardManagerSnapshot expShardMgrSnapshot,
+ final Optional<NormalizedNode<?, ?>>... shardRoots) throws IOException {
assertEquals("Type", legacy.getType(), actual.getType());
if (legacy.getShardManagerSnapshot() == null) {
}
}
- private static void assertSnapshotEquals(Snapshot expected, Optional<NormalizedNode<?, ?>> expRoot,
- org.opendaylight.controller.cluster.raft.persisted.Snapshot actual) throws IOException {
+ private static void assertSnapshotEquals(final Snapshot expected, final Optional<NormalizedNode<?, ?>> expRoot,
+ final org.opendaylight.controller.cluster.raft.persisted.Snapshot actual) throws IOException {
assertEquals("lastIndex", expected.getLastIndex(), actual.getLastIndex());
assertEquals("lastTerm", expected.getLastTerm(), actual.getLastTerm());
assertEquals("lastAppliedIndex", expected.getLastAppliedIndex(), actual.getLastAppliedIndex());
}
}
- private static ShardManagerSnapshot newLegacyShardManagerSnapshot(String... shards) {
+ private static ShardManagerSnapshot newLegacyShardManagerSnapshot(final String... shards) {
return ShardManagerSnapshot.forShardList(Arrays.asList(shards));
}
- private static DatastoreSnapshot.ShardSnapshot newLegacyShardSnapshot(String name,
- org.opendaylight.controller.cluster.raft.Snapshot snapshot) {
+ private static DatastoreSnapshot.ShardSnapshot newLegacyShardSnapshot(final String name,
+ final org.opendaylight.controller.cluster.raft.Snapshot snapshot) {
return new DatastoreSnapshot.ShardSnapshot(name, SerializationUtils.serialize(snapshot));
}
- private static Snapshot newLegacySnapshot(NormalizedNode<?, ?> root)
+ private static Snapshot newLegacySnapshot(final NormalizedNode<?, ?> root)
throws Exception {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
if (root != null) {
MetadataShardDataTreeSnapshot snapshot = new MetadataShardDataTreeSnapshot(root);
- try (final DataOutputStream dos = new DataOutputStream(bos)) {
+ try (DataOutputStream dos = new DataOutputStream(bos)) {
PayloadVersion.BORON.writeTo(dos);
try (ObjectOutputStream oos = new ObjectOutputStream(dos)) {
oos.writeObject(snapshot);
"member-1", null);
}
- private static NormalizedNode<?, ?> toRootNode(YangInstanceIdentifier path, NormalizedNode<?, ?> node)
+ private static NormalizedNode<?, ?> toRootNode(final YangInstanceIdentifier path, final NormalizedNode<?, ?> node)
throws DataValidationFailedException {
DataTree dataTree = InMemoryDataTreeFactory.getInstance().create(TreeType.OPERATIONAL);
dataTree.setSchemaContext(SchemaContextHelper.full());