Class RemoteStore<K,V>

java.lang.Object
org.infinispan.persistence.remote.RemoteStore<K,V>
All Implemented Interfaces:
org.infinispan.persistence.spi.NonBlockingStore<K,V>

public class RemoteStore<K,V> extends Object implements org.infinispan.persistence.spi.NonBlockingStore<K,V>
Cache store that delegates the call to a infinispan cluster. Communication between this cache store and the remote cluster is achieved through the java HotRod client: this assures fault tolerance and smart dispatching of calls to the nodes that have the highest chance of containing the given key. This cache store supports both preloading and fetchPersistentState.

Purging elements is not possible, as HotRod does not support the fetching of all remote keys (this would be a very costly operation as well). Purging takes place at the remote end (infinispan cluster).

Since:
4.1
Author:
Mircea.Markus@jboss.com
See Also:
  • Field Details

    • ctx

      protected org.infinispan.persistence.spi.InitializationContext ctx
  • Constructor Details

    • RemoteStore

      public RemoteStore()
  • Method Details

    • start

      public CompletionStage<Void> start(org.infinispan.persistence.spi.InitializationContext ctx)
      Specified by:
      start in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • characteristics

      public Set<org.infinispan.persistence.spi.NonBlockingStore.Characteristic> characteristics()
      Specified by:
      characteristics in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • stop

      public CompletionStage<Void> stop()
      Specified by:
      stop in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • isAvailable

      public CompletionStage<Boolean> isAvailable()
      Specified by:
      isAvailable in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • load

      public CompletionStage<org.infinispan.persistence.spi.MarshallableEntry<K,V>> load(int segment, Object key)
      Specified by:
      load in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • containsKey

      public CompletionStage<Boolean> containsKey(int segment, Object key)
      Specified by:
      containsKey in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • publishKeys

      public io.reactivex.rxjava3.core.Flowable<K> publishKeys(org.infinispan.commons.util.IntSet segments, Predicate<? super K> filter)
      Specified by:
      publishKeys in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • publishEntries

      public org.reactivestreams.Publisher<org.infinispan.persistence.spi.MarshallableEntry<K,V>> publishEntries(org.infinispan.commons.util.IntSet segments, Predicate<? super K> filter, boolean includeValues)
      Specified by:
      publishEntries in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • size

      public CompletionStage<Long> size(org.infinispan.commons.util.IntSet segments)
      Specified by:
      size in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • approximateSize

      public CompletionStage<Long> approximateSize(org.infinispan.commons.util.IntSet segments)
      Specified by:
      approximateSize in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • purgeExpired

      public org.reactivestreams.Publisher<org.infinispan.persistence.spi.MarshallableEntry<K,V>> purgeExpired()
      Specified by:
      purgeExpired in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • write

      public CompletionStage<Void> write(int segment, org.infinispan.persistence.spi.MarshallableEntry<? extends K,? extends V> entry)
      Specified by:
      write in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • batch

      public CompletionStage<Void> batch(int publisherCount, org.reactivestreams.Publisher<org.infinispan.persistence.spi.NonBlockingStore.SegmentedPublisher<Object>> removePublisher, org.reactivestreams.Publisher<org.infinispan.persistence.spi.NonBlockingStore.SegmentedPublisher<org.infinispan.persistence.spi.MarshallableEntry<K,V>>> writePublisher)
      Specified by:
      batch in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • clear

      public CompletionStage<Void> clear()
      Specified by:
      clear in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • delete

      public CompletionStage<Boolean> delete(int segment, Object key)
      Specified by:
      delete in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • setInternalCacheEntryFactory

      public void setInternalCacheEntryFactory(org.infinispan.container.impl.InternalEntryFactory iceFactory)
    • getRemoteCache

      public org.infinispan.client.hotrod.RemoteCache<Object,Object> getRemoteCache()
    • getConfiguration

      public RemoteStoreConfiguration getConfiguration()
    • ignoreCommandWithFlags

      public boolean ignoreCommandWithFlags(long commandFlags)
      Specified by:
      ignoreCommandWithFlags in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • addSegments

      public CompletionStage<Void> addSegments(org.infinispan.commons.util.IntSet segments)
      Specified by:
      addSegments in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>
    • removeSegments

      public CompletionStage<Void> removeSegments(org.infinispan.commons.util.IntSet segments)
      Specified by:
      removeSegments in interface org.infinispan.persistence.spi.NonBlockingStore<K,V>