Class RemoteCacheImpl<K,​V>

    • Method Detail

      • retrieveEntries

        public org.infinispan.commons.util.CloseableIterator<Map.Entry<Object,​Object>> retrieveEntries​(String filterConverterFactory,
                                                                                                             Object[] filterConverterParams,
                                                                                                             Set<Integer> segments,
                                                                                                             int batchSize)
        Description copied from interface: RemoteCache
        Retrieve entries from the server.
        Specified by:
        retrieveEntries in interface RemoteCache<K,​V>
        Parameters:
        filterConverterFactory - Factory name for the KeyValueFilterConverter or null for no filtering.
        filterConverterParams - Parameters to the KeyValueFilterConverter
        segments - The segments to iterate. If null all segments will be iterated. An empty set will filter out all entries.
        batchSize - The number of entries transferred from the server at a time.
        Returns:
        Iterator for the entries
      • publishEntries

        public <E> org.reactivestreams.Publisher<Map.Entry<K,​E>> publishEntries​(String filterConverterFactory,
                                                                                      Object[] filterConverterParams,
                                                                                      Set<Integer> segments,
                                                                                      int batchSize)
        Description copied from interface: RemoteCache
        Publishes the entries from the server in a non blocking fashion.

        Any subscriber that subscribes to the returned Publisher must not block. It is therefore recommended to offload any blocking or long running operations to a different thread and not use the invoking one. Failure to do so may cause concurrent operations to stall.

        Specified by:
        publishEntries in interface RemoteCache<K,​V>
        Parameters:
        filterConverterFactory - Factory name for the KeyValueFilterConverter or null for no filtering.
        filterConverterParams - Parameters to the KeyValueFilterConverter
        segments - The segments to utilize. If null all segments will be utilized. An empty set will filter out all entries.
        batchSize - The number of entries transferred from the server at a time.
        Returns:
        Publisher for the entries
      • retrieveEntriesByQuery

        public org.infinispan.commons.util.CloseableIterator<Map.Entry<Object,​Object>> retrieveEntriesByQuery​(org.infinispan.query.dsl.Query<?> filterQuery,
                                                                                                                    Set<Integer> segments,
                                                                                                                    int batchSize)
        Description copied from interface: RemoteCache
        Retrieve entries from the server matching a query.
        Specified by:
        retrieveEntriesByQuery in interface RemoteCache<K,​V>
        Parameters:
        filterQuery - Query
        segments - The segments to iterate. If null all segments will be iterated. An empty set will filter out all entries.
        batchSize - The number of entries transferred from the server at a time.
        Returns:
        CloseableIterator
      • publishEntriesByQuery

        public <E> org.reactivestreams.Publisher<Map.Entry<K,​E>> publishEntriesByQuery​(org.infinispan.query.dsl.Query<?> filterQuery,
                                                                                             Set<Integer> segments,
                                                                                             int batchSize)
        Description copied from interface: RemoteCache
        Publish entries from the server matching a query.

        Any subscriber that subscribes to the returned Publisher must not block. It is therefore recommended to offload any blocking or long running operations to a different thread and not use the invoking one. Failure to do so may cause concurrent operations to stall.

        Specified by:
        publishEntriesByQuery in interface RemoteCache<K,​V>
        Parameters:
        filterQuery - Query
        segments - The segments to utilize. If null all segments will be utilized. An empty set will filter out all entries.
        batchSize - The number of entries transferred from the server at a time.
        Returns:
        Publisher containing matching entries
      • publishEntriesWithMetadata

        public org.reactivestreams.Publisher<Map.Entry<K,​MetadataValue<V>>> publishEntriesWithMetadata​(Set<Integer> segments,
                                                                                                             int batchSize)
        Description copied from interface: RemoteCache
        Publish entries with metadata information

        Any subscriber that subscribes to the returned Publisher must not block. It is therefore recommended to offload any blocking or long running operations to a different thread and not use the invoking one. Failure to do so may cause concurrent operations to stall.

        Specified by:
        publishEntriesWithMetadata in interface RemoteCache<K,​V>
        Parameters:
        segments - The segments to utilize. If null all segments will be utilized. An empty set will filter out all entries.
        batchSize - The number of entries transferred from the server at a time.
        Returns:
        Publisher containing entries along with metadata
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Map<K,​V>
      • clearAsync

        public CompletableFuture<Void> clearAsync()
        Specified by:
        clearAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • start

        public void start()
        Specified by:
        start in interface org.infinispan.commons.api.Lifecycle
      • stop

        public void stop()
        Specified by:
        stop in interface org.infinispan.commons.api.Lifecycle
      • getName

        public String getName()
        Specified by:
        getName in interface org.infinispan.commons.api.BasicCache<K,​V>
      • getVersion

        public String getVersion()
        Specified by:
        getVersion in interface org.infinispan.commons.api.BasicCache<K,​V>
      • getProtocolVersion

        public String getProtocolVersion()
        Description copied from interface: RemoteCache
        Returns the HotRod protocol version supported by this RemoteCache implementation
        Specified by:
        getProtocolVersion in interface RemoteCache<K,​V>
      • addClientListener

        public void addClientListener​(Object listener)
        Description copied from interface: RemoteCache
        Add a client listener to receive events that happen in the remote cache. The listener object must be annotated with @ClientListener annotation.
        Specified by:
        addClientListener in interface RemoteCache<K,​V>
      • addClientListener

        public void addClientListener​(Object listener,
                                      Object[] filterFactoryParams,
                                      Object[] converterFactoryParams)
        Description copied from interface: RemoteCache
        Add a client listener to receive events that happen in the remote cache. The listener object must be annotated with @ClientListener annotation.
        Specified by:
        addClientListener in interface RemoteCache<K,​V>
      • removeClientListener

        public void removeClientListener​(Object listener)
        Description copied from interface: RemoteCache
        Remove a previously added client listener. If the listener was not added before, this operation is a no-op.
        Specified by:
        removeClientListener in interface RemoteCache<K,​V>
      • withFlags

        public InternalRemoteCache<K,​V> withFlags​(Flag... flags)
        Description copied from interface: RemoteCache
        Applies one or more Flags to the scope of a single invocation. See the Flag enumeration to for information on available flags.

        Sample usage:

            remoteCache.withFlags(Flag.FORCE_RETURN_VALUE).put("hello", "world");
         
        Specified by:
        withFlags in interface InternalRemoteCache<K,​V>
        Specified by:
        withFlags in interface RemoteCache<K,​V>
        Returns:
        the current RemoteCache instance to continue running operations on.
      • valueToBytes

        protected byte[] valueToBytes​(Object o)
      • assertRemoteCacheManagerIsStarted

        protected void assertRemoteCacheManagerIsStarted()
      • keySet

        public org.infinispan.commons.util.CloseableIteratorSet<K> keySet​(org.infinispan.commons.util.IntSet segments)
        Description copied from interface: RemoteCache
        This method is identical to RemoteCache.keySet() except that it will only return keys that map to the given segments. Note that these segments will be determined by the remote server. Thus you should be aware of how many segments it has configured and hashing algorithm it is using. If the segments and hashing algorithm are not the same this method may return unexpected keys.
        Specified by:
        keySet in interface RemoteCache<K,​V>
        Parameters:
        segments - the segments of keys to return - null means all available
        Returns:
        set containing keys that map to the given segments
        See Also:
        RemoteCache.keySet()
      • keyIterator

        public org.infinispan.commons.util.CloseableIterator<K> keyIterator​(org.infinispan.commons.util.IntSet segments)
        Specified by:
        keyIterator in interface InternalRemoteCache<K,​V>
      • entrySet

        public org.infinispan.commons.util.CloseableIteratorSet<Map.Entry<K,​V>> entrySet​(org.infinispan.commons.util.IntSet segments)
        Description copied from interface: RemoteCache
        This method is identical to RemoteCache.entrySet() except that it will only return entries that map to the given segments. Note that these segments will be determined by the remote server. Thus you should be aware of how many segments it has configured and hashing algorithm it is using. If the segments and hashing algorithm are not the same this method may return unexpected entries.
        Specified by:
        entrySet in interface RemoteCache<K,​V>
        Parameters:
        segments - the segments of entries to return - null means all available
        Returns:
        set containing entries that map to the given segments
        See Also:
        RemoteCache.entrySet()
      • values

        public org.infinispan.commons.util.CloseableIteratorCollection<V> values​(org.infinispan.commons.util.IntSet segments)
        Description copied from interface: RemoteCache
        This method is identical to RemoteCache.values() except that it will only return values that map to the given segments. Note that these segments will be determined by the remote server. Thus you should be aware of how many segments it has configured and hashing algorithm it is using. If the segments and hashing algorithm are not the same this method may return unexpected values.
        Specified by:
        values in interface RemoteCache<K,​V>
        Parameters:
        segments - the segments of values to return - null means all available
        Returns:
        collection containing values that map to the given segments
        See Also:
        RemoteCache.values()
      • execute

        public <T> T execute​(String taskName,
                             Map<String,​?> params)
        Description copied from interface: RemoteCache
        Executes a remote task passing a set of named parameters
        Specified by:
        execute in interface RemoteCache<K,​V>
      • execute

        public <T> T execute​(String taskName,
                             Map<String,​?> params,
                             Object key)
        Description copied from interface: RemoteCache
        Executes a remote task passing a set of named parameters, hinting that the task should be executed on the server that is expected to store given key. The key itself is not transferred to the server.
        Specified by:
        execute in interface RemoteCache<K,​V>
      • isTransactional

        public boolean isTransactional()
        Specified by:
        isTransactional in interface RemoteCache<K,​V>
        Returns:
        true if the cache can participate in a transaction, false otherwise.