Interface TypeSerializerSnapshot<T>

    • Method Detail

      • getCurrentVersion

        int getCurrentVersion()
        Returns the version of the current snapshot's written binary format.
        Returns:
        the version of the current snapshot's written binary format.
      • readSnapshot

        void readSnapshot​(int readVersion,
                          DataInputView in,
                          ClassLoader userCodeClassLoader)
                   throws IOException
        Reads the serializer snapshot from the provided 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.
        Parameters:
        readVersion - version of the serializer snapshot's written binary format
        in - the DataInputView to read the snapshot from.
        userCodeClassLoader - the user code classloader
        Throws:
        IOException - Thrown if the snapshot data could be read or parsed.
        See Also:
        readVersionedSnapshot(DataInputView, ClassLoader)
      • restoreSerializer

        TypeSerializer<T> restoreSerializer()
        Recreates a serializer instance from this snapshot. The returned serializer can be safely used to read data written by the prior serializer (i.e., the serializer that created this snapshot).
        Returns:
        a serializer instance restored from this serializer snapshot.
      • resolveSchemaCompatibility

        TypeSerializerSchemaCompatibility<T> resolveSchemaCompatibility​(TypeSerializerSnapshot<T> oldSerializerSnapshot)
        Checks current serializer's compatibility to read data written by the prior serializer.

        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.

        This method must be implemented to clarify the compatibility. See FLIP-263 for more details.

        Parameters:
        oldSerializerSnapshot - the old serializer snapshot to check.
        Returns:
        the serializer compatibility result.