* participant instance should oppose RAFT candidates which produce persistence of an unsupported version. If a follower
* encounters an unsupported version it must not become fully-operational, as it does not have an accurate view
* of shard state.
- *
- * @author Robert Varga
*/
@Beta
public enum PayloadVersion implements WritableObject {
},
/**
- * ABI version as shipped in Sodium SR1 Simultaneous Release. QName-bearing messages are using
- * {@link NormalizedNodeStreamVersion#SODIUM_SR1}, which improves encoding.
+ * 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 {@code #MAGNESIUM}.
+ *
+ * @deprecated Use {@link #POTASSIUM} instead.
*/
- SODIUM_SR1(7) {
+ @Deprecated(since = "8.0.0", forRemoval = true)
+ CHLORINE_SR2(9) {
@Override
public NormalizedNodeStreamVersion getStreamVersion() {
- return NormalizedNodeStreamVersion.SODIUM_SR1;
+ return NormalizedNodeStreamVersion.MAGNESIUM;
}
},
/**
- * Revised payload version. Payloads remain the same as {@link #SODIUM_SR1}, but messages bearing QNames in any
- * shape are using {@link NormalizedNodeStreamVersion#MAGNESIUM}, which improves encoding.
+ * ABI version shipped enabled {@code 2023.09 Potassium}. This version removes Augmentation identifier and nodes.
+ * Otherwise this format is equivalent to {@link #CHLORINE_SR2}.
*/
- MAGNESIUM(8) {
+ POTASSIUM(10) {
@Override
public NormalizedNodeStreamVersion getStreamVersion() {
- return NormalizedNodeStreamVersion.MAGNESIUM;
+ return NormalizedNodeStreamVersion.POTASSIUM;
}
},
* @return Current {@link PayloadVersion}
*/
public static @NonNull PayloadVersion current() {
- return MAGNESIUM;
+ return POTASSIUM;
}
/**
*/
public static @NonNull PayloadVersion valueOf(final short version)
throws FutureVersionException, PastVersionException {
- switch (Short.toUnsignedInt(version)) {
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- throw new PastVersionException(version, SODIUM_SR1);
- case 7:
- return SODIUM_SR1;
- case 8:
- return MAGNESIUM;
- default:
- throw new FutureVersionException(version, MAGNESIUM);
- }
+ return switch (Short.toUnsignedInt(version)) {
+ case 0, 1, 2, 3, 4, 5, 6, 7, 8 -> throw new PastVersionException(version, CHLORINE_SR2);
+ case 9 -> CHLORINE_SR2;
+ case 10 -> POTASSIUM;
+ default -> throw new FutureVersionException(version, CHLORINE_SR2);
+ };
}
@Override
try {
return valueOf(s);
} catch (FutureVersionException | PastVersionException e) {
- throw new IOException("Unsupported version", e);
+ throw new IOException(e);
}
}
}