Dashboard > GridGain User Guide > Table Of Contents > Developers Guide > Event Storage SPI
Event Storage SPI
Added by architect, last edited by morpheus on Dec 23, 2008  (view change)
Labels: 
(None)


Click on Javadoc link to open Javadoc documentation.

Package

org.gridgain.grid.spi.eventstorage Javadoc

Built-in Implementations

GridGain comes with the following Event Storage SPI implementations:

Description

Grid node's operation produces a steady stream of events that are needed to analyze the execution of the grid tasks and grid related statistics. Node is responsible for storing these local events. Event storage SPI Javadoc provides a pluggable design for such storage implementation. It allows the end user to specify how and where the locally generated events will be stored.

Grid interface provides number of methods to access local event and query events from remote nodes:

  • Grid.addLocalEventListener Javadoc - adds local event listener.
  • Grid.removeLocalEventListener(GridLocalEventListener) Javadoc - removes local event listener.
  • Grid.queryLocalEvents(GridEventFilter) Javadoc - queries events occurred on the local node.
  • Grid.queryEvents(GridEventFilter, Collection<GridNode>, long) Javadoc - queries events occurred on the nodes specified, including remote nodes (note that GridEventFilter Javadoc must implement Serializable Javadoc).

Note, that peer-class-loading is not enabled for event filters yet, so in order to execute remote event query, you must make sure that GridEventFilter Javadoc implementation is on the class path of every node.

Supported Events

The following table describes all events supported by GridGain:

Event Type Description
CHECKPOINT_LOADED Javadoc Checkpoint was loaded.
CHECKPOINT_REMOVED Javadoc Checkpoint was removed (either timeout expired, or manually removed, or automatically removed by task session).
CHECKPOINT_SAVED Javadoc Checkpoint was saved.
JOB_CANCELLED Javadoc Job got cancelled.
JOB_FAILED Javadoc Job has failed.
JOB_FAILED_OVER Javadoc Job got failed over.
JOB_FINISHED Javadoc Job has successfully completed and produced a result which from the user perspective can still be either negative or positive.
JOB_MAPPED Javadoc Grid job was mapped in GridTask.map(List, Object) Javadoc method.
JOB_QUEUED Javadoc Job arrived for execution and has been queued (added to passive queue during collision resolution).
JOB_REJECTED Javadoc Job has been rejected.
JOB_RESULTED Javadoc Grid job result was received by GridTask.result(GridJobResult, List) Javadoc method.
JOB_STARTED Javadoc Job got started.
JOB_TIMED_OUT Javadoc Job timed out.
NODE_FAILED Javadoc Node failed and left topology unexpectedly.
NODE_JOINED Javadoc Node joined topology.
NODE_LEFT Javadoc Node left topology.
SESSION_ATTR_SET Javadoc Session attribute(s) got set.
TASK_DEPLOYED Javadoc Task deployed event.
TASK_FAILED Javadoc Task failed.
TASK_FINISHED Javadoc Task got finished.
TASK_REDUCED Javadoc All split jobs' results were reduced for the task in GridTask.reduce(List) Javadoc method.
TASK_STARTED Javadoc Task got started.
TASK_TIMED_OUT Javadoc Task timed out.
TASK_UNDEPLOYED Javadoc Task undeployed event.

Also see GridEventType Javadoc .

Configuration

GridEventStorageSpi is provided in Grid Configuration passed into GridFactory Javadoc at startup. By default, only one available implementation GridMemoryEventStorageSpi is used.

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);

Note that GridConfiguration interface is just a bean and can also be configured using spring XML configuration.


For more information about using Spring framework for configuration click here.

Default Implementation

By default, in configuration GridMemoryEventStorageSpi is used.

GridMemoryEventStorageSpi (GridGain User Guide)

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.10 Build:#528 Nov 29, 2006) - Bug/feature request - Contact Administrators