Class AbstractStoreConfigurationBuilder<T extends StoreConfiguration,S extends AbstractStoreConfigurationBuilder<T,S>>
java.lang.Object
org.infinispan.configuration.cache.AbstractPersistenceConfigurationChildBuilder
org.infinispan.configuration.cache.AbstractStoreConfigurationBuilder<T,S>
- All Implemented Interfaces:
Builder<T>
,Self<S>
,ConfigurationChildBuilder
,PersistenceConfigurationChildBuilder
,StoreConfigurationBuilder<T,
,S> StoreConfigurationChildBuilder<S>
- Direct Known Subclasses:
AbstractJdbcStoreConfigurationBuilder
,ClusterLoaderConfigurationBuilder
,CustomStoreConfigurationBuilder
,RemoteStoreConfigurationBuilder
,RocksDBStoreConfigurationBuilder
,SingleFileStoreConfigurationBuilder
,SoftIndexFileStoreConfigurationBuilder
public abstract class AbstractStoreConfigurationBuilder<T extends StoreConfiguration,S extends AbstractStoreConfigurationBuilder<T,S>>
extends AbstractPersistenceConfigurationChildBuilder
implements StoreConfigurationBuilder<T,S>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AsyncStoreConfigurationBuilder
<S> protected final AttributeSet
protected final ConfigurationBuilder
-
Constructor Summary
ConstructorDescriptionAbstractStoreConfigurationBuilder
(PersistenceConfigurationBuilder builder, AttributeSet attributes) AbstractStoreConfigurationBuilder
(PersistenceConfigurationBuilder builder, AttributeSet attributes, AttributeSet asyncAttributeSet) -
Method Summary
Modifier and TypeMethodDescriptionaddProperty
(String key, String value) Defines a single property.async()
Configuration for the async cache store.build()
encoding()
fetchPersistentState
(boolean b) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated since 14.0.protected ConfigurationBuilder
ignoreModifications
(boolean b) If true, any operation that modifies the cache (put, remove, clear, store...etc) won't be applied to the cache store.indexing()
locking()
maxBatchSize
(int maxBatchSize) The maximum size of a batch to be inserted/deleted from the store.memory()
preload
(boolean b) If true, when the cache starts, data stored in the cache store will be pre-loaded into memory.properties
(Properties properties) purgeOnStartup
(boolean b) If true, purges this cache store when it starts up.query()
Builder
<?> Reads the configuration from an already created configuration bean into this builder.security()
segmented
(boolean b) If true this store should either be non shared (segmenting can be done automatically for non shared stores) or the shared store must implement theSegmentedAdvancedLoadWriteStore
interface.shared
(boolean b) This setting should be set to true when multiple cache instances share the same cache store (e.g., multiple nodes in a cluster using a JDBC-based CacheStore pointing to the same, shared database.) Setting this to true avoids multiple cache instances writing the same modification multiple times.boolean
simpleCache
(boolean simpleCache) sites()
template
(boolean template) toString()
tracing()
transactional
(boolean b) This setting should be set to true when the underlying cache store supports transactions and it is desirable for the underlying store and the cache to remain synchronized.unsafe()
void
validate()
Validate the data in this builder before building the configuration beanprotected void
validate
(boolean skipClassChecks) void
validate
(GlobalConfiguration globalConfig) withProperties
(Properties props) Properties passed to the cache store or loaderwriteOnly
(boolean b) If true, this cache store will be only used to write entries.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.infinispan.configuration.cache.ConfigurationChildBuilder
aliases, build, clustering, encoding, expiration, indexing, invocationBatching, locking, memory, query, security, simpleCache, simpleCache, sites, statistics, template, tracing, transaction, unsafe
Methods inherited from interface org.infinispan.configuration.cache.PersistenceConfigurationChildBuilder
persistence
-
Field Details
-
attributes
-
async
protected final AsyncStoreConfigurationBuilder<S extends AbstractStoreConfigurationBuilder<T,S>> async -
builder
-
-
Constructor Details
-
AbstractStoreConfigurationBuilder
public AbstractStoreConfigurationBuilder(PersistenceConfigurationBuilder builder, AttributeSet attributes) -
AbstractStoreConfigurationBuilder
public AbstractStoreConfigurationBuilder(PersistenceConfigurationBuilder builder, AttributeSet attributes, AttributeSet asyncAttributeSet)
-
-
Method Details
-
async
Configuration for the async cache store. If enabled, this provides you with asynchronous writes to the cache store, giving you 'write-behind' caching.- Specified by:
async
in interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
fetchPersistentState
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated since 14.0. There is no replacement. First non shared store is picked instead.If true, fetch persistent state when joining a cluster. If multiple cache stores are chained, only one of them can have this property enabled. Persistent state transfer with a shared cache store does not make sense, as the same persistent store that provides the data will just end up receiving it. Therefore, if a shared cache store is used, the cache will not allow a persistent state transfer even if a cache store has this property set to true. Finally, setting it to true only makes sense if in a clustered environment.- Specified by:
fetchPersistentState
in interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
ignoreModifications
If true, any operation that modifies the cache (put, remove, clear, store...etc) won't be applied to the cache store. This means that the cache store could become out of sync with the cache.- Specified by:
ignoreModifications
in interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
purgeOnStartup
If true, purges this cache store when it starts up.- Specified by:
purgeOnStartup
in interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
writeOnly
Description copied from interface:StoreConfigurationChildBuilder
If true, this cache store will be only used to write entries.- Specified by:
writeOnly
in interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
properties
-
addProperty
Defines a single property. Can be used multiple times to define all needed properties, but the full set is overridden by
StoreConfigurationChildBuilder.withProperties(java.util.Properties)
.These properties are passed directly to the cache store.
- Specified by:
addProperty
in interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
withProperties
Properties passed to the cache store or loader- Specified by:
withProperties
in interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
preload
If true, when the cache starts, data stored in the cache store will be pre-loaded into memory. If multiple cache stores are chained, only one of them can have this property enabled. This is particularly useful when data in the cache store will be needed immediately after startup and you want to avoid cache operations being delayed as a result of loading this data lazily. Can be used to provide a 'warm-cache' on startup, however there is a performance penalty as startup time is affected by this process.- Specified by:
preload
in interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
transactional
This setting should be set to true when the underlying cache store supports transactions and it is desirable for the underlying store and the cache to remain synchronized. With this enabled any Exceptions thrown whilst writing to the underlying store will result in both the store's and the cache's transaction rollingback. If enabled and this store is shared, then writes to this store will be performed at prepare time of the Infinispan Tx. If an exception is encountered by the store during prepare time, then this will result in the global Tx being rolledback along with this stores writes, otherwise writes to this store will be committed during the commit phase of 2PC. If this is not enabled, then writes to the cache store are performed during the commit phase of a Tx. Note that this requiresStoreConfigurationChildBuilder.shared(boolean)
to be set to true.- Specified by:
transactional
in interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
maxBatchSize
Description copied from interface:StoreConfigurationChildBuilder
The maximum size of a batch to be inserted/deleted from the store. If the value is less than one, then no upper limit is placed on the number of operations in a batch.- Specified by:
maxBatchSize
in interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
segmented
Description copied from interface:StoreConfigurationChildBuilder
If true this store should either be non shared (segmenting can be done automatically for non shared stores) or the shared store must implement theSegmentedAdvancedLoadWriteStore
interface. Segmented stores help performance for things that require viewing the entire contents of the store (eg. iteration, stream processing, state transfer, mass indexer). If the store doesn't provide constant time operations for methods such asCacheLoader.loadEntry(Object)
orCacheWriter.write(MarshallableEntry)
than segmenting this store could also improve performance of those operations.- Specified by:
segmented
in interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
- Parameters:
b
- whether this store should be segmented- Returns:
- this
-
attributes
- Specified by:
attributes
in interfaceBuilder<T extends StoreConfiguration>
-
validate
public void validate()Description copied from interface:Builder
Validate the data in this builder before building the configuration bean- Specified by:
validate
in interfaceBuilder<T extends StoreConfiguration>
-
validate
protected void validate(boolean skipClassChecks) -
validate
- Specified by:
validate
in interfaceConfigurationChildBuilder
-
read
Description copied from interface:Builder
Reads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
read
in interfaceBuilder<T extends StoreConfiguration>
- Parameters:
template
- the configuration from which to "clone" this config if needed.combine
- the way attributes and children of this instance and the template should be combined.
-
toString
-
aliases
- Specified by:
aliases
in interfaceConfigurationChildBuilder
-
template
- Specified by:
template
in interfaceConfigurationChildBuilder
-
simpleCache
- Specified by:
simpleCache
in interfaceConfigurationChildBuilder
-
simpleCache
public boolean simpleCache()- Specified by:
simpleCache
in interfaceConfigurationChildBuilder
-
clustering
- Specified by:
clustering
in interfaceConfigurationChildBuilder
-
encoding
- Specified by:
encoding
in interfaceConfigurationChildBuilder
-
expiration
- Specified by:
expiration
in interfaceConfigurationChildBuilder
-
query
- Specified by:
query
in interfaceConfigurationChildBuilder
-
indexing
- Specified by:
indexing
in interfaceConfigurationChildBuilder
-
tracing
- Specified by:
tracing
in interfaceConfigurationChildBuilder
-
invocationBatching
- Specified by:
invocationBatching
in interfaceConfigurationChildBuilder
-
statistics
- Specified by:
statistics
in interfaceConfigurationChildBuilder
-
persistence
- Specified by:
persistence
in interfaceConfigurationChildBuilder
-
locking
- Specified by:
locking
in interfaceConfigurationChildBuilder
-
security
- Specified by:
security
in interfaceConfigurationChildBuilder
-
transaction
- Specified by:
transaction
in interfaceConfigurationChildBuilder
-
unsafe
- Specified by:
unsafe
in interfaceConfigurationChildBuilder
-
sites
- Specified by:
sites
in interfaceConfigurationChildBuilder
-
memory
- Specified by:
memory
in interfaceConfigurationChildBuilder
-
getBuilder
-
build
- Specified by:
build
in interfaceConfigurationChildBuilder
-