public class GridDrSenderHubInMemoryStore extends Object implements GridDrSenderHubStore, GridLifecycleAware
setMaxSize(int))setOverflowMode(GridDrSenderHubStoreOverflowMode))GridDrSenderHubConfiguration cfg = new GridDrSenderHubConfiguration(); GridDrSenderHubInMemoryStore store = new GridDrSenderHubInMemoryStore(); // Override default overflow mode. store.setOverflowMode(GridDrSenderHubStoreOverflowMode.REMOVE_OLDEST); // Set in-memory store for sender hub. cfg.setStore(store);
<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfiguration" singleton="true">
...
<property name="drSenderHubConfiguration">
<bean class="org.gridgain.grid.dr.hub.sender.GridDrSenderHubConfiguration">
<property name="store">
<bean class="org.gridgain.grid.dr.hub.sender.store.memory.GridDrSenderHubInMemoryStore">
<property name="overflowMode" value="REMOVE_OLDEST"/>
</bean>
</property>
...
</bean>
</property>
...
</bean>
For information about Spring framework visit www.springframework.org
GridDrSenderHubStore| Modifier and Type | Field and Description |
|---|---|
static int |
DFLT_MAX_SIZE |
static GridDrSenderHubStoreOverflowMode |
DFLT_OVERFLOW_MODE |
| Constructor and Description |
|---|
GridDrSenderHubInMemoryStore() |
| Modifier and Type | Method and Description |
|---|---|
GridDrSenderHubStoreCursor |
cursor(byte dataCenterId)
Gets cursor for the given data center ID.
|
int |
getMaxSize()
Gets maximum number of entries can be stored.
|
GridDrSenderHubStoreOverflowMode |
getOverflowMode()
Gets overflow mode defining how store will behave in case of overflow.
|
void |
setMaxSize(int maxSize)
Sets maximum number of entries can be stored.
|
void |
setOverflowMode(GridDrSenderHubStoreOverflowMode overflowMode)
Sets overflow mode defining how store will behave in case of overflow.
|
void |
start()
Starts grid component, called on grid start.
|
void |
stop()
Stops grid component, called on grid shutdown.
|
void |
store(byte[] dataCenterIds,
byte[] data)
Store data.
|
public static final int DFLT_MAX_SIZE
public static final GridDrSenderHubStoreOverflowMode DFLT_OVERFLOW_MODE
public int getMaxSize()
Defaults to DFLT_MAX_SIZE.
public void setMaxSize(int maxSize)
getMaxSize() for more information.maxSize - Maximum number of entries in store.public GridDrSenderHubStoreOverflowMode getOverflowMode()
Defaults to DFLT_OVERFLOW_MODE.
public void setOverflowMode(GridDrSenderHubStoreOverflowMode overflowMode)
getOverflowMode() for more
information.overflowMode - Overflow mode.public void start()
start in interface GridLifecycleAwarepublic void stop()
stop in interface GridLifecycleAwarepublic void store(byte[] dataCenterIds,
byte[] data)
throws GridException
store in interface GridDrSenderHubStoredataCenterIds - Target data center ids.data - Data center replication store entry.GridException - In case of failure.GridDrSenderHubStoreOverflowException - If overflowed.public GridDrSenderHubStoreCursor cursor(byte dataCenterId) throws GridException
cursor in interface GridDrSenderHubStoredataCenterId - Data center ID.GridException - If failed.Copyright © 2014. All rights reserved.