public class MapStoreConfig extends Object implements IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned
Modifier and Type | Class and Description |
---|---|
static class |
MapStoreConfig.InitialLoadMode
Initial load module
|
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_OFFLOAD
Default offload behavior
|
static int |
DEFAULT_WRITE_BATCH_SIZE
Default batch size for writing
|
static boolean |
DEFAULT_WRITE_COALESCING
Default write coalescing behavior
|
static int |
DEFAULT_WRITE_DELAY_SECONDS
Default delay seconds for writing
|
Constructor and Description |
---|
MapStoreConfig() |
MapStoreConfig(MapStoreConfig config) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getClassId()
Returns type identifier for this class.
|
String |
getClassName()
Returns the name of the MapStore implementation class
|
String |
getFactoryClassName()
Returns the name of the MapStoreFactory implementation class
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
Object |
getFactoryImplementation()
Returns the map store factory implementation object.
|
Object |
getImplementation()
Returns the map store implementation object.
|
MapStoreConfig.InitialLoadMode |
getInitialLoadMode()
Returns the initial load mode.
|
Properties |
getProperties()
Returns all the properties
|
String |
getProperty(String name)
Returns the given property
|
int |
getWriteBatchSize()
Returns the number of operations to be included in each batch processing round.
|
int |
getWriteDelaySeconds()
Returns the number of seconds to delay the store writes.
|
int |
hashCode() |
boolean |
isEnabled()
Returns if this configuration is enabled
|
boolean |
isOffload()
Default value is true.
|
boolean |
isWriteCoalescing()
Returns
true if write-coalescing is enabled. |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
MapStoreConfig |
setClassName(String className)
Sets the name for the MapStore implementation class
|
MapStoreConfig |
setEnabled(boolean enabled)
Enables and disables this configuration
|
MapStoreConfig |
setFactoryClassName(String factoryClassName)
Sets the name for the MapStoreFactory implementation class
|
MapStoreConfig |
setFactoryImplementation(Object factoryImplementation)
Sets the map store factory implementation object.
|
MapStoreConfig |
setImplementation(Object implementation)
Sets the map store implementation object
|
MapStoreConfig |
setInitialLoadMode(MapStoreConfig.InitialLoadMode initialLoadMode)
Sets the initial load mode.
|
MapStoreConfig |
setOffload(boolean offload)
Default value is true.
|
MapStoreConfig |
setProperties(Properties properties)
Sets the properties
|
MapStoreConfig |
setProperty(String name,
String value) |
MapStoreConfig |
setWriteBatchSize(int writeBatchSize)
Sets the number of operations to be included in each batch processing round.
|
MapStoreConfig |
setWriteCoalescing(boolean writeCoalescing)
Setting
writeCoalescing is meaningful
if you are using write-behind MapStore . |
MapStoreConfig |
setWriteDelaySeconds(int writeDelaySeconds)
Sets the number of seconds to delay before writing (storing) the dirty records
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final int DEFAULT_WRITE_DELAY_SECONDS
public static final int DEFAULT_WRITE_BATCH_SIZE
public static final boolean DEFAULT_WRITE_COALESCING
public static final boolean DEFAULT_OFFLOAD
public MapStoreConfig()
public MapStoreConfig(MapStoreConfig config)
public String getClassName()
public MapStoreConfig setClassName(@Nonnull String className)
className
- the name to set for the MapStore implementation classpublic String getFactoryClassName()
public MapStoreConfig setFactoryClassName(@Nonnull String factoryClassName)
factoryClassName
- the name to set for the MapStoreFactory implementation classpublic int getWriteDelaySeconds()
public MapStoreConfig setWriteDelaySeconds(int writeDelaySeconds)
Default value is 0.
writeDelaySeconds
- the number of seconds to delay before writing the dirty recordspublic int getWriteBatchSize()
public MapStoreConfig setWriteBatchSize(int writeBatchSize)
Default value is 1.
writeBatchSize
- the number of operations to be included in each batch processing roundpublic boolean isEnabled()
true
if this configuration is enabled, false
otherwisepublic MapStoreConfig setEnabled(boolean enabled)
enabled
- true
to enables this configuration, false
to disablepublic MapStoreConfig setOffload(boolean offload)
MapStore
interaction can be slow compared to in-memory
processing of data, to make partition threads available during
MapStore
interaction 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
, MapStore
interaction will be done on partition threads.
This may introduce latency for other operations
which don't require MapStore
interaction.
offload
- set true
to enable
offloading, otherwise set false
public boolean isOffload()
Enables and disables offloading behavior.
true
if this configuration
is enabled, false
otherwisesetOffload(boolean)
public MapStoreConfig setImplementation(@Nonnull Object implementation)
implementation
- the map store implementation object to setpublic Object getImplementation()
public MapStoreConfig setFactoryImplementation(@Nonnull Object factoryImplementation)
factoryImplementation
- the factory implementation objectpublic Object getFactoryImplementation()
public MapStoreConfig setProperty(String name, String value)
public String getProperty(String name)
public Properties getProperties()
public MapStoreConfig setProperties(Properties properties)
properties
- the properties to be setpublic MapStoreConfig.InitialLoadMode getInitialLoadMode()
public MapStoreConfig setInitialLoadMode(MapStoreConfig.InitialLoadMode initialLoadMode)
initialLoadMode
- the initial load mode objectpublic boolean isWriteCoalescing()
true
if write-coalescing is enabled.true
if coalescing enabled, false
otherwisesetWriteCoalescing(boolean)
public MapStoreConfig setWriteCoalescing(boolean writeCoalescing)
writeCoalescing
is meaningful
if you are using write-behind MapStore
.
When writeCoalescing
is true
, only the latest
store operation on a key in the writeDelaySeconds
time-window will be reflected to MapStore
.
Default value is true.
writeCoalescing
- true
to enable
write-coalescing, otherwise false
.ClusterProperty.MAP_WRITE_BEHIND_QUEUE_CAPACITY
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getClassId()
IdentifiedDataSerializable
getClassId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2022 Hazelcast, Inc.. All rights reserved.