* Serialization proxy for {@link AbortTransactionPayload}.
*/
final class AT implements SerialForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private TransactionIdentifier identifier;
import java.io.DataInput;
import java.io.IOException;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+import org.opendaylight.controller.cluster.raft.persisted.LegacySerializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*
* @author Robert Varga
*/
-public final class AbortTransactionPayload extends AbstractIdentifiablePayload<TransactionIdentifier> {
+public sealed class AbortTransactionPayload extends AbstractIdentifiablePayload<TransactionIdentifier> {
+ @Deprecated(since = "7.0.0", forRemoval = true)
+ private static final class Magnesium extends AbortTransactionPayload implements LegacySerializable {
+ @java.io.Serial
+ private static final long serialVersionUID = 1L;
+
+ Magnesium(final TransactionIdentifier transactionId, final byte[] serialized) {
+ super(transactionId, serialized);
+ }
+ }
+
+ @Deprecated(since = "7.0.0", forRemoval = true)
private static final class Proxy extends AbstractProxy<TransactionIdentifier> {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
// checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
// For Externalizable
}
- Proxy(final byte[] serialized) {
- super(serialized);
- }
-
@Override
protected TransactionIdentifier readIdentifier(final DataInput in) throws IOException {
return TransactionIdentifier.readFrom(in);
@Override
protected AbortTransactionPayload createObject(final TransactionIdentifier identifier,
final byte[] serialized) {
- return new AbortTransactionPayload(identifier, serialized);
+ return new Magnesium(identifier, serialized);
}
}
private static final Logger LOG = LoggerFactory.getLogger(AbortTransactionPayload.class);
+ @java.io.Serial
private static final long serialVersionUID = 1L;
- private static final int PROXY_SIZE = externalizableProxySize(Proxy::new);
+ private static final int PROXY_SIZE = externalizableProxySize(AT::new);
AbortTransactionPayload(final TransactionIdentifier transactionId, final byte[] serialized) {
super(transactionId, serialized);
}
@Override
- protected Proxy externalizableProxy(final byte[] serialized) {
- return new Proxy(serialized);
+ protected AT externalizableProxy(final byte[] serialized) {
+ return new AT(serialized);
}
@Override
*
* @return A payload.
*/
+ @java.io.Serial
Object readResolve();
/**
}
}
+ @Deprecated(since = "7.0.0", forRemoval = true)
protected abstract static class AbstractProxy<T extends Identifier> implements SerialForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private byte[] serialized;
}
@Override
- protected final Object writeReplace() {
+ public final Object writeReplace() {
return verifyNotNull(externalizableProxy(serialized));
}
- protected abstract @NonNull AbstractProxy<T> externalizableProxy(byte @NonNull[] serialized);
+ protected abstract @NonNull SerialForm externalizableProxy(byte @NonNull[] serialized);
protected abstract int externalizableProxySize();
- protected static final int externalizableProxySize(final Function<byte[], ? extends AbstractProxy<?>> constructor) {
+ protected static final int externalizableProxySize(final Function<byte[], ? extends SerialForm> constructor) {
return SerializationUtils.serialize(constructor.apply(new byte[0])).length;
}
}
final PayloadVersion version = PayloadVersion.readFrom(in);
switch (version) {
case SODIUM_SR1:
- return new ShardSnapshotState(readSnapshot(in), true);
case MAGNESIUM:
+ return new ShardSnapshotState(readSnapshot(in), true);
case CHLORINE_SR2:
return new ShardSnapshotState(readSnapshot(in), false);
case TEST_FUTURE_VERSION:
* Serialization proxy for {@link CreateLocalHistoryPayload}.
*/
final class CH implements SerialForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private LocalHistoryIdentifier identifier;
* Serialization proxy for {@link CommitTransactionPayload}.
*/
final class CT implements Externalizable {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private CommitTransactionPayload payload;
import java.io.DataInput;
import java.io.IOException;
import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
+import org.opendaylight.controller.cluster.raft.persisted.LegacySerializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*
* @author Robert Varga
*/
-public final class CloseLocalHistoryPayload extends AbstractIdentifiablePayload<LocalHistoryIdentifier> {
+public sealed class CloseLocalHistoryPayload extends AbstractIdentifiablePayload<LocalHistoryIdentifier> {
+ @Deprecated(since = "7.0.0", forRemoval = true)
+ private static final class Magnesium extends CloseLocalHistoryPayload implements LegacySerializable {
+ @java.io.Serial
+ private static final long serialVersionUID = 1L;
+
+ Magnesium(final LocalHistoryIdentifier historyId, final byte[] serialized) {
+ super(historyId, serialized);
+ }
+ }
+
+ @Deprecated(since = "7.0.0", forRemoval = true)
private static final class Proxy extends AbstractProxy<LocalHistoryIdentifier> {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
// checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
// For Externalizable
}
- Proxy(final byte[] serialized) {
- super(serialized);
- }
-
@Override
protected LocalHistoryIdentifier readIdentifier(final DataInput in) throws IOException {
return LocalHistoryIdentifier.readFrom(in);
@Override
protected CloseLocalHistoryPayload createObject(final LocalHistoryIdentifier identifier,
final byte[] serialized) {
- return new CloseLocalHistoryPayload(identifier, serialized);
+ return new Magnesium(identifier, serialized);
}
}
private static final Logger LOG = LoggerFactory.getLogger(CloseLocalHistoryPayload.class);
+ @java.io.Serial
private static final long serialVersionUID = 1L;
- private static final int PROXY_SIZE = externalizableProxySize(Proxy::new);
+ private static final int PROXY_SIZE = externalizableProxySize(CH::new);
CloseLocalHistoryPayload(final LocalHistoryIdentifier historyId, final byte[] serialized) {
super(historyId, serialized);
}
@Override
- protected Proxy externalizableProxy(final byte[] serialized) {
- return new Proxy(serialized);
+ protected DH externalizableProxy(final byte[] serialized) {
+ return new DH(serialized);
}
@Override
import org.opendaylight.controller.cluster.io.ChunkedByteArray;
import org.opendaylight.controller.cluster.io.ChunkedOutputStream;
import org.opendaylight.controller.cluster.raft.messages.IdentifiablePayload;
+import org.opendaylight.controller.cluster.raft.persisted.LegacySerializable;
import org.opendaylight.yangtools.concepts.Either;
import org.opendaylight.yangtools.yang.data.api.schema.stream.ReusableStreamReceiver;
import org.opendaylight.yangtools.yang.data.impl.schema.ReusableImmutableNormalizedNodeStreamWriter;
abstract DataInput newDataInput();
@Override
- protected final Object writeReplace() {
- return new Proxy(this);
+ public final Object writeReplace() {
+ return new CT(this);
}
- static final class Simple extends CommitTransactionPayload {
+ static sealed class Simple extends CommitTransactionPayload {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private final byte[] serialized;
}
}
- static final class Chunked extends CommitTransactionPayload {
+ static sealed class Chunked extends CommitTransactionPayload {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
@SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "Handled via serialization proxy")
// Exists to break initialization dependency between CommitTransactionPayload/Simple/Proxy
private static final class ProxySizeHolder {
- static final int PROXY_SIZE = SerializationUtils.serialize(new Proxy(new Simple(new byte[0]))).length;
+ static final int PROXY_SIZE = SerializationUtils.serialize(new CT(new Simple(new byte[0]))).length;
private ProxySizeHolder() {
// Hidden on purpose
}
}
+ @Deprecated(since = "7.0.0", forRemoval = true)
+ private static final class SimpleMagnesium extends Simple implements LegacySerializable {
+ @java.io.Serial
+ private static final long serialVersionUID = 1L;
+
+ SimpleMagnesium(final byte[] serialized) {
+ super(serialized);
+ }
+ }
+
+ @Deprecated(since = "7.0.0", forRemoval = true)
+ private static final class ChunkedMagnesium extends Chunked implements LegacySerializable {
+ @java.io.Serial
+ private static final long serialVersionUID = 1L;
+
+ ChunkedMagnesium(final ChunkedByteArray source) {
+ super(source);
+ }
+ }
+
+ @Deprecated(since = "7.0.0", forRemoval = true)
private static final class Proxy implements Externalizable {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private CommitTransactionPayload payload;
} else if (length < MAX_ARRAY_SIZE) {
final byte[] serialized = new byte[length];
in.readFully(serialized);
- payload = new Simple(serialized);
+ payload = new SimpleMagnesium(serialized);
} else {
- payload = new Chunked(ChunkedByteArray.readFrom(in, length, MAX_ARRAY_SIZE));
+ payload = new ChunkedMagnesium(ChunkedByteArray.readFrom(in, length, MAX_ARRAY_SIZE));
}
}
+ @java.io.Serial
private Object readResolve() {
return verifyNotNull(payload);
}
import java.io.DataInput;
import java.io.IOException;
import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
+import org.opendaylight.controller.cluster.raft.persisted.LegacySerializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*
* @author Robert Varga
*/
-public final class CreateLocalHistoryPayload extends AbstractIdentifiablePayload<LocalHistoryIdentifier> {
+public sealed class CreateLocalHistoryPayload extends AbstractIdentifiablePayload<LocalHistoryIdentifier> {
+ @Deprecated(since = "7.0.0", forRemoval = true)
+ private static final class Magnesium extends CreateLocalHistoryPayload implements LegacySerializable {
+ @java.io.Serial
+ private static final long serialVersionUID = 1L;
+
+ Magnesium(final LocalHistoryIdentifier historyId, final byte[] serialized) {
+ super(historyId, serialized);
+ }
+ }
+
+ @Deprecated(since = "7.0.0", forRemoval = true)
private static final class Proxy extends AbstractProxy<LocalHistoryIdentifier> {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
// checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
// For Externalizable
}
- Proxy(final byte[] serialized) {
- super(serialized);
- }
-
@Override
protected LocalHistoryIdentifier readIdentifier(final DataInput in) throws IOException {
return LocalHistoryIdentifier.readFrom(in);
@Override
protected CreateLocalHistoryPayload createObject(final LocalHistoryIdentifier identifier,
final byte[] serialized) {
- return new CreateLocalHistoryPayload(identifier, serialized);
+ return new Magnesium(identifier, serialized);
}
}
private static final Logger LOG = LoggerFactory.getLogger(CreateLocalHistoryPayload.class);
+ @java.io.Serial
private static final long serialVersionUID = 1L;
- private static final int PROXY_SIZE = externalizableProxySize(Proxy::new);
+ private static final int PROXY_SIZE = externalizableProxySize(CH::new);
CreateLocalHistoryPayload(final LocalHistoryIdentifier historyId, final byte[] serialized) {
super(historyId, serialized);
}
@Override
- protected Proxy externalizableProxy(final byte[] serialized) {
- return new Proxy(serialized);
+ protected CH externalizableProxy(final byte[] serialized) {
+ return new CH(serialized);
}
@Override
* Serialization proxy for {@link CloseLocalHistoryPayload}.
*/
final class DH implements SerialForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private LocalHistoryIdentifier identifier;
* Serialization proxy for {@link DatastoreSnapshot}.
*/
final class DS implements DatastoreSnapshot.SerialForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private DatastoreSnapshot datastoreSnapshot;
* Serialization proxy for {@link ShardDataTreeSnapshot}.
*/
final class DSS implements ShardSnapshot.SerialForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private ShardSnapshot shardSnapshot;
* Serialization proxy for {@link DisableTrackingPayload}.
*/
final class DT implements SerialForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private ClientIdentifier identifier;
import java.io.DataInput;
import java.io.IOException;
import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier;
+import org.opendaylight.controller.cluster.raft.persisted.LegacySerializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public final class DisableTrackingPayload extends AbstractIdentifiablePayload<ClientIdentifier> {
+public sealed class DisableTrackingPayload extends AbstractIdentifiablePayload<ClientIdentifier> {
+ @Deprecated(since = "7.0.0", forRemoval = true)
+ private static final class Magnesium extends DisableTrackingPayload implements LegacySerializable {
+ @java.io.Serial
+ private static final long serialVersionUID = 1L;
+
+ Magnesium(final ClientIdentifier clientId, final byte[] serialized) {
+ super(clientId, serialized);
+ }
+ }
+
+ @Deprecated(since = "7.0.0", forRemoval = true)
private static final class Proxy extends AbstractProxy<ClientIdentifier> {
@java.io.Serial
private static final long serialVersionUID = -5490519942445085251L;
// For Externalizable
}
- Proxy(final byte[] serialized) {
- super(serialized);
- }
-
@Override
protected ClientIdentifier readIdentifier(final DataInput in) throws IOException {
return ClientIdentifier.readFrom(in);
@Override
protected DisableTrackingPayload createObject(final ClientIdentifier identifier,
final byte[] serialized) {
- return new DisableTrackingPayload(identifier, serialized);
+ return new Magnesium(identifier, serialized);
}
}
private static final Logger LOG = LoggerFactory.getLogger(DisableTrackingPayload.class);
+ @java.io.Serial
private static final long serialVersionUID = 1L;
- private static final int PROXY_SIZE = externalizableProxySize(Proxy::new);
+ private static final int PROXY_SIZE = externalizableProxySize(DT::new);
DisableTrackingPayload(final ClientIdentifier clientId, final byte[] serialized) {
super(clientId, serialized);
}
@Override
- protected Proxy externalizableProxy(final byte[] serialized) {
- return new Proxy(serialized);
+ protected DT externalizableProxy(final byte[] serialized) {
+ return new DT(serialized);
}
@Override
* Externalizable proxy for {@link FrontendShardDataTreeSnapshotMetadata}.
*/
final class FM implements Externalizable {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private List<FrontendClientMetadata> clients;
clients = builder.build();
}
+ @java.io.Serial
private Object readResolve() {
return new FrontendShardDataTreeSnapshotMetadata(clients);
}
*/
final class MS implements Externalizable {
private static final Logger LOG = LoggerFactory.getLogger(MS.class);
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private Map<Class<? extends ShardDataTreeSnapshotMetadata<?>>, ShardDataTreeSnapshotMetadata<?>> metadata;
rootNode = stream.readNormalizedNode();
}
+ @java.io.Serial
private Object readResolve() {
return new MetadataShardDataTreeSnapshot(rootNode, metadata);
}
* Serialization proxy for {@link PurgeLocalHistoryPayload}.
*/
final class PH implements SerialForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private LocalHistoryIdentifier identifier;
* Serialization proxy for {@link PurgeTransactionPayload}.
*/
final class PT implements SerialForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private TransactionIdentifier identifier;
* ABI version as shipped in Sodium SR1 Simultaneous Release. QName-bearing messages are using
* {@link NormalizedNodeStreamVersion#SODIUM_SR1}, which improves encoding.
*/
+ @Deprecated(since = "7.0.0", forRemoval = true)
SODIUM_SR1(7) {
@Override
public NormalizedNodeStreamVersion getStreamVersion() {
* 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.
*/
+ @Deprecated(since = "7.0.0", forRemoval = true)
MAGNESIUM(8) {
@Override
public NormalizedNodeStreamVersion getStreamVersion() {
* @return Current {@link PayloadVersion}
*/
public static @NonNull PayloadVersion current() {
- return MAGNESIUM;
+ return CHLORINE_SR2;
}
/**
import java.io.DataInput;
import java.io.IOException;
import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
+import org.opendaylight.controller.cluster.raft.persisted.LegacySerializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*
* @author Robert Varga
*/
-public final class PurgeLocalHistoryPayload extends AbstractIdentifiablePayload<LocalHistoryIdentifier> {
+public sealed class PurgeLocalHistoryPayload extends AbstractIdentifiablePayload<LocalHistoryIdentifier> {
+ @Deprecated(since = "7.0.0", forRemoval = true)
+ private static final class Magnesium extends PurgeLocalHistoryPayload implements LegacySerializable {
+ @java.io.Serial
+ private static final long serialVersionUID = 1L;
+
+ Magnesium(final LocalHistoryIdentifier historyId, final byte[] serialized) {
+ super(historyId, serialized);
+ }
+ }
+
+ @Deprecated(since = "7.0.0", forRemoval = true)
private static final class Proxy extends AbstractProxy<LocalHistoryIdentifier> {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
// checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
// For Externalizable
}
- Proxy(final byte[] serialized) {
- super(serialized);
- }
-
@Override
protected LocalHistoryIdentifier readIdentifier(final DataInput in) throws IOException {
return LocalHistoryIdentifier.readFrom(in);
@Override
protected PurgeLocalHistoryPayload createObject(final LocalHistoryIdentifier identifier,
final byte[] serialized) {
- return new PurgeLocalHistoryPayload(identifier, serialized);
+ return new Magnesium(identifier, serialized);
}
}
private static final Logger LOG = LoggerFactory.getLogger(PurgeLocalHistoryPayload.class);
+ @java.io.Serial
private static final long serialVersionUID = 1L;
- private static final int PROXY_SIZE = externalizableProxySize(Proxy::new);
+ private static final int PROXY_SIZE = externalizableProxySize(PH::new);
PurgeLocalHistoryPayload(final LocalHistoryIdentifier historyId, final byte[] serialized) {
super(historyId, serialized);
}
@Override
- protected Proxy externalizableProxy(final byte[] serialized) {
- return new Proxy(serialized);
+ protected PH externalizableProxy(final byte[] serialized) {
+ return new PH(serialized);
}
@Override
import java.io.DataInput;
import java.io.IOException;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+import org.opendaylight.controller.cluster.raft.persisted.LegacySerializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*
* @author Robert Varga
*/
-public final class PurgeTransactionPayload extends AbstractIdentifiablePayload<TransactionIdentifier> {
+public sealed class PurgeTransactionPayload extends AbstractIdentifiablePayload<TransactionIdentifier> {
+ @Deprecated(since = "7.0.0", forRemoval = true)
+ private static final class Magnesium extends PurgeTransactionPayload implements LegacySerializable {
+ @java.io.Serial
+ private static final long serialVersionUID = 1L;
+
+ Magnesium(final TransactionIdentifier transactionId, final byte[] serialized) {
+ super(transactionId, serialized);
+ }
+ }
+
+ @Deprecated(since = "7.0.0", forRemoval = true)
private static final class Proxy extends AbstractProxy<TransactionIdentifier> {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
// checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
// For Externalizable
}
- Proxy(final byte[] serialized) {
- super(serialized);
- }
-
@Override
protected TransactionIdentifier readIdentifier(final DataInput in) throws IOException {
return TransactionIdentifier.readFrom(in);
@Override
protected PurgeTransactionPayload createObject(final TransactionIdentifier identifier,
final byte[] serialized) {
- return new PurgeTransactionPayload(identifier, serialized);
+ return new Magnesium(identifier, serialized);
}
}
private static final Logger LOG = LoggerFactory.getLogger(PurgeTransactionPayload.class);
+ @java.io.Serial
private static final long serialVersionUID = 1L;
- private static final int PROXY_SIZE = externalizableProxySize(Proxy::new);
+ private static final int PROXY_SIZE = externalizableProxySize(PT::new);
PurgeTransactionPayload(final TransactionIdentifier transactionId, final byte[] serialized) {
super(transactionId, serialized);
}
@Override
- protected Proxy externalizableProxy(final byte[] serialized) {
- return new Proxy(serialized);
+ protected PT externalizableProxy(final byte[] serialized) {
+ return new PT(serialized);
}
@Override
* Serialization proxy for {@link ShardManagerSnapshot}.
*/
final class SM implements ShardManagerSnapshot.SerializedForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private ShardManagerSnapshot snapshot;
public Object readResolve() {
return verifyNotNull(snapshot);
}
-
}
* Serialization proxy for {@link ShardSnapshotState}.
*/
final class SS implements ShardSnapshotState.SerialForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private ShardSnapshotState snapshotState;
* Serialization proxy for {@link SkipTransactionsPayload}.
*/
final class ST implements SerialForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private ImmutableUnsignedLongSet transactionIds;
*/
package org.opendaylight.controller.cluster.datastore.persisted;
-import static com.google.common.base.Verify.verifyNotNull;
import static java.util.Objects.requireNonNull;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.controller.cluster.raft.persisted.MigratedSerializable;
/**
* Represents the persisted snapshot state for the ShardManager.
*
* @author Thomas Pantelis
*/
-public final class ShardManagerSnapshot implements Serializable {
+public sealed class ShardManagerSnapshot implements Serializable {
interface SerializedForm extends Externalizable {
/**
* Return the serial form of this object contents, corresponding to {@link ShardManagerSnapshot#shardList}.
}
}
+ @Deprecated(since = "7.0.0", forRemoval = true)
+ private static final class Magnesium extends ShardManagerSnapshot implements MigratedSerializable {
+ @java.io.Serial
+ private static final long serialVersionUID = 1L;
+
+ Magnesium(final List<String> shardList) {
+ super(shardList);
+ }
+
+ @Override
+ public boolean isMigrated() {
+ return true;
+ }
+ }
+
+ @Deprecated(since = "7.0.0", forRemoval = true)
private static final class Proxy implements SerializedForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
- private ShardManagerSnapshot snapshot;
+ private ShardManagerSnapshot snapshot = null;
// checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
// redundant. It is explicitly needed for Java serialization to be able to create instances via reflection.
// For Externalizable
}
- Proxy(final ShardManagerSnapshot snapshot) {
- this.snapshot = snapshot;
- }
-
@Override
public List<String> shardNames() {
return snapshot.getShardList();
@Override
public Object readResolve() {
- return verifyNotNull(snapshot);
+ return new Magnesium(snapshot.getShardList());
}
}
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private final List<String> shardList;
this.shardList = ImmutableList.copyOf(shardList);
}
- public List<String> getShardList() {
+ public final List<String> getShardList() {
return shardList;
}
- private Object writeReplace() {
- return new Proxy(this);
+ @java.io.Serial
+ public final Object writeReplace() {
+ return new SM(this);
}
@Override
- public String toString() {
+ public final String toString() {
return "ShardManagerSnapshot [ShardList = " + shardList + " ]";
}
}
}
}
+ @Deprecated(since = "7.0.0", forRemoval = true)
private static final class Proxy implements SerialForm {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private ShardSnapshotState snapshotState;
// For Externalizable
}
- Proxy(final ShardSnapshotState snapshotState) {
- this.snapshotState = snapshotState;
- }
-
@Override
public ShardSnapshotState snapshotState() {
return snapshotState;
}
}
+ @java.io.Serial
private static final long serialVersionUID = 1L;
@SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "This field is not Serializable but this class "
return migrated;
}
+ @java.io.Serial
private Object writeReplace() {
- return new Proxy(this);
+ return new SS(this);
}
}
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
import org.opendaylight.controller.cluster.datastore.utils.ImmutableUnsignedLongSet;
+import org.opendaylight.controller.cluster.raft.persisted.LegacySerializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* for other purposes. It contains a {@link LocalHistoryIdentifier} and a list of transaction identifiers within that
* local history.
*/
-public final class SkipTransactionsPayload extends AbstractIdentifiablePayload<LocalHistoryIdentifier> {
+public sealed class SkipTransactionsPayload extends AbstractIdentifiablePayload<LocalHistoryIdentifier> {
+ private static final class Magnesium extends SkipTransactionsPayload implements LegacySerializable {
+ @java.io.Serial
+ private static final long serialVersionUID = 1L;
+
+ Magnesium(final LocalHistoryIdentifier historyId, final byte[] serialized,
+ final ImmutableUnsignedLongSet transactionIds) {
+ super(historyId, serialized, transactionIds);
+ }
+ }
+
+ @Deprecated(since = "7.0.0", forRemoval = true)
private static final class Proxy extends AbstractProxy<LocalHistoryIdentifier> {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private ImmutableUnsignedLongSet transactionIds;
// For Externalizable
}
- Proxy(final byte[] serialized) {
- super(serialized);
- }
-
@Override
protected LocalHistoryIdentifier readIdentifier(final DataInput in) throws IOException {
final var id = LocalHistoryIdentifier.readFrom(in);
@Override
protected SkipTransactionsPayload createObject(final LocalHistoryIdentifier identifier,
final byte[] serialized) {
- return new SkipTransactionsPayload(identifier, serialized, verifyNotNull(transactionIds));
+ return new Magnesium(identifier, serialized, verifyNotNull(transactionIds));
}
}
private static final Logger LOG = LoggerFactory.getLogger(SkipTransactionsPayload.class);
+ @java.io.Serial
private static final long serialVersionUID = 1L;
- private static final int PROXY_SIZE = externalizableProxySize(Proxy::new);
+ private static final int PROXY_SIZE = externalizableProxySize(ST::new);
@SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "Handled via externalizable proxy")
private final @NonNull ImmutableUnsignedLongSet transactionIds;
}
@Override
- protected Proxy externalizableProxy(final byte[] serialized) {
- return new Proxy(serialized);
+ protected ST externalizableProxy(final byte[] serialized) {
+ return new ST(serialized);
}
@Override
public class AbortTransactionPayloadTest extends AbstractIdentifiablePayloadTest<AbortTransactionPayload> {
public AbortTransactionPayloadTest() {
- super(AbortTransactionPayload.create(newTransactionId(0), 512), 264);
+ super(AbortTransactionPayload.create(newTransactionId(0), 512), 125);
}
}
public class CloseLocalHistoryPayloadTest extends AbstractIdentifiablePayloadTest<CloseLocalHistoryPayload> {
public CloseLocalHistoryPayloadTest() {
- super(CloseLocalHistoryPayload.create(newHistoryId(0), 512), 264);
+ super(CloseLocalHistoryPayload.create(newHistoryId(0), 512), 124);
}
}
public void testCandidateSerialization() throws IOException {
final CommitTransactionPayload payload = CommitTransactionPayload.create(nextTransactionId(), candidate);
assertEquals("payload size", 156, payload.size());
- assertEquals("serialized size", 270, SerializationUtils.serialize(payload).length);
+ assertEquals("serialized size", 242, SerializationUtils.serialize(payload).length);
}
@Test
public class CreateLocalHistoryPayloadTest extends AbstractIdentifiablePayloadTest<CreateLocalHistoryPayload> {
public CreateLocalHistoryPayloadTest() {
- super(CreateLocalHistoryPayload.create(newHistoryId(0), 512), 265);
+ super(CreateLocalHistoryPayload.create(newHistoryId(0), 512), 124);
}
}
public class PurgeLocalHistoryPayloadTest extends AbstractIdentifiablePayloadTest<PurgeLocalHistoryPayload> {
public PurgeLocalHistoryPayloadTest() {
- super(PurgeLocalHistoryPayload.create(newHistoryId(0), 512), 264);
+ super(PurgeLocalHistoryPayload.create(newHistoryId(0), 512), 124);
}
}
public class PurgeTransactionPayloadTest extends AbstractIdentifiablePayloadTest<PurgeTransactionPayload> {
public PurgeTransactionPayloadTest() {
- super(PurgeTransactionPayload.create(newTransactionId(0), 512), 264);
+ super(PurgeTransactionPayload.create(newTransactionId(0), 512), 125);
}
}
public class SkipTransactionsPayloadTest extends AbstractIdentifiablePayloadTest<SkipTransactionsPayload> {
public SkipTransactionsPayloadTest() {
- super(SkipTransactionsPayload.create(newHistoryId(0), MutableUnsignedLongSet.of(42).immutableCopy(), 512), 270);
+ super(SkipTransactionsPayload.create(newHistoryId(0), MutableUnsignedLongSet.of(42).immutableCopy(), 512), 131);
}
}