Class ContinuousQueryWithTransformer<K,​V,​T>

    • Constructor Detail

      • ContinuousQueryWithTransformer

        public ContinuousQueryWithTransformer()
        Creates new continuous query with transformer.
    • Method Detail

      • setInitialQuery

        public ContinuousQueryWithTransformer<K,​V,​T> 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.

        Overrides:
        setInitialQuery in class AbstractContinuousQuery<K,​V>
        Parameters:
        initQry - Initial query.
        Returns:
        this for chaining.
      • setRemoteTransformerFactory

        public ContinuousQueryWithTransformer<K,​V,​T> setRemoteTransformerFactory​(javax.cache.configuration.Factory<? extends IgniteClosure<javax.cache.event.CacheEntryEvent<? extends K,​? extends V>,​T>> factory)
        Sets transformer factory. This factory produces transformer is called after and only if entry passes the filter.

        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.

        Parameters:
        factory - Remote transformer factory.
        Returns:
        this for chaining.
      • getRemoteTransformerFactory

        public javax.cache.configuration.Factory<? extends IgniteClosure<javax.cache.event.CacheEntryEvent<? extends K,​? extends V>,​T>> getRemoteTransformerFactory()
        Gets remote transformer factory
        Returns:
        Remote Transformer Factory
      • setTimeInterval

        public ContinuousQueryWithTransformer<K,​V,​T> 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 0 which means that time check is disabled and entries will be sent only when buffer is full.

        Overrides:
        setTimeInterval in class AbstractContinuousQuery<K,​V>
        Parameters:
        timeInterval - Time interval.
        Returns:
        this for chaining.
      • setAutoUnsubscribe

        public ContinuousQueryWithTransformer<K,​V,​T> 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.

        Overrides:
        setAutoUnsubscribe in class AbstractContinuousQuery<K,​V>
        Parameters:
        autoUnsubscribe - Automatic unsubscription flag.
        Returns:
        this for chaining.
      • setPageSize

        public ContinuousQueryWithTransformer<K,​V,​T> setPageSize​(int pageSize)
        Sets optional page size, if 0, then default is used.
        Overrides:
        setPageSize in class Query<javax.cache.Cache.Entry<K,​V>>
        Parameters:
        pageSize - Optional page size.
        Returns:
        this for chaining.
      • setLocal

        public ContinuousQueryWithTransformer<K,​V,​T> setLocal​(boolean loc)
        Sets whether this query should be executed on local node only.
        Overrides:
        setLocal in class Query<javax.cache.Cache.Entry<K,​V>>
        Parameters:
        loc - Local flag.
        Returns:
        this for chaining.