Package org.apache.ignite.events
Class EventAdapter
- java.lang.Object
- 
- org.apache.ignite.events.EventAdapter
 
- 
- All Implemented Interfaces:
- Serializable,- Comparable<Event>,- Event
 - Direct Known Subclasses:
- BaselineChangedEvent,- BaselineConfigurationChangedEvent,- CacheConsistencyViolationEvent,- CacheEvent,- CacheObjectTransformedEvent,- CacheQueryExecutedEvent,- CacheQueryReadEvent,- CacheRebalancingEvent,- CheckpointEvent,- ClusterActivationEvent,- ClusterStateChangeEvent,- ClusterStateChangeStartedEvent,- ClusterTagUpdatedEvent,- DeploymentEvent,- DiscoveryEvent,- JobEvent,- NodeValidationFailedEvent,- PageReplacementStartedEvent,- SnapshotEvent,- SqlQueryExecutionEvent,- TaskEvent,- TransactionStateChangedEvent,- WalSegmentArchivedEvent
 
 public class EventAdapter extends Object implements Event Base adapter for the events. All events (including user-defined ones) should extend this adapter as it provides necessary plumbing implementation details.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description EventAdapter()No-arg constructor.EventAdapter(ClusterNode node, String msg, int type)Creates event based with given parameters.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Event o)booleanequals(Object o)inthashCode()IgniteUuidid()Gets globally unique ID of this event.longlocalOrder()Gets locally unique ID that is atomically incremented for each event.@Nullable Stringmessage()Gets optional message for this event.voidmessage(@Nullable String msg)Sets optional event message.Stringname()Gets event type name.ClusterNodenode()Node where event occurred and was recordedvoidnode(ClusterNode node)Sets node where even is occurred (i.e. node local to the event).StringshortDisplay()Gets a shortened version oftoString()result.longtimestamp()Gets event timestamp.StringtoString()inttype()Gets type of this event.voidtype(int type)Sets event type.
 
- 
- 
- 
Constructor Detail- 
EventAdapterpublic EventAdapter() No-arg constructor.
 - 
EventAdapterpublic EventAdapter(ClusterNode node, String msg, int type) Creates event based with given parameters.- Parameters:
- node- Event initiator node.
- msg- Optional message.
- type- Event type.
 
 
- 
 - 
Method Detail- 
compareTopublic int compareTo(Event o) - Specified by:
- compareToin interface- Comparable<Event>
 
 - 
idpublic IgniteUuid id() Gets globally unique ID of this event.- Specified by:
- idin interface- Event
- Returns:
- Globally unique ID of this event.
- See Also:
- Event.localOrder()
 
 - 
localOrderpublic long localOrder() Gets locally unique ID that is atomically incremented for each event. Unlike globalEvent.id()this local ID can be used for ordering events on this node.Note that for performance considerations Ignite doesn't order events globally. - Specified by:
- localOrderin interface- Event
- Returns:
- Locally unique ID that is atomically incremented for each new event.
- See Also:
- Event.id()
 
 - 
nodepublic void node(ClusterNode node) Sets node where even is occurred (i.e. node local to the event).- Parameters:
- node- Node.
 
 - 
messagepublic void message(@Nullable @Nullable String msg)Sets optional event message.- Parameters:
- msg- Optional event message.
 
 - 
typepublic void type(int type) Sets event type.- Parameters:
- type- Event type.
 
 - 
nodepublic ClusterNode node() Node where event occurred and was recorded
 - 
message@Nullable public @Nullable String message() Gets optional message for this event.
 - 
typepublic int type() Gets type of this event. All system event types are defined inEventType.NOTE: all types in range from 1 to 1000 are reserved for internal Ignite events and should not be used by user-defined events. 
 - 
timestamppublic 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 useEvent.localOrder()instead.
 - 
namepublic String name() Gets event type name.
 - 
shortDisplaypublic String shortDisplay() Gets a shortened version oftoString()result. Suitable for humans to read.- Specified by:
- shortDisplayin interface- Event
- Returns:
- Shortened version of toString()result.
 
 
- 
 
-