Switch DatastoreSnapshot to new proxy 88/105888/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 11 May 2023 16:48:28 +0000 (18:48 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 11 May 2023 16:55:34 +0000 (18:55 +0200)
We have defined DS as the new proxy, but failed to switch to it. This
patch makes that switch.

JIRA: CONTROLLER-2077
Change-Id: I5de4514b2297ca39caadb02d0c30ab7b3dc8fc5c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/DatastoreSnapshot.java

index ec320918095251c055f1be1012079d24c12ecba8..5b026e45569cabe6765585089a49a729a5343092 100644 (file)
@@ -75,10 +75,6 @@ public final class DatastoreSnapshot implements Serializable {
             // For Externalizable
         }
 
-        Proxy(final DatastoreSnapshot datastoreSnapshot) {
-            this.datastoreSnapshot = requireNonNull(datastoreSnapshot);
-        }
-
         @Override
         public DatastoreSnapshot datastoreSnapshot() {
             return datastoreSnapshot;
@@ -95,6 +91,7 @@ public final class DatastoreSnapshot implements Serializable {
         }
     }
 
+    @java.io.Serial
     private static final long serialVersionUID = 1L;
 
     private final @NonNull String type;
@@ -120,8 +117,9 @@ public final class DatastoreSnapshot implements Serializable {
         return shardSnapshots;
     }
 
+    @java.io.Serial
     private Object writeReplace() {
-        return new Proxy(this);
+        return new DS(this);
     }
 
     public static final class ShardSnapshot implements Serializable {
@@ -147,6 +145,7 @@ public final class DatastoreSnapshot implements Serializable {
         }
 
         private static final class Proxy implements SerialForm {
+            @java.io.Serial
             private static final long serialVersionUID = 1L;
 
             private ShardSnapshot shardSnapshot;
@@ -178,6 +177,7 @@ public final class DatastoreSnapshot implements Serializable {
             }
         }
 
+        @java.io.Serial
         private static final long serialVersionUID = 1L;
 
         private final @NonNull String name;
@@ -196,6 +196,7 @@ public final class DatastoreSnapshot implements Serializable {
             return snapshot;
         }
 
+        @java.io.Serial
         private Object writeReplace() {
             return new Proxy(this);
         }