@Internal public final class SerializerConfigImpl extends Object implements SerializerConfig
SerializerConfig
.Constructor and Description |
---|
SerializerConfigImpl() |
SerializerConfigImpl(Configuration configuration,
ExecutionConfig executionConfig) |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultKryoSerializer(Class<?> type,
Class<? extends com.esotericsoftware.kryo.Serializer<?>> serializerClass)
Adds a new Kryo default serializer to the Runtime.
|
<T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> |
addDefaultKryoSerializer(Class<?> type,
T serializer)
Adds a new Kryo default serializer to the Runtime.
|
void |
configure(ReadableConfig configuration,
ClassLoader classLoader)
Sets all relevant options contained in the
ReadableConfig such as e.g. |
SerializerConfigImpl |
copy() |
boolean |
equals(Object obj) |
LinkedHashMap<Class<?>,Class<? extends com.esotericsoftware.kryo.Serializer<?>>> |
getDefaultKryoSerializerClasses()
Returns the registered default Kryo Serializer classes.
|
LinkedHashMap<Class<?>,ExecutionConfig.SerializableSerializer<?>> |
getDefaultKryoSerializers()
Returns the registered default Kryo Serializers.
|
ExecutionConfig |
getExecutionConfig()
Note: This method is used only for compatibility while
TypeInformation.createSerializer(ExecutionConfig) is
deprecated; If it is removed, this method will also be removed. |
LinkedHashSet<Class<?>> |
getRegisteredKryoTypes()
Returns the registered Kryo types.
|
LinkedHashSet<Class<?>> |
getRegisteredPojoTypes()
Returns the registered POJO types.
|
Map<Class<?>,Class<? extends TypeInfoFactory<?>>> |
getRegisteredTypeInfoFactories()
Returns the registered type info factories.
|
LinkedHashMap<Class<?>,Class<? extends com.esotericsoftware.kryo.Serializer<?>>> |
getRegisteredTypesWithKryoSerializerClasses()
Returns the registered types with their Kryo Serializer classes.
|
LinkedHashMap<Class<?>,ExecutionConfig.SerializableSerializer<?>> |
getRegisteredTypesWithKryoSerializers()
Returns the registered types with Kryo Serializers.
|
boolean |
hasGenericTypesDisabled()
Checks whether generic types are supported.
|
int |
hashCode() |
boolean |
isForceAvroEnabled()
Returns whether the Apache Avro is the serializer for POJOs.
|
TernaryBoolean |
isForceKryoAvroEnabled()
Returns whether forces Flink to register Apache Avro classes in Kryo serializer.
|
boolean |
isForceKryoEnabled()
Returns whether Kryo is the serializer for POJOs.
|
void |
registerKryoType(Class<?> type)
Registers the given type with the serialization stack.
|
void |
registerPojoType(Class<?> type)
Registers the given type with the serialization stack.
|
void |
registerTypeWithKryoSerializer(Class<?> type,
Class<? extends com.esotericsoftware.kryo.Serializer> serializerClass)
Registers the given Serializer via its class as a serializer for the given type at the
KryoSerializer.
|
<T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> |
registerTypeWithKryoSerializer(Class<?> type,
T serializer)
Registers the given type with a Kryo Serializer.
|
void |
setForceAvro(boolean forceAvro)
The method will be converted to private in the next Flink major version after removing its
deprecated caller methods.
|
void |
setForceKryo(boolean forceKryo)
The method will be converted to private in the next Flink major version after removing its
deprecated caller methods.
|
void |
setForceKryoAvro(boolean forceKryoAvro)
The method will be converted to private in the next Flink major version after removing its
deprecated caller methods.
|
void |
setGenericTypes(boolean genericTypes)
The method will be converted to private in the next Flink major version after removing its
deprecated caller methods.
|
String |
toString() |
public SerializerConfigImpl()
@Internal public SerializerConfigImpl(Configuration configuration, ExecutionConfig executionConfig)
public <T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> void addDefaultKryoSerializer(Class<?> type, T serializer)
Note that the serializer instance must be serializable (as defined by java.io.Serializable), because it may be distributed to the worker nodes by java serialization.
addDefaultKryoSerializer
in interface SerializerConfig
type
- The class of the types serialized with the given serializer.serializer
- The serializer to use.public void addDefaultKryoSerializer(Class<?> type, Class<? extends com.esotericsoftware.kryo.Serializer<?>> serializerClass)
addDefaultKryoSerializer
in interface SerializerConfig
type
- The class of the types serialized with the given serializer.serializerClass
- The class of the serializer to use.public <T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> void registerTypeWithKryoSerializer(Class<?> type, T serializer)
Note that the serializer instance must be serializable (as defined by java.io.Serializable), because it may be distributed to the worker nodes by java serialization.
registerTypeWithKryoSerializer
in interface SerializerConfig
type
- The class of the types serialized with the given serializer.serializer
- The serializer to use.public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends com.esotericsoftware.kryo.Serializer> serializerClass)
registerTypeWithKryoSerializer
in interface SerializerConfig
type
- The class of the types serialized with the given serializer.serializerClass
- The class of the serializer to use.public void registerPojoType(Class<?> type)
registerPojoType
in interface SerializerConfig
type
- The class of the type to register.public void registerKryoType(Class<?> type)
registerKryoType
in interface SerializerConfig
type
- The class of the type to register.public LinkedHashMap<Class<?>,ExecutionConfig.SerializableSerializer<?>> getRegisteredTypesWithKryoSerializers()
getRegisteredTypesWithKryoSerializers
in interface SerializerConfig
public LinkedHashMap<Class<?>,Class<? extends com.esotericsoftware.kryo.Serializer<?>>> getRegisteredTypesWithKryoSerializerClasses()
getRegisteredTypesWithKryoSerializerClasses
in interface SerializerConfig
public LinkedHashMap<Class<?>,ExecutionConfig.SerializableSerializer<?>> getDefaultKryoSerializers()
getDefaultKryoSerializers
in interface SerializerConfig
public LinkedHashMap<Class<?>,Class<? extends com.esotericsoftware.kryo.Serializer<?>>> getDefaultKryoSerializerClasses()
getDefaultKryoSerializerClasses
in interface SerializerConfig
public LinkedHashSet<Class<?>> getRegisteredKryoTypes()
getRegisteredKryoTypes
in interface SerializerConfig
public LinkedHashSet<Class<?>> getRegisteredPojoTypes()
getRegisteredPojoTypes
in interface SerializerConfig
public Map<Class<?>,Class<? extends TypeInfoFactory<?>>> getRegisteredTypeInfoFactories()
getRegisteredTypeInfoFactories
in interface SerializerConfig
public boolean hasGenericTypesDisabled()
Generic types are enabled by default.
hasGenericTypesDisabled
in interface SerializerConfig
public void setGenericTypes(boolean genericTypes)
SerializerConfig
setGenericTypes
in interface SerializerConfig
public boolean isForceKryoEnabled()
isForceKryoEnabled
in interface SerializerConfig
public void setForceKryo(boolean forceKryo)
SerializerConfig
setForceKryo
in interface SerializerConfig
public boolean isForceAvroEnabled()
isForceAvroEnabled
in interface SerializerConfig
public void setForceAvro(boolean forceAvro)
SerializerConfig
setForceAvro
in interface SerializerConfig
public void setForceKryoAvro(boolean forceKryoAvro)
SerializerConfig
setForceKryoAvro
in interface SerializerConfig
public TernaryBoolean isForceKryoAvroEnabled()
SerializerConfig
isForceKryoAvroEnabled
in interface SerializerConfig
public void configure(ReadableConfig configuration, ClassLoader classLoader)
ReadableConfig
such as e.g. PipelineOptions.FORCE_KRYO
.
It will change the value of a setting only if a corresponding option was set in the configuration
. If a key is not present, the current value of a field will remain untouched.
configure
in interface SerializerConfig
configuration
- a configuration to read the values fromclassLoader
- a class loader to use when loading classespublic ExecutionConfig getExecutionConfig()
TypeInformation.createSerializer(ExecutionConfig)
is
deprecated; If it is removed, this method will also be removed.public SerializerConfigImpl copy()
copy
in interface SerializerConfig
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.