|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.egothor.dir.Group
public abstract class Group
A Group is a group of Barrels which are, in fact, represented as one
Barrel. Such a group can have its own state, thus it also implements
the Status
interface. The group is organized
by a Distributor
that manages and
routes requests and messages to active Barrels.
Field Summary | |
---|---|
protected CachedGroup |
cache
|
Constructor Summary | |
---|---|
protected |
Group()
Constructor for the Group object |
Method Summary | |
---|---|
void |
close()
Close this Group. |
long |
deleted()
Total number of deleted documents in this group. |
void |
destroy()
Destroy this Group. |
abstract Sequence<Barrel> |
elements()
Return the elements contained in this object. |
Sequence<? extends IListMetadata> |
expand(java.lang.String expr)
Return the enumeration of all IListMetadata objects which match the expression. |
abstract DocumentData |
expandDocMetadata(DocumentData ofBarrel,
Token[] interest)
Retrives the document data, but restrict the data block to the part relevant to some tokens of our interest. |
void |
forEach(Task<Barrel> task)
Put the given task to all active (inner) barrels. |
Bitmap |
getBitmap(java.lang.String label)
Return the Bitmap of a given label. |
CachedGroup |
getCache()
Gets the CachedGroup used for storing query results. |
CWI |
getCWI(java.util.HashSet<Token> terms)
Return the subset of CWI for the given subset of terms. |
IListMetadata |
getIListMeta(java.lang.String term)
Return the inverted list metadata for the given term. |
DocumentData |
getMeta(long uid)
Return the metadata for the document with the given unique identifier. |
protected void |
initialize(Distributor<Barrel> d)
Constructor for the Group object. |
void |
initializeCache(Cache<CachedQuery,CachedResult> cache)
Initializes a query result cache with the specified options. |
void |
initializeCache(Cache<CachedQuery,CachedResult> cache,
boolean cacheMetadata)
Initializes a query result cache with the specified options. |
void |
initializeCache(Cache<CachedQuery,CachedResult> cache,
int pageSize)
Initializes a query result cache with the specified options. |
void |
initializeCache(Cache<CachedQuery,CachedResult> cache,
int pageSize,
boolean cacheMetadata)
Initializes a query result cache with the specified options. |
void |
iterate(Request<Barrel> task)
Iterate through the active (inner) barrels in predefined and constant order and try to give them the request until one of them fulfills it. |
BarrelReader |
open()
Open this Group. |
IListReader |
openIList(java.lang.String term,
boolean clean)
Open the inverted list constructed for the given term for reading. |
QueryResponse |
query(int offset,
int length,
int p,
java.lang.String query,
long max_hits2scan,
double pg_rerank,
java.lang.String... controls)
Return a QueryResponse to a user query. |
void |
query(Query q,
ResultList result)
Submit the given query to this Group. |
boolean |
removeDoc(long id)
Remove the document with the given ID and return whether the operation was successful. |
CachedResult |
resolve(CachedQuery cachedQuery)
Gets the value associated with the key without the use of a cache. |
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). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.egothor.core.Barrel |
---|
commit |
Field Detail |
---|
protected CachedGroup cache
Constructor Detail |
---|
protected Group()
Method Detail |
---|
protected void initialize(Distributor<Barrel> d)
d
- routes requests and messages to active Barrelspublic void initializeCache(Cache<CachedQuery,CachedResult> cache)
cache
- actual cache used for storing query resultspublic void initializeCache(Cache<CachedQuery,CachedResult> cache, int pageSize)
cache
- actual cache used for storing query resultspageSize
- maximum size of a query result pagepublic void initializeCache(Cache<CachedQuery,CachedResult> cache, boolean cacheMetadata)
cache
- actual cache used for storing query resultscacheMetadata
- whether we want to cache complete result or just the document ID'spublic void initializeCache(Cache<CachedQuery,CachedResult> cache, int pageSize, boolean cacheMetadata)
cache
- actual cache used for storing query resultspageSize
- maximum size of a query result pagecacheMetadata
- whether we want to cache complete result or just the document ID'spublic CachedGroup getCache()
public Bitmap getBitmap(java.lang.String label)
Barrel
getBitmap
in interface Barrel
label
- the label of the requested Bitmap
public void setBitmap(java.lang.String label, Bitmap bitmap)
Barrel
setBitmap
in interface Barrel
label
- the label of the requested Bitmapbitmap
- Bitmap of removed documents when label is nullpublic CWI getCWI(java.util.HashSet<Token> terms)
terms
- a HashSet containing the terms for which CWI should
be returned
public IListMetadata getIListMeta(java.lang.String term)
getIListMeta
in interface Barrel
term
- the term
public DocumentData getMeta(long uid)
getMeta
in interface Barrel
uid
- the unique identifier of the document in question
public abstract DocumentData expandDocMetadata(DocumentData ofBarrel, Token[] interest)
public QueryResponse query(int offset, int length, int p, java.lang.String query, long max_hits2scan, double pg_rerank, java.lang.String... controls) throws ParseException
offset
- where to start reading the result listlength
- read the result list up to herep
- power parameter in evaluation formula @{link org.egothor.Constants#DEFAULTMODEL}query
- the user's queryin
- the Barrel to searchmax_hits2scan
- maximum positive hits scanned, if achieved then total number of hits is only guessedpg_rerank
- pagerank booster @{link org.egothor.core.query.ResultList}controls
- control BITMAP tokens (String)
ParseException
- if there is difficulty parsing the querypublic CachedResult resolve(CachedQuery cachedQuery)
Resolver
resolve
in interface Resolver<CachedQuery,CachedResult>
cachedQuery
- key to get the value for
public abstract Sequence<Barrel> elements()
public void forEach(Task<Barrel> task)
task
- the task to performpublic void iterate(Request<Barrel> task)
task
- the task to performpublic Sequence<? extends IListMetadata> expand(java.lang.String expr)
expand
in interface Barrel
expr
- the expression to match
public long size()
size
in interface Barrel
public long deleted()
deleted
in interface Barrel
public boolean removeDoc(long id)
removeDoc
in interface Barrel
id
- the document to remove
public IListReader openIList(java.lang.String term, boolean clean)
openIList
in interface Barrel
term
- the term for which the inverted list was constructedclean
- whether to remove all the items denoted as deleted
public BarrelReader open()
open
in interface Barrel
public void destroy()
destroy
in interface Barrel
public void close()
close
in interface Barrel
public void query(Query q, ResultList result)
query
in interface Barrel
q
- the queryresult
- the list to search
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |