public interface IHeapDataManager
Modifier and Type | Method and Description |
---|---|
String |
backup(long identifier,
int maxBackup) |
DataRecordIdentifier |
ceilingDataRecordIdentifier(DataRecordIdentifier dataRecordIdentifier) |
void |
clear()
clear the heap content.
|
void |
clearStandbyModification()
clear creation, modification, and deletion to do on the heap.
|
Iterator<DataRecordIdentifier> |
dataRecordIterator() |
boolean |
deleteDataRecord(DataRecordIdentifier dataRecordIdentifier)
delete an existing data record knowing its identifier.
|
DataRecordIdentifier |
firstDataRecordIdentifier() |
DataRecordIdentifier |
floorDataRecordIdentifier(DataRecordIdentifier dataRecordIdentifier) |
void |
flush()
flush creation, modification, and deletion to the heap
the heap is updated. |
long |
freeSize()
get heap total free size in bytes.
|
Set<DataRecordIdentifier> |
getDataRecordIdentifierSet()
for test purpose
|
long |
getLastRecordPositionInFile()
for test purpose
|
DataRecordIdentifier |
getNewDataRecordIdentifier()
to get a new data identifier for data record creation: return the next
free data record identifier and internally increment the next free data
record identifier
when created #readHeapDataRecord(DataRecordIdentifier) can be
used for the data record identifierflush() must be call to store the modification. |
DataRecordIdentifier |
getNextFreeDataRecordIdentifier()
get the next free data record identifier
|
int |
getNumberOfDataRecord()
get number of data record in heap file.
|
int |
getNumberOfFreeRecord()
get number of free record in heap file.
|
long |
getRecordPositionInfile(DataRecordIdentifier identifier)
for test purpose
|
String |
getStorageFileName() |
boolean |
hasDataRecord(DataRecordIdentifier dataRecordIdentifier)
to check if have data record for a data record identifier.
|
long |
heapSize()
get heap total size in bytes.
|
DataRecordIdentifier |
higherDataRecordIdentifier(DataRecordIdentifier dataRecordIdentifier) |
boolean |
isDataLost()
return true if data lost after file stable state reconstruction.
|
boolean |
isServiceStarted() |
DataRecordIdentifier |
lastDataRecordIdentifier() |
DataRecordIdentifier |
lowerDataRecordIdentifier(DataRecordIdentifier dataRecordIdentifier) |
DataRecordIdentifier |
nextDataRecordIdentifier(DataRecordIdentifier dataRecordIdentifier) |
byte[] |
readDataRecord(DataRecordIdentifier dataRecordIdentifier)
read data for a data record.
|
DataRecordIdentifier |
removeFirstDataRecord()
remove first data record and return its data record identifier.
|
void |
setDataRecordKeyManager(IDataRecordKeyManager dataRecordKeyComparator) |
void |
setNextFreeDataRecordIdentifier(DataRecordIdentifier dataRecordIdentifier)
set the next free data record identifier.
|
void |
startService(boolean removeFiles)
start heap data manager service.
|
void |
stopService()
stop heap data manager service, do not flush in file any modification.
|
void |
stopService(boolean removeFiles) |
long |
usedSize()
get heap total used size in bytes.
|
boolean |
writeDataRecord(DataRecordIdentifier dataRecordIdentifier,
byte[] data)
write data record.
|
boolean isDataLost()
void startService(boolean removeFiles) throws HeapException
removeFiles
- true if remove files before open common initialization at
constructionHeapException
- read/write error, file restored from stable backup, file
management is not opened, no file in stable statevoid stopService() throws HeapException
HeapException
void stopService(boolean removeFiles) throws HeapException
HeapException
boolean isServiceStarted()
void clear() throws HeapException
HeapException
DataRecordIdentifier getNextFreeDataRecordIdentifier() throws HeapException
HeapException
void setNextFreeDataRecordIdentifier(DataRecordIdentifier dataRecordIdentifier) throws HeapException
flush()
must be call to store the modification.dataRecordIdentifier
- the next free data record identifierHeapException
DataRecordIdentifier getNewDataRecordIdentifier() throws HeapException
#readHeapDataRecord(DataRecordIdentifier)
can be
used for the data record identifierflush()
must be call to store the modification.HeapException
boolean hasDataRecord(DataRecordIdentifier dataRecordIdentifier) throws HeapException
nodeIdentifier
- the data record identifierHeapException
byte[] readDataRecord(DataRecordIdentifier dataRecordIdentifier) throws HeapException
dataRecordIdentifier
- data record to read identifierHeapException
boolean writeDataRecord(DataRecordIdentifier dataRecordIdentifier, byte[] data) throws HeapException
dataRecordIdentifier
- data record to write identifierdata
- the data to writeHeapException
boolean deleteDataRecord(DataRecordIdentifier dataRecordIdentifier) throws HeapException
flush()
must be call to store the modification.dataRecordIdentifier
- data record to delete identifierHeapException
DataRecordIdentifier firstDataRecordIdentifier() throws HeapException
HeapException
DataRecordIdentifier nextDataRecordIdentifier(DataRecordIdentifier dataRecordIdentifier) throws HeapException
dataRecordIdentifier
- wich for next is requestedHeapException
DataRecordIdentifier lastDataRecordIdentifier() throws HeapException
HeapException
DataRecordIdentifier lowerDataRecordIdentifier(DataRecordIdentifier dataRecordIdentifier) throws HeapException
dataRecordIdentifier
- the keynull
if there is no such key.HeapException
DataRecordIdentifier floorDataRecordIdentifier(DataRecordIdentifier dataRecordIdentifier) throws HeapException
dataRecordIdentifier
- the keykey
, or
null
if there is no such keyHeapException
DataRecordIdentifier ceilingDataRecordIdentifier(DataRecordIdentifier dataRecordIdentifier) throws HeapException
dataRecordIdentifier
- the keykey
, or
null
if there is no such keyHeapException
DataRecordIdentifier higherDataRecordIdentifier(DataRecordIdentifier dataRecordIdentifier) throws HeapException
dataRecordIdentifier
- the keykey
, or null
if there
is no such keyHeapException
DataRecordIdentifier removeFirstDataRecord() throws HeapException
flush()
must be call to store the modification.HeapException
void flush() throws HeapException
HeapException
void clearStandbyModification() throws HeapException
HeapException
void setDataRecordKeyManager(IDataRecordKeyManager dataRecordKeyComparator) throws HeapException
HeapException
int getNumberOfDataRecord() throws HeapException
HeapException
int getNumberOfFreeRecord() throws HeapException
HeapException
long heapSize() throws HeapException
HeapException
long freeSize() throws HeapException
HeapException
long usedSize() throws HeapException
HeapException
String backup(long identifier, int maxBackup) throws HeapException
HeapException
String getStorageFileName() throws HeapException
HeapException
@Fortest Set<DataRecordIdentifier> getDataRecordIdentifierSet() throws HeapException
HeapException
Iterator<DataRecordIdentifier> dataRecordIterator() throws HeapException
HeapException
@Fortest long getRecordPositionInfile(DataRecordIdentifier identifier) throws HeapException
identifier
- HeapException
@Fortest long getLastRecordPositionInFile() throws HeapException
HeapException
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.