Remove Namespace.FLOATING_ID 42/104742/8
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 2 Mar 2023 19:36:10 +0000 (20:36 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Mar 2023 12:14:57 +0000 (14:14 +0200)
We do not allow for dynamically-allocated IDs. Remove the constant and
the corresponding special-case.

JIRA: CONTROLLER-2072
Change-Id: I7de4ec77bd6934cd89c78de406cf9e0c73fa2cd4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
third-party/atomix/storage/src/main/java/io/atomix/utils/serializer/Namespace.java

index 186464b97cd745bcb2484f2969c4819f6ec4ba73..9dcbded38bb6b4f19a6a56d5e7a4ad20ba2c052d 100644 (file)
@@ -54,11 +54,6 @@ public final class Namespace implements JournalSerdes, KryoFactory, KryoPool {
      */
     private static final int DEFAULT_BUFFER_SIZE = 4096;
 
-    /**
-     * ID to use if this KryoNamespace does not define registration id.
-     */
-    private static final int FLOATING_ID = -1;
-
     /**
      * Smallest ID free to use for user defined registrations.
      */
@@ -245,9 +240,6 @@ public final class Namespace implements JournalSerdes, KryoFactory, KryoPool {
 
         for (RegistrationBlock block : registeredBlocks) {
             int id = block.begin();
-            if (id == FLOATING_ID) {
-                id = kryo.getNextRegistrationId();
-            }
             for (Entry<Class<?>[], EntrySerializer<?>> entry : block.types()) {
                 register(kryo, entry.getKey(), entry.getValue(), id++);
             }