public class SparkseeConfig
extends java.lang.Object
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).
Checksums enabled: true ('sparksee.storage.checksum' 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).
Number of pools in the pool cluster: 0 pools ('sparksee.io.pool.clustersize' at SparkseeProperties). 0 or 1 means the clustering is disabled.
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:
<X>[D|H|M|S|s|m|u]
where <X> 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.
Capture abort signals to dump the call stack ('sparksee.callstackdump' at SparkseeProperties) is enabled by default on most platforms.
Constructor and Description |
---|
SparkseeConfig()
Creates a new instance.
|
SparkseeConfig(java.lang.String path)
Creates a new instance with a specific config file.
|
SparkseeConfig(java.lang.String path,
java.lang.String clientId,
java.lang.String licenseId)
Creates a new instance with a specific config file and IDs.
|
Modifier and Type | Method and Description |
---|---|
boolean |
downloadExpected()
Check if a new license will be automatically downloaded with the current settings.
|
int |
downloadLicense()
Try to download a license key Can be used to explicitly download a license when the autodownload is disabled (LicensePreDownloadDays == -1).
|
java.lang.String |
getAESIV()
Get the AES initialization vector in a hexadecimal encoded string.
|
java.lang.String |
getAESKey()
Get the AES encryption key in a hexadecimal encoded string.
|
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.
|
boolean |
getCallStackDump()
Gets whether the signals will be captured to dump the call stack or not.
|
boolean |
getChecksumEnabled()
Gets whether the storage checksum usage is enabled or disabled.
|
java.lang.String |
getClientId()
Gets the client identifier.
|
java.lang.String |
getDownloadStatus()
Gets a message with the license download result.
|
boolean |
getEncryptionEnabled()
Gets whether the storage encryption is enabled or disabled.
|
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.
|
long |
getInMemAllocSize()
Gets the in-memory allocator size.
|
java.lang.String |
getLicense()
Gets the license key.
|
java.lang.String |
getLicenseId()
Gets the license identifier.
|
int |
getLicensePreDownloadDays()
Get the number of days before expiration when a new license will be downloaded.
|
java.lang.String |
getLicenseRequest()
Get information useful to manually request a license.
|
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 |
getPoolPartitions()
Gets the number of partitions in each PartitionedPool.
|
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.
|
java.lang.String |
getSparkseeConfigFile()
Gets the config file path.
|
boolean |
getTmpEnabled()
Gets whether using temporary storage for computations is enabled.
|
java.lang.String |
getTmpFolder()
Gets the temporary folder used for temporary staging.
|
boolean |
save()
Save the current configuration in the specified config file.
|
boolean |
saveAll()
Save all the current configuration settings in the specified config file.
|
boolean |
setAESEncryptionEnabled(int keySize)
Enables storage encryption using AES and GENARATES a key and an iv.
|
boolean |
setAESEncryptionEnabled(java.lang.String keyInHex,
java.lang.String ivInHex)
Enables storage encryption using AES with the given key and iv.
|
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 |
setCallStackDump(boolean status)
Sets whether the signals will be captured to dump the call stack or not.
|
void |
setChecksumEnabled(boolean status)
Enables or disables the storage checksum usage.
|
void |
setClientId(java.lang.String clientId)
Set the client identifier.
|
void |
setEncryptionDisabled()
Disables storage encryption.
|
void |
setExtentPages(int pages)
Sets the number of pages per extent.
|
void |
setExtentSize(int kBytes)
Sets the size of the extents in KB.
|
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 |
setInMemAllocSize(long size)
Sets the in-memory allocator size.
|
int |
setLicense(java.lang.String key)
Sets the license key.
|
void |
setLicenseId(java.lang.String licenseId)
Set the license identifier.
|
void |
setLicensePreDownloadDays(int days)
Start trying to automatically download a new license at the specified number of days before expiration.
|
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 |
setPoolPartitions(int pools)
Sets the number of pools in each PartitionedPool.
|
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.
|
void |
setSparkseeConfigFile(java.lang.String path)
Sets the config file path.
|
void |
setTmpEnabled(boolean enabled)
Sets whether to use temporary storage for computations or not.
|
void |
setTmpFolder(java.lang.String tmpFolder)
Sets the temporary folder used for temporary staging.
|
public SparkseeConfig(java.lang.String path)
The config file will be loaded using the global properties class and the file may be automatically overwritten with the config changes. If the file doesn't exists, it will be created.
path
- [in] File path to the config file.public SparkseeConfig(java.lang.String path, java.lang.String clientId, java.lang.String licenseId)
The config file will be loaded using the global properties class and the file may be automatically overwritten with the config changes. If the config file already exists, the client and license ids should have the same values as the given arguments. If the file doesn't exists, it will be created.
path
- [in] File path to the config file.clientId
- [in] The client identifier.licenseId
- [in] The license identifier.public SparkseeConfig()
Values are set with default values.
public void setRecoveryEnabled(boolean status)
status
- [in] If TRUE this enables the recovery, if FALSE then disables it.public void setLicensePreDownloadDays(int days)
days
- [in] Number of days before expiration or -1 if the license should never be downloaded.public int getExtentPages()
public boolean saveAll()
It will try to save the current configuration only if a config file was specified. The saved config file WILL CONATAIN all the modified settings including the secret ENCRYPTION KEYS. You should usually just use the Save method instead.
public java.lang.String getAESKey()
public int getPoolPersistentMaxSize()
public int getPoolTemporaryMinSize()
public boolean getCallStackDump()
public void setRecoveryCacheMaxSize(int extents)
extents
- [in] The maximum size for the recovery log cache in extents. A 0 sets the default value (extents up to 1MB).public boolean setAESEncryptionEnabled(java.lang.String keyInHex, java.lang.String ivInHex)
The key and initialization vector will not be saved in the config file.
keyInHex
- [In] The AES encryption Key as an hexadecimal string (8, 16 or 32 bytes).ivInHex
- [In] The AES Initialization Vector as an hexadecimal string (16 bytes).public boolean getHighAvailabilityEnabled()
public int getPoolPersistentMinSize()
public void setChecksumEnabled(boolean status)
status
- [in] If TRUE this enables the checksum, if FALSE then disables it.public void setPoolPersistentMinSize(int frames)
frames
- [in] The minimum size for the persistent pool in number of frames. It must be non-negative.public void setCacheStatisticsEnabled(boolean status)
status
- [in] If TRUE this enables cache statistics, if FALSE this disables cache statistics.public void setRecoveryCheckpointTime(long microSeconds)
microSeconds
- [in] The delay time (in microseconds) between automatic checkpoints. A 0 forces a checkpoint after each commited transaction.public void setEncryptionDisabled()
public void setRecoveryLogFile(java.lang.String filePath)
filePath[in] The recovery log file. Left it empty for the default log file (same as <database_file_name>.log)
filePath
- [in] The recovery log file. Left it empty for the default log file (same as <database_file_name>.log)public void setPoolFrameSize(int extents)
extents
- [in] The size of a pool frame in number of extents. It must be non-negative.public java.lang.String getRecoveryLogFile()
public void setHighAvailabilityEnabled(boolean status)
status
- [in] If TRUE this enables high availability mode, if FALSE this disables high availability mode.public long getCacheStatisticsSnapshotTime()
Useless if cache statistics are disabled.
public int getExtentSize()
public java.lang.String getSparkseeConfigFile()
public void setExtentSize(int kBytes)
kBytes
- [in] The size of an extent in KB. An extent can have a size between 4KB and 64KB, and it must be a power of 2.public void setHighAvailabilityIP(java.lang.String ip)
ip
- [in] The IP address and port of the instance.public int getPoolTemporaryMaxSize()
public void setInMemAllocSize(long size)
size
- The size to set the in-memory allocator topublic void setHighAvailabilityMasterHistory(long filePath)
filePath
- [in] The master's history log.public void setTmpEnabled(boolean enabled)
enabled
- True to use temporary storage for computationpublic java.lang.String getLogFile()
public boolean getTmpEnabled()
public int getPoolFrameSize()
public boolean getCacheStatisticsEnabled()
public void setHighAvailabilityCoordinators(java.lang.String ip)
ip
- [in] The coordinators address and port list.public void setHighAvailabilitySynchronization(long microSeconds)
microSeconds
- [in] The synchronization polling time.public java.lang.String getClientId()
public java.lang.String getCacheStatisticsFile()
Useless if cache statistics are disabled.
public void setSparkseeConfigFile(java.lang.String path)
The file is not loaded in this operation, see the constructor options if you need to load the file. The config file may be automatically overwritten with the config changes. If the file doesn't exists, it will be created.
path
- [in] File path to the config file.public boolean save()
It will try to save the current configuration only if a config file was specified. This method will be automatically used when a Sparksee class downloads a new License.
public void setPoolPersistentMaxSize(int frames)
frames
- [in] The maximum size for the persistent pool in number of frames. It must be non-negative.public LogLevel getLogLevel()
public int setLicense(java.lang.String key)
key
- [in] The license key. Returns -1 if the new key can't be used, 0 if it's the same license or 1 if the new license is applied.public java.lang.String getDownloadStatus()
It can be used when the DownloadLicense call failed.
public void setLicenseId(java.lang.String licenseId)
If you don't have a license identifier, you may want to register at http://sparsity-technologies.com/#sparksee
licenseId
- [in] The license identifier.public java.lang.String getLicense()
public java.lang.String getHighAvailabilityIP()
public boolean setAESEncryptionEnabled(int keySize)
YOU MUST GET AND KEEP SAFE THE GENERATED KEY AND IV! The key and initialization vector will not be saved in the config file.
keySize
- [In] The key size in bytes (8, 16 or 32).public long getInMemAllocSize()
public int getLicensePreDownloadDays()
public void setCallStackDump(boolean status)
status
- [in] If TRUE signals must be captured.public int downloadLicense()
public boolean getRecoveryEnabled()
public java.lang.String getLicenseRequest()
public void setCacheStatisticsFile(java.lang.String filePath)
Useless if cache statistics are disabled.
filePath
- [in] The cache statistics log file.public java.lang.String getTmpFolder()
public int getPoolPartitions()
public java.lang.String getHighAvailabilityCoordinators()
public long getRecoveryCheckpointTime()
public void setLogFile(java.lang.String filePath)
filePath
- [in] The log file.public void setExtentPages(int pages)
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.public void setClientId(java.lang.String clientId)
If you don't have a client identifier, you may want to register at http://sparsity-technologies.com/#sparksee
clientId
- [in] The client identifier.public void setLogLevel(LogLevel level)
level
- [in] The LogLevel.public int getRecoveryCacheMaxSize()
public boolean getChecksumEnabled()
public long getHighAvailabilitySynchronization()
public long getHighAvailabilityMasterHistory()
public java.lang.String getLicenseId()
public java.lang.String getAESIV()
public boolean getEncryptionEnabled()
public void setPoolPartitions(int pools)
pools
- [in] The number of pools in each PartitionedPool. It must be non-negative.public boolean getRollbackEnabled()
public void setPoolTemporaryMaxSize(int frames)
frames
- [in] The maximum size for the temporary pool in number of frames. It must be non-negative.public int getCacheMaxSize()
public void setRollbackEnabled(boolean status)
status
- [in] If TRUE this enables the rollback, if FALSE then disables it.public void setTmpFolder(java.lang.String tmpFolder)
tmpFolder
- The temporary folder to setpublic void setCacheStatisticsSnapshotTime(long microSeconds)
Useless if cache statistics are disabled.
microSeconds
- [in] The cache statistics snapshot time in microseconds.public void setCacheMaxSize(int megaBytes)
megaBytes
- [in] The maximum size for the cache (all pools) in MB. It must be non-negative.public void setPoolTemporaryMinSize(int frames)
frames
- [in] The minimum size for the temporary pool in number of frames. It must be non-negative.public boolean downloadExpected()