Class RemoteStore<K,V>
- java.lang.Object
-
- org.infinispan.persistence.remote.RemoteStore<K,V>
-
- All Implemented Interfaces:
org.infinispan.commons.api.Lifecycle
,org.infinispan.persistence.spi.AdvancedCacheLoader<K,V>
,org.infinispan.persistence.spi.AdvancedCacheWriter<K,V>
,org.infinispan.persistence.spi.AdvancedLoadWriteStore<K,V>
,org.infinispan.persistence.spi.CacheLoader<K,V>
,org.infinispan.persistence.spi.CacheWriter<K,V>
,org.infinispan.persistence.spi.ExternalStore<K,V>
,org.infinispan.persistence.spi.FlagAffectedStore<K,V>
@ThreadSafe public class RemoteStore<K,V> extends Object implements org.infinispan.persistence.spi.AdvancedLoadWriteStore<K,V>, org.infinispan.persistence.spi.FlagAffectedStore<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:
RemoteStoreConfiguration
, Hotrod Java Client
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.persistence.spi.AdvancedCacheLoader
org.infinispan.persistence.spi.AdvancedCacheLoader.CacheLoaderTask<K extends Object,V extends Object>, org.infinispan.persistence.spi.AdvancedCacheLoader.TaskContext
-
Nested classes/interfaces inherited from interface org.infinispan.persistence.spi.AdvancedCacheWriter
org.infinispan.persistence.spi.AdvancedCacheWriter.PurgeListener<K extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description protected org.infinispan.persistence.spi.InitializationContext
ctx
-
Constructor Summary
Constructors Constructor Description RemoteStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
contains(Object key)
boolean
delete(Object key)
RemoteStoreConfiguration
getConfiguration()
org.infinispan.client.hotrod.RemoteCache<Object,Object>
getRemoteCache()
void
init(org.infinispan.persistence.spi.InitializationContext ctx)
boolean
isAvailable()
org.infinispan.marshall.core.MarshalledEntry<K,V>
load(Object key)
org.reactivestreams.Publisher<org.infinispan.marshall.core.MarshalledEntry<K,V>>
publishEntries(Predicate<? super K> filter, boolean fetchValue, boolean fetchMetadata)
io.reactivex.Flowable<K>
publishKeys(Predicate<? super K> filter)
void
purge(Executor threadPool, org.infinispan.persistence.spi.AdvancedCacheWriter.PurgeListener task)
void
setInternalCacheEntryFactory(org.infinispan.container.impl.InternalEntryFactory iceFactory)
boolean
shouldWrite(long commandFlags)
int
size()
void
start()
void
stop()
void
write(org.infinispan.marshall.core.MarshalledEntry entry)
void
writeBatch(Iterable<org.infinispan.marshall.core.MarshalledEntry<? extends K,? extends V>> marshalledEntries)
-
-
-
Method Detail
-
init
public void init(org.infinispan.persistence.spi.InitializationContext ctx)
-
start
public void start() throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
start
in interfaceorg.infinispan.commons.api.Lifecycle
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
stop
public void stop() throws org.infinispan.persistence.spi.PersistenceException
- Specified by:
stop
in interfaceorg.infinispan.commons.api.Lifecycle
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
isAvailable
public boolean isAvailable()
-
load
public org.infinispan.marshall.core.MarshalledEntry<K,V> load(Object key) throws org.infinispan.persistence.spi.PersistenceException
-
contains
public boolean contains(Object key) throws org.infinispan.persistence.spi.PersistenceException
-
publishEntries
public org.reactivestreams.Publisher<org.infinispan.marshall.core.MarshalledEntry<K,V>> publishEntries(Predicate<? super K> filter, boolean fetchValue, boolean fetchMetadata)
-
size
public int size()
-
purge
public void purge(Executor threadPool, org.infinispan.persistence.spi.AdvancedCacheWriter.PurgeListener task)
-
write
public void write(org.infinispan.marshall.core.MarshalledEntry entry) throws org.infinispan.persistence.spi.PersistenceException
-
writeBatch
public void writeBatch(Iterable<org.infinispan.marshall.core.MarshalledEntry<? extends K,? extends V>> marshalledEntries)
-
clear
public void clear() throws org.infinispan.persistence.spi.PersistenceException
-
delete
public boolean delete(Object key) throws org.infinispan.persistence.spi.PersistenceException
-
setInternalCacheEntryFactory
public void setInternalCacheEntryFactory(org.infinispan.container.impl.InternalEntryFactory iceFactory)
-
getConfiguration
public RemoteStoreConfiguration getConfiguration()
-
-