public interface Index<ReferenceType extends Reference> extends java.lang.Iterable<ReferenceContainer<ReferenceType>>
Modifier and Type | Method and Description |
---|---|
void |
add(byte[] termHash,
ReferenceType entry)
add a single reference to the reverse index
if no references to the word are stored, the a new entry is added,
if there are already references to the word hash stored,
then the old and the new references are merged
|
void |
add(ReferenceContainer<ReferenceType> newEntries)
add references to the reverse index
if no references to the word are stored, the new Entries are added,
if there are already references to the word that is denoted with the
reference to be stored, then the old and the new references are merged
|
void |
clear()
delete all references entries
|
void |
close()
close the reverse index
|
int |
count(byte[] termHash)
count the number of references for the given word
do not use this method to check the existence of a reference by comparing
the result with zero, use hasReferences instead.
|
void |
delete(byte[] termHash)
delete all references for a word
the difference to 'remove' is, that the removed element is not returned
|
ReferenceContainer<ReferenceType> |
get(byte[] termHash,
HandleSet referenceselection)
get the references to a given word.
|
boolean |
has(byte[] termHash)
check if there are references stored to the given word hash
|
void |
merge(Index<ReferenceType> otherIndex)
merge this index with another index
|
int |
minMem()
calculate needed memory
|
CloneableIterator<ReferenceContainer<ReferenceType>> |
referenceContainerIterator(byte[] startHash,
boolean rot,
boolean excludePrivate)
iterate all references from the beginning of a specific word hash
|
CloneableIterator<Rating<byte[]>> |
referenceCountIterator(byte[] startHash,
boolean rot,
boolean excludePrivate)
iterate all references from the beginning of a specific word hash
|
Row |
referenceRow()
ask for the Row that is used to construct one reference
|
ReferenceContainer<ReferenceType> |
remove(byte[] termHash)
remove all references for a word
|
boolean |
remove(byte[] termHash,
byte[] referenceHash)
remove a specific reference entry
|
int |
remove(byte[] termHash,
HandleSet referenceHashes)
remove a set of reference entries for a given word
|
int |
remove(HandleSet termHashes,
byte[] urlHashBytes) |
void |
removeDelayed() |
void |
removeDelayed(byte[] termHash,
byte[] referenceHash) |
java.util.TreeMap<byte[],ReferenceContainer<ReferenceType>> |
searchConjunction(HandleSet wordHashes,
HandleSet urlselection)
collect containers for given word hashes.
|
int |
size()
the number of all references
|
int |
termKeyLength()
every index entry is made for a term which has a fixed size
|
ByteOrder |
termKeyOrdering()
return the order that is used for the storage of the word hashes
|
int termKeyLength()
void merge(Index<ReferenceType> otherIndex) throws java.io.IOException, SpaceExceededException
otherIndex
- java.io.IOException
SpaceExceededException
void add(ReferenceContainer<ReferenceType> newEntries) throws java.io.IOException, SpaceExceededException
newEntries
- the References to be merged with existing referencesjava.io.IOException
SpaceExceededException
void add(byte[] termHash, ReferenceType entry) throws java.io.IOException, SpaceExceededException
termHash
- entry
- java.io.IOException
SpaceExceededException
boolean has(byte[] termHash)
termHash
- int count(byte[] termHash)
termHash
- ReferenceContainer<ReferenceType> get(byte[] termHash, HandleSet referenceselection) throws java.io.IOException
termHash
- referenceselection
- java.io.IOException
ReferenceContainer<ReferenceType> remove(byte[] termHash) throws java.io.IOException
termHash
- java.io.IOException
void delete(byte[] termHash) throws java.io.IOException
termHash
- java.io.IOException
boolean remove(byte[] termHash, byte[] referenceHash) throws java.io.IOException
termHash
- referenceHash
- the key for the reference entry to be removedjava.io.IOException
void removeDelayed(byte[] termHash, byte[] referenceHash) throws java.io.IOException
java.io.IOException
int remove(byte[] termHash, HandleSet referenceHashes) throws java.io.IOException
termHash
- the key for the referencesreferenceHash
- the reference entry keysjava.io.IOException
int remove(HandleSet termHashes, byte[] urlHashBytes) throws java.io.IOException
java.io.IOException
void removeDelayed() throws java.io.IOException
java.io.IOException
CloneableIterator<Rating<byte[]>> referenceCountIterator(byte[] startHash, boolean rot, boolean excludePrivate) throws java.io.IOException
startHash
- rot
- if true, then rotate at the end to the beginningram
- java.io.IOException
CloneableIterator<ReferenceContainer<ReferenceType>> referenceContainerIterator(byte[] startHash, boolean rot, boolean excludePrivate) throws java.io.IOException
startHash
- rot
- if true, then rotate at the end to the beginningram
- java.io.IOException
java.util.TreeMap<byte[],ReferenceContainer<ReferenceType>> searchConjunction(HandleSet wordHashes, HandleSet urlselection)
wordHashes
- urlselection
- void clear() throws java.io.IOException
java.io.IOException
void close()
int size()
int minMem()
ByteOrder termKeyOrdering()
Row referenceRow()