public class MappedPageImpl extends Object implements IMappedPage, Closeable
| Constructor and Description |
|---|
MappedPageImpl(MappedByteBuffer mbb,
String pageFile,
long index) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush()
Persist any changes to disk
|
ByteBuffer |
getLocal(int position)
Get a thread local copy of the mapped page buffer
|
byte[] |
getLocal(int position,
int length)
Get data from a thread local copy of the mapped page buffer
|
String |
getPageFile()
The back page file name of the mapped page
|
long |
getPageIndex()
The index of the mapped page
|
boolean |
isClosed()
Check if this mapped page has been closed or not
|
boolean |
isNew()
Is the mapped page new or was it read from disk
|
void |
setDirty(boolean dirty)
Set if the mapped page has been changed or not
|
void |
setNew(boolean isNew) |
String |
toString() |
public MappedPageImpl(MappedByteBuffer mbb, String pageFile, long index)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void setNew(boolean isNew)
public boolean isNew()
IMappedPageisNew in interface IMappedPagepublic void setDirty(boolean dirty)
IMappedPagesetDirty in interface IMappedPagedirty - dirty flag to setpublic void flush()
IMappedPageflush in interface IMappedPagepublic byte[] getLocal(int position,
int length)
IMappedPagegetLocal in interface IMappedPageposition - start position(relative to the start position of source mapped page buffer) of the thread local bufferlength - the length to fetchpublic ByteBuffer getLocal(int position)
IMappedPagegetLocal in interface IMappedPageposition - start position(relative to the start position of source mapped page buffer) of the thread local bufferpublic boolean isClosed()
IMappedPageisClosed in interface IMappedPagepublic String getPageFile()
IMappedPagegetPageFile in interface IMappedPagepublic long getPageIndex()
IMappedPagegetPageIndex in interface IMappedPageCopyright © 2020. All rights reserved.