@PublicEvolving @Deprecated public abstract class TypeSerializerConfigSnapshot<T> extends VersionedIOReadableWritable implements TypeSerializerSnapshot<T>
TypeSerializerSnapshot
).
Serializers that create snapshots and compatibility checks with the old interfaces extends this class
and should migrate to extend TypeSerializerSnapshot
to properly support state evolution/migration
and be future-proof.
Modifier and Type | Class and Description |
---|---|
static interface |
TypeSerializerConfigSnapshot.SelfResolvingTypeSerializer<E>
Deprecated.
This interface assists with the migration path to the new serialization abstraction.
|
Constructor and Description |
---|
TypeSerializerConfigSnapshot()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
int |
getCurrentVersion()
Deprecated.
Returns the version of the current snapshot's written binary format.
|
ClassLoader |
getUserCodeClassLoader()
Deprecated.
Returns the user code class loader.
|
void |
readSnapshot(int readVersion,
DataInputView in,
ClassLoader userCodeClassLoader)
Deprecated.
Reads the serializer snapshot from the provided
DataInputView . |
TypeSerializerSchemaCompatibility<T> |
resolveSchemaCompatibility(TypeSerializer<T> newSerializer)
Deprecated.
Checks a new serializer's compatibility to read data written by the prior serializer.
|
TypeSerializer<T> |
restoreSerializer()
Deprecated.
Creates a serializer using this configuration, that is capable of reading data
written by the serializer described by this configuration.
|
void |
setPriorSerializer(TypeSerializer<T> serializer)
Deprecated.
Set the originating serializer of this configuration snapshot.
|
void |
setUserCodeClassLoader(ClassLoader userCodeClassLoader)
Deprecated.
Set the user code class loader.
|
void |
writeSnapshot(DataOutputView out)
Deprecated.
Writes the serializer snapshot to the provided
DataOutputView . |
getCompatibleVersions, getReadVersion, read, write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
readVersionedSnapshot, writeVersionedSnapshot
getVersion
@Internal public final void setPriorSerializer(TypeSerializer<T> serializer)
@Internal public final void setUserCodeClassLoader(ClassLoader userCodeClassLoader)
This method is not part of the public user-facing API, and cannot be overriden.
userCodeClassLoader
- user code class loader.@Internal public final ClassLoader getUserCodeClassLoader()
public final int getCurrentVersion()
TypeSerializerSnapshot
getCurrentVersion
in interface TypeSerializerSnapshot<T>
public final void writeSnapshot(DataOutputView out) throws IOException
TypeSerializerSnapshot
DataOutputView
.
The current version of the written serializer snapshot's binary format
is specified by the TypeSerializerSnapshot.getCurrentVersion()
method.writeSnapshot
in interface TypeSerializerSnapshot<T>
out
- the DataOutputView
to write the snapshot to.IOException
- Thrown if the snapshot data could not be written.TypeSerializerSnapshot.writeVersionedSnapshot(DataOutputView, TypeSerializerSnapshot)
public final void readSnapshot(int readVersion, DataInputView in, ClassLoader userCodeClassLoader) throws IOException
TypeSerializerSnapshot
DataInputView
.
The version of the binary format that the serializer snapshot was written
with is provided. This version can be used to determine how the serializer
snapshot should be read.readSnapshot
in interface TypeSerializerSnapshot<T>
readVersion
- version of the serializer snapshot's written binary formatin
- the DataInputView
to read the snapshot from.userCodeClassLoader
- the user code classloaderIOException
- Thrown if the snapshot data could be read or parsed.TypeSerializerSnapshot.readVersionedSnapshot(DataInputView, ClassLoader)
public final TypeSerializer<T> restoreSerializer()
restoreSerializer
in interface TypeSerializerSnapshot<T>
public TypeSerializerSchemaCompatibility<T> resolveSchemaCompatibility(TypeSerializer<T> newSerializer)
TypeSerializerSnapshot
When a checkpoint/savepoint is restored, this method checks whether the serialization format of the data in the checkpoint/savepoint is compatible for the format of the serializer used by the program that restores the checkpoint/savepoint. The outcome can be that the serialization format is compatible, that the program's serializer needs to reconfigure itself (meaning to incorporate some information from the TypeSerializerSnapshot to be compatible), that the format is outright incompatible, or that a migration needed. In the latter case, the TypeSerializerSnapshot produces a serializer to deserialize the data, and the restoring program's serializer re-serializes the data, thus converting the format during the restore operation.
resolveSchemaCompatibility
in interface TypeSerializerSnapshot<T>
newSerializer
- the new serializer to check.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.