Package com.arjuna.ats.arjuna.common
Class ObjectStoreEnvironmentBean
java.lang.Object
com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean
- All Implemented Interfaces:
ObjectStoreEnvironmentBeanMBean
- Direct Known Subclasses:
MetaObjectStoreEnvironmentBean
A JavaBean containing configuration properties for the objectstore and various implementations thereof.
- Author:
- Jonathan Halliday (jonathan.halliday@redhat.com)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of hash buckets used for the cache work queue.int
Returns the maximum number of removed items that may be held in the cache before being purged.int
Returns the interval on which the cache will wake and process outstanding work.int
Returns the maximum allowed size, in bytes, of the cache store's in-memory cache.int
Returns the maximum number of outstanding writes that may be held in the cache.boolean
Should the store create the tableboolean
Should the store drop the tableboolean
int
Returns the number of directories over which the ObjectStore contents will be distributed.int
Returns the maximum number of attempts which may be made to create a file path in the store.int
Returns the time in milliseconds to wait between file creation retries.Returns an instance of a class implementing JDBCAccess.JMX name that the Narayana object store tooling MBean will be registered at.Returns the local ObjectStore root directory name.Returns the ObjectStore directory path.Returns the fully qualified class name for the ObjectStore implementation.long
Returns the purge interval for the LogStore, in milliseconds.int
getShare()
Returns the share mode for the ObjectStore, i.e., is this being shared between VMs? This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore, TwoPhaseVolatileStore, VolatileStore.Get the table prefixlong
Returns the default size of the LogStore file, in bytes.boolean
Returns true if writes to the objectstore should include a disk sync.boolean
boolean
Returns true if ObjectStore operations should be synched to disk.boolean
Returns true if zero length files should be returned by a recovery scan.boolean
Returns true if the LogStore should write removal records synchronously.boolean
Returns true if transaction log operations should be synched to disk.boolean
void
setCacheStoreHash
(int cacheStoreHash) Sets the number of hash buskets used to store the cache work queue.void
setCacheStoreRemovedItems
(int cacheStoreRemovedItems) Sets the maximum number of removed items that may be held in the cache before being purged.void
setCacheStoreScanPeriod
(int cacheStoreScanPeriod) Sets the interval on which the cache will process outstanding work, in milliseconds.void
setCacheStoreSize
(int cacheStoreSize) Sets the maximum size, in bytes, of the in-memory object state cache.void
setCacheStoreSync
(boolean cacheStoreSync) Sets if writes to the store should be synched to disk or not.void
setCacheStoreWorkItems
(int cacheStoreWorkItems) Sets the maximum number of outstanding writes that may be held in the cache.void
setCreateTable
(boolean createTable) Set whether to create the table.void
setDropTable
(boolean dropTable) Set whether to drop the table.void
setExposeAllLogRecordsAsMBeans
(boolean exposeAllLogRecords) Determine whether the ObjStoreBrowser should report basic information about all logs.void
setHashedDirectories
(int hashedDirectories) Sets the number of directories over which the ObjectStore will be split.void
setHierarchyRetry
(int hierarchyRetry) Sets the maximum number of attempts which may be made to create a direcory tree in the store.void
setHierarchyTimeout
(int hierarchyTimeout) Sets the time in milliseconds to wait between file creation retries.void
setIgnoreMBeanHeuristics
(boolean ignoreMBeanHeuristics) Determine whether or not MBean operations that delete a transaction will delete participants that are still in a heuristic statevoid
setJdbcAccess
(String connectionDetails) Sets the instance of JDBCAccessvoid
setJdbcDataSource
(DataSource jdbcStoreDataSource) Set a DataSource to be used for the JDBCStore.void
setJmxToolingMBeanName
(String jmxToolingMBeanName) Set JMX name where the Narayana object store tooling MBean will be registered at.void
setLocalOSRoot
(String localOSRoot) Sets the local ObjectStore root directory name.void
setObjectStoreDir
(String objectStoreDir) Sets the ObjectStore directory path.void
setObjectStoreSync
(boolean objectStoreSync) Sets if ObjectStore operations should be synched to disk or not.void
setObjectStoreType
(String objectStoreType) Sets the symbolic name of the ObjectStore implementation.void
setPurgeTime
(long purgeTime) Sets the purge interval for the LogStore, in milliseconds.void
setScanZeroLengthFiles
(boolean scanZeroLengthFiles) Sets if zero length files should be returned by a recovery scan.void
setShare
(int share) Sets the share mode of the ObjectStore This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore, TwoPhaseVolatileStore, VolatileStore.void
setSynchronousRemoval
(boolean synchronousRemoval) Sets if the LogStore should write removal records synchronously or not.void
setTablePrefix
(String tablePrefix) Set the table prefixvoid
setTransactionSync
(boolean transactionSync) Sets if transaction log operations should be synched to disk or not.void
setTxLogSize
(long txLogSize) Sets the default size of the LogStore, in bytes.void
setVolatileStoreSupportAllObjUids
(boolean volatileStoreSupportAllObjUids) Indicate whether or not the volatile store typesVolatileStore
andTwoPhaseVolatileStore
should support theRecoveryStore.allObjUids(java.lang.String, com.arjuna.ats.arjuna.state.InputObjectState, int)
andRecoveryStore.allTypes(com.arjuna.ats.arjuna.state.InputObjectState)
API methods
-
Constructor Details
-
ObjectStoreEnvironmentBean
public ObjectStoreEnvironmentBean()
-
-
Method Details
-
getCacheStoreSize
public int getCacheStoreSize()Returns the maximum allowed size, in bytes, of the cache store's in-memory cache. This property is used by the following object store implementations: CacheStore. Default: 10240 bytes Equivalent deprecated property: com.arjuna.ats.internal.arjuna.objectstore.cacheStore.size- Specified by:
getCacheStoreSize
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the memory cache size in bytes.
-
setCacheStoreSize
public void setCacheStoreSize(int cacheStoreSize) Sets the maximum size, in bytes, of the in-memory object state cache. This property is used by the following object store implementations: CacheStore.- Parameters:
cacheStoreSize
- the maximum cache size in bytes.
-
isCacheStoreSync
public boolean isCacheStoreSync()Returns true if writes to the objectstore should include a disk sync. Unlikely to be worthwile since the store caches state in memory anyhow. This property is used by the following object store implementations: CacheStore. Default: false Equivalent deprecated property: com.arjuna.ats.internal.arjuna.objectstore.cacheStore.sync- Specified by:
isCacheStoreSync
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- true if writes should be synched to disk, false otherwise.
-
setCacheStoreSync
public void setCacheStoreSync(boolean cacheStoreSync) Sets if writes to the store should be synched to disk or not. This property is used by the following object store implementations: CacheStore.- Parameters:
cacheStoreSync
- true to enable syncing, false to disable.
-
getCacheStoreRemovedItems
public int getCacheStoreRemovedItems()Returns the maximum number of removed items that may be held in the cache before being purged. This property is used by the following object store implementations: CacheStore. Default: 256 Equivalent deprecated property: com.arjuna.ats.internal.arjuna.objectstore.cacheStore.removedItems- Specified by:
getCacheStoreRemovedItems
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the maximum number of removed items in the cache.
-
setCacheStoreRemovedItems
public void setCacheStoreRemovedItems(int cacheStoreRemovedItems) Sets the maximum number of removed items that may be held in the cache before being purged. This property is used by the following object store implementations: CacheStore.- Parameters:
cacheStoreRemovedItems
- teh maximun number of items.
-
getCacheStoreScanPeriod
public int getCacheStoreScanPeriod()Returns the interval on which the cache will wake and process outstanding work. This property is used by the following object store implementations: CacheStore. Default: 120000 milliseconds Equivalent deprecated property: com.arjuna.ats.internal.arjuna.objectstore.cacheStore.scanPeriod- Specified by:
getCacheStoreScanPeriod
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the work interval of the cache, in milliseconds.
-
setCacheStoreScanPeriod
public void setCacheStoreScanPeriod(int cacheStoreScanPeriod) Sets the interval on which the cache will process outstanding work, in milliseconds. This property is used by the following object store implementations: CacheStore.- Parameters:
cacheStoreScanPeriod
- the sleep duration, in milliseconds.
-
getCacheStoreWorkItems
public int getCacheStoreWorkItems()Returns the maximum number of outstanding writes that may be held in the cache. This property is used by the following object store implementations: CacheStore. Default: 100 Equivalent deprecated property: com.arjuna.ats.internal.arjuna.objectstore.cacheStore.workItems- Specified by:
getCacheStoreWorkItems
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the maximum number of outstanding writes in the cache.
-
setCacheStoreWorkItems
public void setCacheStoreWorkItems(int cacheStoreWorkItems) Sets the maximum number of outstanding writes that may be held in the cache. This property is used by the following object store implementations: CacheStore.- Parameters:
cacheStoreWorkItems
- the maximum number of outstnading writes.
-
getCacheStoreHash
public int getCacheStoreHash()Returns the number of hash buckets used for the cache work queue. This property is used by the following object store implementations: CacheStore. Default: 128 Equivalent deprecated property: com.arjuna.ats.internal.arjuna.objectstore.cacheStore.hash- Specified by:
getCacheStoreHash
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the number of hash buckets used to store the cache state.
-
setCacheStoreHash
public void setCacheStoreHash(int cacheStoreHash) Sets the number of hash buskets used to store the cache work queue. This property is used by the following object store implementations: CacheStore.- Parameters:
cacheStoreHash
- the number of hash buckets.
-
getLocalOSRoot
Returns the local ObjectStore root directory name. This should be a path element, not a complete path. This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore, TwoPhaseVolatileStore, VolatileStore. Default: "defaultStore" Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.localOSRoot- Specified by:
getLocalOSRoot
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the local ObjectStore root directory name.
-
setLocalOSRoot
Sets the local ObjectStore root directory name. This should be a path element, not a complete path. This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore, TwoPhaseVolatileStore, VolatileStore.- Parameters:
localOSRoot
- the directory name.
-
getObjectStoreDir
Returns the ObjectStore directory path. This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore, TwoPhaseVolatileStore, VolatileStore. Default: {user.dir}/ObjectStore Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.objectStoreDir- Specified by:
getObjectStoreDir
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the ObjectStore directory path.
-
setObjectStoreDir
Sets the ObjectStore directory path. This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore, TwoPhaseVolatileStore, VolatileStore.- Parameters:
objectStoreDir
- the directory path.
-
isObjectStoreSync
public boolean isObjectStoreSync()Returns true if ObjectStore operations should be synched to disk. Note that this value may be overridden by store implementation specific configuration. See also: isTransactionSync This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.objectStoreSync- Specified by:
isObjectStoreSync
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- true for synched operations, false otherwise.
-
setObjectStoreSync
public void setObjectStoreSync(boolean objectStoreSync) Sets if ObjectStore operations should be synched to disk or not. Caution: Disabling this may be lead to non-ACID transaction behaviour. This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore.- Parameters:
objectStoreSync
- true to sunc to disk, false to skip synching.
-
getObjectStoreType
Returns the fully qualified class name for the ObjectStore implementation. Default: "com.arjuna.ats.internal.arjuna.objectstore.ShadowNoFileLockStore" Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.objectStoreType- Specified by:
getObjectStoreType
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the fully qualified class name of the ObjectStore implementation.
-
setObjectStoreType
Sets the symbolic name of the ObjectStore implementation.- Parameters:
objectStoreType
- the symbolic name of the implementation.
-
getHashedDirectories
public int getHashedDirectories()Returns the number of directories over which the ObjectStore contents will be distributed. Splitting the contents is important for performance on some file systems, as it reduces chain length (number of items in a directory) and directory lock contention. This property is used by the following object store implementations: CacheStore, HashedActionStore, HashedStore. Default: 255 Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.hashedDirectories- Specified by:
getHashedDirectories
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the number of directories over which to distribute the store.
-
setHashedDirectories
public void setHashedDirectories(int hashedDirectories) Sets the number of directories over which the ObjectStore will be split. This property is used by the following object store implementations: CacheStore, HashedActionStore, HashedStore.- Parameters:
hashedDirectories
- the number of directories.
-
isTransactionSync
public boolean isTransactionSync()Returns true if transaction log operations should be synched to disk. This property is used by the following object store implementations: ActionStore, HashedActionStore, LogStore. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.transactionSync- Specified by:
isTransactionSync
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- true if operations should be forcedto disk, false otherwise.
-
setTransactionSync
public void setTransactionSync(boolean transactionSync) Sets if transaction log operations should be synched to disk or not. Caution: Disabling this may be lead to non-ACID transaction behaviour. This property is used by the following object store implementations: ActionStore, HashedActionStore, LogStore.- Parameters:
transactionSync
- true to enable synching, false to disable.
-
isScanZeroLengthFiles
public boolean isScanZeroLengthFiles()Returns true if zero length files should be returned by a recovery scan. This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore. Default: false- Returns:
- true if scan results should include zero length files, false if they should be excluded.
-
setScanZeroLengthFiles
public void setScanZeroLengthFiles(boolean scanZeroLengthFiles) Sets if zero length files should be returned by a recovery scan. This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore.- Parameters:
scanZeroLengthFiles
- true to include zero length files in scan results, false to exclude them.
-
getHierarchyRetry
public int getHierarchyRetry()Returns the maximum number of attempts which may be made to create a file path in the store. This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore. Default: 100 Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.hierarchyRetry- Specified by:
getHierarchyRetry
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the maximum number of attempts to create a nested directory tree.
-
setHierarchyRetry
public void setHierarchyRetry(int hierarchyRetry) Sets the maximum number of attempts which may be made to create a direcory tree in the store. This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore.- Parameters:
hierarchyRetry
- the maximum number of file creation attempts.
-
getHierarchyTimeout
public int getHierarchyTimeout()Returns the time in milliseconds to wait between file creation retries. This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore. Default: 100 milliseconds. Equivalent deprecated property: com.arjuna.ats.arjuna.objectstore.hierarchyTimeout- Specified by:
getHierarchyTimeout
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the time to wait before retrying a failed file creation, in milliseconds.
-
setHierarchyTimeout
public void setHierarchyTimeout(int hierarchyTimeout) Sets the time in milliseconds to wait between file creation retries. This property is used by the following object store implementations: ActionStore, CacheStore, HashedActionStore, HashedStore, LogStore, NullActionStore, ShadowingStore, ShadowNoFileLockStore.- Parameters:
hierarchyTimeout
- the wait time in milliseconds.
-
isSynchronousRemoval
public boolean isSynchronousRemoval()Returns true if the LogStore should write removal records synchronously. Disabling this may increase performance at the cost of recovery complexity. This property is used by the following object store implementations: LogStore. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.transactionLog.synchronousRemoval- Specified by:
isSynchronousRemoval
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- true for synchronous removals, false for buffered (asynchronous) operation.
-
setSynchronousRemoval
public void setSynchronousRemoval(boolean synchronousRemoval) Sets if the LogStore should write removal records synchronously or not. This property is used by the following object store implementations: LogStore.- Parameters:
synchronousRemoval
- true for synchronous operation, false for asynchronous.
-
getTxLogSize
public long getTxLogSize()Returns the default size of the LogStore file, in bytes. This property is used by the following object store implementations: LogStore. Default: 10MB Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.transactionLog.txLogSize- Specified by:
getTxLogSize
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the default file size for the LogStore, in bytes.
-
setTxLogSize
public void setTxLogSize(long txLogSize) Sets the default size of the LogStore, in bytes. This property is used by the following object store implementations: LogStore.- Parameters:
txLogSize
- the default file size, in bytes.
-
getPurgeTime
public long getPurgeTime()Returns the purge interval for the LogStore, in milliseconds. This property is used by the following object store implementations: LogStore. Default: 100000 milliseconds Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.transactionLog.purgeTime- Specified by:
getPurgeTime
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- the purge interval in milliseconds.
-
setPurgeTime
public void setPurgeTime(long purgeTime) Sets the purge interval for the LogStore, in milliseconds. This property is used by the following object store implementations: LogStore.- Parameters:
purgeTime
- the purge interval in milliseconds.
-
getJdbcAccess
Returns an instance of a class implementing JDBCAccess.- Specified by:
getJdbcAccess
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- a JDBCAccess implementation instance, or null.
-
setJdbcAccess
Sets the instance of JDBCAccess- Specified by:
setJdbcAccess
in interfaceObjectStoreEnvironmentBeanMBean
- Parameters:
connectionDetails
- an Object that provides JDBCAccess, or null.
-
setJdbcDataSource
Set a DataSource to be used for the JDBCStore. This property takes precedence over the propertyjdbcAccess
To avoid automatic schema modifications set the following config properties to false, false and null respectively:setCreateTable(boolean)
,setDropTable(boolean)
,setTablePrefix(String)
.- Parameters:
jdbcStoreDataSource
- A configured instance of javax.sql.DataSource
-
getJdbcDataSource
-
getTablePrefix
Get the table prefix- Specified by:
getTablePrefix
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- The prefix to apply to the table
-
setTablePrefix
Set the table prefix- Specified by:
setTablePrefix
in interfaceObjectStoreEnvironmentBeanMBean
- Parameters:
tablePrefix
- A prefix to use on the tables
-
getDropTable
public boolean getDropTable()Should the store drop the table- Specified by:
getDropTable
in interfaceObjectStoreEnvironmentBeanMBean
- Returns:
- Whether to drop the table
-
setDropTable
public void setDropTable(boolean dropTable) Set whether to drop the table.- Specified by:
setDropTable
in interfaceObjectStoreEnvironmentBeanMBean
- Parameters:
dropTable
- Drop the table
-
getCreateTable
public boolean getCreateTable()Should the store create the table- Returns:
- Whether to create the table
-
setCreateTable
public void setCreateTable(boolean createTable) Set whether to create the table.- Parameters:
createTable
- Create the table
-
getExposeAllLogRecordsAsMBeans
public boolean getExposeAllLogRecordsAsMBeans()- Returns:
- Whether basic information about all log reccords are exposed
-
setExposeAllLogRecordsAsMBeans
public void setExposeAllLogRecordsAsMBeans(boolean exposeAllLogRecords) Determine whether the ObjStoreBrowser should report basic information about all logs. Because exposing log records has the side effect of activating the default is to only activate ones for which we know the side effects are harmlessObjectStoreBrowser
Use this method to explicitly set the desired behaviour. You can also set this behaviour via JMX usingJMX
- Parameters:
exposeAllLogRecords
- Set to true to expose basic information about all log records
-
setIgnoreMBeanHeuristics
public void setIgnoreMBeanHeuristics(boolean ignoreMBeanHeuristics) Determine whether or not MBean operations that delete a transaction will delete participants that are still in a heuristic state- Parameters:
ignoreMBeanHeuristics
- if false heuristic participants may only be deleted after the heuristic has been cleared
-
isIgnoreMBeanHeuristics
public boolean isIgnoreMBeanHeuristics()- Returns:
- whether or not MBean operations that delete a transaction will delete participants that are still in a heuristic state
-
isVolatileStoreSupportAllObjUids
public boolean isVolatileStoreSupportAllObjUids()- Returns:
- whether the volatile store types
VolatileStore
andTwoPhaseVolatileStore
should support theRecoveryStore.allObjUids(java.lang.String, com.arjuna.ats.arjuna.state.InputObjectState, int)
andRecoveryStore.allTypes(com.arjuna.ats.arjuna.state.InputObjectState)
API methods
-
setVolatileStoreSupportAllObjUids
public void setVolatileStoreSupportAllObjUids(boolean volatileStoreSupportAllObjUids) Indicate whether or not the volatile store typesVolatileStore
andTwoPhaseVolatileStore
should support theRecoveryStore.allObjUids(java.lang.String, com.arjuna.ats.arjuna.state.InputObjectState, int)
andRecoveryStore.allTypes(com.arjuna.ats.arjuna.state.InputObjectState)
API methods- Parameters:
volatileStoreSupportAllObjUids
- if true then add support for finding Uids by type in the volatile stores
-
setJmxToolingMBeanName
Set JMX name where the Narayana object store tooling MBean will be registered at.- Parameters:
jmxToolingMBeanName
- A name of the JMX MBean
-
getJmxToolingMBeanName
JMX name that the Narayana object store tooling MBean will be registered at. The default value isjboss.jta:type=ObjectStore
which is considered deprecated anw will be changed fornarayana.logStore:type=ObjectStore
in some next Narayana releases.- Returns:
- name of the MBean where tooling objects will be available at
-