T - the type of the data being migrated.@PublicEvolving public final class CompatibilityResult<T> extends Object
CompatibilityResult contains information about whether or not data migration
is required in order to continue using new serializers for previously serialized data.| Modifier and Type | Method and Description |
|---|---|
static <T> CompatibilityResult<T> |
compatible()
Returns a result that signals that the new serializer is compatible and no migration is required.
|
TypeDeserializer<T> |
getConvertDeserializer() |
boolean |
isRequiresMigration() |
static <T> CompatibilityResult<T> |
requiresMigration()
Returns a result that signals migration to be performed.
|
static <T> CompatibilityResult<T> |
requiresMigration(TypeDeserializer<T> convertDeserializer)
Returns a result that signals migration to be performed, and in the case that the preceding serializer
cannot be found or restored to read the previous data during migration, a provided convert deserializer
can be used.
|
static <T> CompatibilityResult<T> |
requiresMigration(TypeSerializer<T> convertSerializer)
Returns a result that signals migration to be performed, and in the case that the preceding serializer
cannot be found or restored to read the previous data during migration, a provided convert serializer
can be used.
|
public static <T> CompatibilityResult<T> compatible()
public static <T> CompatibilityResult<T> requiresMigration(@Nonnull TypeDeserializer<T> convertDeserializer)
T - the type of the data being migrated.convertDeserializer - the convert deserializer to use, in the case that the preceding serializer
cannot be found.public static <T> CompatibilityResult<T> requiresMigration(@Nonnull TypeSerializer<T> convertSerializer)
T - the type of the data being migrated.convertSerializer - the convert serializer to use, in the case that the preceding serializer
cannot be found. The provided serializer will only be used for deserialization.public static <T> CompatibilityResult<T> requiresMigration()
You can also provide a convert deserializer using requiresMigration(TypeDeserializer)
or requiresMigration(TypeSerializer), which will be used as a fallback resort in such cases.
public TypeDeserializer<T> getConvertDeserializer()
public boolean isRequiresMigration()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.