com.sparsity.dex.gdb
Class DexConfig

java.lang.Object
  extended by com.sparsity.dex.gdb.DexConfig

public class DexConfig
extends java.lang.Object

Dex configuration class.

If not specified, 0 means unlimited which is the maximum available. For the pools that's the total cache size. For the cache unlimited means nearly all the physical memory of the computer.

For each field, there is a default value. This value can be overrided with values from a properties file (see DexProperties class). Also, this settings can be overrided calling a specific setter.

For each field, it is shown its default value and the property to override this value:

Extent size: 4KB ('dex.storage.extentsize' at DexProperties).

Pages per extent: 1 page ('dex.storage.extentpages' at DexProperties).

Pool frame size: 1 extent ('dex.io.pool.frame.size' at DexProperties).

Minimum size for the persistent pool: 64 frames ('dex.io.pool.persistent.minsize' at DexProperties).

Maximum size for the persistent pool: 0 frames ('dex.io.pool.persistent.maxsize' at DexProperties).

Minimum size for the temporary pool: 16 frames ('dex.io.pool.temporal.minsize' at DexProperties).

Maximum size for the temporary pool: 0 frames ('dex.io.pool.temporal.maxsize' at DexProperties).

Maximum size for the cache (all pools): 0 MB ('dex.io.cache.maxsize' at DexProperties).

License code: "" ('dex.license' at DexProperties). No license code means evaluation license.

Log level: LogLevel::Info ('dex.log.level' at DexProperties).

Log file: "dex.log" ('dex.log.file' at DexProperties).

Cache statistics: false (disabled) ('dex.cache.statistics' at DexProperties).

Cache statistics log file: "statistics.log" ('dex.cache.statisticsFile' at DexProperties).

Cache statistics snapshot time: 1000 msecs [TimeUnit] ('dex.cache.statisticsSnapshotTime' at DexProperties).

Recovery enabled: false ('dex.io.recovery' at DexProperties).

Recovery log file: "" ('dex.io.recovery.logfile' at DexProperties).

Recovery cache max size: 1MB ('dex.io.recovery.cachesize' at DexProperties).

Recovery checkpoint time: 60 seconds [TimeUnit] ('dex.io.recovery.checkpointTime' at DexProperties).

High-availability: false (disabled) ('dex.ha' at DexProperties).

High-availability coordinators: "" ('dex.ha.coordinators' at DexProperties).

High-availability IP: "" ('dex.ha.ip' at DexProperties).

High-availability sync polling: 0 (disabled) [TimeUnit] ('dex.ha.sync' at DexProperties).

High-availability master history: 1D (1 day) [TimeUnit] ('dex.ha.master.history' at DexProperties).

Use of TimeUnit:

Those variables using TimeUnit allow for:

[D|H|M|S|s|m|u]

where is a number followed by an optional character which represents the unit: D for days, H for hours, M for minutes, S or s for seconds, m for milliseconds and u for microseconds. If no unit character is given, seconds are assumed.

Author:
Sparsity Technologies http://www.sparsity-technologies.com

Constructor Summary
DexConfig()
          Creates a new instance.
 
Method Summary
 int getCacheMaxSize()
          Gets the maximum size for the cache (all pools) in MB.
 boolean getCacheStatisticsEnabled()
          Gets whether cache statistics are enabled or disabled.
 java.lang.String getCacheStatisticsFile()
          Gets the cache statistics log file.
 long getCacheStatisticsSnapshotTime()
          Gets the cache statistics snapshot time in microseconds.
 int getExtentPages()
          Gets the number of pages per extent.
 int getExtentSize()
          Gets the size of a extent.
 java.lang.String getHighAvailabilityCoordinators()
          Gets the coordinators address and port list.
 boolean getHighAvailabilityEnabled()
          Gets whether high availability mode is enabled or disabled.
 java.lang.String getHighAvailabilityIP()
          Gets the IP address and port of the instance.
 long getHighAvailabilityMasterHistory()
          Gets the master's history log.
 long getHighAvailabilitySynchronization()
          Gets the synchronization polling time.
 java.lang.String getLicense()
          Gets the license code.
 java.lang.String getLogFile()
          Gets the log file.
 LogLevel getLogLevel()
          Gets the log level.
 int getPoolFrameSize()
          Gets the size of a pool frame in number of extents.
 int getPoolPersistentMaxSize()
          Gets the maximum size for the persistent pool in number of frames.
 int getPoolPersistentMinSize()
          Gets the minimum size for the persistent pool in number of frames.
 int getPoolTemporaryMaxSize()
          Gets the maximum size for the temporary pool in number of frames.
 int getPoolTemporaryMinSize()
          Gets the minimum size for the temporary pool in number of frames.
 int getRecoveryCacheMaxSize()
          Gets the maximum size for the recovery log cache in extents.
 long getRecoveryCheckpointTime()
          Gets the delay time (in microseconds) between automatic checkpoints.
 boolean getRecoveryEnabled()
          Gets whether the recovery is enabled or disabled.
 java.lang.String getRecoveryLogFile()
          Gets the recovery log file.
 void setCacheMaxSize(int v)
          Sets the maximum size for the cache (all pools) in MB.
 void setCacheStatisticsEnabled(boolean v)
          Enables or disables cache statistics.
 void setCacheStatisticsFile(java.lang.String v)
          Sets the cache statistics log file.
 void setCacheStatisticsSnapshotTime(long v)
          Sets the cache statistics snapshot time.
 void setExtentPages(int v)
          Sets the number of pages per extent.
 void setExtentSize(int v)
          Sets the size of a pool frame in number of extents.
 void setHighAvailabilityCoordinators(java.lang.String v)
          Sets the coordinators address and port list.
 void setHighAvailabilityEnabled(boolean v)
          Enables or disables high availability mode.
 void setHighAvailabilityIP(java.lang.String v)
          Sets the IP address and port of the instance.
 void setHighAvailabilityMasterHistory(long v)
          Sets the master's history log.
 void setHighAvailabilitySynchronization(long v)
          Sets the synchronization polling time.
 void setLicense(java.lang.String v)
          Sets the license code.
 void setLogFile(java.lang.String v)
          Sets the log file.
 void setLogLevel(LogLevel v)
          Sets the log level.
 void setPoolFrameSize(int v)
          Sets the size of a pool frame in number of extents.
 void setPoolPersistentMaxSize(int v)
          Sets the maximum size for the persistent pool in number of frames.
 void setPoolPersistentMinSize(int v)
          Sets the minimum size for the persistent pool in number of frames.
 void setPoolTemporaryMaxSize(int v)
          Sets the maximum size for the temporary pool in number of frames.
 void setPoolTemporaryMinSize(int v)
          Sets the minimum size for the temporary pool in number of frames.
 void setRecoveryCacheMaxSize(int v)
          Sets the maximum size for the recovery log cache in extents.
 void setRecoveryCheckpointTime(long v)
          Sets the delay time (in microseconds) between automatic checkpoints.
 void setRecoveryEnabled(boolean v)
          Enables or disables the recovery.
 void setRecoveryLogFile(java.lang.String v)
          Sets the recovery log file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DexConfig

public DexConfig()
Creates a new instance.

Values are set with default values.

Method Detail

getHighAvailabilitySynchronization

public long getHighAvailabilitySynchronization()
Gets the synchronization polling time.

Returns:
The Synchronization polling time.

setRecoveryCacheMaxSize

public void setRecoveryCacheMaxSize(int v)
Sets the maximum size for the recovery log cache in extents.

Parameters:
v - [in] The maximum size for the recovery log cache in extents. A 0 sets the default value (extents up to 1MB).

setHighAvailabilityIP

public void setHighAvailabilityIP(java.lang.String v)
Sets the IP address and port of the instance.

Parameters:
v - [in] The IP address and port of the instance.

setPoolPersistentMinSize

public void setPoolPersistentMinSize(int v)
Sets the minimum size for the persistent pool in number of frames.

Parameters:
v - [in] The minimum size for the persistent pool in number of frames. It must be non-negative.

getExtentSize

public int getExtentSize()
Gets the size of a extent.

Returns:
The size of a extent in KB.

setHighAvailabilityEnabled

public void setHighAvailabilityEnabled(boolean v)
Enables or disables high availability mode.

Parameters:
v - [in] If TRUE this enables high availability mode, if FALSE this disables high availability mode.

setHighAvailabilityCoordinators

public void setHighAvailabilityCoordinators(java.lang.String v)
Sets the coordinators address and port list.

Parameters:
v - [in] The coordinators address and port list.

getLogFile

public java.lang.String getLogFile()
Gets the log file.

Returns:
The log file.

getRecoveryCheckpointTime

public long getRecoveryCheckpointTime()
Gets the delay time (in microseconds) between automatic checkpoints.

Returns:
The delay time (in microseconds) between automatic checkpoints.

setCacheStatisticsSnapshotTime

public void setCacheStatisticsSnapshotTime(long v)
Sets the cache statistics snapshot time.

Useless if cache statistics are disabled.

Parameters:
v - [in] The cache statistics snapshot time in microseconds.

getCacheStatisticsEnabled

public boolean getCacheStatisticsEnabled()
Gets whether cache statistics are enabled or disabled.

Returns:
TRUE if cache statistics are enabled, FALSE otherwise.

getPoolPersistentMaxSize

public int getPoolPersistentMaxSize()
Gets the maximum size for the persistent pool in number of frames.

Returns:
The maximum size for the persistent pool in number of frames.

setLogLevel

public void setLogLevel(LogLevel v)
Sets the log level.

Parameters:
v - [in] The LogLevel.

setExtentSize

public void setExtentSize(int v)
Sets the size of a pool frame in number of extents.

Parameters:
v - [in] The size of a extent size in KB. An extent can have a size between 4KB and 64KB, and it must be a power of 2.

getRecoveryLogFile

public java.lang.String getRecoveryLogFile()
Gets the recovery log file.

Returns:
The recovery log file.

getExtentPages

public int getExtentPages()
Gets the number of pages per extent.

Returns:
The number of pages per extent.

setPoolPersistentMaxSize

public void setPoolPersistentMaxSize(int v)
Sets the maximum size for the persistent pool in number of frames.

Parameters:
v - [in] The maximum size for the persistent pool in number of frames. It must be non-negative.

setCacheMaxSize

public void setCacheMaxSize(int v)
Sets the maximum size for the cache (all pools) in MB.

Parameters:
v - [in] The maximum size for the cache (all pools) in MB. It must be non-negative.

getHighAvailabilityEnabled

public boolean getHighAvailabilityEnabled()
Gets whether high availability mode is enabled or disabled.

Returns:
TRUE if high availability mode is enabled, FALSE otherwise.

setRecoveryLogFile

public void setRecoveryLogFile(java.lang.String v)
Sets the recovery log file.

Parameters:
v - [in] The recovery log file. Left it empty for the default log file (same as .log)

getRecoveryEnabled

public boolean getRecoveryEnabled()
Gets whether the recovery is enabled or disabled.

Returns:
TRUE if the recovery is enabled, FALSE otherwise.

getHighAvailabilityCoordinators

public java.lang.String getHighAvailabilityCoordinators()
Gets the coordinators address and port list.

Returns:
The coordinators address and port list.

setLicense

public void setLicense(java.lang.String v)
Sets the license code.

Parameters:
v - [in] The license code.

setRecoveryEnabled

public void setRecoveryEnabled(boolean v)
Enables or disables the recovery.

Parameters:
v - [in] If TRUE this enables the recovery, if FALSE then disables it.

setPoolTemporaryMaxSize

public void setPoolTemporaryMaxSize(int v)
Sets the maximum size for the temporary pool in number of frames.

Parameters:
v - [in] The maximum size for the temporary pool in number of frames. It must be non-negative.

setHighAvailabilitySynchronization

public void setHighAvailabilitySynchronization(long v)
Sets the synchronization polling time.

Parameters:
v - [in] The synchronization polling time.

setPoolFrameSize

public void setPoolFrameSize(int v)
Sets the size of a pool frame in number of extents.

Parameters:
v - [in] The size of a pool frame in number of extents. It must be non-negative.

getCacheStatisticsFile

public java.lang.String getCacheStatisticsFile()
Gets the cache statistics log file.

Useless if cache statistics are disabled.

Returns:
The cache statistics log file.

setCacheStatisticsFile

public void setCacheStatisticsFile(java.lang.String v)
Sets the cache statistics log file.

Useless if cache statistics are disabled.

Parameters:
v - [in] The cache statistics log file.

getPoolFrameSize

public int getPoolFrameSize()
Gets the size of a pool frame in number of extents.

Returns:
The size of a pool frame in number of extents.

getCacheMaxSize

public int getCacheMaxSize()
Gets the maximum size for the cache (all pools) in MB.

Returns:
The maximum size for the cache (all pools) in MB.

getCacheStatisticsSnapshotTime

public long getCacheStatisticsSnapshotTime()
Gets the cache statistics snapshot time in microseconds.

Useless if cache statistics are disabled.

Returns:
The cache statistics snapshot time in microseconds.

getPoolTemporaryMaxSize

public int getPoolTemporaryMaxSize()
Gets the maximum size for the temporary pool in number of frames.

Returns:
The maximum size for the temporary pool in number of frames.

setExtentPages

public void setExtentPages(int v)
Sets the number of pages per extent.

Parameters:
v - [in] The number of pages. It must be at least 1 page and the page size must be greater than or equal to 4KB.

setPoolTemporaryMinSize

public void setPoolTemporaryMinSize(int v)
Sets the minimum size for the temporary pool in number of frames.

Parameters:
v - [in] The minimum size for the temporary pool in number of frames. It must be non-negative.

getLicense

public java.lang.String getLicense()
Gets the license code.

Returns:
The license code.

getPoolTemporaryMinSize

public int getPoolTemporaryMinSize()
Gets the minimum size for the temporary pool in number of frames.

Returns:
The minimum size for the temporary pool in number of frames.

setHighAvailabilityMasterHistory

public void setHighAvailabilityMasterHistory(long v)
Sets the master's history log.

Parameters:
v - [in] The master's history log.

setCacheStatisticsEnabled

public void setCacheStatisticsEnabled(boolean v)
Enables or disables cache statistics.

Parameters:
v - [in] If TRUE this enables cache statistics, if FALSE this disables cache statistics.

getRecoveryCacheMaxSize

public int getRecoveryCacheMaxSize()
Gets the maximum size for the recovery log cache in extents.

Returns:
The maximum size for the recovery log cache in extents.

getHighAvailabilityMasterHistory

public long getHighAvailabilityMasterHistory()
Gets the master's history log.

Returns:
The master's history log.

getHighAvailabilityIP

public java.lang.String getHighAvailabilityIP()
Gets the IP address and port of the instance.

Returns:
The IP address and port of the instance.

getLogLevel

public LogLevel getLogLevel()
Gets the log level.

Returns:
The LogLevel.

setRecoveryCheckpointTime

public void setRecoveryCheckpointTime(long v)
Sets the delay time (in microseconds) between automatic checkpoints.

Parameters:
v - [in] The delay time (in microseconds) between automatic checkpoints. A 0 forces a checkpoint after each commited transaction.

setLogFile

public void setLogFile(java.lang.String v)
Sets the log file.

Parameters:
v - [in] The log file.

getPoolPersistentMinSize

public int getPoolPersistentMinSize()
Gets the minimum size for the persistent pool in number of frames.

Returns:
The minimum size for the persistent pool in number of frames.