Package org.kairosdb.bigqueue.page
Interface IMappedPage
-
- All Known Implementing Classes:
MappedPageImpl
public interface IMappedPageMemory mapped page file ADT- Author:
- bulldog
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidflush()Persist any changes to diskByteBuffergetLocal(int position)Get a thread local copy of the mapped page bufferbyte[]getLocal(int position, int length)Get data from a thread local copy of the mapped page bufferStringgetPageFile()The back page file name of the mapped pagelonggetPageIndex()The index of the mapped pagebooleanisClosed()Check if this mapped page has been closed or notbooleanisNew()Is the mapped page new or was it read from diskvoidsetDirty(boolean dirty)Set if the mapped page has been changed or not
-
-
-
Method Detail
-
getLocal
ByteBuffer getLocal(int position)
Get a thread local copy of the mapped page buffer- Parameters:
position- start position(relative to the start position of source mapped page buffer) of the thread local buffer- Returns:
- a byte buffer with specific position as start position.
-
getLocal
byte[] getLocal(int position, int length)Get data from a thread local copy of the mapped page buffer- Parameters:
position- start position(relative to the start position of source mapped page buffer) of the thread local bufferlength- the length to fetch- Returns:
- byte data
-
isClosed
boolean isClosed()
Check if this mapped page has been closed or not- Returns:
- returns true if closed
-
isNew
boolean isNew()
Is the mapped page new or was it read from disk- Returns:
- true if no file on disk existed
-
setDirty
void setDirty(boolean dirty)
Set if the mapped page has been changed or not- Parameters:
dirty- dirty flag to set
-
getPageFile
String getPageFile()
The back page file name of the mapped page- Returns:
- name of page file
-
getPageIndex
long getPageIndex()
The index of the mapped page- Returns:
- the index
-
flush
void flush()
Persist any changes to disk
-
-