java.lang.Object
com.arjuna.ats.internal.arjuna.objectstore.slot.VolatileSlots
All Implemented Interfaces:
BackingSlots

public class VolatileSlots extends Object implements BackingSlots
Trivial in-memory backend for the SlotStore, useful for benchmarking but not much else.
Author:
Jonathan Halliday (jonathan.halliday@redhat.com), 2020-03
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    clear(int slot, boolean sync)
    Update the given slot, discarding the contents.
    void
    Initialize the instance from the given configuration.
    byte[]
    read(int slot)
    Read the given slot, returning its contents.
    void
    write(int slot, byte[] data, boolean sync)
    Update the given slot with the provided data, overwriting (non-atomically) any existing data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VolatileSlots

      public VolatileSlots()
  • Method Details

    • init

      public void init(SlotStoreEnvironmentBean config)
      Description copied from interface: BackingSlots
      Initialize the instance from the given configuration. This must be called once per instance, before any other method is called.
      Specified by:
      init in interface BackingSlots
      Parameters:
      config - The configuration to apply.
    • write

      public void write(int slot, byte[] data, boolean sync)
      Description copied from interface: BackingSlots
      Update the given slot with the provided data, overwriting (non-atomically) any existing data. The update may not be immediately persistent, depending on config syncWrites
      Specified by:
      write in interface BackingSlots
      Parameters:
      slot - the index, from 0 to config numberOfSlots-1
      data - the content.
      sync - true for immediate persistence, false otherwise
    • read

      public byte[] read(int slot)
      Description copied from interface: BackingSlots
      Read the given slot, returning its contents.
      Specified by:
      read in interface BackingSlots
      Parameters:
      slot - the index, from 0 to config numberOfSlots-1
      Returns:
      the content, or null if the slot has not been written or has been cleared.
    • clear

      public void clear(int slot, boolean sync)
      Description copied from interface: BackingSlots
      Update the given slot, discarding the contents. The update may not be immediately persistent, depending on config syncDeletes and isSyncWrites
      Specified by:
      clear in interface BackingSlots
      Parameters:
      slot - the index, from 0 to config numberOfSlots-1
      sync - true for immediate persistence, false otherwise