public abstract class MapIndexStorage<Key,Value> extends java.lang.Object implements IndexStorage<Key,Value>
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.locks.Lock |
l |
protected java.nio.file.Path |
myBaseStorageFile |
protected SLRUCache<Key,ChangeTrackingValueContainer<Value>> |
myCache |
protected KeyDescriptor<Key> |
myKeyDescriptor |
protected PersistentMap<Key,UpdatableValueContainer<Value>> |
myMap |
| Modifier | Constructor and Description |
|---|---|
protected |
MapIndexStorage(java.nio.file.Path storageFile,
KeyDescriptor<Key> keyDescriptor,
DataExternalizer<Value> valueExternalizer,
int cacheSize,
boolean keyIsUniqueForIndexedFile) |
protected |
MapIndexStorage(java.nio.file.Path storageFile,
KeyDescriptor<Key> keyDescriptor,
DataExternalizer<Value> valueExternalizer,
int cacheSize,
boolean keyIsUniqueForIndexedFile,
boolean initialize,
boolean readOnly,
ValueContainerInputRemapping inputRemapping) |
| Modifier and Type | Method and Description |
|---|---|
void |
addValue(Key key,
int inputId,
Value value) |
protected abstract void |
checkCanceled() |
void |
clear() |
void |
clearCaches() |
void |
close() |
protected boolean |
doProcessKeys(Processor<? super Key> processor) |
void |
flush() |
PersistentMap<Key,UpdatableValueContainer<Value>> |
getIndexMap() |
static java.nio.file.Path |
getIndexStorageFile(java.nio.file.Path baseFile) |
protected void |
initMapAndCache() |
boolean |
processKeys(Processor<? super Key> processor) |
ChangeTrackingValueContainer<Value> |
read(Key key) |
void |
removeAllValues(Key key,
int inputId) |
protected static <T> T |
unwrapCauseAndRethrow(java.lang.RuntimeException e) |
protected PersistentMap<Key,UpdatableValueContainer<Value>> myMap
protected SLRUCache<Key,ChangeTrackingValueContainer<Value>> myCache
protected final java.nio.file.Path myBaseStorageFile
protected final KeyDescriptor<Key> myKeyDescriptor
protected final java.util.concurrent.locks.Lock l
protected MapIndexStorage(java.nio.file.Path storageFile,
KeyDescriptor<Key> keyDescriptor,
DataExternalizer<Value> valueExternalizer,
int cacheSize,
boolean keyIsUniqueForIndexedFile)
throws java.io.IOException
java.io.IOExceptionprotected MapIndexStorage(java.nio.file.Path storageFile,
KeyDescriptor<Key> keyDescriptor,
DataExternalizer<Value> valueExternalizer,
int cacheSize,
boolean keyIsUniqueForIndexedFile,
boolean initialize,
boolean readOnly,
ValueContainerInputRemapping inputRemapping)
throws java.io.IOException
java.io.IOExceptionprotected void initMapAndCache()
throws java.io.IOException
java.io.IOExceptionprotected abstract void checkCanceled()
public void flush()
flush in interface IndexStorage<Key,Value>flush in interface java.io.Flushablepublic void close()
throws StorageException
close in interface IndexStorage<Key,Value>StorageExceptionpublic void clear()
throws StorageException
clear in interface IndexStorage<Key,Value>StorageExceptionpublic ChangeTrackingValueContainer<Value> read(Key key) throws StorageException
read in interface IndexStorage<Key,Value>StorageExceptionpublic void addValue(Key key, int inputId, Value value) throws StorageException
addValue in interface IndexStorage<Key,Value>StorageExceptionpublic void removeAllValues(Key key, int inputId) throws StorageException
removeAllValues in interface IndexStorage<Key,Value>StorageExceptionpublic void clearCaches()
clearCaches in interface IndexStorage<Key,Value>protected static <T> T unwrapCauseAndRethrow(java.lang.RuntimeException e)
throws StorageException
StorageExceptionpublic boolean processKeys(Processor<? super Key> processor) throws StorageException
StorageExceptionprotected boolean doProcessKeys(Processor<? super Key> processor) throws java.io.IOException
java.io.IOExceptionpublic PersistentMap<Key,UpdatableValueContainer<Value>> getIndexMap()
public static java.nio.file.Path getIndexStorageFile(java.nio.file.Path baseFile)