dcapwell commented on code in PR #2660:
URL: https://github.com/apache/cassandra/pull/2660#discussion_r1313400155
##########
src/java/org/apache/cassandra/net/MessagingService.java:
##########
@@ -264,6 +239,36 @@ public static List<Version> supportedVersions()
return Collections.unmodifiableList(versions);
}
}
+ // Maintance Note:
+ // Try to keep Version enum in-sync for testing. By having the versions
in the enum tests can get access without forcing this class
+ // to load, which adds a lot of costs to each test
+ @Deprecated
+ public static final int VERSION_30 = 10;
+ @Deprecated
+ public static final int VERSION_3014 = 11;
+ public static final int VERSION_40 = 12;
+ public static final int VERSION_50 = 13; // c14227 TTL overflow, 'uint'
timestamps
+ public static final int minimum_version = VERSION_40;
+ public static final int current_version = Version.CURRENT.value;
+ static AcceptVersions accept_messaging = new
AcceptVersions(minimum_version, current_version);
+ static AcceptVersions accept_streaming = new
AcceptVersions(current_version, current_version);
+ static Map<Integer, Integer> versionOrdinalMap =
Arrays.stream(Version.values()).collect(Collectors.toMap(v -> v.value, v ->
v.ordinal()));
+
+ /**
+ * This is an optimisation to speed up the translation of the serialization
+ * version to the {@link Version} enum ordinal.
+ *
+ * @param version the serialization version
+ * @return a {@link Version} ordinal value
+ */
+ public static int getVersionOrdinal(int version)
Review Comment:
this isn't new, I moved the `Version` enum higher up and looks like git
thinks I removed and added here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]