Package com.usatiuk.objects.stores
Class MemoryObjectPersistentStore
java.lang.Object
com.usatiuk.objects.stores.MemoryObjectPersistentStore
- All Implemented Interfaces:
ObjectPersistentStore
@ApplicationScoped
public class MemoryObjectPersistentStore
extends Object
implements ObjectPersistentStore
In-memory implementation of the ObjectPersistentStore interface.
For testing purposes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
commitTx
(TxManifestRaw names, long txId) Commit a transaction to the persistent store.long
Get the free space of the persistent store.Get a snapshot of the persistent store.long
Get the size of the persistent store.
-
Constructor Details
-
MemoryObjectPersistentStore
public MemoryObjectPersistentStore()
-
-
Method Details
-
getSnapshot
Description copied from interface:ObjectPersistentStore
Get a snapshot of the persistent store.- Specified by:
getSnapshot
in interfaceObjectPersistentStore
- Returns:
- a snapshot of the persistent store
-
commitTx
Description copied from interface:ObjectPersistentStore
Commit a transaction to the persistent store.- Specified by:
commitTx
in interfaceObjectPersistentStore
- Parameters:
names
- the transaction manifesttxId
- the transaction ID
-
getTotalSpace
public long getTotalSpace()Description copied from interface:ObjectPersistentStore
Get the size of the persistent store.- Specified by:
getTotalSpace
in interfaceObjectPersistentStore
- Returns:
- the size of the persistent store
-
getFreeSpace
public long getFreeSpace()Description copied from interface:ObjectPersistentStore
Get the free space of the persistent store.- Specified by:
getFreeSpace
in interfaceObjectPersistentStore
- Returns:
- the free space of the persistent store
-