public class SinglePageEntryBuffer extends Object implements SharedEntryBuffer
It extends BufferPage and complements it with the methods required to make a page look like a complete buffer. In essence, it just makes a page mutable by reassigning merge results to the same buffer + index refs
This saves a lot of overhead because 90% of stores fit into one page, as we don't have to keep track of a list of pages etc
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
EMPTY_DATA |
static int[] |
EMPTY_INDEX |
| Constructor and Description |
|---|
SinglePageEntryBuffer() |
| Modifier and Type | Method and Description |
|---|---|
int |
byteSize() |
SharedEntryBufferFragmentationReport |
createFragmentationReport(int maxPageSize) |
void |
dumpTo(DataOutputStream out) |
Entry |
get(int index)
Entry is packed into byte array in the following way
1.
|
int |
getIndex(StaticBuffer column) |
Entry |
getNoCopy(int index) |
protected int[] |
getOffsetIndex() |
protected byte[] |
getRawData() |
EntryList |
getSlice(KeySliceQuery query) |
boolean |
isEmpty() |
boolean |
isPaged() |
List<org.janusgraph.diskstorage.inmemory.BufferPage> |
merge(Entry[] add,
int iaddp,
int addLimit,
Entry[] del,
int idelp,
int delLimit,
int maxPageSize) |
static List<org.janusgraph.diskstorage.inmemory.BufferPage> |
merge(List<org.janusgraph.diskstorage.inmemory.BufferPage> pagesToMerge,
int maxPageSize) |
void |
mutate(Entry[] add,
Entry[] del,
int maxPageSize) |
int |
numEntries() |
int |
numPages() |
void |
quickDefragment(int maxPageSize) |
protected void |
setOffsetIndex(int[] offsetIndex) |
protected void |
setRawData(byte[] rawData) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbyteSize, isEmpty, numEntriespublic static final int[] EMPTY_INDEX
public static final byte[] EMPTY_DATA
public int numPages()
numPages in interface SharedEntryBufferpublic EntryList getSlice(KeySliceQuery query)
getSlice in interface SharedEntryBufferpublic void mutate(Entry[] add, Entry[] del, int maxPageSize)
mutate in interface SharedEntryBufferpublic boolean isPaged()
isPaged in interface SharedEntryBufferpublic SharedEntryBufferFragmentationReport createFragmentationReport(int maxPageSize)
createFragmentationReport in interface SharedEntryBufferpublic void quickDefragment(int maxPageSize)
quickDefragment in interface SharedEntryBufferpublic void dumpTo(DataOutputStream out) throws IOException
dumpTo in interface SharedEntryBufferIOExceptionprotected int[] getOffsetIndex()
protected byte[] getRawData()
protected void setRawData(byte[] rawData)
protected void setOffsetIndex(int[] offsetIndex)
public boolean isEmpty()
public int getIndex(StaticBuffer column)
public Entry get(int index)
index - public Entry getNoCopy(int index)
public int numEntries()
public int byteSize()
public static List<org.janusgraph.diskstorage.inmemory.BufferPage> merge(List<org.janusgraph.diskstorage.inmemory.BufferPage> pagesToMerge, int maxPageSize)
public List<org.janusgraph.diskstorage.inmemory.BufferPage> merge(Entry[] add, int iaddp, int addLimit, Entry[] del, int idelp, int delLimit, int maxPageSize)
Copyright © 2012–2023. All rights reserved.