public class DataStorageConfiguration extends Object implements Serializable
getPageSize()
). An individual page can store one or many cache key-value entries
that allows reusing the memory in the most efficient way and avoid memory fragmentation issues.
By default, the durable memory allocates a single expandable data region with default settings. All the caches that
will be configured in an application will be mapped to this data region by default, thus, all the cache data will
reside in that data region. Parameters of default data region can be changed by setting
setDefaultDataRegionConfiguration(DataRegionConfiguration)
.
Other data regions (except default) can be configured with
setDataRegionConfigurations(DataRegionConfiguration...)
.
Data region can be used in memory-only mode, or in persistent mode, when memory is used as a caching layer for disk.
Persistence for data region can be turned on with DataRegionConfiguration.setPersistenceEnabled(boolean)
flag. To learn more about data regions refer to DataRegionConfiguration
documentation.
Sample configuration below shows how to make 5 GB data regions the default one for Apache Ignite:
<property name="dataStorageConfiguration">
<bean class="org.apache.ignite.configuration.DataStorageConfiguration">
<property name="systemCacheInitialSize" value="#{100L * 1024 * 1024}"/>
<property name="defaultDataRegionConfiguration">
<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
<property name="name" value="default_data_region"/>
<property name="initialSize" value="#{5L * 1024 * 1024 * 1024}"/>
</bean>
</property>
</bean>
</property>
Modifier and Type | Field and Description |
---|---|
static int |
DFLT_CHECKPOINT_FREQ |
static int |
DFLT_CHECKPOINT_THREADS
Default number of checkpoint threads.
|
static CheckpointWriteOrder |
DFLT_CHECKPOINT_WRITE_ORDER
Default checkpoint write order.
|
static String |
DFLT_DATA_REG_DEFAULT_NAME
This name is assigned to default Dataregion if no user-defined default MemPlc is specified
|
static long |
DFLT_DATA_REGION_INITIAL_SIZE
Default data region start size (256 MB).
|
static long |
DFLT_DATA_REGION_MAX_SIZE
Default data region's size is 20% of physical memory available on current machine.
|
static int |
DFLT_LOCK_WAIT_TIME
Lock default wait time, 10 sec.
|
static boolean |
DFLT_METRICS_ENABLED |
static int |
DFLT_PAGE_SIZE
Default memory page size.
|
static int |
DFLT_RATE_TIME_INTERVAL_MILLIS
Default length of interval over which rate-based metric is calculated.
|
static int |
DFLT_SUB_INTERVALS
Default amount of sub intervals to calculate rate-based metric.
|
static int |
DFLT_TLB_SIZE
Default thread local buffer size.
|
static boolean |
DFLT_WAL_ALWAYS_WRITE_FULL_PAGES
Default wal always write full pages.
|
static long |
DFLT_WAL_ARCHIVE_MAX_SIZE
Default max size of WAL archive files, in bytes
|
static String |
DFLT_WAL_ARCHIVE_PATH
Default wal archive directory.
|
static int |
DFLT_WAL_BUFF_SIZE
Default thread local buffer size.
|
static boolean |
DFLT_WAL_COMPACTION_ENABLED
Default wal compaction enabled.
|
static int |
DFLT_WAL_COMPACTION_LEVEL
Default wal compaction level.
|
static int |
DFLT_WAL_FLUSH_FREQ
Default Wal flush frequency.
|
static int |
DFLT_WAL_FSYNC_DELAY
Default wal fsync delay.
|
static int |
DFLT_WAL_HISTORY_SIZE
Default number of checkpoints to be kept in WAL after checkpoint is finished
|
static WALMode |
DFLT_WAL_MODE
Default wal mode.
|
static String |
DFLT_WAL_PATH
Default wal directory.
|
static int |
DFLT_WAL_RECORD_ITERATOR_BUFFER_SIZE
Default wal record iterator buffer size.
|
static int |
DFLT_WAL_SEGMENT_SIZE
Default WAL file segment size, 64MBytes
|
static int |
DFLT_WAL_SEGMENTS |
static boolean |
DFLT_WRITE_THROTTLING_ENABLED
Default write throttling enabled.
|
Constructor and Description |
---|
DataStorageConfiguration() |
Modifier and Type | Method and Description |
---|---|
long |
getCheckpointFrequency()
Gets checkpoint frequency.
|
Long |
getCheckpointReadLockTimeout()
Returns timeout for checkpoint read lock acquisition.
|
int |
getCheckpointThreads()
Gets a number of threads to use for the checkpoint purposes.
|
CheckpointWriteOrder |
getCheckpointWriteOrder()
This property defines order of writing pages to disk storage during checkpoint.
|
int |
getConcurrencyLevel()
Returns the number of concurrent segments in Ignite internal page mapping tables.
|
DataRegionConfiguration[] |
getDataRegionConfigurations()
Gets an array of all data regions configured.
|
DataRegionConfiguration |
getDefaultDataRegionConfiguration() |
org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory |
getFileIOFactory()
Factory to provide implementation of FileIO interface
which is used for data storage files read/write operations
|
long |
getLockWaitTime()
Timeout in milliseconds to wait when acquiring persistence store lock file before failing the local node.
|
long |
getMaxWalArchiveSize()
Gets a max allowed size of WAL archives.
|
long |
getMetricsRateTimeInterval()
Gets the length of the time interval for rate-based metrics.
|
int |
getMetricsSubIntervalCount()
Gets the number of sub-intervals to split the
getMetricsRateTimeInterval() into to track the update history. |
int |
getPageSize()
The page memory consists of one or more expandable data regions defined by
DataRegionConfiguration . |
String |
getStoragePath()
Returns a path the root directory where the Persistent Store will persist data and indexes.
|
long |
getSystemRegionInitialSize()
Initial size of a data region reserved for system cache.
|
long |
getSystemRegionMaxSize()
Maximum data region size reserved for system cache.
|
String |
getWalArchivePath()
Gets a path to the WAL archive directory.
|
long |
getWalAutoArchiveAfterInactivity() |
int |
getWalBufferSize()
Property defines size of WAL buffer.
|
int |
getWalCompactionLevel() |
long |
getWalFlushFrequency()
This property define how often WAL will be fsync-ed in
BACKGROUND mode. |
long |
getWalFsyncDelayNanos()
Property that allows to trade latency for throughput in
WALMode.FSYNC mode. |
int |
getWalHistorySize()
Deprecated.
Instead of walHistorySize use maxWalArchiveSize for manage of archive size.
|
WALMode |
getWalMode()
Property that defines behavior of wal fsync.
|
String |
getWalPath()
Gets a path to the directory where WAL is stored.
|
int |
getWalRecordIteratorBufferSize()
Property define how many bytes iterator read from
disk (for one reading), during go ahead wal.
|
int |
getWalSegments()
Gets a number of WAL segments to work with.
|
int |
getWalSegmentSize()
Gets size of a WAL segment in bytes.
|
int |
getWalThreadLocalBufferSize()
Property for size of thread local buffer.
|
boolean |
isAlwaysWriteFullPages()
Gets flag that enforces writing full page to WAL on every change (instead of delta record).
|
boolean |
isMetricsEnabled()
Gets flag indicating whether persistence metrics collection is enabled.
|
boolean |
isWalCompactionEnabled() |
boolean |
isWalHistorySizeParameterUsed()
If WalHistorySize was set by user will use this parameter for compatibility.
|
boolean |
isWriteThrottlingEnabled()
Gets flag indicating whether write throttling is enabled.
|
DataStorageConfiguration |
setAlwaysWriteFullPages(boolean alwaysWriteFullPages)
Sets flag that enforces writing full page to WAL on every change (instead of delta record).
|
DataStorageConfiguration |
setCheckpointFrequency(long checkpointFreq)
Sets the checkpoint frequency which is a minimal interval when the dirty pages will be written
to the Persistent Store.
|
DataStorageConfiguration |
setCheckpointReadLockTimeout(long checkpointReadLockTimeout)
Sets timeout for checkpoint read lock acquisition.
|
DataStorageConfiguration |
setCheckpointThreads(int checkpointThreads)
Sets a number of threads to use for the checkpoint purposes.
|
DataStorageConfiguration |
setCheckpointWriteOrder(CheckpointWriteOrder checkpointWriteOrder)
This property defines order of writing pages to disk storage during checkpoint.
|
DataStorageConfiguration |
setConcurrencyLevel(int concLvl)
Sets the number of concurrent segments in Ignite internal page mapping tables.
|
DataStorageConfiguration |
setDataRegionConfigurations(DataRegionConfiguration... dataRegionConfigurations)
Sets data regions configurations.
|
DataStorageConfiguration |
setDefaultDataRegionConfiguration(DataRegionConfiguration dfltDataRegConf)
Overrides configuration of default data region which is created automatically.
|
DataStorageConfiguration |
setFileIOFactory(org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory fileIOFactory)
Sets factory to provide implementation of FileIO interface
which is used for data storage files read/write operations
|
DataStorageConfiguration |
setLockWaitTime(long lockWaitTime)
Timeout in milliseconds to wait when acquiring persistence store lock file before failing the local node.
|
DataStorageConfiguration |
setMaxWalArchiveSize(long walArchiveMaxSize)
Sets a max allowed size of WAL archives.
|
DataStorageConfiguration |
setMetricsEnabled(boolean metricsEnabled)
Sets flag indicating whether persistence metrics collection is enabled.
|
DataStorageConfiguration |
setMetricsRateTimeInterval(long metricsRateTimeInterval)
Sets the length of the time interval for rate-based metrics.
|
DataStorageConfiguration |
setMetricsSubIntervalCount(int metricsSubIntervalCnt)
Sets the number of sub-intervals to split the
getMetricsRateTimeInterval() into to track the update history. |
DataStorageConfiguration |
setPageSize(int pageSize)
Changes the page size.
|
DataStorageConfiguration |
setStoragePath(String persistenceStorePath)
Sets a path to the root directory where the Persistent Store will persist data and indexes.
|
DataStorageConfiguration |
setSystemRegionInitialSize(long sysRegionInitSize)
Sets initial size of a data region reserved for system cache.
|
DataStorageConfiguration |
setSystemRegionMaxSize(long sysRegionMaxSize)
Sets maximum data region size reserved for system cache.
|
DataStorageConfiguration |
setWalArchivePath(String walArchivePath)
Sets a path for the WAL archive directory.
|
DataStorageConfiguration |
setWalAutoArchiveAfterInactivity(long walAutoArchiveAfterInactivity)
Note: setting this value with
WALMode.FSYNC may generate file size overhead for WAL segments in case
grid is used rarely. |
DataStorageConfiguration |
setWalBufferSize(int walBuffSize) |
DataStorageConfiguration |
setWalCompactionEnabled(boolean walCompactionEnabled)
Sets flag indicating whether WAL compaction is enabled.
|
void |
setWalCompactionLevel(int walCompactionLevel) |
DataStorageConfiguration |
setWalFlushFrequency(long walFlushFreq)
This property define how often WAL will be fsync-ed in
BACKGROUND mode. |
DataStorageConfiguration |
setWalFsyncDelayNanos(long walFsyncDelayNanos)
Sets property that allows to trade latency for throughput in
WALMode.FSYNC mode. |
DataStorageConfiguration |
setWalHistorySize(int walHistSize)
Deprecated.
Instead of walHistorySize use maxWalArchiveSize for manage of archive size.
|
DataStorageConfiguration |
setWalMode(WALMode walMode)
Sets property that defines behavior of wal fsync.
|
DataStorageConfiguration |
setWalPath(String walStorePath)
Sets a path to the directory where WAL is stored.
|
DataStorageConfiguration |
setWalRecordIteratorBufferSize(int walRecordIterBuffSize)
Sets property defining how many bytes iterator read from
disk (for one reading), during go ahead wal.
|
DataStorageConfiguration |
setWalSegments(int walSegments)
Sets a number of WAL segments to work with.
|
DataStorageConfiguration |
setWalSegmentSize(int walSegmentSize)
Sets size of a WAL segment.
|
DataStorageConfiguration |
setWalThreadLocalBufferSize(int walTlbSize)
Sets size of thread local buffer.
|
DataStorageConfiguration |
setWriteThrottlingEnabled(boolean writeThrottlingEnabled)
Sets flag indicating whether write throttling is enabled.
|
String |
toString() |
public static final long DFLT_DATA_REGION_INITIAL_SIZE
public static final long DFLT_DATA_REGION_MAX_SIZE
public static final int DFLT_PAGE_SIZE
public static final String DFLT_DATA_REG_DEFAULT_NAME
public static final int DFLT_CHECKPOINT_FREQ
public static final int DFLT_LOCK_WAIT_TIME
public static final boolean DFLT_METRICS_ENABLED
public static final int DFLT_SUB_INTERVALS
public static final int DFLT_RATE_TIME_INTERVAL_MILLIS
public static final int DFLT_CHECKPOINT_THREADS
public static final CheckpointWriteOrder DFLT_CHECKPOINT_WRITE_ORDER
public static final int DFLT_WAL_HISTORY_SIZE
public static final long DFLT_WAL_ARCHIVE_MAX_SIZE
public static final int DFLT_WAL_SEGMENTS
public static final int DFLT_WAL_SEGMENT_SIZE
public static final WALMode DFLT_WAL_MODE
public static final int DFLT_TLB_SIZE
public static final int DFLT_WAL_BUFF_SIZE
public static final int DFLT_WAL_FLUSH_FREQ
public static final int DFLT_WAL_FSYNC_DELAY
public static final int DFLT_WAL_RECORD_ITERATOR_BUFFER_SIZE
public static final boolean DFLT_WAL_ALWAYS_WRITE_FULL_PAGES
public static final String DFLT_WAL_PATH
public static final String DFLT_WAL_ARCHIVE_PATH
public static final boolean DFLT_WRITE_THROTTLING_ENABLED
public static final boolean DFLT_WAL_COMPACTION_ENABLED
public static final int DFLT_WAL_COMPACTION_LEVEL
public long getSystemRegionInitialSize()
public DataStorageConfiguration setSystemRegionInitialSize(long sysRegionInitSize)
DFLT_SYS_REG_INIT_SIZE
sysRegionInitSize
- Size in bytes.this
for chaining.public long getSystemRegionMaxSize()
public DataStorageConfiguration setSystemRegionMaxSize(long sysRegionMaxSize)
DFLT_SYS_REG_MAX_SIZE
.sysRegionMaxSize
- Maximum size in bytes for system cache data region.this
for chaining.public int getPageSize()
DataRegionConfiguration
.
Every data region is split on pages of fixed size that store actual cache entries.public DataStorageConfiguration setPageSize(int pageSize)
pageSize
- Page size in bytes. If value is not set (or zero), DFLT_PAGE_SIZE
will be used.public DataRegionConfiguration[] getDataRegionConfigurations()
CacheConfiguration.setDataRegionName(String)
method.public DataStorageConfiguration setDataRegionConfigurations(DataRegionConfiguration... dataRegionConfigurations)
dataRegionConfigurations
- Data regions configurations.public int getConcurrencyLevel()
public DataStorageConfiguration setConcurrencyLevel(int concLvl)
concLvl
- Mapping table concurrency level.public DataRegionConfiguration getDefaultDataRegionConfiguration()
CacheConfiguration.setDataRegionName(String)
.public DataStorageConfiguration setDefaultDataRegionConfiguration(DataRegionConfiguration dfltDataRegConf)
dfltDataRegConf
- Default data region configuration.public String getStoragePath()
public DataStorageConfiguration setStoragePath(String persistenceStorePath)
persistenceStorePath
- Persistence store path.public long getCheckpointFrequency()
public DataStorageConfiguration setCheckpointFrequency(long checkpointFreq)
checkpointFreq
- checkpoint frequency in milliseconds.this
for chaining.public int getCheckpointThreads()
public DataStorageConfiguration setCheckpointThreads(int checkpointThreads)
checkpointThreads
- Number of checkpoint threads. Four threads are used by default.this
for chaining.public long getLockWaitTime()
public DataStorageConfiguration setLockWaitTime(long lockWaitTime)
lockWaitTime
- Lock wait time in milliseconds.this
for chaining.@Deprecated public int getWalHistorySize()
getMaxWalArchiveSize()
@Deprecated public DataStorageConfiguration setWalHistorySize(int walHistSize)
walHistSize
- Number of checkpoints to keep after a checkpoint is finished.this
for chaining.setMaxWalArchiveSize(long)
public boolean isWalHistorySizeParameterUsed()
true
if use WalHistorySize for compatibility.public long getMaxWalArchiveSize()
public DataStorageConfiguration setMaxWalArchiveSize(long walArchiveMaxSize)
walArchiveMaxSize
- max size of WAL archive directory.this
for chaining.public int getWalSegments()
public DataStorageConfiguration setWalSegments(int walSegments)
walSegments
- Number of WAL segments.this
for chaining.public int getWalSegmentSize()
public DataStorageConfiguration setWalSegmentSize(int walSegmentSize)
DFLT_WAL_SEGMENT_SIZE
will be used.walSegmentSize
- WAL segment size. Value must be between 512Kb and 2Gb.This
for chaining.public String getWalPath()
public DataStorageConfiguration setWalPath(String walStorePath)
walStorePath
- WAL persistence path, absolute or relative to Ignite work directory.this
for chaining.public String getWalArchivePath()
public DataStorageConfiguration setWalArchivePath(String walArchivePath)
walArchivePath
- WAL archive directory.this
for chaining.public boolean isMetricsEnabled()
DFLT_METRICS_ENABLED
.public DataStorageConfiguration setMetricsEnabled(boolean metricsEnabled)
metricsEnabled
- Metrics enabled flag.public boolean isWriteThrottlingEnabled()
public DataStorageConfiguration setWriteThrottlingEnabled(boolean writeThrottlingEnabled)
writeThrottlingEnabled
- Write throttling enabled flag.public long getMetricsRateTimeInterval()
DFLT_RATE_TIME_INTERVAL_MILLIS
.public DataStorageConfiguration setMetricsRateTimeInterval(long metricsRateTimeInterval)
metricsRateTimeInterval
- Time interval in milliseconds.public int getMetricsSubIntervalCount()
getMetricsRateTimeInterval()
into to track the update history.
Default value is DFLT_SUB_INTERVALS
.public DataStorageConfiguration setMetricsSubIntervalCount(int metricsSubIntervalCnt)
getMetricsRateTimeInterval()
into to track the update history.metricsSubIntervalCnt
- The number of sub-intervals for history tracking.public WALMode getWalMode()
WALMode
for details.public DataStorageConfiguration setWalMode(WALMode walMode)
WALMode
for details.walMode
- Wal mode.public int getWalThreadLocalBufferSize()
public DataStorageConfiguration setWalThreadLocalBufferSize(int walTlbSize)
walTlbSize
- Thread local buffer size (in bytes).public int getWalBufferSize()
public DataStorageConfiguration setWalBufferSize(int walBuffSize)
walBuffSize
- WAL buffer size.public long getWalFlushFrequency()
BACKGROUND
mode. Ignored for
all other WAL modes.public DataStorageConfiguration setWalFlushFrequency(long walFlushFreq)
BACKGROUND
mode. Ignored for
all other WAL modes.walFlushFreq
- WAL flush frequency, in milliseconds.public long getWalFsyncDelayNanos()
WALMode.FSYNC
mode.
It limits minimum time interval between WAL fsyncs. First thread that initiates WAL fsync will wait for
this number of nanoseconds, another threads will just wait fsync of first thread (similar to CyclicBarrier).
Total throughput should increase under load as total WAL fsync rate will be limited.public DataStorageConfiguration setWalFsyncDelayNanos(long walFsyncDelayNanos)
WALMode.FSYNC
mode.
It limits minimum time interval between WAL fsyncs. First thread that initiates WAL fsync will wait for
this number of nanoseconds, another threads will just wait fsync of first thread (similar to CyclicBarrier).
Total throughput should increase under load as total WAL fsync rate will be limited.walFsyncDelayNanos
- Wal fsync delay, in nanoseconds.public int getWalRecordIteratorBufferSize()
public DataStorageConfiguration setWalRecordIteratorBufferSize(int walRecordIterBuffSize)
walRecordIterBuffSize
- Wal record iterator buffer size.public boolean isAlwaysWriteFullPages()
public DataStorageConfiguration setAlwaysWriteFullPages(boolean alwaysWriteFullPages)
alwaysWriteFullPages
- Always write full pages flag.public org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory getFileIOFactory()
public DataStorageConfiguration setFileIOFactory(org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory fileIOFactory)
fileIOFactory
- File I/O factorypublic DataStorageConfiguration setWalAutoArchiveAfterInactivity(long walAutoArchiveAfterInactivity)
WALMode.FSYNC
may generate file size overhead for WAL segments in case
grid is used rarely.walAutoArchiveAfterInactivity
- time in millis to run auto archiving segment (even if incomplete) after last
record logging. public long getWalAutoArchiveAfterInactivity()
public CheckpointWriteOrder getCheckpointWriteOrder()
public DataStorageConfiguration setCheckpointWriteOrder(CheckpointWriteOrder checkpointWriteOrder)
checkpointWriteOrder
- Checkpoint write order.public boolean isWalCompactionEnabled()
public DataStorageConfiguration setWalCompactionEnabled(boolean walCompactionEnabled)
walCompactionEnabled
- Wal compaction enabled flag.public int getWalCompactionLevel()
public void setWalCompactionLevel(int walCompactionLevel)
walCompactionLevel
- New ZIP level to WAL compaction.public Long getCheckpointReadLockTimeout()
setCheckpointReadLockTimeout(long)
public DataStorageConfiguration setCheckpointReadLockTimeout(long checkpointReadLockTimeout)
When any thread cannot acquire checkpoint read lock in this time, then critical failure handler is being called.
checkpointReadLockTimeout
- Timeout for checkpoint read lock acquisition in milliseconds.this
for chaining.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019