GridGain™ 3.6.0e
Enterprise Edition

org.gridgain.grid
Interface GridEvent

All Superinterfaces:
Comparable<GridEvent>, GridMetadataAware, Serializable
All Known Implementing Classes:
GridCacheEvent, GridCachePreloadEvent, GridCheckpointEvent, GridDeploymentEvent, GridDiscoveryEvent, GridEventAdapter, GridJobEvent, GridLicenseEvent, GridSwapSpaceEvent, GridTaskEvent

public interface GridEvent
extends GridMetadataAware, Comparable<GridEvent>

Grid events are used for notification about what happens within the grid. Note that by design GridGain keeps all events generated on the local node locally and it provides APIs for performing a distributed queries across multiple nodes:

Events and Performance

Note that by default all events in GridGain are enabled and therefore generated and stored by whatever event storage SPI is configured. GridGain can and often does generate thousands events per seconds under the load and therefore it creates a significant additional load on the system. If these events are not needed by the application this load is unnecessary and leads to significant performance degradation.

It is highly recommended to enable only those events that your application logic requires by using either GridConfiguration.getExcludeEventTypes() or GridConfiguration.getIncludeEventTypes() methods in GridGain configuration. Note that certain events are required for GridGain's internal operations and such events will still be generated but not stored by event storage SPI if they are disabled in GridGain configuration.

Wiki & Forum:


Wiki
Forum

See Also:
GridJobEvent, GridCacheEvent, GridCachePreloadEvent, GridSwapSpaceEvent, GridCheckpointEvent, GridDeploymentEvent, GridDiscoveryEvent, GridTaskEvent, Grid.waitForEventAsync(GridPredicate, int...), Grid.waitForEvent(long, Runnable, GridPredicate, int...)
 

Method Summary
 GridUuid id()
          Gets globally unique ID of this event.
 long localOrder()
          Gets locally unique ID that is atomically incremented for each event.
 String message()
          Gets optional message for this event.
 String name()
          Gets name of this event.
 UUID nodeId()
          Gets ID of the node where event occurred and was recorded.
 String shortDisplay()
          Gets a shortened version of toString() result.
 long timestamp()
          Gets event timestamp.
 int type()
          Gets type of this event.
 
Methods inherited from interface org.gridgain.grid.GridMetadataAware
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, putMetaIfAbsent, removeMeta, removeMeta, replaceMeta
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

id

GridUuid id()
Gets globally unique ID of this event.

Returns:
Globally unique ID of this event.
See Also:
GridEvent.localOrder()

localOrder

long localOrder()
Gets locally unique ID that is atomically incremented for each event. Unlike global GridEvent.id() this local ID can be used for ordering events on this node.

Note that for performance considerations GridGain doesn't order events globally.

Returns:
Locally unique ID that is atomically incremented for each new event.
See Also:
GridEvent.id()

nodeId

UUID nodeId()
Gets ID of the node where event occurred and was recorded.

Returns:
ID of the node where event occurred and was recorded.

message

String message()
Gets optional message for this event.

Returns:
Optional (can be null) message for this event.

type

int type()
Gets type of this event. All system event types are defined in GridEventType.

NOTE: all types in range from 1 to 1000 are reserved for internal GridGain events and should not be used by user-defined events.

Returns:
Event's type.
See Also:
GridEventType

name

String name()
Gets name of this event. All events are defined in GridEventType class.

Returns:
Name of this event.

timestamp

long timestamp()
Gets event timestamp. Timestamp is local to the node on which this event was produced. Note that more than one event can be generated with the same timestamp. For ordering purposes use GridEvent.localOrder() instead.

Returns:
Event timestamp.

shortDisplay

String shortDisplay()
Gets a shortened version of toString() result. Suitable for humans to read.

Returns:
Shortened version of toString() result.

GridGain™ 3.6.0e
Enterprise Edition

GridGain - Real Time Big Data
Enterprise Edition, ver. 3.6.0e.13012012
2012 Copyright © GridGain Systems
Follow us:   Follow GridGain on Github Follow GridGain on Facebook Join GridGain User Group Follow GridGain on Twitter Follow GridGain on YouTube