org.apache.ignite.events

## Class CacheQueryExecutedEvent<K,V>

- java.lang.Object
- - org.apache.ignite.events.EventAdapter
  - - org.apache.ignite.events.CacheQueryExecutedEvent<K,V>

All Implemented Interfaces:
  Serializable, Comparable<Event>, Event

    public class CacheQueryExecutedEvent<K,V>
    extends EventAdapter

Cache query execution event.

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

User can also wait for events using method `IgniteEvents.waitForLocal(org.apache.ignite.lang.IgnitePredicate, int...)`.

# Events and Performance

Note that by default all events in Ignite are enabled and therefore generated and stored by whatever event storage SPI is configured. Ignite 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 `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.

See Also:
  `EventType.EVT_CACHE_QUERY_EXECUTED`, `EventType.EVTS_CACHE_QUERY`, Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`CacheQueryExecutedEvent(ClusterNode node, String msg, int type, String qryType, String cacheName, String clsName, String clause, IgniteBiPredicate<K,V> scanQryFilter, CacheEntryEventSerializableFilter<K,V> contQryFilter, Object[] args, UUID subjId, String taskName)`

### Method Summary

Methods
`Object[]` `arguments()` Gets query arguments.
`String` `cacheName()` Gets cache name on which query was executed.
`String` `className()` Gets queried class name.
`String` `clause()` Gets query clause.
`CacheEntryEventSerializableFilter<K,V>` `continuousQueryFilter()` Gets continuous query filter.
`String` `queryType()` Gets query type.
`IgniteBiPredicate<K,V>` `scanQueryFilter()` Gets scan query filter.
`UUID` `subjectId()` Gets security subject ID.
`String` `taskName()` Gets the name of the task that executed the query (if any).
`String` `toString()`

### Methods inherited from class org.apache.ignite.events.EventAdapter

`compareTo, equals, hashCode, id, localOrder, message, message, name, node, node, shortDisplay, timestamp, type, type`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### CacheQueryExecutedEvent

    public CacheQueryExecutedEvent(ClusterNode node,
                           String msg,
                           int type,
                           String qryType,
                           @Nullable
                           String cacheName,
                           @Nullable
                           String clsName,
                           @Nullable
                           String clause,
                           @Nullable
                           IgniteBiPredicate<K,V> scanQryFilter,
                           @Nullable
                           CacheEntryEventSerializableFilter<K,V> contQryFilter,
                           @Nullable
                           Object[] args,
                           @Nullable
                           UUID subjId,
                           @Nullable
                           String taskName)

Parameters:
  `node` - Node where event was fired.
  `msg` - Event message.
  `type` - Event type.
  `qryType` - Query type.
  `cacheName` - Cache name.
  `clsName` - Class name.
  `clause` - Clause.
  `scanQryFilter` - Scan query filter.
  `args` - Query arguments.
  `subjId` - Security subject ID.

### Method Detail

#### queryType

    public String queryType()

Gets query type.

Returns:
  Query type. Can be `"SQL"`, `"SQL_FIELDS"`, `"FULL_TEXT"`, `"SCAN"`, `"CONTINUOUS"` or `"SPI"`.

#### cacheName

    @Nullable
    public String cacheName()

Gets cache name on which query was executed.

Returns:
  Cache name.

#### className

    @Nullable
    public String className()

Gets queried class name.

Applicable for `SQL` and @{code full text} queries.

Returns:
  Queried class name.

#### clause

    @Nullable
    public String clause()

Gets query clause.

Applicable for `SQL`, `SQL fields` and @{code full text} queries.

Returns:
  Query clause.

#### scanQueryFilter

    @Nullable
    public IgniteBiPredicate<K,V> scanQueryFilter()

Gets scan query filter.

Applicable for `scan` queries.

Returns:
  Scan query filter.

#### continuousQueryFilter

    @Nullable
    public CacheEntryEventSerializableFilter<K,V> continuousQueryFilter()

Gets continuous query filter.

Applicable for `continuous` queries.

Returns:
  Continuous query filter.

#### arguments

    @Nullable
    public Object[] arguments()

Gets query arguments.

Applicable for `SQL` and `SQL fields` queries.

Returns:
  Query arguments.

#### subjectId

    @Nullable
    public UUID subjectId()

Gets security subject ID.

Returns:
  Security subject ID.

#### taskName

    @Nullable
    public String taskName()

Gets the name of the task that executed the query (if any).

Returns:
  Task name.

#### toString

    public String toString()

Overrides:
  `toString` in class `EventAdapter`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.9.0
Release Date | : March 2 2017