public abstract class AbstractContinuousQuery<K,V> extends Query<javax.cache.Cache.Entry<K,V>>
Modifier and Type | Field and Description |
---|---|
static boolean |
DFLT_AUTO_UNSUBSCRIBE
Default value for automatic unsubscription flag.
|
static int |
DFLT_PAGE_SIZE
Default page size.
|
static long |
DFLT_TIME_INTERVAL
Maximum default time interval after which buffer will be flushed (if buffering is enabled).
|
Constructor and Description |
---|
AbstractContinuousQuery() |
Modifier and Type | Method and Description |
---|---|
Query<javax.cache.Cache.Entry<K,V>> |
getInitialQuery()
Gets initial query.
|
javax.cache.configuration.Factory<? extends javax.cache.event.CacheEntryEventFilter<K,V>> |
getRemoteFilterFactory()
Gets remote filter.
|
long |
getTimeInterval()
Gets time interval.
|
boolean |
isAutoUnsubscribe()
Gets automatic unsubscription flag value.
|
boolean |
isIncludeExpired()
Gets the flag value defining whether to notify about
EventType.EXPIRED events. |
AbstractContinuousQuery<K,V> |
setAutoUnsubscribe(boolean autoUnsubscribe)
Sets automatic unsubscribe flag.
|
void |
setIncludeExpired(boolean includeExpired)
Sets the flag value defining whether to notify about
EventType.EXPIRED events. |
AbstractContinuousQuery<K,V> |
setInitialQuery(Query<javax.cache.Cache.Entry<K,V>> initQry)
Sets initial query.
|
AbstractContinuousQuery<K,V> |
setRemoteFilterFactory(javax.cache.configuration.Factory<? extends javax.cache.event.CacheEntryEventFilter<K,V>> rmtFilterFactory)
Sets optional key-value filter factory.
|
AbstractContinuousQuery<K,V> |
setTimeInterval(long timeInterval)
Sets time interval.
|
getPageSize, isLocal, prepare, setLocal, setPageSize, toString
public static final int DFLT_PAGE_SIZE
1
means that all entries
will be sent to master node immediately (buffering is disabled).public static final long DFLT_TIME_INTERVAL
public static final boolean DFLT_AUTO_UNSUBSCRIBE
public AbstractContinuousQuery<K,V> setInitialQuery(Query<javax.cache.Cache.Entry<K,V>> initQry)
This query will be executed before continuous listener is registered which allows to iterate through entries which already existed at the time continuous query is executed.
initQry
- Initial query.this
for chaining.public Query<javax.cache.Cache.Entry<K,V>> getInitialQuery()
public AbstractContinuousQuery<K,V> setRemoteFilterFactory(javax.cache.configuration.Factory<? extends javax.cache.event.CacheEntryEventFilter<K,V>> rmtFilterFactory)
WARNING: all operations that involve any kind of JVM-local or distributed locking (e.g., synchronization or transactional cache operations), should be executed asynchronously without blocking the thread that called the filter. Otherwise, you can get deadlocks.
If remote filter are annotated with IgniteAsyncCallback
then it is executed in async callback
pool (see IgniteConfiguration.getAsyncCallbackPoolSize()
) that allow to perform a cache operations.
rmtFilterFactory
- Key-value filter factory.this
for chaining.IgniteAsyncCallback
,
IgniteConfiguration.getAsyncCallbackPoolSize()
public javax.cache.configuration.Factory<? extends javax.cache.event.CacheEntryEventFilter<K,V>> getRemoteFilterFactory()
public AbstractContinuousQuery<K,V> setTimeInterval(long timeInterval)
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 (its size can be provided via Query.setPageSize(int)
method) or time provided via this method is exceeded.
Default time interval is 0
which means that
time check is disabled and entries will be sent only when buffer is full.
timeInterval
- Time interval.this
for chaining.public long getTimeInterval()
public AbstractContinuousQuery<K,V> setAutoUnsubscribe(boolean autoUnsubscribe)
This flag indicates that query filters on remote nodes should be
automatically unregistered if master node (node that initiated the query) leaves topology. If this flag is
false
, filters will be unregistered only when the query is cancelled from master node, and won't ever be
unregistered if master node leaves grid.
Default value for this flag is true
.
autoUnsubscribe
- Automatic unsubscription flag.this
for chaining.public boolean isAutoUnsubscribe()
public void setIncludeExpired(boolean includeExpired)
EventType.EXPIRED
events.
If true
, then the remote listener will get notifications about entries
expired in cache. Otherwise, only EventType.CREATED
, EventType.UPDATED
and EventType.REMOVED
events will be fired in the remote listener.
This flag is false
by default, so EventType.EXPIRED
events are disabled.
includeExpired
- Whether to notify about EventType.EXPIRED
events.public boolean isIncludeExpired()
EventType.EXPIRED
events.EventType.EXPIRED
events.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019