Package com.hazelcast.config
Class QueueStoreConfig
- java.lang.Object
-
- com.hazelcast.config.QueueStoreConfig
-
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
public class QueueStoreConfig extends java.lang.Object implements IdentifiedDataSerializable
Configuration for theQueueStore
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_BULK_LOAD
The default size of batches in which the queue will be loaded from the queue store.static int
DEFAULT_MEMORY_LIMIT
The default number of queue item values to keep in memory.static java.lang.String
STORE_BINARY
Binary: By default, Hazelcast stores the queue items in serialized form in memory.static java.lang.String
STORE_BULK_LOAD
Bulk Load: When the queue is initialized, items are loaded from QueueStore in bulks.static java.lang.String
STORE_MEMORY_LIMIT
Memory Limit: This is the number of items after which Hazelcast will store items only to datastore.
-
Constructor Summary
Constructors Constructor Description QueueStoreConfig()
QueueStoreConfig(QueueStoreConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getClassId()
Returns type identifier for this class.java.lang.String
getClassName()
Returns the class name of the queue store implementation to be used when instantiating the queue store.java.lang.String
getFactoryClassName()
Returns the factory class name which will be used to instantiate the queue store.int
getFactoryId()
Returns DataSerializableFactory factory ID for this class.QueueStoreFactory
getFactoryImplementation()
Returns the queue store factory implementation which will be used to instantiate the queue store.java.util.Properties
getProperties()
Returns the properties to be used when instantiating the queue store.java.lang.String
getProperty(java.lang.String name)
Returns the property with the givenname
which is used when instantiating and interacting with the queue store.QueueStore
getStoreImplementation()
Returns the implementation of the queue store which will be used to store queue items.int
hashCode()
boolean
isEnabled()
Returnstrue
if the queue store is enabled,false
otherwise.void
readData(ObjectDataInput in)
Reads fields from the input streamQueueStoreConfig
setClassName(java.lang.String className)
Sets the class name of the queue store implementation to be used when instantiating the queue store.QueueStoreConfig
setEnabled(boolean enabled)
Enables or disables the queue store.QueueStoreConfig
setFactoryClassName(java.lang.String factoryClassName)
Sets the factory class name which will be used to instantiate the queue store.QueueStoreConfig
setFactoryImplementation(QueueStoreFactory factoryImplementation)
Sets the queue store factory implementation which will be used to instantiate the queue store.QueueStoreConfig
setProperties(java.util.Properties properties)
Sets the properties to be used when instantiating the queue store.QueueStoreConfig
setProperty(java.lang.String name, java.lang.String value)
Sets a property to be used when instantiating the queue store.QueueStoreConfig
setStoreImplementation(QueueStore storeImplementation)
Sets the implementation of the queue store which will be used to store queue items.java.lang.String
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
-
-
Field Detail
-
DEFAULT_MEMORY_LIMIT
public static final int DEFAULT_MEMORY_LIMIT
The default number of queue item values to keep in memory. This value is ignored if there is no queue store enabled or if the queue is a priority queue.- See Also:
- Constant Field Values
-
DEFAULT_BULK_LOAD
public static final int DEFAULT_BULK_LOAD
The default size of batches in which the queue will be loaded from the queue store. This value is ignored if the queue is a priority queue. In that case, the queue is loaded fully during initialisation.- See Also:
- Constant Field Values
-
STORE_BINARY
public static final java.lang.String STORE_BINARY
Binary: By default, Hazelcast stores the queue items in serialized form in memory. Before it inserts the queue items into datastore, it deserializes them. But if you will not reach the queue store from an external application, you might prefer that the items be inserted in binary form. You can get rid of the de-serialization step; this would be a performance optimization. The binary feature is disabled by default.- See Also:
- Constant Field Values
-
STORE_MEMORY_LIMIT
public static final java.lang.String STORE_MEMORY_LIMIT
Memory Limit: This is the number of items after which Hazelcast will store items only to datastore. For example, if the memory limit is 1000, then the 1001st item will be put only to datastore. This feature is useful when you want to avoid out-of-memory conditions. The default number for memory-limit is 1000. If you want to always use memory, you can set it to Integer.MAX_VALUE.- See Also:
- Constant Field Values
-
STORE_BULK_LOAD
public static final java.lang.String STORE_BULK_LOAD
Bulk Load: When the queue is initialized, items are loaded from QueueStore in bulks. Bulk load is the size of these bulks. By default, bulk-load is 250.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
QueueStoreConfig
public QueueStoreConfig()
-
QueueStoreConfig
public QueueStoreConfig(QueueStoreConfig config)
-
-
Method Detail
-
getStoreImplementation
@Nullable public QueueStore getStoreImplementation()
Returns the implementation of the queue store which will be used to store queue items.
-
setStoreImplementation
public QueueStoreConfig setStoreImplementation(@Nonnull QueueStore storeImplementation)
Sets the implementation of the queue store which will be used to store queue items.- Parameters:
storeImplementation
- the implementation to store queue items- Returns:
- this configuration
- Throws:
java.lang.NullPointerException
- if the provided implementation isnull
-
isEnabled
public boolean isEnabled()
Returnstrue
if the queue store is enabled,false
otherwise.
-
setEnabled
public QueueStoreConfig setEnabled(boolean enabled)
Enables or disables the queue store.- Parameters:
enabled
-true
to enable the queue store,false
to disable it- Returns:
- this configuration
-
getClassName
@Nullable public java.lang.String getClassName()
Returns the class name of the queue store implementation to be used when instantiating the queue store.
-
setClassName
public QueueStoreConfig setClassName(@Nonnull java.lang.String className)
Sets the class name of the queue store implementation to be used when instantiating the queue store. The class should implement theQueueStore
interface.- Parameters:
className
- the queue store class name- Returns:
- this configuration
-
getProperties
public java.util.Properties getProperties()
Returns the properties to be used when instantiating the queue store. Some properties are used by Hazelcast to determine how to interact with the queue store (seeSTORE_MEMORY_LIMIT
,STORE_BINARY
andSTORE_BULK_LOAD
).
-
setProperties
public QueueStoreConfig setProperties(java.util.Properties properties)
Sets the properties to be used when instantiating the queue store. Some properties are used by Hazelcast to determine how to interact with the queue store (seeSTORE_MEMORY_LIMIT
,STORE_BINARY
andSTORE_BULK_LOAD
).- Parameters:
properties
- the properties to be used when instantiating the queue store- Returns:
- this configuration
-
getProperty
public java.lang.String getProperty(java.lang.String name)
Returns the property with the givenname
which is used when instantiating and interacting with the queue store.- Parameters:
name
- the property name- Returns:
- the property value
-
setProperty
public QueueStoreConfig setProperty(java.lang.String name, java.lang.String value)
Sets a property to be used when instantiating the queue store. Some properties are used by Hazelcast to determine how to interact with the queue store (seeSTORE_MEMORY_LIMIT
,STORE_BINARY
andSTORE_BULK_LOAD
).- Parameters:
name
- the property namevalue
- the property value- Returns:
- this configuration
-
getFactoryClassName
@Nullable public java.lang.String getFactoryClassName()
Returns the factory class name which will be used to instantiate the queue store. The class should implement theQueueStoreFactory
interface.
-
setFactoryClassName
public QueueStoreConfig setFactoryClassName(@Nonnull java.lang.String factoryClassName)
Sets the factory class name which will be used to instantiate the queue store. The class should implement theQueueStoreFactory
interface.- Parameters:
factoryClassName
- the queue store factory class name- Returns:
- this configuration
-
getFactoryImplementation
@Nullable public QueueStoreFactory getFactoryImplementation()
Returns the queue store factory implementation which will be used to instantiate the queue store. The class should implement theQueueStoreFactory
interface.
-
setFactoryImplementation
public QueueStoreConfig setFactoryImplementation(@Nonnull QueueStoreFactory factoryImplementation)
Sets the queue store factory implementation which will be used to instantiate the queue store. The class should implement theQueueStoreFactory
interface.- Parameters:
factoryImplementation
- the queue store factory implementation- Returns:
- this configuration
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getFactoryId
public int getFactoryId()
Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()
Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
writeData
public void writeData(ObjectDataOutput out) throws java.io.IOException
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
public void readData(ObjectDataInput in) throws java.io.IOException
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-