public class InMemoryKeyColumnValueStore extends Object implements KeyColumnValueStore
KeyColumnValueStore.
This implementation is thread-safe. All data is held in memory, which means that the capacity of this store is
determined by the available heap space. No data is persisted and all data lost when the jvm terminates or store closed.
The implementation also provides basic dump/restore capabilities, so that a "snapshot" of its contents can be saved to filesystem
and loaded back.
Finally, it provides a means to assess the fragmentation of the data across allocated memory storage, and to defragment it if required.
NOTE: with usual "populate then query" and "add only" use cases, fragmentation is of no concern. Only if your application performs
a lot of deletes interleaved with additions for a prolong periods of time, and if you are experiencing a "bigger than expected" memory
footprint, is it worth looking at fragmentation report.NO_ADDITIONS, NO_DELETIONS| Constructor and Description |
|---|
InMemoryKeyColumnValueStore(String name) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMultiSlicespublic InMemoryKeyColumnValueStore(String name)
public EntryList getSlice(KeySliceQuery query, StoreTransaction txh) throws BackendException
getSlice in interface KeyColumnValueStoreBackendExceptionpublic Map<StaticBuffer,EntryList> getSlice(List<StaticBuffer> keys, SliceQuery query, StoreTransaction txh) throws BackendException
getSlice in interface KeyColumnValueStoreBackendExceptionpublic void mutate(StaticBuffer key, List<Entry> additions, List<StaticBuffer> deletions, StoreTransaction txh) throws BackendException
mutate in interface KeyColumnValueStoreBackendExceptionpublic void acquireLock(StaticBuffer key, StaticBuffer column, StaticBuffer expectedValue, StoreTransaction txh) throws BackendException
acquireLock in interface KeyColumnValueStoreBackendExceptionpublic KeyIterator getKeys(KeyRangeQuery query, StoreTransaction txh) throws BackendException
getKeys in interface KeyColumnValueStoreBackendExceptionpublic KeyIterator getKeys(SliceQuery query, StoreTransaction txh) throws BackendException
getKeys in interface KeyColumnValueStoreBackendExceptionpublic KeySlicesIterator getKeys(MultiSlicesQuery queries, StoreTransaction txh) throws BackendException
getKeys in interface KeyColumnValueStoreBackendExceptionpublic String getName()
getName in interface KeyColumnValueStorepublic void clear()
public void close()
throws BackendException
close in interface KeyColumnValueStoreBackendExceptionpublic InMemoryKeyColumnValueStoreFragmentationReport createFragmentationReport(StoreTransaction txh) throws BackendException
BackendExceptionpublic void quickDefragment(Collection<org.janusgraph.diskstorage.inmemory.InMemoryColumnValueStore> stores, StoreTransaction txh) throws BackendException
BackendExceptionpublic void quickDefragment(StoreTransaction txh) throws BackendException
BackendExceptionpublic void dumpTo(Path storePath, ForkJoinPool parallelOperationsExecutor)
public static InMemoryKeyColumnValueStore readFrom(Path storePath, String name, ForkJoinPool parallelOperationsExecutor) throws IOException
IOExceptionCopyright © 2012–2023. All rights reserved.