Class SlotStoreEnvironmentBean
java.lang.Object
com.arjuna.ats.internal.arjuna.objectstore.slot.SlotStoreEnvironmentBean
- All Implemented Interfaces:
SlotStoreEnvironmentBeanMBean
A JavaBean containing configuration properties for the SlotStore based transaction logging system.
- Author:
- Jonathan Halliday (jonathan.halliday@redhat.com), 2020-03
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns an instance of a class implementing com.arjuna.ats.internal.arjuna.objectstore.slot.BackingSlotsReturns the class name of the com.arjuna.ats.internal.arjuna.objectstore.slot.BackingSlots implementationint
Returns the desired maximum record size for the store.int
Returns the desired number of slots for the store.Returns the store directory pathboolean
Returns the sync setting for transaction store delete operations.boolean
Returns the sync setting for transaction store write operations.void
setBackingSlots
(BackingSlots instance) Sets the instance of BackingSlotsvoid
setBackingSlotsClassName
(String backingSlotsClassName) void
setBytesPerSlot
(int bytesPerSlot) Sets the desired maximum size of entries in the store.void
setNumberOfSlots
(int numberOfSlots) Sets the desired number of slots for the store.void
setStoreDir
(String storeDir) Sets the store directory path.void
setSyncDeletes
(boolean syncDeletes) Sets if store delete operations should be synchronous or not.void
setSyncWrites
(boolean syncWrites) Sets if store write operations should be synchronous or not.
-
Constructor Details
-
SlotStoreEnvironmentBean
public SlotStoreEnvironmentBean()
-
-
Method Details
-
getNumberOfSlots
public int getNumberOfSlots()Returns the desired number of slots for the store.- Specified by:
getNumberOfSlots
in interfaceSlotStoreEnvironmentBeanMBean
- Returns:
- The capacity, in entries, of the store.
-
setNumberOfSlots
public void setNumberOfSlots(int numberOfSlots) Sets the desired number of slots for the store. Should equal the maximum number of unresolved transactions expected at any given time, including those in-flight and awaiting recovery.Caution: reducing the number of slots in a non-empty store may result in data loss.
Default: 256
- Specified by:
setNumberOfSlots
in interfaceSlotStoreEnvironmentBeanMBean
- Parameters:
numberOfSlots
- The capacity, in entries, of the store.
-
getBytesPerSlot
public int getBytesPerSlot()Returns the desired maximum record size for the store.- Specified by:
getBytesPerSlot
in interfaceSlotStoreEnvironmentBeanMBean
- Returns:
- The max size, in bytes, of a store entry.
-
setBytesPerSlot
public void setBytesPerSlot(int bytesPerSlot) Sets the desired maximum size of entries in the store. A typical tx record is under 1k. A 4k (disk block) size is probably reasonable.Caution: modifying the size of slots in a non-empty store may result in data loss.
Default: 4k
- Specified by:
setBytesPerSlot
in interfaceSlotStoreEnvironmentBeanMBean
- Parameters:
bytesPerSlot
- the max size, in bytes, of a store entry.
-
getStoreDir
Returns the store directory path- Specified by:
getStoreDir
in interfaceSlotStoreEnvironmentBeanMBean
- Returns:
- the store directory name
-
setStoreDir
Sets the store directory path.Default: {user.dir}/SlotStore
- Specified by:
setStoreDir
in interfaceSlotStoreEnvironmentBeanMBean
- Parameters:
storeDir
- the path to the store directory.
-
isSyncWrites
public boolean isSyncWrites()Returns the sync setting for transaction store write operations. To preserve ACID properties this value must be set to true, in which case log write operations block until data is forced to the physical storage device. Turn sync off only if you don't care about data integrity.- Specified by:
isSyncWrites
in interfaceSlotStoreEnvironmentBeanMBean
- Returns:
- true if log writes should be synchronous, false otherwise.
-
setSyncWrites
public void setSyncWrites(boolean syncWrites) Sets if store write operations should be synchronous or not.Default: true.
- Specified by:
setSyncWrites
in interfaceSlotStoreEnvironmentBeanMBean
- Parameters:
syncWrites
- true for synchronous operation, false otherwise.
-
isSyncDeletes
public boolean isSyncDeletes()Returns the sync setting for transaction store delete operations. For optimal crash recovery this value should be set to true. Asynchronous deletes may give rise to unnecessary crash recovery complications.- Specified by:
isSyncDeletes
in interfaceSlotStoreEnvironmentBeanMBean
- Returns:
- true if log deletes should be synchronous, false otherwise.
-
setSyncDeletes
public void setSyncDeletes(boolean syncDeletes) Sets if store delete operations should be synchronous or not.Default: true.
- Specified by:
setSyncDeletes
in interfaceSlotStoreEnvironmentBeanMBean
- Parameters:
syncDeletes
- true for synchronous operation, false otherwise.
-
getBackingSlotsClassName
Returns the class name of the com.arjuna.ats.internal.arjuna.objectstore.slot.BackingSlots implementationDefault: "com.arjuna.ats.internal.arjuna.objectstore.slot.VolatileSlots"
- Specified by:
getBackingSlotsClassName
in interfaceSlotStoreEnvironmentBeanMBean
- Returns:
- the name of the class implementing BackingSlots.
-
setBackingSlotsClassName
- Specified by:
setBackingSlotsClassName
in interfaceSlotStoreEnvironmentBeanMBean
-
getBackingSlots
Returns an instance of a class implementing com.arjuna.ats.internal.arjuna.objectstore.slot.BackingSlotsIf there is no pre-instantiated instance set and classloading or instantiation fails, this method will log an appropriate warning and return null, not throw an exception.
- Specified by:
getBackingSlots
in interfaceSlotStoreEnvironmentBeanMBean
- Returns:
- a BackingSlots implementation instance, or null.
-
setBackingSlots
Sets the instance of BackingSlots- Specified by:
setBackingSlots
in interfaceSlotStoreEnvironmentBeanMBean
- Parameters:
instance
- an Object that implements com.arjuna.ats.internal.arjuna.objectstore.slot.BackingSlots
-