public class SerializationConfig extends Object
HazelcastInstance
.Constructor and Description |
---|
SerializationConfig() |
SerializationConfig(SerializationConfig serializationConfig) |
public SerializationConfig()
public SerializationConfig(SerializationConfig serializationConfig)
public GlobalSerializerConfig getGlobalSerializerConfig()
GlobalSerializerConfig
public SerializationConfig setGlobalSerializerConfig(GlobalSerializerConfig globalSerializerConfig)
globalSerializerConfig
- configuration of serializer that will be used
if no other serializer is applicablepublic Collection<SerializerConfig> getSerializerConfigs()
SerializerConfig
spublic SerializationConfig addSerializerConfig(SerializerConfig serializerConfig)
serializerConfig
- serializer configuration of a class typeSerializerConfig
for chainingpublic SerializationConfig setSerializerConfigs(Collection<SerializerConfig> serializerConfigs)
serializerConfigs
- lists of serializer configs that will be registeredSerializerConfig
for chainingpublic int getPortableVersion()
public SerializationConfig setPortableVersion(int portableVersion)
portableVersion
- int value for the version of portable classesSerializerConfig
for chainingpublic Map<Integer,String> getDataSerializableFactoryClasses()
DataSerializableFactory
public SerializationConfig setDataSerializableFactoryClasses(Map<Integer,String> dataSerializableFactoryClasses)
dataSerializableFactoryClasses
- map of factory ID and corresponding factory class namesSerializerConfig
for chainingDataSerializableFactory
public SerializationConfig addDataSerializableFactoryClass(int factoryId, String dataSerializableFactoryClass)
factoryId
- factory ID of dataSerializableFactory to be registereddataSerializableFactoryClass
- name of dataSerializableFactory class to be registeredSerializerConfig
for chainingDataSerializableFactory
public SerializationConfig addDataSerializableFactoryClass(int factoryId, Class<? extends DataSerializableFactory> dataSerializableFactoryClass)
factoryId
- factory ID of dataSerializableFactory to be registereddataSerializableFactoryClass
- dataSerializableFactory class to be registeredSerializerConfig
for chainingDataSerializableFactory
public Map<Integer,DataSerializableFactory> getDataSerializableFactories()
DataSerializableFactory
public SerializationConfig setDataSerializableFactories(Map<Integer,DataSerializableFactory> dataSerializableFactories)
dataSerializableFactories
- map of factory ID and corresponding dataSerializable objectsSerializerConfig
for chainingDataSerializableFactory
public SerializationConfig addDataSerializableFactory(int factoryId, DataSerializableFactory dataSerializableFactory)
factoryId
- factory ID of DataSerializableFactory to be registereddataSerializableFactory
- DataSerializableFactory object to be registeredSerializerConfig
for chainingDataSerializableFactory
public Map<Integer,String> getPortableFactoryClasses()
PortableFactory
public SerializationConfig setPortableFactoryClasses(Map<Integer,String> portableFactoryClasses)
portableFactoryClasses
- map of factory ID and corresponding factory class namesSerializerConfig
for chainingPortableFactory
public SerializationConfig addPortableFactoryClass(int factoryId, Class<? extends PortableFactory> portableFactoryClass)
factoryId
- factory ID of portableFactory to be registeredportableFactoryClass
- portableFactory class to be registeredSerializerConfig
for chainingPortableFactory
public SerializationConfig addPortableFactoryClass(int factoryId, String portableFactoryClass)
factoryId
- factory ID of portableFactory to be registeredportableFactoryClass
- name of the portableFactory class to be registeredSerializerConfig
for chainingPortableFactory
public Map<Integer,PortableFactory> getPortableFactories()
PortableFactory
public SerializationConfig setPortableFactories(Map<Integer,PortableFactory> portableFactories)
portableFactories
- map of factory ID and corresponding factory objectsSerializerConfig
for chainingPortableFactory
public SerializationConfig addPortableFactory(int factoryId, PortableFactory portableFactory)
factoryId
- factory ID of portableFactory to be registeredportableFactory
- portableFactory object to be registeredSerializerConfig
for chainingPortableFactory
public Set<ClassDefinition> getClassDefinitions()
ClassDefinition
public SerializationConfig addClassDefinition(ClassDefinition classDefinition)
classDefinition
- the class definition to be registeredSerializerConfig
for chainingClassDefinition
public SerializationConfig setClassDefinitions(Set<ClassDefinition> classDefinitions)
classDefinitions
- set of class definitions to be registeredSerializerConfig
for chainingClassDefinition
public boolean isCheckClassDefErrors()
true
(enabled).
When enabled, serialization system will check for class definitions error at start and throw an Serialization
Exception with error definition.true
if enabled, false
otherwisepublic SerializationConfig setCheckClassDefErrors(boolean checkClassDefErrors)
checkClassDefErrors
- set to false
to disableSerializerConfig
for chainingpublic boolean isUseNativeByteOrder()
true
if serialization is configured to use native byte order of the underlying platformpublic SerializationConfig setUseNativeByteOrder(boolean useNativeByteOrder)
useNativeByteOrder
- set to true
to use native byte order of the underlying platformSerializerConfig
for chainingpublic ByteOrder getByteOrder()
public SerializationConfig setByteOrder(ByteOrder byteOrder)
byteOrder
- that serialization will useSerializerConfig
for chainingpublic boolean isEnableCompression()
true
if compression enabledpublic SerializationConfig setEnableCompression(boolean enableCompression)
enableCompression
- set to true
to enable compressionSerializerConfig
for chainingpublic boolean isEnableSharedObject()
Default value is true
.
true
if enabledpublic SerializationConfig setEnableSharedObject(boolean enableSharedObject)
enableSharedObject
- set to false
to disableSerializerConfig
for chainingpublic boolean isAllowUnsafe()
Default value is false
.
true
if using unsafe is allowed, false
otherwisepublic SerializationConfig setAllowUnsafe(boolean allowUnsafe)
allowUnsafe
- set to true
to allow usage of unsafeSerializerConfig
for chainingpublic boolean isAllowOverrideDefaultSerializers()
true
if default serializers may be overridden by custom serializerspublic SerializationConfig setAllowOverrideDefaultSerializers(boolean allowOverrideDefaultSerializers)
Default serializers are used heavily by the hazelcast internally. If any of the instance in the same cluster overrides a default serializer, all the members and clients in the same cluster must override it with the same serializer.
This configuration is introduced specifically to support the following case:
To be able to support Rolling Upgrade from an old version to the new version, one needs to make sure of the backward compatibility of the serialization. As a solution, the user will set this property on the new version so that new instances will be able to override new default serializers with their existing custom serializers.
allowOverrideDefaultSerializers
- value to setSerializerConfig
for chainingpublic JavaSerializationFilterConfig getJavaSerializationFilterConfig()
public SerializationConfig setJavaSerializationFilterConfig(JavaSerializationFilterConfig javaSerializationFilterConfig)
javaSerializationFilterConfig
- the javaSerializationFilterConfig to set (may be null
)public SerializationConfig setCompactSerializationConfig(@Nonnull CompactSerializationConfig compactSerializationConfig)
compactSerializationConfig
- config for the compact serialization formatSerializerConfig
for chainingpublic CompactSerializationConfig getCompactSerializationConfig()
Copyright © 2024 Hazelcast, Inc.. All rights reserved.