public class FSTBinaryOffheapMap extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
FSTBinaryOffheapMap.KeyValIter |
| Modifier and Type | Field and Description |
|---|---|
protected MallocBytezAllocator |
alloc |
protected long |
bytezOffset |
static int |
CORE_HEADER_LEN |
static int |
CUSTOM_FILEHEADER_LEN |
protected Bytez |
customHeader |
static int |
FILE_HEADER_LEN |
protected FreeList |
freeList |
static long |
GB |
protected OffHeapByteTree |
index |
static int |
KEY_OFFSET_IN_HEADER |
protected int |
keyLen |
protected String |
mappedFile |
static long |
MB |
protected Bytez |
memory |
protected int |
numElem |
| Constructor and Description |
|---|
FSTBinaryOffheapMap(int keyLen,
long sizeMemBytes,
int numberOfElems) |
FSTBinaryOffheapMap(String mappedFile,
int keyLen,
long sizeMemBytes,
int numberOfElems) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
addEntry(ByteSource key,
ByteSource value) |
protected void |
addToFreeList(long offset) |
FSTBinaryOffheapMap.KeyValIter |
binaryKeys() |
Iterator<ByteSource> |
binaryValues() |
protected void |
decElems() |
void |
dumpIndexStats() |
protected void |
finalize() |
void |
free() |
BytezByteSource |
getBinary(ByteSource key)
get an entry.
|
int |
getCapacityMB() |
protected int |
getContentLenFromHeader(long off) |
Bytez |
getCustomFileHeader() |
protected int |
getEntryLengthForContentLength(long lengthOfEntry)
called upon add, allows to reserve extra space for later growth per entry
|
long |
getFreeMem() |
protected int |
getHeaderLen() |
protected int |
getLenFromHeader(long off) |
int |
getSize() |
long |
getUsedMem() |
protected void |
incElems() |
protected void |
init(int keyLen,
long sizeMemBytes,
int numberOfElems) |
protected void |
initFromFile(String file,
int keyLen,
long sizeMemBytes,
int numberOfElems) |
String |
printBinaryKey(ByteSource key) |
void |
putBinary(ByteSource key,
ByteSource value) |
void |
removeBinary(ByteSource key)
remove the key from the binary map
|
protected void |
removeEntry(long offset) |
protected void |
setEntry(long off,
int entryLen,
ByteSource value) |
protected void |
writeEntryHeader(long offset,
int entryLen,
int contentLen,
boolean removed) |
public static final long MB
public static final long GB
public static final int CUSTOM_FILEHEADER_LEN
public static final int CORE_HEADER_LEN
public static final int FILE_HEADER_LEN
public static final int KEY_OFFSET_IN_HEADER
protected OffHeapByteTree index
protected Bytez memory
protected Bytez customHeader
protected MallocBytezAllocator alloc
protected int numElem
protected int keyLen
protected long bytezOffset
protected FreeList freeList
protected String mappedFile
public FSTBinaryOffheapMap(String mappedFile, int keyLen, long sizeMemBytes, int numberOfElems) throws Exception
Exceptionpublic FSTBinaryOffheapMap(int keyLen,
long sizeMemBytes,
int numberOfElems)
public Bytez getCustomFileHeader()
protected void initFromFile(String file, int keyLen, long sizeMemBytes, int numberOfElems) throws Exception
Exceptionprotected void init(int keyLen,
long sizeMemBytes,
int numberOfElems)
protected void finalize()
throws Throwable
public void free()
public void putBinary(ByteSource key, ByteSource value)
protected void removeEntry(long offset)
protected void addToFreeList(long offset)
protected void setEntry(long off,
int entryLen,
ByteSource value)
protected long addEntry(ByteSource key, ByteSource value)
public BytezByteSource getBinary(ByteSource key)
key - public void removeBinary(ByteSource key)
key - protected void decElems()
protected void incElems()
protected int getEntryLengthForContentLength(long lengthOfEntry)
lengthOfEntry - protected void writeEntryHeader(long offset,
int entryLen,
int contentLen,
boolean removed)
protected int getHeaderLen()
protected int getLenFromHeader(long off)
protected int getContentLenFromHeader(long off)
public Iterator<ByteSource> binaryValues()
public String printBinaryKey(ByteSource key)
public FSTBinaryOffheapMap.KeyValIter binaryKeys()
public long getFreeMem()
public long getUsedMem()
public int getCapacityMB()
public int getSize()
public void dumpIndexStats()
Copyright © 2015. All rights reserved.