com.sparsity.sparksee.gdb
Class SparkseeConfig

java.lang.Object
  extended by com.sparsity.sparksee.gdb.SparkseeConfig

public class SparkseeConfig
extends java.lang.Object

Sparksee 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 SparkseeProperties 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 ('sparksee.storage.extentsize' at SparkseeProperties).

Pages per extent: 1 page ('sparksee.storage.extentpages' at SparkseeProperties).

Pool frame size: 1 extent ('sparksee.io.pool.frame.size' at SparkseeProperties).

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

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

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

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

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

License code: "" ('sparksee.license' at SparkseeProperties). No license code means evaluation license.

Log level: Info ('sparksee.log.level' at SparkseeProperties).

Log file: "sparksee.log" ('sparksee.log.file' at SparkseeProperties).

Cache statistics: false (disabled) ('sparksee.cache.statistics' at SparkseeProperties).

Cache statistics log file: "statistics.log" ('sparksee.cache.statisticsFile' at SparkseeProperties).

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

Recovery enabled: false ('sparksee.io.recovery' at SparkseeProperties).

Recovery log file: "" ('sparksee.io.recovery.logfile' at SparkseeProperties).

Recovery cache max size: 1MB ('sparksee.io.recovery.cachesize' at SparkseeProperties).

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

High-availability: false (disabled) ('sparksee.ha' at SparkseeProperties).

High-availability coordinators: "" ('sparksee.ha.coordinators' at SparkseeProperties).

High-availability IP: "" ('sparksee.ha.ip' at SparkseeProperties).

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

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

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
SparkseeConfig()
          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.
 boolean getRollbackEnabled()
          Gets whether the rollback is enabled or disabled.
 void setCacheMaxSize(int megaBytes)
          Sets the maximum size for the cache (all pools) in MB.
 void setCacheStatisticsEnabled(boolean status)
          Enables or disables cache statistics.
 void setCacheStatisticsFile(java.lang.String filePath)
          Sets the cache statistics log file.
 void setCacheStatisticsSnapshotTime(long microSeconds)
          Sets the cache statistics snapshot time.
 void setExtentPages(int pages)
          Sets the number of pages per extent.
 void setExtentSize(int kBytes)
          Sets the size of a pool frame in number of extents.
 void setHighAvailabilityCoordinators(java.lang.String ip)
          Sets the coordinators address and port list.
 void setHighAvailabilityEnabled(boolean status)
          Enables or disables high availability mode.
 void setHighAvailabilityIP(java.lang.String ip)
          Sets the IP address and port of the instance.
 void setHighAvailabilityMasterHistory(long filePath)
          Sets the master's history log.
 void setHighAvailabilitySynchronization(long microSeconds)
          Sets the synchronization polling time.
 void setLicense(java.lang.String key)
          Sets the license code.
 void setLogFile(java.lang.String filePath)
          Sets the log file.
 void setLogLevel(LogLevel level)
          Sets the log level.
 void setPoolFrameSize(int extents)
          Sets the size of a pool frame in number of extents.
 void setPoolPersistentMaxSize(int frames)
          Sets the maximum size for the persistent pool in number of frames.
 void setPoolPersistentMinSize(int frames)
          Sets the minimum size for the persistent pool in number of frames.
 void setPoolTemporaryMaxSize(int frames)
          Sets the maximum size for the temporary pool in number of frames.
 void setPoolTemporaryMinSize(int frames)
          Sets the minimum size for the temporary pool in number of frames.
 void setRecoveryCacheMaxSize(int extents)
          Sets the maximum size for the recovery log cache in extents.
 void setRecoveryCheckpointTime(long microSeconds)
          Sets the delay time (in microseconds) between automatic checkpoints.
 void setRecoveryEnabled(boolean status)
          Enables or disables the recovery.
 void setRecoveryLogFile(java.lang.String filePath)
          Sets the recovery log file.
 void setRollbackEnabled(boolean status)
          Enables or disables the rollback.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SparkseeConfig

public SparkseeConfig()
Creates a new instance.

Values are set with default values.

Method Detail

setLicense

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

Parameters:
key - [in] The license code.

getHighAvailabilitySynchronization

public long getHighAvailabilitySynchronization()
Gets the synchronization polling time.

Returns:
The Synchronization polling time.

setExtentPages

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

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

setHighAvailabilityCoordinators

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

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

getExtentSize

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

Returns:
The size of a extent in KB.

setLogFile

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

Parameters:
filePath - [in] The log file.

setLogLevel

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

Parameters:
level - [in] The LogLevel.

setCacheStatisticsEnabled

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

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

getLogFile

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

Returns:
The log file.

setCacheStatisticsSnapshotTime

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

Useless if cache statistics are disabled.

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

getRecoveryCheckpointTime

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

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

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.

setPoolPersistentMaxSize

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

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

getRecoveryLogFile

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

Returns:
The recovery log file.

setHighAvailabilityMasterHistory

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

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

setCacheStatisticsFile

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

Useless if cache statistics are disabled.

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

getHighAvailabilityCoordinators

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

Returns:
The coordinators address and port list.

setPoolFrameSize

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

Parameters:
extents - [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.

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.

setRecoveryEnabled

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

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

getLicense

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

Returns:
The license code.

setPoolTemporaryMinSize

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

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

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.

setHighAvailabilitySynchronization

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

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

setCacheMaxSize

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

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

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.

setHighAvailabilityEnabled

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

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

setRecoveryCacheMaxSize

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

Parameters:
extents - [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 ip)
Sets the IP address and port of the instance.

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

setExtentSize

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

Parameters:
kBytes - [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.

setRollbackEnabled

public void setRollbackEnabled(boolean status)
Enables or disables the rollback.

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

getExtentPages

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

Returns:
The number of pages per extent.

setPoolTemporaryMaxSize

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

Parameters:
frames - [in] The maximum size for the temporary pool in number of frames. 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.

getRecoveryEnabled

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

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

setPoolPersistentMinSize

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

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

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.

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.

getRollbackEnabled

public boolean getRollbackEnabled()
Gets whether the rollback is enabled or disabled.

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

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.

setRecoveryCheckpointTime

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

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

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.

setRecoveryLogFile

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

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