public class GridDiscoveryEvent extends GridEventAdapter
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:
GridEvents.remoteQuery(GridPredicate, long) -
asynchronously querying events occurred on the nodes specified, including remote nodes.
GridEvents.localQuery(GridPredicate) -
querying only local events stored on this local node.
GridEvents.localListen(GridPredicate, int...) -
listening to local grid events (events from remote nodes not included).
GridEvents.waitForLocal(GridPredicate, int...).
It is highly recommended to enable only those events that your application logic requires
by using GridConfiguration.getIncludeEventTypes() method 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.
| Constructor and Description |
|---|
GridDiscoveryEvent()
No-arg constructor.
|
GridDiscoveryEvent(UUID nodeId,
String msg,
int type)
Creates new discovery event with given parameters.
|
GridDiscoveryEvent(UUID nodeId,
String msg,
int type,
UUID evtNodeId)
Creates new discovery event with given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
UUID |
eventNodeId()
Gets ID of the node that caused this event to be generated.
|
void |
eventNodeId(UUID evtNodeId)
Sets ID of the node this event is referring to.
|
GridNodeShadow |
shadow()
Gets node shadow.
|
void |
shadow(GridNodeShadow shadow)
Sets node shadow.
|
String |
shortDisplay()
Gets a shortened version of
toString() result. |
Collection<GridNodeShadow> |
topologyNodes()
Gets topology nodes from topology snapshot.
|
void |
topologySnapshot(long topVer,
Collection<GridNodeShadow> topSnapshot)
Sets the topology snapshot.
|
long |
topologyVersion()
Gets topology version if this event is raised on
topology change and configured discovery SPI implementation
supports topology versioning.
|
String |
toString() |
public GridDiscoveryEvent()
public GridDiscoveryEvent(UUID nodeId, String msg, int type, UUID evtNodeId)
nodeId - Local node ID.msg - Optional event message.type - Event type.evtNodeId - ID of the node that caused this event to be generated.public String shortDisplay()
toString() result. Suitable for humans to read.shortDisplay in interface GridEventshortDisplay in class GridEventAdaptertoString() result.public void eventNodeId(UUID evtNodeId)
evtNodeId - Event node ID. Note that event node ID is different from node ID
available via GridEventAdapter.nodeId() method.public UUID eventNodeId()
A locally recorded the event that a remote node
B joined the topology. In this case this method will return ID of B and
method GridEventAdapter.nodeId() will return ID of Apublic void shadow(GridNodeShadow shadow)
shadow - Node shadow to set.@Nullable public GridNodeShadow shadow()
null if one wasn't set.public long topologyVersion()
0 if configured discovery SPI implementation
does not support versioning.public Collection<GridNodeShadow> topologyNodes()
public void topologySnapshot(long topVer,
Collection<GridNodeShadow> topSnapshot)
topVer - Topology version.topSnapshot - Topology snapshot.public String toString()
toString in class GridEventAdapter
Core Products
:
Data Grid ver. 6.0.2,
Streaming ver. 6.0.2
Accelerators
:
Hadoop Accelerator ver. 6.0.2
Release Date
:
March 24 2014