Add cds-access-api MAGNESIUM version 04/84704/9
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 25 Sep 2019 10:41:24 +0000 (12:41 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 25 Sep 2019 15:14:51 +0000 (15:14 +0000)
This adds a new ABI version, which uses Magnesium normalized node
stream.

JIRA: CONTROLLER-1919
Change-Id: Ie27b6cbd090b6f155c9600055ac6ef12304b1a99
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/ABIVersion.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/Message.java

index ee70447..90949db 100644 (file)
@@ -70,6 +70,16 @@ public enum ABIVersion implements WritableObject {
             return NormalizedNodeStreamVersion.SODIUM_SR1;
         }
     },
+    /**
+     * Revised ABI version. The messages remain the same as {@link #BORON}, but messages bearing QNames in any shape
+     * are using {@link NormalizedNodeStreamVersion#MAGNESIUM}, which improves encoding.
+     */
+    MAGNESIUM(8) {
+        @Override
+        public NormalizedNodeStreamVersion getStreamVersion() {
+            return NormalizedNodeStreamVersion.MAGNESIUM;
+        }
+    },
 
     /**
      * Version which is newer than any other version. This version exists purely for testing purposes.
@@ -133,8 +143,10 @@ public enum ABIVersion implements WritableObject {
                 return NEON_SR2;
             case 7:
                 return SODIUM_SR1;
+            case 8:
+                return MAGNESIUM;
             default:
-                throw new FutureVersionException(value, SODIUM_SR1);
+                throw new FutureVersionException(value, MAGNESIUM);
         }
     }
 
index 1d198fc..5456fbb 100644 (file)
@@ -114,6 +114,7 @@ public abstract class Message<T extends WritableIdentifier, C extends Message<T,
             case BORON:
             case NEON_SR2:
             case SODIUM_SR1:
+            case MAGNESIUM:
                 return verifyNotNull(cloneAsVersion(toVersion));
             case TEST_PAST_VERSION:
             case TEST_FUTURE_VERSION:

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.