public abstract class Group extends Object implements Barrel, Resolver<CachedQuery,CachedResult>
Status
interface. The group is organized
by a Distributor
that manages and
routes requests and messages to active Barrels.Modifier and Type | Method and Description |
---|---|
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(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(String label)
Return the Bitmap of a given label.
|
CachedGroup |
getCache()
Gets the CachedGroup used for storing query results.
|
CWI |
getCWI(HashSet<Token> terms)
Return the subset of CWI for the given subset of terms.
|
IListMetadata |
getIListMeta(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.
|
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(String term,
boolean clean)
Open the inverted list constructed for the given term for reading.
|
QueryResponse |
query(int offset,
int length,
int p,
String query,
long max_hits2scan,
double pg_rerank,
ControlsHandler cHandler,
String... controls)
Return a QueryResponse to a user query.
|
QueryResponse |
query(int offset,
int length,
int p,
String query,
long max_hits2scan,
double pg_rerank,
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(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).
|
public 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(String label)
Barrel
public void setBitmap(String label, Bitmap bitmap)
Barrel
public CWI getCWI(HashSet<Token> terms)
terms
- a HashSet containing the terms for which CWI should
be returnedpublic IListMetadata getIListMeta(String term)
getIListMeta
in interface Barrel
term
- the termpublic DocumentData getMeta(long uid)
public abstract DocumentData expandDocMetadata(DocumentData ofBarrel, Token[] interest)
public QueryResponse query(int offset, int length, int p, String query, long max_hits2scan, double pg_rerank, String... controls) throws ParseException
ControlsHandlerGlad
handler.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 querymax_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 tokens (String)ParseException
- if there is difficulty parsing the querypublic QueryResponse query(int offset, int length, int p, String query, long max_hits2scan, double pg_rerank, ControlsHandler cHandler, 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 querymax_hits2scan
- maximum positive hits scanned, if achieved then total number of hits is only guessedpg_rerank
- pagerank booster @{link org.egothor.core.query.ResultList}cHandler
- implementation of control tokens integration into the querycontrols
- control tokens (String)ParseException
- if there is difficulty parsing the queryControlsHandler
,
ControlsHandlerGlad
,
ControlsHandlerStern
public CachedResult resolve(CachedQuery cachedQuery)
Resolver
resolve
in interface Resolver<CachedQuery,CachedResult>
cachedQuery
- key to get the value forpublic 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(String expr)
public long size()
public long deleted()
public boolean removeDoc(long id)
public IListReader openIList(String term, boolean clean)
public BarrelReader open()
public void close()
close
in interface AutoCloseable
close
in interface Barrel
public void query(Query q, ResultList result)
Copyright © 2016 Egothor. All Rights Reserved.