public class IgfsEvent extends EventAdapter
Grid events are used for notification about what happens within the grid. Note that by design Ignite keeps all events generated on the local node locally and it provides APIs for performing a distributed queries across multiple nodes:
IgniteEvents.remoteQuery(org.apache.ignite.lang.IgnitePredicate, long, int...)
-
asynchronously querying events occurred on the nodes specified, including remote nodes.
IgniteEvents.localQuery(org.apache.ignite.lang.IgnitePredicate, int...)
-
querying only local events stored on this local node.
IgniteEvents.localListen(org.apache.ignite.lang.IgnitePredicate, int...)
-
listening to local grid events (events from remote nodes not included).
IgniteEvents.waitForLocal(org.apache.ignite.lang.IgnitePredicate, int...)
.
It is highly recommended to enable only those events that your application logic requires
by using IgniteConfiguration.getIncludeEventTypes()
method in Ignite configuration. Note that certain
events are required for Ignite's internal operations and such events will still be generated but not stored by
event storage SPI if they are disabled in Ignite configuration.
Constructor and Description |
---|
IgfsEvent(IgfsPath path,
ClusterNode node,
int type)
Constructs an event instance.
|
IgfsEvent(IgfsPath path,
ClusterNode node,
int type,
long dataSize)
Constructs an event instance for close events:
(
EventType.EVT_IGFS_FILE_CLOSED_READ ,
EventType.EVT_IGFS_FILE_CLOSED_WRITE ). |
IgfsEvent(IgfsPath path,
ClusterNode node,
int type,
Map<String,String> meta)
Constructs an event instance for file metadata update events
(
EventType.EVT_IGFS_META_UPDATED ). |
IgfsEvent(IgfsPath path,
IgfsPath newPath,
ClusterNode node,
int type)
Constructs an event instance for path modification event
(
EventType.EVT_IGFS_FILE_RENAMED ,
EventType.EVT_IGFS_DIR_RENAMED ). |
Modifier and Type | Method and Description |
---|---|
long |
dataSize()
Transferred data size for this event.
|
boolean |
isDirectory()
Checks if this is a directory-related event.
|
@Nullable IgfsPath |
newPath()
New file or directory path for this event (used in
EventType.EVT_IGFS_FILE_RENAMED event). |
IgfsPath |
path()
Path of the file or directory, on which event has occurred.
|
String |
toString() |
@Nullable Map<String,String> |
updatedMeta()
Updated file metadata properties.
|
compareTo, equals, hashCode, id, localOrder, message, message, name, node, node, shortDisplay, timestamp, type, type
public IgfsEvent(IgfsPath path, ClusterNode node, int type)
path
- File or directory path.node
- Node.type
- Event type.public IgfsEvent(IgfsPath path, IgfsPath newPath, ClusterNode node, int type)
EventType.EVT_IGFS_FILE_RENAMED
,
EventType.EVT_IGFS_DIR_RENAMED
).path
- File or directory path.newPath
- New file or directory path.node
- Node.type
- Event type.public IgfsEvent(IgfsPath path, ClusterNode node, int type, long dataSize)
EventType.EVT_IGFS_FILE_CLOSED_READ
,
EventType.EVT_IGFS_FILE_CLOSED_WRITE
).path
- File path.node
- Node.type
- Event type.dataSize
- Transferred data size in bytes.public IgfsEvent(IgfsPath path, ClusterNode node, int type, Map<String,String> meta)
EventType.EVT_IGFS_META_UPDATED
).path
- File path.node
- Node.type
- Event type.meta
- Modified properties.public IgfsPath path()
@Nullable public @Nullable IgfsPath newPath()
EventType.EVT_IGFS_FILE_RENAMED
event).null
,
if not relevant for this event.public long dataSize()
@Nullable public @Nullable Map<String,String> updatedMeta()
null
,
if not relevant for this event.public boolean isDirectory()
True
if this event is directory-related.public String toString()
toString
in class EventAdapter
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019