*/
package org.opendaylight.controller.cluster.datastore.persisted;
-import com.google.common.base.Verify;
+import static com.google.common.base.Verify.verifyNotNull;
+
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
static @NonNull ShardSnapshotState versionedDeserialize(final ObjectInput in) throws IOException {
final PayloadVersion version = PayloadVersion.readFrom(in);
switch (version) {
- case BORON:
- return new ShardSnapshotState(readSnapshot(in), true);
- case NEON_SR2:
case SODIUM_SR1:
+ return new ShardSnapshotState(readSnapshot(in), true);
+ case MAGNESIUM:
return new ShardSnapshotState(readSnapshot(in), false);
case TEST_FUTURE_VERSION:
case TEST_PAST_VERSION:
// These versions are never returned and this code is effectively dead
default:
// Not included as default in above switch to ensure we get warnings when new versions are added
- throw new IOException("Encountered unhandled version" + version);
+ throw new IOException("Encountered unhandled version " + version);
}
}
}
@Override
- public final Optional<NormalizedNode<?, ?>> getRootNode() {
- return Optional.of(Verify.verifyNotNull(rootNode(), "Snapshot %s returned non-present root node", getClass()));
+ public final Optional<NormalizedNode> getRootNode() {
+ return Optional.of(verifyNotNull(rootNode(), "Snapshot %s returned non-present root node", getClass()));
}
/**
*
* @return The root node.
*/
- abstract @NonNull NormalizedNode<?, ?> rootNode();
+ abstract @NonNull NormalizedNode rootNode();
/**
* Return the snapshot payload version. Implementations of this method should return a constant.
private void versionedSerialize(final ObjectOutput out, final PayloadVersion version) throws IOException {
switch (version) {
- case BORON:
- case NEON_SR2:
case SODIUM_SR1:
- // Boron, NeonSR2 and Sodium snapshots use Java Serialization, but differ in stream format
+ case MAGNESIUM:
+ // Sodium and Magnesium snapshots use Java Serialization, but differ in stream format
out.writeObject(this);
return;
case TEST_FUTURE_VERSION: