com.hazelcast.config
Class MapStoreConfig

java.lang.Object
  extended by com.hazelcast.config.MapStoreConfig
Direct Known Subclasses:
MapStoreConfigReadOnly

public class MapStoreConfig
extends Object

Contains the configuration for a Map Store.


Nested Class Summary
static class MapStoreConfig.InitialLoadMode
          Initial load module
 
Field Summary
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 Summary
MapStoreConfig()
           
MapStoreConfig(MapStoreConfig config)
           
 
Method Summary
 MapStoreConfigReadOnly getAsReadOnly()
           
 String getClassName()
          Returns the name of the MapStore implementation class
 String getFactoryClassName()
          Returns the name of the MapStoreFactory implementation class
 Object getFactoryImplementation()
          Returns the map store factory implementation object
 Object getImplementation()
          Returns the map store implementation object
 MapStoreConfig.InitialLoadMode getInitialLoadMode()
          Returns initial load mode
 Properties getProperties()
           
 String getProperty(String name)
           
 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.
 boolean isEnabled()
          Returns if this configuration is enabled
 boolean isWriteCoalescing()
          Returns true if write-coalescing is enabled.
 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 initial load mode

LAZY: Default load mode where load is async EAGER: load mode where load is blocked till all partitions are loaded

 MapStoreConfig setProperties(Properties properties)
           
 MapStoreConfig setProperty(String name, String value)
           
 MapStoreConfig setWriteBatchSize(int writeBatchSize)
          Sets the number of operations to be included in each batch processing round.
 void 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

Default value is 0.

 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_WRITE_DELAY_SECONDS

public static final int DEFAULT_WRITE_DELAY_SECONDS
Default delay seconds for writing

See Also:
Constant Field Values

DEFAULT_WRITE_BATCH_SIZE

public static final int DEFAULT_WRITE_BATCH_SIZE
Default batch size for writing

See Also:
Constant Field Values

DEFAULT_WRITE_COALESCING

public static final boolean DEFAULT_WRITE_COALESCING
Default write coalescing behavior

See Also:
Constant Field Values
Constructor Detail

MapStoreConfig

public MapStoreConfig()

MapStoreConfig

public MapStoreConfig(MapStoreConfig config)
Method Detail

getAsReadOnly

public MapStoreConfigReadOnly getAsReadOnly()

getClassName

public String getClassName()
Returns the name of the MapStore implementation class

Returns:
the name of the class

setClassName

public MapStoreConfig setClassName(String className)
Sets the name for the MapStore implementation class

Parameters:
className - the name of the MapStore implementation class to set

getFactoryClassName

public String getFactoryClassName()
Returns the name of the MapStoreFactory implementation class

Returns:
the name of the class

setFactoryClassName

public MapStoreConfig setFactoryClassName(String factoryClassName)
Sets the name for the MapStoreFactory implementation class

Parameters:
factoryClassName - the name of the MapStoreFactory implementation class to set

getWriteDelaySeconds

public int getWriteDelaySeconds()
Returns the number of seconds to delay the store writes.

Returns:
the number of delay seconds.

setWriteDelaySeconds

public MapStoreConfig setWriteDelaySeconds(int writeDelaySeconds)
Sets the number of seconds to delay before writing (storing) the dirty records

Default value is 0.

Parameters:
writeDelaySeconds - the number of seconds to delay.

getWriteBatchSize

public int getWriteBatchSize()
Returns the number of operations to be included in each batch processing round.

Returns:
write batch size.

setWriteBatchSize

public MapStoreConfig setWriteBatchSize(int writeBatchSize)
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.

isEnabled

public boolean isEnabled()
Returns if this configuration is enabled

Returns:
true if enabled, false otherwise

setEnabled

public MapStoreConfig setEnabled(boolean enabled)
Enables and disables this configuration

Parameters:
enabled -

setImplementation

public MapStoreConfig setImplementation(Object implementation)
Sets the map store implementation object

Parameters:
implementation - implementation object
Returns:
this MapStoreConfig instance

getImplementation

public Object getImplementation()
Returns the map store implementation object

Returns:
map store implementation object

setFactoryImplementation

public MapStoreConfig setFactoryImplementation(Object factoryImplementation)
Sets the map store factory implementation object

Parameters:
factoryImplementation - factory implementation object
Returns:
this MapStoreConfig instance

getFactoryImplementation

public Object getFactoryImplementation()
Returns the map store factory implementation object

Returns:
map store factory implementation object

setProperty

public MapStoreConfig setProperty(String name,
                                  String value)

getProperty

public String getProperty(String name)

getProperties

public Properties getProperties()

setProperties

public MapStoreConfig setProperties(Properties properties)

getInitialLoadMode

public MapStoreConfig.InitialLoadMode getInitialLoadMode()
Returns initial load mode

Returns:
initial load mode object

setInitialLoadMode

public MapStoreConfig setInitialLoadMode(MapStoreConfig.InitialLoadMode initialLoadMode)
Sets 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 - initial load mode object

isWriteCoalescing

public boolean isWriteCoalescing()
Returns true if write-coalescing is enabled.

Returns:
true if coalescing enabled, false otherwise.
See Also:
setWriteCoalescing(boolean)

setWriteCoalescing

public void setWriteCoalescing(boolean writeCoalescing)
Setting 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.

Parameters:
writeCoalescing - true to enable write-coalescing, false otherwise.
See Also:
GroupProperties.MAP_WRITE_BEHIND_QUEUE_CAPACITY

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.