Interface InitializationContext
- All Known Implementing Classes:
DelegatingInitializationContext
,InitializationContextImpl
@ThreadSafe
public interface InitializationContext
Aggregates the initialisation state needed by org.infinispan.persistence.spi.NonBlockingStore.
- Since:
- 6.0
- Author:
- Mircea Markus
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
This method returns whether the store can directly purge its contents on startup, which can be more performant than a clear.Returns a manager that is designed to execute tasks that might block.To be used for buildingByteBuffer
objects.getCache()
<T extends StoreConfiguration>
TReturns the global configurationThe configured partitioner that can be used to determine which segment a given key belongs to.<K,
V> MarshallableEntryFactory <K, V> Should be used to build allMarshallableEntry
objects.Returns an executor for non-blocking tasks.Returns a manager that is designed to help with non blocking operations.Returns the persistence marshaller which should be used to marshall/unmarshall all stored bytes.
-
Method Details
-
getConfiguration
-
getCache
Cache getCache() -
getKeyPartitioner
KeyPartitioner getKeyPartitioner()The configured partitioner that can be used to determine which segment a given key belongs to. This is useful when a store is segmented.- Returns:
- partitioner that can provide what segment a key maps to
-
getTimeService
TimeService getTimeService() -
getByteBufferFactory
ByteBufferFactory getByteBufferFactory()To be used for buildingByteBuffer
objects. -
getNonBlockingExecutor
Executor getNonBlockingExecutor()Returns an executor for non-blocking tasks. Users must guarantee that the tasks they submit to this executor do not block the thread in which the executor runs. Doing so can cause Infinispan to handle operations more slowly, reducing performance, because threads are limited to the number of cores and are used extensively.- Returns:
- an executor that can submit non-blocking tasks.
-
getBlockingManager
BlockingManager getBlockingManager()Returns a manager that is designed to execute tasks that might block. This manager ensures that only the blocking code is run on a blocking thread and any stage continues on a non-blocking thread.- Returns:
- a manager that should be used to execute blocking operations.
-
getNonBlockingManager
NonBlockingManager getNonBlockingManager()Returns a manager that is designed to help with non blocking operations.- Returns:
- a manager that can be used to help with offloading non blocking work.
-
getMarshallableEntryFactory
Should be used to build allMarshallableEntry
objects. -
getPersistenceMarshaller
PersistenceMarshaller getPersistenceMarshaller()Returns the persistence marshaller which should be used to marshall/unmarshall all stored bytes. -
getGlobalConfiguration
GlobalConfiguration getGlobalConfiguration()Returns the global configuration -
canStoreDirectlyPurgeOnStartup
default boolean canStoreDirectlyPurgeOnStartup()This method returns whether the store can directly purge its contents on startup, which can be more performant than a clear. This will only be true ifStoreConfiguration.purgeOnStartup()
is true, but it may be false even when it is if there are other constraints limiting purge until after contents are loaded.- Returns:
- whether a store can directly purge its contents on startup
-