Package org.nustaq.offheap
Class FSTCodedOffheapMap<K,V>
java.lang.Object
org.nustaq.offheap.FSTBinaryOffheapMap
org.nustaq.offheap.FSTCodedOffheapMap<K,V>
- Direct Known Subclasses:
FSTSerializedOffheapMap
An offheap map adding mechanics to encode and decode keys and values.
Again remember keys have to be of fixed size and should be as short as possible.
Performance and memory consumtpion is best if significant digits are at the
end of a key (e.g. "year_montH_day" instead "day_month_year".
This class can be used for manual implementation of encoding/decoding.
See StringOffHeapMap for an example on how to do efficient wrapping/encoding of keys
-
Nested Class Summary
Nested classes/interfaces inherited from class org.nustaq.offheap.FSTBinaryOffheapMap
FSTBinaryOffheapMap.KeyValIter
-
Field Summary
Fields 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
ConstructorDescriptionFSTCodedOffheapMap
(int keyLen, long sizeMemBytes, int numberOfElems) FSTCodedOffheapMap
(String mappedFile, int keyLen, long sizeMemBytes, int numberOfElems) -
Method Summary
Modifier and TypeMethodDescriptionabstract V
abstract ByteSource
abstract ByteSource
encodeValue
(V value) void
void
values()
Warning: Concurrent Modification (e.g. add remove elements during iteration) is NOT SUPPORTED and NOT CHECKED.Methods inherited from class org.nustaq.offheap.FSTBinaryOffheapMap
addEntry, addToFreeList, binaryKeys, binaryValues, decElems, dumpIndexStats, finalize, free, getBinary, getCapacityMB, getContentLenFromHeader, getCustomFileHeader, getEntryLengthForContentLength, getFileName, getFreeMem, getHeaderLen, getLenFromHeader, getSize, getUsedMem, incElems, init, initFromFile, main, printBinaryKey, putBinary, removeBinary, removeEntry, resizeStore, setEntry, writeEntryHeader
-
Constructor Details
-
Method Details
-
encodeKey
-
encodeValue
-
decodeValue
-
get
-
put
-
remove
-
values
Warning: Concurrent Modification (e.g. add remove elements during iteration) is NOT SUPPORTED and NOT CHECKED. Collect keys to change inside an iteration and perform changes on the map after iteration is finished.- Returns:
- an iterator on the values contained in this map.
-