Class AbstractContinuousQuery<K,V>
- java.lang.Object
- 
- org.apache.ignite.cache.query.Query<javax.cache.Cache.Entry<K,V>>
- 
- org.apache.ignite.cache.query.AbstractContinuousQuery<K,V>
 
 
- 
- All Implemented Interfaces:
- Serializable
 - Direct Known Subclasses:
- ContinuousQuery,- ContinuousQueryWithTransformer
 
 public abstract class AbstractContinuousQuery<K,V> extends Query<javax.cache.Cache.Entry<K,V>> Base class for continuous query.
- 
- 
Field SummaryFields Modifier and Type Field Description static booleanDFLT_AUTO_UNSUBSCRIBEDefault value for automatic unsubscription flag.static intDFLT_PAGE_SIZEDefault page size.static longDFLT_TIME_INTERVALMaximum default time interval after which buffer will be flushed (if buffering is enabled).
 - 
Constructor SummaryConstructors Constructor Description AbstractContinuousQuery()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method 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.longgetTimeInterval()Gets time interval.booleanisAutoUnsubscribe()Gets automatic unsubscription flag value.booleanisIncludeExpired()Gets the flag value defining whether to notify aboutEventType.EXPIREDevents.AbstractContinuousQuery<K,V>setAutoUnsubscribe(boolean autoUnsubscribe)Sets automatic unsubscribe flag.AbstractContinuousQuery<K,V>setIncludeExpired(boolean includeExpired)Sets the flag value defining whether to notify aboutEventType.EXPIREDevents.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.- 
Methods inherited from class org.apache.ignite.cache.query.QuerygetPageSize, isLocal, prepare, setLocal, setPageSize, toString
 
- 
 
- 
- 
- 
Field Detail- 
DFLT_PAGE_SIZEpublic static final int DFLT_PAGE_SIZE Default page size. Size of1means that all entries will be sent to master node immediately (buffering is disabled).- See Also:
- Constant Field Values
 
 - 
DFLT_TIME_INTERVALpublic static final long DFLT_TIME_INTERVAL Maximum default time interval after which buffer will be flushed (if buffering is enabled).- See Also:
- Constant Field Values
 
 - 
DFLT_AUTO_UNSUBSCRIBEpublic static final boolean DFLT_AUTO_UNSUBSCRIBE Default value for automatic unsubscription flag. Remote filters will be unregistered by default if master node leaves topology.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
setInitialQuerypublic AbstractContinuousQuery<K,V> setInitialQuery(Query<javax.cache.Cache.Entry<K,V>> initQry) Sets initial query.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. - Parameters:
- initQry- Initial query.
- Returns:
- thisfor chaining.
 
 - 
getInitialQuerypublic Query<javax.cache.Cache.Entry<K,V>> getInitialQuery() Gets initial query.- Returns:
- Initial query.
 
 - 
setRemoteFilterFactorypublic AbstractContinuousQuery<K,V> setRemoteFilterFactory(javax.cache.configuration.Factory<? extends javax.cache.event.CacheEntryEventFilter<K,V>> rmtFilterFactory) Sets optional key-value filter factory. This factory produces filter is called before entry is sent to the master node.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 IgniteAsyncCallbackthen it is executed in async callback pool (seeIgniteConfiguration.getAsyncCallbackPoolSize()) that allow to perform a cache operations.- Parameters:
- rmtFilterFactory- Key-value filter factory.
- Returns:
- thisfor chaining.
- See Also:
- IgniteAsyncCallback,- IgniteConfiguration.getAsyncCallbackPoolSize()
 
 - 
getRemoteFilterFactorypublic javax.cache.configuration.Factory<? extends javax.cache.event.CacheEntryEventFilter<K,V>> getRemoteFilterFactory() Gets remote filter.- Returns:
- Remote filter.
 
 - 
setTimeIntervalpublic AbstractContinuousQuery<K,V> setTimeInterval(long timeInterval) Sets time interval.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 0which means that time check is disabled and entries will be sent only when buffer is full.- Parameters:
- timeInterval- Time interval.
- Returns:
- thisfor chaining.
 
 - 
getTimeIntervalpublic long getTimeInterval() Gets time interval.- Returns:
- Time interval.
 
 - 
setAutoUnsubscribepublic AbstractContinuousQuery<K,V> setAutoUnsubscribe(boolean autoUnsubscribe) Sets automatic unsubscribe flag.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.- Parameters:
- autoUnsubscribe- Automatic unsubscription flag.
- Returns:
- thisfor chaining.
 
 - 
isAutoUnsubscribepublic boolean isAutoUnsubscribe() Gets automatic unsubscription flag value.- Returns:
- Automatic unsubscription flag.
 
 - 
setIncludeExpiredpublic AbstractContinuousQuery<K,V> setIncludeExpired(boolean includeExpired) Sets the flag value defining whether to notify aboutEventType.EXPIREDevents. Iftrue, then the remote listener will get notifications about entries expired in cache. Otherwise, onlyEventType.CREATED,EventType.UPDATEDandEventType.REMOVEDevents will be fired in the remote listener.This flag is falseby default, soEventType.EXPIREDevents are disabled.- Parameters:
- includeExpired- Whether to notify about- EventType.EXPIREDevents.
- Returns:
- thisfor chaining.
 
 - 
isIncludeExpiredpublic boolean isIncludeExpired() Gets the flag value defining whether to notify aboutEventType.EXPIREDevents.- Returns:
- Whether to notify about EventType.EXPIREDevents.
 
 
- 
 
-