Class AbstractSegmentedAdvancedLoadWriteStore<K,V>
- java.lang.Object
-
- org.infinispan.persistence.support.AbstractSegmentedAdvancedLoadWriteStore<K,V>
-
- All Implemented Interfaces:
Lifecycle
,AdvancedCacheExpirationWriter<K,V>
,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 java.lang.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.AdvancedCacheExpirationWriter
AdvancedCacheExpirationWriter.ExpirationPurgeListener<K,V>
-
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(java.lang.Object key)
Returns true if the storage contains an entry associated with the given key.boolean
delete(java.lang.Object key)
protected abstract java.util.function.ToIntFunction<java.lang.Object>
getKeyMapper()
MarshallableEntry<K,V>
loadEntry(java.lang.Object key)
Fetches an entry from the storage.void
write(MarshallableEntry<? 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.AdvancedCacheExpirationWriter
purge
-
Methods inherited from interface org.infinispan.persistence.spi.AdvancedCacheLoader
entryPublisher, process, publishEntries, publishKeys, size
-
Methods inherited from interface org.infinispan.persistence.spi.AdvancedCacheWriter
clear
-
Methods inherited from interface org.infinispan.persistence.spi.CacheLoader
init, load
-
Methods inherited from interface org.infinispan.persistence.spi.CacheWriter
bulkUpdate, deleteBatch, init, isAvailable, write, 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, entryPublisher, get, load, publishEntries, publishKeys, purge, removeSegments, size, write, write
-
-
-
-
Method Detail
-
getKeyMapper
protected abstract java.util.function.ToIntFunction<java.lang.Object> getKeyMapper()
-
loadEntry
public final MarshallableEntry<K,V> loadEntry(java.lang.Object key)
Description copied from interface:CacheLoader
Fetches an entry from the storage. If aMarshallableEntry
needs to be created here,InitializationContext.getMarshallableEntryFactory()
()} andInitializationContext.getByteBufferFactory()
should be used.- Specified by:
loadEntry
in interfaceCacheLoader<K,V>
- Returns:
- the entry, or null if the entry does not exist
-
contains
public final boolean contains(java.lang.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(MarshallableEntry<? 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:
MarshallableEntry
-
delete
public final boolean delete(java.lang.Object key)
- Specified by:
delete
in interfaceCacheWriter<K,V>
- Returns:
- true if the entry existed in the persistent store and it was deleted.
-
-