NormalizedNodeAggregator should also report empty
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / persisted / ShardDataTreeSnapshot.java
index fd35046f04630461da0128ea7aaadd243df48a1c..7ae9fa288679601f2c17c8708f668808fdfd8ab4 100644 (file)
@@ -12,9 +12,8 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.Optional;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Abstract base class for snapshots of the ShardDataTree.
@@ -23,14 +22,12 @@ import org.slf4j.LoggerFactory;
  */
 @Beta
 public abstract class ShardDataTreeSnapshot {
-    private static final Logger LOG = LoggerFactory.getLogger(ShardDataTreeSnapshot.class);
-
     ShardDataTreeSnapshot() {
         // Hidden to prevent subclassing from outside of this package
     }
 
-    public static ShardDataTreeSnapshot deserialize(final ObjectInput in) throws IOException {
-        final ShardDataTreeSnapshot ret = AbstractVersionedShardDataTreeSnapshot.versionedDeserialize(in);
+    public static @NonNull ShardSnapshotState deserialize(final ObjectInput in) throws IOException {
+        final ShardSnapshotState ret = AbstractVersionedShardDataTreeSnapshot.versionedDeserialize(in);
 
         // Make sure we consume all bytes, otherwise something went very wrong
         final int bytesLeft = in.available();
@@ -38,7 +35,6 @@ public abstract class ShardDataTreeSnapshot {
             throw new IOException("Deserialization left " + bytesLeft + " in the buffer");
         }
 
-
         return ret;
     }
 
@@ -47,7 +43,7 @@ public abstract class ShardDataTreeSnapshot {
      *
      * @return An optional root node.
      */
-    public abstract Optional<NormalizedNode<?, ?>> getRootNode();
+    public abstract Optional<NormalizedNode> getRootNode();
 
     public abstract void serialize(ObjectOutput out) throws IOException;
 }