Interface BackingSlots

All Known Implementing Classes:
DiskSlots, MappedDiskSlots, PmemSlots, VolatileSlots

public interface BackingSlots
Interface for pluggable internal implementations of the SlotStore backend.
Author:
Jonathan Halliday (jonathan.halliday@redhat.com), 2020-04
  • 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.
  • Method Details

    • init

      void init(SlotStoreEnvironmentBean config) throws IOException
      Initialize the instance from the given configuration. This must be called once per instance, before any other method is called.
      Parameters:
      config - The configuration to apply.
      Throws:
      IOException
    • write

      void write(int slot, byte[] data, boolean sync) throws IOException
      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
      Parameters:
      slot - the index, from 0 to config numberOfSlots-1
      sync - true for immediate persistence, false otherwise
      data - the content.
      Throws:
      IOException
    • read

      byte[] read(int slot) throws IOException
      Read the given slot, returning its contents.
      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.
      Throws:
      IOException
    • clear

      void clear(int slot, boolean sync) throws IOException
      Update the given slot, discarding the contents. The update may not be immediately persistent, depending on config syncDeletes and isSyncWrites
      Parameters:
      slot - the index, from 0 to config numberOfSlots-1
      sync - true for immediate persistence, false otherwise
      Throws:
      IOException