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,JpaStoreConfigurationBuilder,LevelDBStoreConfigurationBuilder,LuceneLoaderConfigurationBuilder,RemoteStoreConfigurationBuilder,RestStoreConfigurationBuilder,SingleFileStoreConfigurationBuilder
public abstract class AbstractStoreConfigurationBuilder<T extends StoreConfiguration,S extends AbstractStoreConfigurationBuilder<T,S>> extends AbstractPersistenceConfigurationChildBuilder implements StoreConfigurationBuilder<T,S>
-
-
Field Summary
Fields Modifier and Type Field Description protected AsyncStoreConfigurationBuilder<S>asyncprotected AttributeSetattributesprotected ConfigurationBuilderbuilderprotected booleanfetchPersistentStateDeprecated.protected booleanignoreModificationsDeprecated.protected booleanpreloadDeprecated.protected PropertiespropertiesDeprecated.protected booleanpurgeOnStartupDeprecated.protected booleansharedDeprecated.protected SingletonStoreConfigurationBuilder<S>singletonStore
-
Constructor Summary
Constructors Constructor Description AbstractStoreConfigurationBuilder(PersistenceConfigurationBuilder builder)Deprecated.AbstractStoreConfigurationBuilder(PersistenceConfigurationBuilder builder, AttributeSet attributes)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SaddProperty(String key, String value)Defines a single property.AsyncStoreConfigurationBuilder<S>async()Configuration for the async cache store.Configurationbuild()ClusteringConfigurationBuilderclustering()CompatibilityModeConfigurationBuildercompatibility()Deprecated.CustomInterceptorsConfigurationBuildercustomInterceptors()DataContainerConfigurationBuilderdataContainer()DeadlockDetectionConfigurationBuilderdeadlockDetection()EncodingConfigurationBuilderencoding()EvictionConfigurationBuildereviction()ExpirationConfigurationBuilderexpiration()SfetchPersistentState(boolean b)If true, fetch persistent state when joining a cluster.protected ConfigurationBuildergetBuilder()SignoreModifications(boolean b)If true, any operation that modifies the cache (put, remove, clear, store...etc) won't be applied to the cache store.IndexingConfigurationBuilderindexing()InvocationBatchingConfigurationBuilderinvocationBatching()JMXStatisticsConfigurationBuilderjmxStatistics()LockingConfigurationBuilderlocking()SmaxBatchSize(int maxBatchSize)The maximum size of a batch to be inserted/deleted from the store.MemoryConfigurationBuildermemory()PersistenceConfigurationBuilderpersistence()Spreload(boolean b)If true, when the cache starts, data stored in the cache store will be pre-loaded into memory.Sproperties(Properties properties)SpurgeOnStartup(boolean b)If true, purges this cache store when it starts up.Builder<?>read(T template)Reads the configuration from an already created configuration bean into this builder.SecurityConfigurationBuildersecurity()Ssegmented(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 theSegmentedAdvancedLoadWriteStoreinterface.Sshared(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.booleansimpleCache()ConfigurationChildBuildersimpleCache(boolean simpleCache)SingletonStoreConfigurationBuilder<S>singleton()SingletonStore is a delegating cache store used for situations when only one instance in a cluster should interact with the underlying store.SitesConfigurationBuildersites()StoreAsBinaryConfigurationBuilderstoreAsBinary()Deprecated.ConfigurationChildBuildertemplate(boolean template)StringtoString()TransactionConfigurationBuildertransaction()Stransactional(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.UnsafeConfigurationBuilderunsafe()voidvalidate()Validate the data in this builder before building the configuration beanprotected voidvalidate(boolean skipClassChecks)voidvalidate(GlobalConfiguration globalConfig)VersioningConfigurationBuilderversioning()SwithProperties(Properties props)Properties passed to the cache store or loader-
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
build, clustering, compatibility, customInterceptors, dataContainer, deadlockDetection, encoding, eviction, expiration, indexing, invocationBatching, jmxStatistics, locking, memory, security, simpleCache, simpleCache, sites, storeAsBinary, template, transaction, unsafe, versioning
-
Methods inherited from interface org.infinispan.configuration.cache.PersistenceConfigurationChildBuilder
persistence
-
-
-
-
Field Detail
-
attributes
protected final AttributeSet attributes
-
async
protected final AsyncStoreConfigurationBuilder<S extends AbstractStoreConfigurationBuilder<T,S>> async
-
singletonStore
protected final SingletonStoreConfigurationBuilder<S extends AbstractStoreConfigurationBuilder<T,S>> singletonStore
-
preload
@Deprecated protected boolean preload
Deprecated.
-
shared
@Deprecated protected boolean shared
Deprecated.
-
ignoreModifications
@Deprecated protected boolean ignoreModifications
Deprecated.
-
properties
@Deprecated protected Properties properties
Deprecated.
-
purgeOnStartup
@Deprecated protected boolean purgeOnStartup
Deprecated.
-
fetchPersistentState
@Deprecated protected boolean fetchPersistentState
Deprecated.
-
builder
protected final ConfigurationBuilder builder
-
-
Constructor Detail
-
AbstractStoreConfigurationBuilder
@Deprecated public AbstractStoreConfigurationBuilder(PersistenceConfigurationBuilder builder)
Deprecated.
-
AbstractStoreConfigurationBuilder
public AbstractStoreConfigurationBuilder(PersistenceConfigurationBuilder builder, AttributeSet attributes)
-
-
Method Detail
-
async
public AsyncStoreConfigurationBuilder<S> 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:
asyncin interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
singleton
public SingletonStoreConfigurationBuilder<S> singleton()
SingletonStore is a delegating cache store used for situations when only one instance in a cluster should interact with the underlying store. The coordinator of the cluster will be responsible for the underlying CacheStore. SingletonStore is a simply facade to a real CacheStore implementation. It always delegates reads to the real CacheStore.- Specified by:
singletonin interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
fetchPersistentState
public S fetchPersistentState(boolean b)
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, and only 'replication' and 'invalidation' cluster modes are supported.- Specified by:
fetchPersistentStatein interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
ignoreModifications
public S ignoreModifications(boolean b)
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:
ignoreModificationsin interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
purgeOnStartup
public S purgeOnStartup(boolean b)
If true, purges this cache store when it starts up.- Specified by:
purgeOnStartupin interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
properties
public S properties(Properties properties)
-
addProperty
public S addProperty(String key, String value)
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:
addPropertyin interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
withProperties
public S withProperties(Properties props)
Properties passed to the cache store or loader- Specified by:
withPropertiesin interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
preload
public S preload(boolean b)
If true, when the cache starts, data stored in the cache store will be pre-loaded into memory. 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:
preloadin interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
shared
public S 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. If enabled, only the node where the modification originated will write to the cache store. If disabled, each individual cache reacts to a potential remote update by storing the data to the cache store. Note that this could be useful if each individual node has its own cache store - perhaps local on-disk.- Specified by:
sharedin interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
transactional
public S 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. 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:
transactionalin interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
maxBatchSize
public S maxBatchSize(int maxBatchSize)
Description copied from interface:StoreConfigurationChildBuilderThe 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:
maxBatchSizein interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>
-
segmented
public S segmented(boolean b)
Description copied from interface:StoreConfigurationChildBuilderIf true this store should either be non shared (segmenting can be done automatically for non shared stores) or the shared store must implement theSegmentedAdvancedLoadWriteStoreinterface. 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.load(Object)orCacheWriter.write(MarshalledEntry)than segmenting this store could also improve performance of those operations.- Specified by:
segmentedin interfaceStoreConfigurationChildBuilder<T extends StoreConfiguration>- Parameters:
b- whether this store should be segmented- Returns:
- this
-
validate
public void validate()
Description copied from interface:BuilderValidate the data in this builder before building the configuration bean- Specified by:
validatein interfaceBuilder<T extends StoreConfiguration>
-
validate
protected void validate(boolean skipClassChecks)
-
validate
public void validate(GlobalConfiguration globalConfig)
- Specified by:
validatein interfaceConfigurationChildBuilder
-
read
public Builder<?> read(T template)
Description copied from interface:BuilderReads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
readin interfaceBuilder<T extends StoreConfiguration>- Parameters:
template- the configuration from which to "clone" this config if needed.
-
template
public ConfigurationChildBuilder template(boolean template)
- Specified by:
templatein interfaceConfigurationChildBuilder
-
simpleCache
public ConfigurationChildBuilder simpleCache(boolean simpleCache)
- Specified by:
simpleCachein interfaceConfigurationChildBuilder
-
simpleCache
public boolean simpleCache()
- Specified by:
simpleCachein interfaceConfigurationChildBuilder
-
clustering
public ClusteringConfigurationBuilder clustering()
- Specified by:
clusteringin interfaceConfigurationChildBuilder
-
customInterceptors
public CustomInterceptorsConfigurationBuilder customInterceptors()
- Specified by:
customInterceptorsin interfaceConfigurationChildBuilder
-
dataContainer
public DataContainerConfigurationBuilder dataContainer()
- Specified by:
dataContainerin interfaceConfigurationChildBuilder
-
deadlockDetection
public DeadlockDetectionConfigurationBuilder deadlockDetection()
- Specified by:
deadlockDetectionin interfaceConfigurationChildBuilder
-
encoding
public EncodingConfigurationBuilder encoding()
- Specified by:
encodingin interfaceConfigurationChildBuilder
-
eviction
public EvictionConfigurationBuilder eviction()
- Specified by:
evictionin interfaceConfigurationChildBuilder
-
expiration
public ExpirationConfigurationBuilder expiration()
- Specified by:
expirationin interfaceConfigurationChildBuilder
-
indexing
public IndexingConfigurationBuilder indexing()
- Specified by:
indexingin interfaceConfigurationChildBuilder
-
invocationBatching
public InvocationBatchingConfigurationBuilder invocationBatching()
- Specified by:
invocationBatchingin interfaceConfigurationChildBuilder
-
jmxStatistics
public JMXStatisticsConfigurationBuilder jmxStatistics()
- Specified by:
jmxStatisticsin interfaceConfigurationChildBuilder
-
persistence
public PersistenceConfigurationBuilder persistence()
- Specified by:
persistencein interfaceConfigurationChildBuilder
-
locking
public LockingConfigurationBuilder locking()
- Specified by:
lockingin interfaceConfigurationChildBuilder
-
security
public SecurityConfigurationBuilder security()
- Specified by:
securityin interfaceConfigurationChildBuilder
-
storeAsBinary
@Deprecated public StoreAsBinaryConfigurationBuilder storeAsBinary()
Deprecated.- Specified by:
storeAsBinaryin interfaceConfigurationChildBuilder
-
transaction
public TransactionConfigurationBuilder transaction()
- Specified by:
transactionin interfaceConfigurationChildBuilder
-
versioning
public VersioningConfigurationBuilder versioning()
- Specified by:
versioningin interfaceConfigurationChildBuilder
-
unsafe
public UnsafeConfigurationBuilder unsafe()
- Specified by:
unsafein interfaceConfigurationChildBuilder
-
sites
public SitesConfigurationBuilder sites()
- Specified by:
sitesin interfaceConfigurationChildBuilder
-
compatibility
@Deprecated public CompatibilityModeConfigurationBuilder compatibility()
Deprecated.- Specified by:
compatibilityin interfaceConfigurationChildBuilder
-
memory
public MemoryConfigurationBuilder memory()
- Specified by:
memoryin interfaceConfigurationChildBuilder
-
getBuilder
protected ConfigurationBuilder getBuilder()
-
build
public Configuration build()
- Specified by:
buildin interfaceConfigurationChildBuilder
-
-