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 TypeMethodDescriptionvoidcommitTx(TxManifestRaw names, long txId) Commit a transaction to the persistent store.longGet the free space of the persistent store.Get a snapshot of the persistent store.longGet the size of the persistent store.
-
Constructor Details
-
MemoryObjectPersistentStore
public MemoryObjectPersistentStore()
-
-
Method Details
-
getSnapshot
Description copied from interface:ObjectPersistentStoreGet a snapshot of the persistent store.- Specified by:
getSnapshotin interfaceObjectPersistentStore- Returns:
- a snapshot of the persistent store
-
commitTx
Description copied from interface:ObjectPersistentStoreCommit a transaction to the persistent store.- Specified by:
commitTxin interfaceObjectPersistentStore- Parameters:
names- the transaction manifesttxId- the transaction ID
-
getTotalSpace
public long getTotalSpace()Description copied from interface:ObjectPersistentStoreGet the size of the persistent store.- Specified by:
getTotalSpacein interfaceObjectPersistentStore- Returns:
- the size of the persistent store
-
getFreeSpace
public long getFreeSpace()Description copied from interface:ObjectPersistentStoreGet the free space of the persistent store.- Specified by:
getFreeSpacein interfaceObjectPersistentStore- Returns:
- the free space of the persistent store
-