public final class InMemoryLinkedDataStore extends AbstractDataStore
locks, SAFE_MODE| Constructor and Description |
|---|
InMemoryLinkedDataStore(String name,
int initialSize,
int maxSize)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkHandle(int handle)
Check handle validity
|
void |
close()
Close the store releasing associated system resources
|
void |
commitChanges()
Ensure everything's persisted (synchronous)
|
void |
commitChanges(SynchronizationBarrier barrier)
Ensure everything's persisted (asynchronous)
|
int |
delete(int handle)
Delete data associated to the given handle from the store
|
int |
first()
Get the first data handle stored
|
int |
getAbsoluteStoreUsage()
Get the absolute store usage amount (%)
(Ratio of used space over maximum allocatable space)
|
int |
getStoreUsage()
Get the store usage amount (%)
(Ratio of used space over currently allocated space)
|
void |
init()
Initialize the data store
|
int |
next(int handle)
Get the next data handle after the given one
|
int |
previous(int handle)
Get the previous data handle after the given one
|
int |
replace(int handle,
Object obj)
Replace data in the store at the given position
|
Object |
retrieve(int handle)
Retrieve the data associated to a given handle
|
int |
size()
Get the number of entries in the store
|
int |
store(Object obj,
int previousHandle)
Put some data under in the store after the previous handle data
|
String |
toString() |
isLocked, lock, unlockpublic InMemoryLinkedDataStore(String name, int initialSize, int maxSize)
public void init()
throws DataStoreException
LinkedDataStoreDataStoreExceptionprotected void checkHandle(int handle)
throws DataStoreException
AbstractDataStorecheckHandle in class AbstractDataStoreDataStoreExceptionpublic Object retrieve(int handle) throws DataStoreException
LinkedDataStoreDataStoreException - on storage error or invalid handlepublic int replace(int handle,
Object obj)
throws DataStoreException
LinkedDataStorehandle - message handleobj - the message to storeDataStoreExceptionpublic int store(Object obj, int previousHandle) throws DataStoreException
LinkedDataStorepreviousHandle - previous entry handle, use 0 if the store is emptyDataStoreExceptionpublic int delete(int handle)
throws DataStoreException
LinkedDataStoreDataStoreException - on storage error or invalid handlepublic int first()
throws DataStoreException
LinkedDataStoreDataStoreExceptionpublic int next(int handle)
throws DataStoreException
LinkedDataStorehandle - block handleDataStoreExceptionpublic int previous(int handle)
throws DataStoreException
LinkedDataStorehandle - block handleDataStoreExceptionpublic int size()
DataStorepublic void commitChanges(SynchronizationBarrier barrier) throws DataStoreException
DataStoreDataStoreExceptionpublic void commitChanges()
throws DataStoreException
DataStoreDataStoreExceptionpublic void close()
DataStorepublic int getStoreUsage()
DataStorepublic int getAbsoluteStoreUsage()
DataStoreCopyright © 2021. All rights reserved.