Class MemoryConfigurationBuilder
- java.lang.Object
-
- org.infinispan.configuration.cache.MemoryConfigurationBuilder
-
- All Implemented Interfaces:
Builder<MemoryConfiguration>
,ConfigurationChildBuilder
public class MemoryConfigurationBuilder extends Object implements Builder<MemoryConfiguration>
Controls the data container for the cache.- Author:
- William Burns
-
-
Field Summary
Fields Modifier and Type Field Description protected ConfigurationBuilder
builder
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
addressCount()
How many address pointers are configured for the off heap storage.MemoryConfigurationBuilder
addressCount(int addressCount)
Configuration setting when using off-heap that defines how many address pointers there are.Configuration
build()
ClusteringConfigurationBuilder
clustering()
CompatibilityModeConfigurationBuilder
compatibility()
Deprecated.MemoryConfiguration
create()
Create the configuration beanCustomInterceptorsConfigurationBuilder
customInterceptors()
DataContainerConfigurationBuilder
dataContainer()
DeadlockDetectionConfigurationBuilder
deadlockDetection()
EncodingConfigurationBuilder
encoding()
EvictionConfigurationBuilder
eviction()
EvictionStrategy
evictionStrategy()
The configured eviction strategy, please seeevictionStrategy(EvictionStrategy)
.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 The eviction strategy NONE and MANUAL are essentially the same except that MANUAL does not warn the user when passivation is enabled.EvictionType
evictionType()
The configured eviction type, please seeevictionType(EvictionType)
.MemoryConfigurationBuilder
evictionType(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.ExpirationConfigurationBuilder
expiration()
protected ConfigurationBuilder
getBuilder()
IndexingConfigurationBuilder
indexing()
InvocationBatchingConfigurationBuilder
invocationBatching()
JMXStatisticsConfigurationBuilder
jmxStatistics()
LockingConfigurationBuilder
locking()
MemoryConfigurationBuilder
memory()
PersistenceConfigurationBuilder
persistence()
MemoryConfigurationBuilder
read(MemoryConfiguration template)
Reads the configuration from an already created configuration bean into this builder.SecurityConfigurationBuilder
security()
boolean
simpleCache()
ConfigurationChildBuilder
simpleCache(boolean simpleCache)
SitesConfigurationBuilder
sites()
long
size()
The configured eviction size, please seesize(long)
.MemoryConfigurationBuilder
size(long size)
Defines the maximum size before eviction occurs.StorageType
storageType()
The underlying storage type for this configurationMemoryConfigurationBuilder
storageType(StorageType storageType)
Set theStorageType
to determine how the data is stored in the data container.StoreAsBinaryConfigurationBuilder
storeAsBinary()
Deprecated.ConfigurationChildBuilder
template(boolean template)
String
toString()
TransactionConfigurationBuilder
transaction()
UnsafeConfigurationBuilder
unsafe()
void
validate()
Validate the data in this builder before building the configuration beanvoid
validate(GlobalConfiguration globalConfig)
VersioningConfigurationBuilder
versioning()
-
-
-
Field Detail
-
builder
protected final ConfigurationBuilder builder
-
-
Method Detail
-
storageType
public MemoryConfigurationBuilder storageType(StorageType storageType)
Set theStorageType
to 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
-
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
public MemoryConfigurationBuilder addressCount(int addressCount)
Configuration 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
public int addressCount()
How 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:Builder
Validate the data in this builder before building the configuration bean- Specified by:
validate
in interfaceBuilder<MemoryConfiguration>
-
validate
public void validate(GlobalConfiguration globalConfig)
- Specified by:
validate
in interfaceConfigurationChildBuilder
-
create
public MemoryConfiguration create()
Description copied from interface:Builder
Create the configuration bean- Specified by:
create
in interfaceBuilder<MemoryConfiguration>
- Returns:
-
read
public MemoryConfigurationBuilder read(MemoryConfiguration template)
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<MemoryConfiguration>
- Parameters:
template
- the configuration from which to "clone" this config if needed.
-
template
public ConfigurationChildBuilder template(boolean template)
- Specified by:
template
in interfaceConfigurationChildBuilder
-
simpleCache
public ConfigurationChildBuilder simpleCache(boolean simpleCache)
- Specified by:
simpleCache
in interfaceConfigurationChildBuilder
-
simpleCache
public boolean simpleCache()
- Specified by:
simpleCache
in interfaceConfigurationChildBuilder
-
clustering
public ClusteringConfigurationBuilder clustering()
- Specified by:
clustering
in interfaceConfigurationChildBuilder
-
customInterceptors
public CustomInterceptorsConfigurationBuilder customInterceptors()
- Specified by:
customInterceptors
in interfaceConfigurationChildBuilder
-
dataContainer
public DataContainerConfigurationBuilder dataContainer()
- Specified by:
dataContainer
in interfaceConfigurationChildBuilder
-
deadlockDetection
public DeadlockDetectionConfigurationBuilder deadlockDetection()
- Specified by:
deadlockDetection
in interfaceConfigurationChildBuilder
-
encoding
public EncodingConfigurationBuilder encoding()
- Specified by:
encoding
in interfaceConfigurationChildBuilder
-
eviction
public EvictionConfigurationBuilder eviction()
- Specified by:
eviction
in interfaceConfigurationChildBuilder
-
expiration
public ExpirationConfigurationBuilder expiration()
- Specified by:
expiration
in interfaceConfigurationChildBuilder
-
indexing
public IndexingConfigurationBuilder indexing()
- Specified by:
indexing
in interfaceConfigurationChildBuilder
-
invocationBatching
public InvocationBatchingConfigurationBuilder invocationBatching()
- Specified by:
invocationBatching
in interfaceConfigurationChildBuilder
-
jmxStatistics
public JMXStatisticsConfigurationBuilder jmxStatistics()
- Specified by:
jmxStatistics
in interfaceConfigurationChildBuilder
-
persistence
public PersistenceConfigurationBuilder persistence()
- Specified by:
persistence
in interfaceConfigurationChildBuilder
-
locking
public LockingConfigurationBuilder locking()
- Specified by:
locking
in interfaceConfigurationChildBuilder
-
security
public SecurityConfigurationBuilder security()
- Specified by:
security
in interfaceConfigurationChildBuilder
-
storeAsBinary
@Deprecated public StoreAsBinaryConfigurationBuilder storeAsBinary()
Deprecated.- Specified by:
storeAsBinary
in interfaceConfigurationChildBuilder
-
transaction
public TransactionConfigurationBuilder transaction()
- Specified by:
transaction
in interfaceConfigurationChildBuilder
-
versioning
public VersioningConfigurationBuilder versioning()
- Specified by:
versioning
in interfaceConfigurationChildBuilder
-
unsafe
public UnsafeConfigurationBuilder unsafe()
- Specified by:
unsafe
in interfaceConfigurationChildBuilder
-
sites
public SitesConfigurationBuilder sites()
- Specified by:
sites
in interfaceConfigurationChildBuilder
-
compatibility
@Deprecated public CompatibilityModeConfigurationBuilder compatibility()
Deprecated.- Specified by:
compatibility
in interfaceConfigurationChildBuilder
-
memory
public MemoryConfigurationBuilder memory()
- Specified by:
memory
in interfaceConfigurationChildBuilder
-
getBuilder
protected ConfigurationBuilder getBuilder()
-
build
public Configuration build()
- Specified by:
build
in interfaceConfigurationChildBuilder
-
-