org.egothor.core
Interface Barrel

All Known Implementing Classes:
BarrelShadow, Document, Group, MemoryBarrel, Tanker, TankerImpl, TankerImplDuplicityChecker, TankerImplSecure, ThickBarrel

public interface Barrel

A Barrel is an index that can be opened for reading (via BarrelReader), manage the removal of documents from itself, and can return metadata of inverted lists and documents. A Barrel can also destroy itself.

Author:
Leo Galambos

Method Summary
 void close()
          Close this Barrel.
 void commit()
          Commit changes of this barrel to disk.
 long deleted()
          Return the number of deleted documents in this Barrel.
 void destroy()
          Destroy all data structures this Barrel uses.
 Sequence<? extends IListMetadata> expand(java.lang.String expr)
          Return the enumeration of all IListMetadata objects which match the expression.
 Bitmap getBitmap(java.lang.String label)
          Return the Bitmap of a given label.
 IListMetadata getIListMeta(java.lang.String term)
          Return the inverted list metadata of the given term.
 DocumentData getMeta(long uid)
          Return the metadata of document number uid.
 BarrelReader open()
          Return a reader for this Barrel.
 IListReader openIList(java.lang.String term, boolean clean)
          Open the inverted list of term for reading.
 void query(Query q, ResultList result)
          Submit a query to this Barrel.
 boolean removeDoc(long id)
          Remove the given document from this Barrel.
 void setBitmap(java.lang.String label, Bitmap bitmap)
          Try to set the Bitmap of a given label.
 long size()
          Return the number of all documents in this Barrel (including the deleted ones).
 

Method Detail

getBitmap

Bitmap getBitmap(java.lang.String label)
Return the Bitmap of a given label.

Parameters:
label - the label of the requested Bitmap
Returns:
Bitmap of removed documents when label is null

setBitmap

void setBitmap(java.lang.String label,
               Bitmap bitmap)
Try to set the Bitmap of a given label.

Parameters:
label - the label of the requested Bitmap
bitmap - Bitmap of removed documents when label is null

expand

Sequence<? extends IListMetadata> expand(java.lang.String expr)
Return the enumeration of all IListMetadata objects which match the expression.

Parameters:
expr - the expression to match
Returns:
null when not supported

size

long size()
Return the number of all documents in this Barrel (including the deleted ones).

Returns:
the number of documents

deleted

long deleted()
Return the number of deleted documents in this Barrel.

Returns:
the number of deleted documents

removeDoc

boolean removeDoc(long id)
Remove the given document from this Barrel.

Parameters:
id - the document to remove
Returns:
true if the document exists and was not already removed, false otherwise

openIList

IListReader openIList(java.lang.String term,
                      boolean clean)
Open the inverted list of term for reading.

Parameters:
term - the term
clean - whether to remove all the items denoted as deleted
Returns:
an IListReader to read the inverted list, or null if the term is not in this Barrel

open

BarrelReader open()
Return a reader for this Barrel.

Returns:
a BarrelReader

destroy

void destroy()
Destroy all data structures this Barrel uses.


getMeta

DocumentData getMeta(long uid)
Return the metadata of document number uid.

Parameters:
uid - the document number
Returns:
a DocMetadDocumentDatacontaining the metadata of the given document, or null if the document does not exist in the Barrel

getIListMeta

IListMetadata getIListMeta(java.lang.String term)
Return the inverted list metadata of the given term.

Parameters:
term - the term
Returns:
an IListMetaData object containing the metadata of the inverted list, or null if the term is not in the Barrel

close

void close()
Close this Barrel.


commit

void commit()
Commit changes of this barrel to disk.


query

void query(Query q,
           ResultList result)
Submit a query to this Barrel.

Above 1.2.5 : the equation of similarity in the extended boolean model. If p=1 the model is similar to the vector space model. As p approaches infinity (or a very large value), the model is equal to the classic boolean model. This parameter is not passed as a parameter to this routine - it should be part of the query object.

Parameters:
q - the query
result - reads documents for similarity to the query