Define PayloadVersion.CHLORINE_SR2 64/103464/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 29 Nov 2022 19:00:38 +0000 (20:00 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 29 Nov 2022 20:55:11 +0000 (21:55 +0100)
Add the definition of PayloadVersion.CHLORINE_SR2. This is backwards
compatiblein most senses.

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

index 5e85434e4aa38bba477a3b64bc470a961be317f8..be38f29b4493e57dcee559346226018191883039 100644 (file)
@@ -34,6 +34,7 @@ abstract class AbstractVersionedShardDataTreeSnapshot extends ShardDataTreeSnaps
             case SODIUM_SR1:
                 return new ShardSnapshotState(readSnapshot(in), true);
             case MAGNESIUM:
+            case CHLORINE_SR2:
                 return new ShardSnapshotState(readSnapshot(in), false);
             case TEST_FUTURE_VERSION:
             case TEST_PAST_VERSION:
@@ -77,6 +78,7 @@ abstract class AbstractVersionedShardDataTreeSnapshot extends ShardDataTreeSnaps
         switch (version) {
             case SODIUM_SR1:
             case MAGNESIUM:
+            case CHLORINE_SR2:
                 // Sodium and Magnesium snapshots use Java Serialization, but differ in stream format
                 out.writeObject(this);
                 return;
index 0cd939a36bae9279f22aa7a118f6691906a4b1f3..4eb5ad6c3745b941e2484fa51d0bf719fd1845a8 100644 (file)
@@ -71,6 +71,17 @@ public enum PayloadVersion implements WritableObject {
         }
     },
 
+    /**
+     * ABI version shipped enabled {@code 2022.09 Chlorine SR2}. This version revises the serialization format of
+     * payloads proxies to reduce their size. Otherwise this format is equivalent to {@link #MAGNESIUM}.
+     */
+    CHLORINE_SR2(9) {
+        @Override
+        public NormalizedNodeStreamVersion getStreamVersion() {
+            return NormalizedNodeStreamVersion.MAGNESIUM;
+        }
+    },
+
     /**
      * Version which is newer than any other version. This version exists purely for testing purposes.
      */
@@ -130,7 +141,8 @@ public enum PayloadVersion implements WritableObject {
             case 0, 1, 2, 3, 4, 5, 6 -> throw new PastVersionException(version, SODIUM_SR1);
             case 7 -> SODIUM_SR1;
             case 8 -> MAGNESIUM;
-            default -> throw new FutureVersionException(version, MAGNESIUM);
+            case 9 -> CHLORINE_SR2;
+            default -> throw new FutureVersionException(version, CHLORINE_SR2);
         };
     }