Class PmemSlots
java.lang.Object
com.arjuna.ats.internal.arjuna.objectstore.slot.PmemSlots
- All Implemented Interfaces:
BackingSlots
Implementation of the SlotStore backend interface that uses the mashona logwriting library
to support fs-dax mode persistent memory storage.
This will compile with JDK-8+ but runtime use requires JDK-14+ for JEP-352
- Author:
- Jonathan Halliday (jonathan.halliday@redhat.com), 2021-01
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear
(int slot, boolean sync) Update the given slot, discarding the contents.void
init
(SlotStoreEnvironmentBean config) 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.
-
Constructor Details
-
PmemSlots
public PmemSlots()
-
-
Method Details
-
init
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 interfaceBackingSlots
- Parameters:
config
- The configuration to apply.- Throws:
IOException
-
write
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 interfaceBackingSlots
- Parameters:
slot
- the index, from 0 to config numberOfSlots-1data
- the content.sync
- true for immediate persistence, false otherwise- Throws:
IOException
-
read
Description copied from interface:BackingSlots
Read the given slot, returning its contents.- Specified by:
read
in interfaceBackingSlots
- 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
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 interfaceBackingSlots
- Parameters:
slot
- the index, from 0 to config numberOfSlots-1sync
- true for immediate persistence, false otherwise- Throws:
IOException
-