Class InitializationContextImpl
java.lang.Object
org.infinispan.persistence.InitializationContextImpl
- All Implemented Interfaces:
InitializationContext
- Since:
- 6.0
- Author:
- Mircea Markus
-
Constructor Summary
ConstructorsConstructorDescriptionInitializationContextImpl
(StoreConfiguration configuration, Cache cache, KeyPartitioner keyPartitioner, PersistenceMarshaller marshaller, TimeService timeService, ByteBufferFactory byteBufferFactory, MarshallableEntryFactory marshallableEntryFactory, Executor nonBlockingExecutor, GlobalConfiguration globalConfiguration, BlockingManager blockingManager, NonBlockingManager nonBlockingManager) -
Method Summary
Modifier and TypeMethodDescriptionboolean
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()
Returns 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.
-
Constructor Details
-
InitializationContextImpl
public InitializationContextImpl(StoreConfiguration configuration, Cache cache, KeyPartitioner keyPartitioner, PersistenceMarshaller marshaller, TimeService timeService, ByteBufferFactory byteBufferFactory, MarshallableEntryFactory marshallableEntryFactory, Executor nonBlockingExecutor, GlobalConfiguration globalConfiguration, BlockingManager blockingManager, NonBlockingManager nonBlockingManager)
-
-
Method Details
-
getConfiguration
- Specified by:
getConfiguration
in interfaceInitializationContext
-
getCache
- Specified by:
getCache
in interfaceInitializationContext
-
getKeyPartitioner
Description copied from interface:InitializationContext
The configured partitioner that can be used to determine which segment a given key belongs to. This is useful when a store is segmented.- Specified by:
getKeyPartitioner
in interfaceInitializationContext
- Returns:
- partitioner that can provide what segment a key maps to
-
getTimeService
- Specified by:
getTimeService
in interfaceInitializationContext
-
getByteBufferFactory
Description copied from interface:InitializationContext
To be used for buildingByteBuffer
objects.- Specified by:
getByteBufferFactory
in interfaceInitializationContext
-
getMarshallableEntryFactory
Description copied from interface:InitializationContext
Should be used to build allMarshallableEntry
objects.- Specified by:
getMarshallableEntryFactory
in interfaceInitializationContext
-
getNonBlockingExecutor
Description copied from interface:InitializationContext
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.- Specified by:
getNonBlockingExecutor
in interfaceInitializationContext
- Returns:
- an executor that can submit non-blocking tasks.
-
getBlockingManager
Description copied from interface:InitializationContext
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.- Specified by:
getBlockingManager
in interfaceInitializationContext
- Returns:
- a manager that should be used to execute blocking operations.
-
getNonBlockingManager
Description copied from interface:InitializationContext
Returns a manager that is designed to help with non blocking operations.- Specified by:
getNonBlockingManager
in interfaceInitializationContext
- Returns:
- a manager that can be used to help with offloading non blocking work.
-
getPersistenceMarshaller
Description copied from interface:InitializationContext
Returns the persistence marshaller which should be used to marshall/unmarshall all stored bytes.- Specified by:
getPersistenceMarshaller
in interfaceInitializationContext
-
getGlobalConfiguration
Description copied from interface:InitializationContext
Returns the global configuration- Specified by:
getGlobalConfiguration
in interfaceInitializationContext
-
canStoreDirectlyPurgeOnStartup
public boolean canStoreDirectlyPurgeOnStartup()Description copied from interface:InitializationContext
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.- Specified by:
canStoreDirectlyPurgeOnStartup
in interfaceInitializationContext
- Returns:
- whether a store can directly purge its contents on startup
-