Class SlotStoreEnvironmentBean

java.lang.Object
com.arjuna.ats.internal.arjuna.objectstore.slot.SlotStoreEnvironmentBean
All Implemented Interfaces:
SlotStoreEnvironmentBeanMBean

public class SlotStoreEnvironmentBean extends Object implements SlotStoreEnvironmentBeanMBean
A JavaBean containing configuration properties for the SlotStore based transaction logging system.
Author:
Jonathan Halliday (jonathan.halliday@redhat.com), 2020-03
  • Constructor Details

    • SlotStoreEnvironmentBean

      public SlotStoreEnvironmentBean()
  • Method Details

    • getNumberOfSlots

      public int getNumberOfSlots()
      Returns the desired number of slots for the store.
      Specified by:
      getNumberOfSlots in interface SlotStoreEnvironmentBeanMBean
      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 interface SlotStoreEnvironmentBeanMBean
      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 interface SlotStoreEnvironmentBeanMBean
      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 interface SlotStoreEnvironmentBeanMBean
      Parameters:
      bytesPerSlot - the max size, in bytes, of a store entry.
    • getStoreDir

      public String getStoreDir()
      Returns the store directory path
      Specified by:
      getStoreDir in interface SlotStoreEnvironmentBeanMBean
      Returns:
      the store directory name
    • setStoreDir

      public void setStoreDir(String storeDir)
      Sets the store directory path.

      Default: {user.dir}/SlotStore

      Specified by:
      setStoreDir in interface SlotStoreEnvironmentBeanMBean
      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 interface SlotStoreEnvironmentBeanMBean
      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 interface SlotStoreEnvironmentBeanMBean
      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 interface SlotStoreEnvironmentBeanMBean
      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 interface SlotStoreEnvironmentBeanMBean
      Parameters:
      syncDeletes - true for synchronous operation, false otherwise.
    • getBackingSlotsClassName

      public String getBackingSlotsClassName()
      Returns the class name of the com.arjuna.ats.internal.arjuna.objectstore.slot.BackingSlots implementation

      Default: "com.arjuna.ats.internal.arjuna.objectstore.slot.VolatileSlots"

      Specified by:
      getBackingSlotsClassName in interface SlotStoreEnvironmentBeanMBean
      Returns:
      the name of the class implementing BackingSlots.
    • setBackingSlotsClassName

      public void setBackingSlotsClassName(String backingSlotsClassName)
      Specified by:
      setBackingSlotsClassName in interface SlotStoreEnvironmentBeanMBean
    • getBackingSlots

      public BackingSlots getBackingSlots()
      Returns an instance of a class implementing com.arjuna.ats.internal.arjuna.objectstore.slot.BackingSlots

      If 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 interface SlotStoreEnvironmentBeanMBean
      Returns:
      a BackingSlots implementation instance, or null.
    • setBackingSlots

      public void setBackingSlots(BackingSlots instance)
      Sets the instance of BackingSlots
      Specified by:
      setBackingSlots in interface SlotStoreEnvironmentBeanMBean
      Parameters:
      instance - an Object that implements com.arjuna.ats.internal.arjuna.objectstore.slot.BackingSlots