|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.egothor.dir.Group
org.egothor.dir.Tanker
org.egothor.dir.TankerImpl
org.egothor.dir.TankerImplSecure
public class TankerImplSecure
This object encapsulates standard TankerImpl and adds multithread safe behavior. This class is synchronized with some exceptions:
elementsSecure() - should be synchronized by user as it
returns a wrapped iterator.
openSecure() - should be synchronized by user. It is
necessary to use its pair method close() in the finally block.
Example follows:
synchronized (tanker) {
try {
tanker.openSecure();
...
} finally {
tanker.close();
}
}
| Field Summary | |
|---|---|
protected DataRepository |
localDocDB
local repository of documents |
protected TankerImpl |
localTanker
local place where all barrels are appended and other changes are logged. |
| Fields inherited from class org.egothor.dir.Group |
|---|
cache |
| Constructor Summary | |
|---|---|
TankerImplSecure()
|
|
| Method Summary | |
|---|---|
void |
append(BarrelReader barrelReader)
Appends a reader to this tanker. |
void |
close()
Closes this tanker. |
void |
commit()
Commits all the changes. |
protected void |
commitEmit(int recordsx4,
long[] record4)
|
java.util.HashMap<java.lang.Long,java.lang.Boolean> |
commitWithResults()
Performes a commit and returns information about the whole process. |
long |
deleted()
Total number of deleted documents in this group. |
void |
destroy()
Description of the Method |
Sequence<Barrel> |
elements()
Deprecated. |
Sequence<Barrel> |
elementsSecure()
Gets elements of this tanker, done in multithreaded safe way. |
Sequence<? extends IListMetadata> |
expand(java.lang.String expr)
Return the enumeration of all IListMetadata objects which match the expression. |
DocumentData |
expandDocMetadata(DocumentData ofBarrel,
Token[] interest)
Deprecated. |
DocumentData |
expandDocMetadataSecure(DocumentData ofBarrel,
Token[] interest)
Standard exapnding of doc metadata, but using multithreaded safe way. |
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. |
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. |
int |
getRootVersionID()
|
void |
initializeTankerSecure(java.lang.String indexDir,
DataRepository repo,
boolean useBerkeleyGP,
boolean MTE,
int capacity,
int mergeFactor,
java.lang.String lockServerConfigFilename,
int indexConstPeriodOfTime)
Initializations of the tanker. |
void |
initializeTankerSecure(java.lang.String indexDir,
DataRepository repo,
boolean useBerkeleyGP,
boolean MTE,
int capacity,
java.lang.String lockServerConfigFilename,
int indexConstPeriodOfTime)
Initializations of the tanker. |
boolean |
isDirty()
Test whether this Tanker has been modified. |
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. |
java.util.Properties |
loadState()
Read properties of the Tanker |
BarrelReader |
open()
Deprecated. |
IListReader |
openIList(java.lang.String term,
boolean clean)
Deprecated. |
IListReader |
openIListSecure(java.lang.String term,
boolean clean)
Opens IList reader using secure multithreading safe way. |
BarrelReader |
openSecure()
Opens a reader for this tanker, using secure multithreading safe way. |
void |
optimize()
Optimize this tanker. |
QueryResponse |
query(int offset,
int length,
int p,
java.lang.String query,
long max_hits2scan,
double pg_rerank,
java.lang.String... controls)
Deprecated. |
void |
query(Query q,
ResultList result)
Deprecated. |
QueryResponse |
querySecure(int offset,
int length,
int p,
java.lang.String query,
long max_hits2scan,
double pg_rerank,
java.lang.String... controls)
Standard query, but using multithreaded safe way. |
void |
querySecure(Query q,
ResultList result)
Standard query, but using multithreaded safe way. |
void |
reloadIndex(int indexConstPeriodOfTime)
Relaods the whole index. |
boolean |
removeDoc(long id)
Deprecated. |
void |
removeDoc(long id,
int revision)
|
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 org.egothor.dir.TankerImpl |
|---|
commitEmitEnd, initializeTanker, initializeTanker, removeDoc |
| Methods inherited from class org.egothor.dir.Tanker |
|---|
finalize, initialize |
| Methods inherited from class org.egothor.dir.Group |
|---|
getCache, initialize, initializeCache, initializeCache, initializeCache, initializeCache, resolve |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TankerImpl localTanker
protected DataRepository localDocDB
| Constructor Detail |
|---|
public TankerImplSecure()
| Method Detail |
|---|
public void initializeTankerSecure(java.lang.String indexDir,
DataRepository repo,
boolean useBerkeleyGP,
boolean MTE,
int capacity,
java.lang.String lockServerConfigFilename,
int indexConstPeriodOfTime)
throws java.io.IOException,
com.sleepycat.db.DatabaseException
null, then file locking is used. It must be in
java.util.Properties format.
indexDir - useBerkeleyDocDB - useBerkeleyGP - MTE - capacity - lockServerConfigFilename - indexConstPeriodOfTime -
java.io.IOException
com.sleepycat.db.DatabaseException
public void initializeTankerSecure(java.lang.String indexDir,
DataRepository repo,
boolean useBerkeleyGP,
boolean MTE,
int capacity,
int mergeFactor,
java.lang.String lockServerConfigFilename,
int indexConstPeriodOfTime)
throws java.io.IOException,
com.sleepycat.db.DatabaseException
null, then file locking is used. It must be in
java.util.Properties format.
indexDir - useBerkeleyDocDB - useBerkeleyGP - MTE - capacity - mergeFactor - lockServerConfigFilename - indexConstPeriodOfTime -
java.io.IOException
com.sleepycat.db.DatabaseException@Deprecated public BarrelReader open()
Group
open in interface Barrelopen in class Group
public BarrelReader openSecure()
throws EgothorIndexConstExpiredException
In case of muliple thread sharing one instance of the tanker this method
should be synchronized by user as follows. It is necessary to use its
pair method close() in the
finally block! :
synchronized (tanker) {
try {
tanker.openSecure();
...
} finally {
tanker.close();
}
}
EgothorIndexConstExpiredException - If index constancy expired AND index has changed.
@Deprecated
public IListReader openIList(java.lang.String term,
boolean clean)
Group
openIList in interface BarrelopenIList in class Groupterm - the term for which the inverted list was constructedclean - whether to remove all the items denoted as deleted
public IListReader openIListSecure(java.lang.String term,
boolean clean)
throws EgothorIndexConstExpiredException
term - clean -
EgothorIndexConstExpiredException - If index constancy expired AND index has changed.
@Deprecated
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
Group
query in class Groupoffset - 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 BITMAP tokens (String)
ParseException - if there is difficulty parsing the query
public QueryResponse querySecure(int offset,
int length,
int p,
java.lang.String query,
long max_hits2scan,
double pg_rerank,
java.lang.String... controls)
throws ParseException,
EgothorIndexConstExpiredException
offset - length - p - query - max_hits2scan - pg_rerank - controls -
ParseException
EgothorIndexConstExpiredException - If index constancy expired AND index has changed.
@Deprecated
public void query(Query q,
ResultList result)
Group
query in interface Barrelquery in class Groupq - the queryresult - the list to search
public void querySecure(Query q,
ResultList result)
throws EgothorIndexConstExpiredException
q - result -
EgothorIndexConstExpiredException - If index constancy expired AND index has changed.
@Deprecated
public DocumentData expandDocMetadata(DocumentData ofBarrel,
Token[] interest)
Group
expandDocMetadata in class TankerImpl
public DocumentData expandDocMetadataSecure(DocumentData ofBarrel,
Token[] interest)
throws EgothorIndexConstExpiredException
ofBarrel - interest -
EgothorIndexConstExpiredException - If index constancy expired AND index has changed.public void append(BarrelReader barrelReader)
append in interface BarrelWriterappend in class TankerImplbarrelReader - the Barrel to add@Deprecated public boolean removeDoc(long id)
Group
removeDoc in interface BarrelremoveDoc in class TankerImplid - the document to remove
public void removeDoc(long id,
int revision)
id - uid of the documentrevision - revision of the documentpublic java.util.HashMap<java.lang.Long,java.lang.Boolean> commitWithResults()
public void commit()
commit in interface Barrelcommit in class TankerImplcom.sleepycat.db.DatabaseException
java.io.IOException
public void reloadIndex(int indexConstPeriodOfTime)
throws java.io.IOException
indexConstPeriodOfTime -
java.io.IOException
protected void commitEmit(int recordsx4,
long[] record4)
throws java.io.IOException
commitEmit in class TankerImpljava.io.IOExceptionpublic void destroy()
TankerImpl
destroy in interface Barreldestroy in class TankerImplpublic void close()
In case of muliple thread sharing one instance of the tanker this method
should be used everytime an openSecure() method is called and
synchronized by user as follows:
synchronized (tanker) {
try {
tanker.openSecure();
...
} finally {
tanker.close();
}
}
close in interface Barrelclose in interface BarrelWriterclose in class TankerImplpublic void optimize()
optimize in class Tanker@Deprecated public Sequence<Barrel> elements()
Tanker
elements in class Tanker
public Sequence<Barrel> elementsSecure()
throws EgothorIndexConstExpiredException
In case of muliple thread sharing one instance of the tanker this method should be synchronized by user as follows, as it returns a wrapped iterator:
synchronized (tanker) {
Sequence<Barrel> elements = tanker.elementsSecure();
...
}
EgothorIndexConstExpiredException - If index constancy expired AND index has changed.
public java.util.Properties loadState()
throws java.io.IOException
TankerImpl
loadState in class TankerImpljava.io.IOExceptionpublic int getRootVersionID()
getRootVersionID in class Tankerpublic boolean isDirty()
Tanker
isDirty in class Tankerpublic long deleted()
Group
deleted in interface Barreldeleted in class Grouppublic Sequence<? extends IListMetadata> expand(java.lang.String expr)
Group
expand in interface Barrelexpand in class Groupexpr - the expression to match
public void forEach(Task<Barrel> task)
Group
forEach in class Grouptask - the task to performpublic Bitmap getBitmap(java.lang.String label)
Barrel
getBitmap in interface BarrelgetBitmap in class Grouplabel - the label of the requested Bitmap
public CWI getCWI(java.util.HashSet<Token> terms)
Group
getCWI in class Groupterms - a HashSet containing the terms for which CWI should
be returned
public IListMetadata getIListMeta(java.lang.String term)
Group
getIListMeta in interface BarrelgetIListMeta in class Groupterm - the term
public DocumentData getMeta(long uid)
Group
getMeta in interface BarrelgetMeta in class Groupuid - the unique identifier of the document in question
public void iterate(Request<Barrel> task)
Group
iterate in class Grouptask - the task to perform
public void setBitmap(java.lang.String label,
Bitmap bitmap)
Barrel
setBitmap in interface BarrelsetBitmap in class Grouplabel - the label of the requested Bitmapbitmap - Bitmap of removed documents when label is nullpublic long size()
Group
size in interface Barrelsize in class Group
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||