Class MemoryConfigurationBuilder
- java.lang.Object
-
- org.infinispan.configuration.cache.MemoryConfigurationBuilder
-
- All Implemented Interfaces:
BaseConfigurationInfo,Builder<MemoryConfiguration>,ConfigurationBuilderInfo,ConfigurationChildBuilder
public class MemoryConfigurationBuilder extends Object implements Builder<MemoryConfiguration>, ConfigurationBuilderInfo
Controls the data container for the cache.- Author:
- William Burns
-
-
Field Summary
Fields Modifier and Type Field Description protected ConfigurationBuilderbuilder
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intaddressCount()Deprecated.since 10.0MemoryConfigurationBuilderaddressCount(int addressCount)Deprecated.since 10.0Configurationbuild()ClusteringConfigurationBuilderclustering()MemoryConfigurationcreate()Create the configuration beanCustomInterceptorsConfigurationBuildercustomInterceptors()Deprecated.Since 10.0, custom interceptors support will be removed and only modules will be able to define interceptorsEncodingConfigurationBuilderencoding()EvictionStrategyevictionStrategy()The configured eviction strategy, please seeevictionStrategy(EvictionStrategy).MemoryConfigurationBuilderevictionStrategy(EvictionStrategy strategy)Sets the eviction strategy which can be: NONE - no eviction will take place MANUAL - no eviction will take place automatically, but user is assumed to manually call evict REMOVE - eviction will remove entries to make room for new entries to be inserted EXCEPTION - eviction will not take place, but instead an exception will be thrown to ensure container doesn't grow too large The eviction strategy NONE and MANUAL are essentially the same except that MANUAL does not warn the user when passivation is enabled.EvictionTypeevictionType()The configured eviction type, please seeevictionType(EvictionType).MemoryConfigurationBuilderevictionType(EvictionType type)Sets the eviction type which can either be COUNT - entries will be evicted when the number of entries exceeds thesize(long)MEMORY - entries will be evicted when the approximate combined size of all values exceeds thesize(long)Cache size is guaranteed not to exceed upper limit specified by size.ExpirationConfigurationBuilderexpiration()protected ConfigurationBuildergetBuilder()ConfigurationBuilderInfogetBuilderInfo(String name, String qualifier)Collection<ConfigurationBuilderInfo>getChildrenInfo()org.infinispan.commons.configuration.elements.ElementDefinitiongetElementDefinition()IndexingConfigurationBuilderindexing()InvocationBatchingConfigurationBuilderinvocationBatching()LockingConfigurationBuilderlocking()MemoryConfigurationBuildermemory()PersistenceConfigurationBuilderpersistence()MemoryConfigurationBuilderread(MemoryConfiguration template)Reads the configuration from an already created configuration bean into this builder.SecurityConfigurationBuildersecurity()booleansimpleCache()ConfigurationChildBuildersimpleCache(boolean simpleCache)SitesConfigurationBuildersites()longsize()The configured eviction size, please seesize(long).MemoryConfigurationBuildersize(long size)Defines the maximum size before eviction occurs.StatisticsConfigurationBuilderstatistics()StorageTypestorageType()The underlying storage type for this configurationMemoryConfigurationBuilderstorageType(StorageType storageType)Set theStorageTypeto determine how the data is stored in the data container.ConfigurationChildBuildertemplate(boolean template)StringtoString()TransactionConfigurationBuildertransaction()UnsafeConfigurationBuilderunsafe()voidvalidate()Validate the data in this builder before building the configuration beanvoidvalidate(GlobalConfiguration globalConfig)-
Methods inherited from interface org.infinispan.commons.configuration.BaseConfigurationInfo
attributes
-
Methods inherited from interface org.infinispan.commons.configuration.ConfigurationBuilderInfo
getNewBuilderInfo
-
Methods inherited from interface org.infinispan.configuration.cache.ConfigurationChildBuilder
jmxStatistics
-
-
-
-
Field Detail
-
builder
protected final ConfigurationBuilder builder
-
-
Method Detail
-
getChildrenInfo
public Collection<ConfigurationBuilderInfo> getChildrenInfo()
- Specified by:
getChildrenInfoin interfaceConfigurationBuilderInfo- Returns:
- a collection of
ConfigurationBuilderInfofor the sub-elements of the builder.
-
storageType
public MemoryConfigurationBuilder storageType(StorageType storageType)
Set theStorageTypeto determine how the data is stored in the data container.- Parameters:
storageType- the storage type of the underlying data- Returns:
- this configuration builder
-
storageType
public StorageType storageType()
The underlying storage type for this configuration- Returns:
- the configured storage type
-
size
public MemoryConfigurationBuilder size(long size)
Defines the maximum size before eviction occurs. SeeevictionType(EvictionType)for more details on the size is interpreted. IfevictionStrategy(EvictionStrategy)has not been invoked, this will set the strategy toEvictionStrategy.REMOVE.- Parameters:
size- the maximum size for the container
-
getElementDefinition
public org.infinispan.commons.configuration.elements.ElementDefinition getElementDefinition()
- Specified by:
getElementDefinitionin interfaceBaseConfigurationInfo- Returns:
- the
ElementDefinitionof the configuration.
-
size
public long size()
The configured eviction size, please seesize(long).- Returns:
- the configured evicted size
-
evictionType
public MemoryConfigurationBuilder evictionType(EvictionType type)
Sets the eviction type which can either be- COUNT - entries will be evicted when the number of entries exceeds the
size(long) - MEMORY - entries will be evicted when the approximate combined size of all values exceeds the
size(long)
- Parameters:
type-
- COUNT - entries will be evicted when the number of entries exceeds the
-
evictionType
public EvictionType evictionType()
The configured eviction type, please seeevictionType(EvictionType).- Returns:
- the configured eviction type
-
evictionStrategy
public MemoryConfigurationBuilder evictionStrategy(EvictionStrategy strategy)
Sets the eviction strategy which can be:- NONE - no eviction will take place
- MANUAL - no eviction will take place automatically, but user is assumed to manually call evict
- REMOVE - eviction will remove entries to make room for new entries to be inserted
- EXCEPTION - eviction will not take place, but instead an exception will be thrown to ensure container doesn't grow too large
- Parameters:
strategy- the strategy to set- Returns:
- this
-
evictionStrategy
public EvictionStrategy evictionStrategy()
The configured eviction strategy, please seeevictionStrategy(EvictionStrategy).- Returns:
- the configured eviction stategy
-
addressCount
@Deprecated public MemoryConfigurationBuilder addressCount(int addressCount)
Deprecated.since 10.0Configuration setting when using off-heap that defines how many address pointers there are. This number will be rounded up to the next power of two. This helps performance in that the more address pointers there are the less collisions there will be which improve performance of both read and write operations. This is only used when OFF_HEAP storage type is configuredstorageType(StorageType).- Parameters:
addressCount-- Returns:
- this
-
addressCount
@Deprecated public int addressCount()
Deprecated.since 10.0How many address pointers are configured for the off heap storage. SeeaddressCount(int)for more information.- Returns:
- the configured amount of address pointers
-
validate
public void validate()
Description copied from interface:BuilderValidate the data in this builder before building the configuration bean- Specified by:
validatein interfaceBuilder<MemoryConfiguration>
-
validate
public void validate(GlobalConfiguration globalConfig)
- Specified by:
validatein interfaceConfigurationChildBuilder
-
create
public MemoryConfiguration create()
Description copied from interface:BuilderCreate the configuration bean- Specified by:
createin interfaceBuilder<MemoryConfiguration>- Returns:
-
read
public MemoryConfigurationBuilder read(MemoryConfiguration 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<MemoryConfiguration>- Parameters:
template- the configuration from which to "clone" this config if needed.
-
getBuilderInfo
public ConfigurationBuilderInfo getBuilderInfo(String name, String qualifier)
- Specified by:
getBuilderInfoin interfaceConfigurationBuilderInfo- Returns:
- the
ConfigurationBuilderInfoassociated with a certain serialized element name.
-
toString
public String toString()
-
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
@Deprecated public CustomInterceptorsConfigurationBuilder customInterceptors()
Deprecated.Since 10.0, custom interceptors support will be removed and only modules will be able to define interceptors- Specified by:
customInterceptorsin interfaceConfigurationChildBuilder
-
encoding
public EncodingConfigurationBuilder encoding()
- Specified by:
encodingin 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
-
statistics
public StatisticsConfigurationBuilder statistics()
- Specified by:
statisticsin 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
-
transaction
public TransactionConfigurationBuilder transaction()
- Specified by:
transactionin interfaceConfigurationChildBuilder
-
unsafe
public UnsafeConfigurationBuilder unsafe()
- Specified by:
unsafein interfaceConfigurationChildBuilder
-
sites
public SitesConfigurationBuilder sites()
- Specified by:
sitesin interfaceConfigurationChildBuilder
-
memory
public MemoryConfigurationBuilder memory()
- Specified by:
memoryin interfaceConfigurationChildBuilder
-
getBuilder
protected ConfigurationBuilder getBuilder()
-
build
public Configuration build()
- Specified by:
buildin interfaceConfigurationChildBuilder
-
-