Switch identifiers to new proxies 85/103485/10
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 30 Nov 2022 22:07:11 +0000 (23:07 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 1 Dec 2022 16:39:36 +0000 (17:39 +0100)
We have more efficient serialization proxies defined, use them for
writeout and deprecate the old ones.

JIRA: CONTROLLER-2051
Change-Id: I1daa83e8fcdd3776951fc1c284c9e6d0d7f64078
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 files changed:
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/ClientIdentifier.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/FrontendIdentifier.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/FrontendType.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifier.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/MemberName.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/TransactionIdentifier.java
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/AbstractIdentifierTest.java
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/ClientIdentifierTest.java
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/FrontendIdentifierTest.java
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/FrontendTypeTest.java
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifierTest.java
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/MemberNameTest.java
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/TransactionIdentifierTest.java

index fc8a2a4954ee9e51dbf64eb18a9e476caac310bc..3468ed6a5d76e729e42e18f12e44c6233a4f4b06 100644 (file)
@@ -49,6 +49,7 @@ public final class ClientIdentifier implements WritableIdentifier {
         }
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     private static final class Proxy implements SerialForm {
         @java.io.Serial
         private static final long serialVersionUID = 1L;
@@ -142,6 +143,6 @@ public final class ClientIdentifier implements WritableIdentifier {
 
     @java.io.Serial
     private Object writeReplace() {
-        return new Proxy(this);
+        return new CI(this);
     }
 }
index 933aa16c79cbea78ba87f7120f02b9ecebc2dd53..10024a206e9d7ff7d290b7aeb8804b8ce5ca5f05 100644 (file)
@@ -45,6 +45,7 @@ public final class FrontendIdentifier implements WritableIdentifier {
         }
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     private static final class Proxy implements SerialForm {
         @java.io.Serial
         private static final long serialVersionUID = 1L;
@@ -135,6 +136,6 @@ public final class FrontendIdentifier implements WritableIdentifier {
 
     @java.io.Serial
     private Object writeReplace() {
-        return new Proxy(this);
+        return new FI(this);
     }
 }
index 3a25df7dc48447136740fda5624404409863270d..1ccdd69a07481557b4f99b2c1ee83fc51ea57d8a 100644 (file)
@@ -56,6 +56,7 @@ public final class FrontendType implements Comparable<FrontendType>, WritableIde
         }
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     private static final class Proxy implements SerialForm {
         @java.io.Serial
         private static final long serialVersionUID = 1L;
@@ -179,7 +180,7 @@ public final class FrontendType implements Comparable<FrontendType>, WritableIde
     }
 
     @java.io.Serial
-    Object writeReplace() {
-        return new Proxy(this);
+    private Object writeReplace() {
+        return new FT(this);
     }
 }
index 0e70edc76fb10d7c63e34f032722c4b5afbb2dfb..334f10291d9067a9612b4cfe73b29773588139c7 100644 (file)
@@ -64,6 +64,7 @@ public final class LocalHistoryIdentifier implements WritableIdentifier {
         }
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     private static final class Proxy implements SerialForm {
         @java.io.Serial
         private static final long serialVersionUID = 1L;
@@ -169,6 +170,6 @@ public final class LocalHistoryIdentifier implements WritableIdentifier {
 
     @java.io.Serial
     private Object writeReplace() {
-        return new Proxy(this);
+        return new HI(this);
     }
 }
index 41a91360757c1f4fa99010af842652ce1a8d3eea..47af6b3b1ebd01395aaeb1fd10e0183d29111398 100644 (file)
@@ -52,6 +52,7 @@ public final class MemberName implements Comparable<MemberName>, WritableIdentif
         }
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     private static final class Proxy implements SerialForm {
         @java.io.Serial
         private static final long serialVersionUID = 1L;
@@ -163,6 +164,6 @@ public final class MemberName implements Comparable<MemberName>, WritableIdentif
 
     @java.io.Serial
     Object writeReplace() {
-        return new Proxy(this);
+        return new MN(this);
     }
 }
index b03e2cd5c34e0a2ddf468e49c4e8b16376f35f4b..b5c652333ffec1fc842ae36a3a008cb915c192a0 100644 (file)
@@ -45,6 +45,7 @@ public final class TransactionIdentifier implements WritableIdentifier {
         }
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     private static final class Proxy implements SerialForm {
         @java.io.Serial
         private static final long serialVersionUID = 1L;
@@ -139,6 +140,6 @@ public final class TransactionIdentifier implements WritableIdentifier {
 
     @java.io.Serial
     private Object writeReplace() {
-        return new Proxy(this);
+        return new TI(this);
     }
 }
index 8fcc9fa1f5ffe1f7eabf3326f65982ac56ed6b64..74cd4cf3ba182d2b3ee3c805dba0b33991589f25 100644 (file)
@@ -42,7 +42,6 @@ public abstract class AbstractIdentifierTest<T extends Identifier> {
         assertEquals(object().hashCode(), equalObject().hashCode());
     }
 
-
     @Test
     public final void testSerialization() throws Exception {
         assertTrue(object().equals(copy(object())));
index 0908659487cec6282eab05fcfd217a5bbd0813f2..d9bd5c126b87704243fb56282f8f84e0a9e1b7cf 100644 (file)
@@ -32,6 +32,6 @@ public class ClientIdentifierTest extends AbstractIdentifierTest<ClientIdentifie
 
     @Override
     int expectedSize() {
-        return 114;
+        return 94;
     }
 }
index cc7124483b4e2de4683077df62e44321af6b1ca7..203ffd5ab90a8c4b59589914eed8bbec180d051f 100644 (file)
@@ -33,6 +33,6 @@ public class FrontendIdentifierTest extends AbstractIdentifierTest<FrontendIdent
 
     @Override
     int expectedSize() {
-        return 115;
+        return 93;
     }
 }
index 0cfd887d565dff9bc32f7aa136a795180b9d6499..904a27f2e51721f5f0af0e5ed520ba06c0ee46e3 100644 (file)
@@ -35,7 +35,7 @@ public class FrontendTypeTest extends AbstractIdentifierTest<FrontendType> {
 
     @Override
     int expectedSize() {
-        return 104;
+        return 88;
     }
 
     @Test
index 136aa5a0f31245aaffea0ae892ea798537e95fce..469916c68acc019de1606e7ca2d9883a98169400 100644 (file)
@@ -34,7 +34,7 @@ public class MemberNameTest extends AbstractIdentifierTest<MemberName> {
 
     @Override
     int expectedSize() {
-        return 101;
+        return 87;
     }
 
     @Test