Package com.hazelcast.config
Class MapStoreConfig
java.lang.Object
com.hazelcast.config.MapStoreConfig
- All Implemented Interfaces:
DataSerializable,IdentifiedDataSerializable,com.hazelcast.nio.serialization.impl.Versioned
public class MapStoreConfig
extends Object
implements IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned
Contains the configuration for a Map Store.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanDefault offload behaviorstatic final intDefault batch size for writingstatic final booleanDefault write coalescing behaviorstatic final intDefault delay seconds for writing -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanintReturns type identifier for this class.Returns the name of the MapStore implementation classReturns the name of the MapStoreFactory implementation classintReturns DataSerializableFactory factory ID for this class.Returns the map store factory implementation object.Returns the map store implementation object.Returns the initial load mode.Returns all the propertiesgetProperty(String name) Returns the given propertyintReturns the number of operations to be included in each batch processing round.intReturns the number of seconds to delay the store writes.final inthashCode()booleanReturns if this configuration is enabledbooleanDefault value is true.booleanReturnstrueif write-coalescing is enabled.voidReads fields from the input streamsetClassName(String className) Sets the name for the MapStore implementation classsetEnabled(boolean enabled) Enables and disables this configurationsetFactoryClassName(String factoryClassName) Sets the name for the MapStoreFactory implementation classsetFactoryImplementation(Object factoryImplementation) Sets the map store factory implementation object.setImplementation(Object implementation) Sets the map store implementation objectsetInitialLoadMode(MapStoreConfig.InitialLoadMode initialLoadMode) Sets the initial load mode.setOffload(boolean offload) Default value is true.setProperties(Properties properties) Sets the propertiessetProperty(String name, String value) setWriteBatchSize(int writeBatchSize) Sets the number of operations to be included in each batch processing round.setWriteCoalescing(boolean writeCoalescing) SettingwriteCoalescingis meaningful if you are using write-behindMapStore.setWriteDelaySeconds(int writeDelaySeconds) Sets the number of seconds to delay before writing (storing) the dirty recordstoString()voidWrites object fields to output stream
-
Field Details
-
DEFAULT_WRITE_DELAY_SECONDS
public static final int DEFAULT_WRITE_DELAY_SECONDSDefault delay seconds for writing- See Also:
-
DEFAULT_WRITE_BATCH_SIZE
public static final int DEFAULT_WRITE_BATCH_SIZEDefault batch size for writing- See Also:
-
DEFAULT_WRITE_COALESCING
public static final boolean DEFAULT_WRITE_COALESCINGDefault write coalescing behavior- See Also:
-
DEFAULT_OFFLOAD
public static final boolean DEFAULT_OFFLOADDefault offload behavior- See Also:
-
-
Constructor Details
-
MapStoreConfig
public MapStoreConfig() -
MapStoreConfig
-
-
Method Details
-
getClassName
Returns the name of the MapStore implementation class- Returns:
- the name of the MapStore implementation class
-
setClassName
Sets the name for the MapStore implementation class- Parameters:
className- the name to set for the MapStore implementation class
-
getFactoryClassName
Returns the name of the MapStoreFactory implementation class- Returns:
- the name of the MapStoreFactory implementation class
-
setFactoryClassName
Sets the name for the MapStoreFactory implementation class- Parameters:
factoryClassName- the name to set for the MapStoreFactory implementation class
-
getWriteDelaySeconds
public int getWriteDelaySeconds()Returns the number of seconds to delay the store writes.- Returns:
- the number of seconds to delay the store writes
-
setWriteDelaySeconds
Sets the number of seconds to delay before writing (storing) the dirty recordsDefault value is 0.
- Parameters:
writeDelaySeconds- the number of seconds to delay before writing the dirty records
-
getWriteBatchSize
public int getWriteBatchSize()Returns the number of operations to be included in each batch processing round.- Returns:
- write batch size: the number of operations to be included in each batch processing round
-
setWriteBatchSize
Sets the number of operations to be included in each batch processing round.Default value is 1.
- Parameters:
writeBatchSize- the number of operations to be included in each batch processing round
-
isEnabled
public boolean isEnabled()Returns if this configuration is enabled- Returns:
trueif this configuration is enabled,falseotherwise
-
setEnabled
Enables and disables this configuration- Parameters:
enabled-trueto enables this configuration,falseto disable
-
setOffload
Default value is true.MapStoreinteraction can be slow compared to in-memory processing of data, to make partition threads available duringMapStoreinteraction for other cluster operations, MapStore/MapLoader implementations are offloaded from partition threads to a different thread pool by default.If you set this property to
false,MapStoreinteraction will be done on partition threads. This may introduce latency for other operations which don't requireMapStoreinteraction.- Parameters:
offload- settrueto enable offloading, otherwise setfalse- Since:
- 5.2
-
isOffload
public boolean isOffload()Default value is true.Enables and disables offloading behavior.
- Returns:
trueif this configuration is enabled,falseotherwise- Since:
- 5.2
- See Also:
-
setImplementation
Sets the map store implementation object- Parameters:
implementation- the map store implementation object to set- Returns:
- this MapStoreConfig instance
-
getImplementation
Returns the map store implementation object.- Returns:
- the map store implementation object
-
setFactoryImplementation
Sets the map store factory implementation object.- Parameters:
factoryImplementation- the factory implementation object- Returns:
- this MapStoreConfig instance
-
getFactoryImplementation
Returns the map store factory implementation object.- Returns:
- the map store factory implementation object
-
setProperty
-
getProperty
Returns the given property- Returns:
- the given property
-
getProperties
Returns all the properties- Returns:
- all the properties
-
setProperties
Sets the properties- Parameters:
properties- the properties to be set- Returns:
- this MapStoreConfig
-
getInitialLoadMode
Returns the initial load mode.- Returns:
- the initial load mode object
-
setInitialLoadMode
Sets the initial load mode.- LAZY: Default load mode where load is async
- EAGER: load mode where load is blocked till all partitions are loaded
- Parameters:
initialLoadMode- the initial load mode object
-
isWriteCoalescing
public boolean isWriteCoalescing()Returnstrueif write-coalescing is enabled.- Returns:
trueif coalescing enabled,falseotherwise- See Also:
-
setWriteCoalescing
SettingwriteCoalescingis meaningful if you are using write-behindMapStore.When
writeCoalescingistrue, only the latest store operation on a key in thewriteDelaySecondstime-window will be reflected toMapStore.Default value is true.
- Parameters:
writeCoalescing-trueto enable write-coalescing, otherwisefalse.- See Also:
-
toString
-
equals
-
hashCode
public final int hashCode() -
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializableReturns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryIdin interfaceIdentifiedDataSerializable- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassIdin interfaceIdentifiedDataSerializable- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializableWrites object fields to output stream- Specified by:
writeDatain interfaceDataSerializable- Parameters:
out- output- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializableReads fields from the input stream- Specified by:
readDatain interfaceDataSerializable- Parameters:
in- input- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the input stream has been closed.
-