Class AbstractSegmentedAdvancedLoadWriteStore<K,V>
- java.lang.Object
-
- org.infinispan.persistence.support.AbstractSegmentedAdvancedLoadWriteStore<K,V>
-
- All Implemented Interfaces:
Lifecycle
,AdvancedCacheLoader<K,V>
,AdvancedCacheWriter<K,V>
,AdvancedLoadWriteStore<K,V>
,CacheLoader<K,V>
,CacheWriter<K,V>
,ExternalStore<K,V>
,SegmentedAdvancedLoadWriteStore<K,V>
- Direct Known Subclasses:
ComposedSegmentedLoadWriteStore
public abstract class AbstractSegmentedAdvancedLoadWriteStore<K,V> extends Object implements SegmentedAdvancedLoadWriteStore<K,V>
Abstract segment loader writer that implements all the single key non segmented methods by invoking the segmented equivalent by passing in the segment returned from invokinggetKeyMapper()
. These methods are also all declared final as to make sure the end user does not implement the incorrect method. All other methods must be implemented as normal.- Since:
- 9.4
- Author:
- wburns
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.persistence.spi.AdvancedCacheLoader
AdvancedCacheLoader.CacheLoaderTask<K,V>, AdvancedCacheLoader.TaskContext
-
Nested classes/interfaces inherited from interface org.infinispan.persistence.spi.AdvancedCacheWriter
AdvancedCacheWriter.PurgeListener<K>
-
-
Constructor Summary
Constructors Constructor Description AbstractSegmentedAdvancedLoadWriteStore()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
contains(Object key)
Returns true if the storage contains an entry associated with the given key.boolean
delete(Object key)
protected abstract ToIntFunction<Object>
getKeyMapper()
MarshalledEntry<K,V>
load(Object key)
Fetches an entry from the storage.void
write(MarshalledEntry<? extends K,? extends V> entry)
Persists the entry to the storage.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.persistence.spi.AdvancedCacheLoader
process, publishEntries, publishKeys, size
-
Methods inherited from interface org.infinispan.persistence.spi.AdvancedCacheWriter
clear, purge
-
Methods inherited from interface org.infinispan.persistence.spi.CacheLoader
init
-
Methods inherited from interface org.infinispan.persistence.spi.CacheWriter
deleteBatch, init, isAvailable, writeBatch
-
Methods inherited from interface org.infinispan.persistence.spi.ExternalStore
destroy, isAvailable
-
Methods inherited from interface org.infinispan.persistence.spi.SegmentedAdvancedLoadWriteStore
addSegments, clear, contains, delete, load, publishEntries, publishKeys, removeSegments, size, write
-
-
-
-
Method Detail
-
getKeyMapper
protected abstract ToIntFunction<Object> getKeyMapper()
-
load
public final MarshalledEntry<K,V> load(Object key)
Description copied from interface:CacheLoader
Fetches an entry from the storage. If aMarshalledEntry
needs to be created here,InitializationContext.getMarshalledEntryFactory()
andInitializationContext.getByteBufferFactory()
should be used.- Specified by:
load
in interfaceCacheLoader<K,V>
- Returns:
- the entry, or null if the entry does not exist
-
contains
public final boolean contains(Object key)
Description copied from interface:CacheLoader
Returns true if the storage contains an entry associated with the given key.- Specified by:
contains
in interfaceCacheLoader<K,V>
-
write
public final void write(MarshalledEntry<? extends K,? extends V> entry)
Description copied from interface:CacheWriter
Persists the entry to the storage.- Specified by:
write
in interfaceCacheWriter<K,V>
- See Also:
MarshalledEntry
-
delete
public final boolean delete(Object key)
- Specified by:
delete
in interfaceCacheWriter<K,V>
- Returns:
- true if the entry existed in the persistent store and it was deleted.
-
-