| Apache Ignite C++

Public Types | Public Member Functions | Friends | List of all members
ignite::cache::query::continuous::ContinuousQuery< K, V > Class Template Reference

Continuous query. More...

`#include <continuous_query.h>`

## Public Types
enum | { DEFAULT_BUFFER_SIZE = 1 }
| Default value for the buffer size.
enum | { DEFAULT_TIME_INTERVAL = 0 }
| Default value for the time interval.

## Public Member Functions
| ~ContinuousQuery ()
| Destructor.
| ContinuousQuery (Reference< event::CacheEntryEventListener< K, V > > lsnr)
| Constructor. More...
| ContinuousQuery (Reference< event::CacheEntryEventListener< K, V > > lsnr, bool loc)
| Constructor. More...
template<typename F >
| ContinuousQuery (Reference< event::CacheEntryEventListener< K, V > > lsnr, const Reference< F > &remoteFilter)
| Constructor. More...
template<typename F >
| ContinuousQuery (Reference< event::CacheEntryEventListener< K, V > > lsnr, const Reference< F > &remoteFilter, bool loc)
| Constructor. More...
void | SetLocal (bool val)
| Set local flag. More...
bool | GetLocal () const
| Get local flag. More...
void | SetBufferSize (int32_t val)
| Set buffer size. More...
int32_t | GetBufferSize () const
| Get buffer size. More...
void | SetTimeInterval (int64_t val)
| Set time interval. More...
int64_t | GetTimeInterval () const
| Get time interval. More...
void | SetListener (Reference< event::CacheEntryEventListener< K, V > > lsnr)
| Set cache entry event listener. More...
const event::CacheEntryEventListener< K, V > & | GetListener () const
| Get cache entry event listener. More...
event::CacheEntryEventListener< K, V > & | GetListener ()
| Get cache entry event listener. More...

## Friends
class | Cache< K, V >

## Detailed Description

### template<typename K, typename V>
class ignite::cache::query::continuous::ContinuousQuery< K, V >

Continuous query.

Continuous queries allow to register a remote and a listener for cache update events. On any update to the related cache an event is sent to the node that has executed the query and listener is notified on that node.

Continuous query can either be executed on the whole topology or only on local node.

To execute the query over the cache use method ignite::cache::Cache::QueryContinuous().

## Constructor & Destructor Documentation

## ◆ ContinuousQuery() [1/4]

template<typename K , typename V >

ignite::cache::query::continuous::ContinuousQuery< K, V >::ContinuousQuery | ( | Reference< event::CacheEntryEventListener< K, V > > | lsnr | ) |
| inline

Constructor.

Parameters

  lsnr | Event listener. Invoked on the node where continuous query execution has been started.

## ◆ ContinuousQuery() [2/4]

template<typename K , typename V >

ignite::cache::query::continuous::ContinuousQuery< K, V >::ContinuousQuery | ( | Reference< event::CacheEntryEventListener< K, V > > | lsnr,
|  | bool | loc
| ) |  |
| inline

Constructor.

Parameters

  lsnr | Event listener Invoked on the node where continuous query execution has been started.
  loc | Whether query should be executed locally.

## ◆ ContinuousQuery() [3/4]

template<typename K , typename V >
template<typename F >

ignite::cache::query::continuous::ContinuousQuery< K, V >::ContinuousQuery | ( | Reference< event::CacheEntryEventListener< K, V > > | lsnr,
|  | const Reference< F > & | remoteFilter
| ) |  |
| inline

Constructor.

Parameters

  lsnr | Event listener. Invoked on the node where continuous query execution has been started.
  remoteFilter | Remote filter.

## ◆ ContinuousQuery() [4/4]

template<typename K , typename V >
template<typename F >

ignite::cache::query::continuous::ContinuousQuery< K, V >::ContinuousQuery | ( | Reference< event::CacheEntryEventListener< K, V > > | lsnr,
|  | const Reference< F > & | remoteFilter,
|  | bool | loc
| ) |  |
| inline

Constructor.

Parameters

  lsnr | Event listener Invoked on the node where continuous query execution has been started.
  remoteFilter | Remote filter.
  loc | Whether query should be executed locally.

## Member Function Documentation

## ◆ GetBufferSize()

template<typename K , typename V >

int32_t ignite::cache::query::continuous::ContinuousQuery< K, V >::GetBufferSize | ( |  | ) | const
| inline

Get buffer size.

When a cache update happens, entry is first put into a buffer. Entries from buffer will be sent to the master node only if the buffer is full or time provided via timeInterval is exceeded.

Returns
  Buffer size.

## ◆ GetListener() [1/2]

template<typename K , typename V >

event::CacheEntryEventListener<K, V>& ignite::cache::query::continuous::ContinuousQuery< K, V >::GetListener | ( |  | ) |
| inline

Get cache entry event listener.

Returns
  Cache entry event listener.

## ◆ GetListener() [2/2]

template<typename K , typename V >

const event::CacheEntryEventListener<K, V>& ignite::cache::query::continuous::ContinuousQuery< K, V >::GetListener | ( |  | ) | const
| inline

Get cache entry event listener.

Returns
  Cache entry event listener.

## ◆ GetLocal()

template<typename K , typename V >

bool ignite::cache::query::continuous::ContinuousQuery< K, V >::GetLocal | ( |  | ) | const
| inline

Get local flag.

Returns
  Value of the flag. If true, query will be executed only on local node, so only local entries will be returned as query result.

## ◆ GetTimeInterval()

template<typename K , typename V >

int64_t ignite::cache::query::continuous::ContinuousQuery< K, V >::GetTimeInterval | ( |  | ) | const
| inline

Get time interval.

When a cache update happens, entry is first put into a buffer. Entries from buffer are sent to the master node only if the buffer is full (its size can be changed via SetBufferSize) or time provided via SetTimeInterval method is exceeded.

Default value is DEFAULT_TIME_INTERVAL, i.e. 0, which means that time check is disabled and entries will be sent only when buffer is full.

Returns
  Time interval.

## ◆ SetBufferSize()

template<typename K , typename V >

void ignite::cache::query::continuous::ContinuousQuery< K, V >::SetBufferSize | ( | int32_t | val | ) |
| inline

Set buffer size.

When a cache update happens, entry is first put into a buffer. Entries from buffer will be sent to the master node only if the buffer is full or time provided via timeInterval is exceeded.

Parameters

  val | Buffer size.

## ◆ SetListener()

template<typename K , typename V >

void ignite::cache::query::continuous::ContinuousQuery< K, V >::SetListener | ( | Reference< event::CacheEntryEventListener< K, V > > | lsnr | ) |
| inline

Set cache entry event listener.

Parameters

  lsnr | Cache entry event listener. Invoked on the node where continuous query execution has been started.

## ◆ SetLocal()

template<typename K , typename V >

void ignite::cache::query::continuous::ContinuousQuery< K, V >::SetLocal | ( | bool | val | ) |
| inline

Set local flag.

Parameters

  val | Value of the flag. If true, query will be executed only on local node, so only local entries will be returned as query result.

## ◆ SetTimeInterval()

template<typename K , typename V >

void ignite::cache::query::continuous::ContinuousQuery< K, V >::SetTimeInterval | ( | int64_t | val | ) |
| inline

Set time interval.

When a cache update happens, entry is first put into a buffer. Entries from buffer are sent to the master node only if the buffer is full (its size can be changed via SetBufferSize) or time provided via this method is exceeded.

Default value is DEFAULT_TIME_INTERVAL, i.e. 0, which means that time check is disabled and entries will be sent only when buffer is full.

Parameters

  val | Time interval in miliseconds.

The documentation for this class was generated from the following file:

- continuous_query.h