Package org.nustaq.offheap
Class FSTSerializedOffheapMap<K,V>
java.lang.Object
org.nustaq.offheap.FSTBinaryOffheapMap
org.nustaq.offheap.FSTCodedOffheapMap<K,V>
org.nustaq.offheap.FSTSerializedOffheapMap<K,V>
- Direct Known Subclasses:
FSTAsciiStringOffheapMap,FSTLongOffheapMap,FSTUTFStringOffheapMap
public abstract class FSTSerializedOffheapMap<K,V> extends FSTCodedOffheapMap<K,V>
An offheap map using serialization for Value Objects.
Note there are several wrappers to represent keys as ByteSource (see FSTAsciiStringOffheapMap for example)
this class is not threadsafe
-
Nested Class Summary
Nested classes/interfaces inherited from class org.nustaq.offheap.FSTBinaryOffheapMap
FSTBinaryOffheapMap.KeyValIter -
Field Summary
Fields Modifier and Type Field Description protected byte[]bufferprotected FSTCodercoderprotected ByteArrayByteSourcetmpValFields inherited from class org.nustaq.offheap.FSTBinaryOffheapMap
alloc, bytezOffset, CORE_HEADER_LEN, CUSTOM_FILEHEADER_LEN, customHeader, FILE_HEADER_LEN, freeList, GB, index, KEY_OFFSET_IN_HEADER, keyLen, mappedFile, MB, memory, mutationCount, numElem -
Constructor Summary
Constructors Constructor Description FSTSerializedOffheapMap(int keyLen, long sizeBytes, int numberOfElems, FSTCoder coder)FSTSerializedOffheapMap(java.lang.String mappedFile, int keyLen, long sizeMemBytes, int numberOfElems, FSTCoder coder) -
Method Summary
Modifier and Type Method Description VdecodeValue(BytezByteSource val)ByteSourceencodeValue(V value)FSTCodergetCoder()protected intgetEntryLengthForContentLength(long lengthOfEntry)default is to let 100% room for later entry growth.Methods inherited from class org.nustaq.offheap.FSTCodedOffheapMap
encodeKey, get, put, remove, valuesMethods inherited from class org.nustaq.offheap.FSTBinaryOffheapMap
addEntry, addToFreeList, binaryKeys, binaryValues, decElems, dumpIndexStats, finalize, free, getBinary, getCapacityMB, getContentLenFromHeader, getCustomFileHeader, getFileName, getFreeMem, getHeaderLen, getLenFromHeader, getSize, getUsedMem, incElems, init, initFromFile, main, printBinaryKey, putBinary, removeBinary, removeEntry, resizeStore, setEntry, writeEntryHeader
-
Field Details
-
Constructor Details
-
FSTSerializedOffheapMap
-
FSTSerializedOffheapMap
public FSTSerializedOffheapMap(java.lang.String mappedFile, int keyLen, long sizeMemBytes, int numberOfElems, FSTCoder coder) throws java.lang.Exception- Throws:
java.lang.Exception
-
-
Method Details
-
encodeValue
- Specified by:
encodeValuein classFSTCodedOffheapMap<K,V>
-
getEntryLengthForContentLength
protected int getEntryLengthForContentLength(long lengthOfEntry)default is to let 100% room for later entry growth. Avoid fragmentation as hell.- Overrides:
getEntryLengthForContentLengthin classFSTBinaryOffheapMap- Parameters:
lengthOfEntry-- Returns:
-
getCoder
-
decodeValue
- Specified by:
decodeValuein classFSTCodedOffheapMap<K,V>
-