public abstract class MapReduceIndex<Key,Value,Input> extends java.lang.Object implements InvertedIndex<Key,Value,Input>
Modifier and Type | Field and Description |
---|---|
protected IndexExtension<Key,Value,Input> |
myExtension |
protected DataIndexer<Key,Value,Input> |
myIndexer |
protected IndexId<Key,Value> |
myIndexId |
protected java.util.concurrent.atomic.AtomicLong |
myModificationStamp |
protected IndexStorage<Key,Value> |
myStorage |
protected DataExternalizer<Value> |
myValueExternalizer |
ARE_COMPOSITE_INDEXERS_ENABLED
Modifier | Constructor and Description |
---|---|
protected |
MapReduceIndex(IndexExtension<Key,Value,Input> extension,
IndexStorage<Key,Value> storage,
ForwardIndex forwardIndex,
ForwardIndexAccessor<Key,Value> forwardIndexAccessor) |
protected |
MapReduceIndex(IndexExtension<Key,Value,Input> extension,
IndexStorage<Key,Value> storage,
ForwardIndex forwardIndex,
ForwardIndexAccessor<Key,Value> forwardIndexAccessor,
java.util.concurrent.locks.ReadWriteLock lock) |
Modifier and Type | Method and Description |
---|---|
protected UpdateData<Key,Value> |
calculateUpdateData(int inputId,
Input content) |
abstract void |
checkCanceled() |
static <Key,Value> |
checkValuesHaveProperEqualsAndHashCode(java.util.Map<Key,Value> data,
IndexId<Key,Value> indexId,
DataExternalizer<Value> valueExternalizer) |
void |
clear() |
protected Computable<java.lang.Boolean> |
createIndexUpdateComputation(AbstractUpdateData<Key,Value> updateData) |
void |
dispose() |
protected void |
doClear() |
protected void |
doDispose() |
protected void |
doFlush() |
void |
flush() |
ValueContainer<Value> |
getData(Key key) |
IndexExtension<Key,Value,Input> |
getExtension() |
ForwardIndex |
getForwardIndex() |
ForwardIndexAccessor<Key,Value> |
getForwardIndexAccessor() |
protected InputDataDiffBuilder<Key,Value> |
getKeysDiffBuilder(int inputId) |
java.util.concurrent.locks.ReadWriteLock |
getLock() |
long |
getModificationStamp() |
java.util.concurrent.locks.Lock |
getReadLock() |
IndexStorage<Key,Value> |
getStorage() |
java.util.concurrent.locks.Lock |
getWriteLock() |
protected java.util.Map<Key,Value> |
mapByIndexer(int inputId,
Input content) |
protected InputData<Key,Value> |
mapInput(int inputId,
Input content) |
protected abstract void |
requestRebuild(java.lang.Throwable e) |
Computable<java.lang.Boolean> |
update(int inputId,
Input content) |
protected void |
updateForwardIndex(int inputId,
InputData<Key,Value> data) |
void |
updateWithMap(AbstractUpdateData<Key,Value> updateData) |
protected final IndexStorage<Key,Value> myStorage
protected final DataExternalizer<Value> myValueExternalizer
protected final IndexExtension<Key,Value,Input> myExtension
protected final java.util.concurrent.atomic.AtomicLong myModificationStamp
protected final DataIndexer<Key,Value,Input> myIndexer
protected MapReduceIndex(IndexExtension<Key,Value,Input> extension, IndexStorage<Key,Value> storage, ForwardIndex forwardIndex, ForwardIndexAccessor<Key,Value> forwardIndexAccessor, java.util.concurrent.locks.ReadWriteLock lock)
protected MapReduceIndex(IndexExtension<Key,Value,Input> extension, IndexStorage<Key,Value> storage, ForwardIndex forwardIndex, ForwardIndexAccessor<Key,Value> forwardIndexAccessor)
public ForwardIndex getForwardIndex()
public ForwardIndexAccessor<Key,Value> getForwardIndexAccessor()
public IndexExtension<Key,Value,Input> getExtension()
public IndexStorage<Key,Value> getStorage()
public final java.util.concurrent.locks.ReadWriteLock getLock()
public void clear()
clear
in interface InvertedIndex<Key,Value,Input>
protected void doClear() throws StorageException, java.io.IOException
StorageException
java.io.IOException
public void flush() throws StorageException
flush
in interface InvertedIndex<Key,Value,Input>
StorageException
protected void doFlush() throws java.io.IOException, StorageException
java.io.IOException
StorageException
public void dispose()
dispose
in interface InvertedIndex<Key,Value,Input>
protected void doDispose() throws StorageException
StorageException
public final java.util.concurrent.locks.Lock getReadLock()
public final java.util.concurrent.locks.Lock getWriteLock()
public ValueContainer<Value> getData(Key key) throws StorageException
getData
in interface InvertedIndex<Key,Value,Input>
StorageException
public final Computable<java.lang.Boolean> update(int inputId, Input content)
update
in interface InvertedIndex<Key,Value,Input>
inputId
- *positive* id of content.protected Computable<java.lang.Boolean> createIndexUpdateComputation(AbstractUpdateData<Key,Value> updateData)
protected UpdateData<Key,Value> calculateUpdateData(int inputId, Input content)
protected void updateForwardIndex(int inputId, InputData<Key,Value> data) throws java.io.IOException
java.io.IOException
protected InputDataDiffBuilder<Key,Value> getKeysDiffBuilder(int inputId) throws java.io.IOException
java.io.IOException
public abstract void checkCanceled()
protected abstract void requestRebuild(java.lang.Throwable e)
public long getModificationStamp()
public void updateWithMap(AbstractUpdateData<Key,Value> updateData) throws StorageException
StorageException
public static <Key,Value> void checkValuesHaveProperEqualsAndHashCode(java.util.Map<Key,Value> data, IndexId<Key,Value> indexId, DataExternalizer<Value> valueExternalizer)