|
GridGain 2.1.0
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gridgain.grid.spi.GridSpiAdapter
org.gridgain.grid.spi.eventstorage.memory.GridMemoryEventStorageSpi
@GridSpiInfo(author="GridGain Systems",
url="www.gridgain.org",
email="support@gridgain.com",
version="x.x")
@GridSpiMultipleInstancesSupport(value=true)
public class GridMemoryEventStorageSpi
In-memory GridEventStorageSpi implementation. All events are
kept in the FIFO queue. If no configuration is provided a default expiration
GridMemoryEventStorageSpi.DFLT_EXPIRE_AGE_MS and default count GridMemoryEventStorageSpi.DFLT_EXPIRE_COUNT will
be used.
It's recommended not to set huge size and unlimited TTL because this might
lead to consuming a lot of memory and result in OutOfMemoryError.
Both event expiration time and maximum queue size could be changed at
runtime.
GridMemoryEventStorageSpi.setExpireCount(long))GridMemoryEventStorageSpi.setExpireAgeMs(long))GridMemoryEventStorageSpispi = new GridMemoryEventStorageSpi(); // Init own events size. spi.setExpireCount(2000); GridConfigurationAdapter cfg = new GridConfigurationAdapter(); // Override default event storage SPI. cfg.setEventStorageSpi(spi); // Start grid. GridFactory.start(cfg);
<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true">
...
<property name="discoverySpi">
<bean class="org.gridgain.grid.spi.eventstorage.memory.GridMemoryEventStorageSpi">
<property name="expireCount" value="2000"/>
</bean>
</property>
...
</bean>
For information about Spring framework visit www.springframework.org
See Also:
Documentation
Email Support
Online Forums
Issue Tracking
Author: 2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.1.0
GridEventStorageSpi
![]() |
![]() |
![]() |
![]() |
| Field Summary | |
|---|---|
static long |
DFLT_EXPIRE_AGE_MS
Default event time to live value in milliseconds (value is Long.MAX_VALUE). |
static int |
DFLT_EXPIRE_COUNT
Default expire count (value is 10000). |
| Constructor Summary | |
|---|---|
GridMemoryEventStorageSpi()
|
|
| Method Summary | |
|---|---|
void |
clearAll()
Removes all events from the event queue. |
long |
getExpireAgeMs()
Gets event time-to-live value. |
long |
getExpireCount()
Gets maximum event queue size. |
List<GridEvent> |
queryLocalEvents(GridEventFilter filter)
Queries locally-stored events only. |
void |
record(GridEvent evt)
Records single event. |
void |
setExpireAgeMs(long expireAgeMs)
Sets events expiration time. |
void |
setExpireCount(long expireCnt)
Sets events queue size. |
void |
spiStart(String gridName)
This method is called to start SPI. |
void |
spiStop()
This method is called to stop SPI. |
String |
toString()
|
| Methods inherited from class org.gridgain.grid.spi.GridSpiAdapter |
|---|
assertParameter, configInfo, createSpiAttributeName, getAuthor, getConsistentAttributeNames, getGridGainHome, getLocalNodeId, getName, getNodeAttributes, getSpiContext, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, getVendorEmail, getVendorUrl, getVersion, onContextDestroyed, onContextInitialized, registerMBean, setName, setSpiContext, startInfo, startStopwatch, stopInfo, unregisterMBean |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.gridgain.grid.spi.GridSpi |
|---|
getName, getNodeAttributes, onContextDestroyed, onContextInitialized |
| Methods inherited from interface org.gridgain.grid.spi.GridSpiManagementMBean |
|---|
getAuthor, getGridGainHome, getLocalNodeId, getName, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, getVendorEmail, getVendorUrl, getVersion |
| Field Detail |
|---|
public static final long DFLT_EXPIRE_AGE_MS
Long.MAX_VALUE).
public static final int DFLT_EXPIRE_COUNT
| Constructor Detail |
|---|
public GridMemoryEventStorageSpi()
| Method Detail |
|---|
public void spiStart(String gridName)
throws GridSpiException
spiStart in interface GridSpiGridSpiException - Throws in case of any error during SPI start.gridName - Name of grid instance this SPI is being started for
(null for default grid).
public void spiStop()
throws GridSpiException
spiStop in interface GridSpiGridSpiException - Thrown in case of any error during SPI stop.@GridSpiConfiguration(optional=true) public void setExpireAgeMs(long expireAgeMs)
If not provided, default value is GridMemoryEventStorageSpi.DFLT_EXPIRE_AGE_MS.
expireAgeMs - Expiration time in milliseconds.@GridSpiConfiguration(optional=true) public void setExpireCount(long expireCnt)
If not provided, default value GridMemoryEventStorageSpi.DFLT_EXPIRE_COUNT will be used.
expireCnt - Maximum queue size.public long getExpireAgeMs()
getExpireAgeMs in interface GridMemoryEventStorageSpiMBeanpublic long getExpireCount()
getExpireCount in interface GridMemoryEventStorageSpiMBeanpublic void clearAll()
clearAll in interface GridMemoryEventStorageSpiMBeanpublic List<GridEvent> queryLocalEvents(GridEventFilter filter)
queryLocalEvents in interface GridEventStorageSpifilter - Event filter or null to use no filter
and return all events.
public void record(GridEvent evt)
throws GridSpiException
record in interface GridEventStorageSpiGridSpiException - If event recording failed for any reason.evt - Event that should be recorded.public String toString()
toString in class Object
|
GridGain 2.1.0
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - Grid Computing Made Simple, ver. 2.1.0.19122008
2005-2008 Copyright © GridGain Systems. All Rights Reserved. |
|
|