|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Barrel
open
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 Barrel
openIList
in class Group
term
- 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 Group
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 BITMAP tokens (String)
ParseException
- if there is difficulty parsing the querypublic 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 Barrel
query
in class Group
q
- the queryresult
- the list to searchpublic 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 BarrelWriter
append
in class TankerImpl
barrelReader
- the Barrel to add@Deprecated public boolean removeDoc(long id)
Group
removeDoc
in interface Barrel
removeDoc
in class TankerImpl
id
- 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 Barrel
commit
in class TankerImpl
com.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 TankerImpl
java.io.IOException
public void destroy()
TankerImpl
destroy
in interface Barrel
destroy
in class TankerImpl
public 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 Barrel
close
in interface BarrelWriter
close
in class TankerImpl
public 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 TankerImpl
java.io.IOException
public int getRootVersionID()
getRootVersionID
in class Tanker
public boolean isDirty()
Tanker
isDirty
in class Tanker
public long deleted()
Group
deleted
in interface Barrel
deleted
in class Group
public Sequence<? extends IListMetadata> expand(java.lang.String expr)
Group
expand
in interface Barrel
expand
in class Group
expr
- the expression to match
public void forEach(Task<Barrel> task)
Group
forEach
in class Group
task
- the task to performpublic Bitmap getBitmap(java.lang.String label)
Barrel
getBitmap
in interface Barrel
getBitmap
in class Group
label
- the label of the requested Bitmap
public CWI getCWI(java.util.HashSet<Token> terms)
Group
getCWI
in class Group
terms
- a HashSet containing the terms for which CWI should
be returned
public IListMetadata getIListMeta(java.lang.String term)
Group
getIListMeta
in interface Barrel
getIListMeta
in class Group
term
- the term
public DocumentData getMeta(long uid)
Group
getMeta
in interface Barrel
getMeta
in class Group
uid
- the unique identifier of the document in question
public void iterate(Request<Barrel> task)
Group
iterate
in class Group
task
- the task to performpublic void setBitmap(java.lang.String label, Bitmap bitmap)
Barrel
setBitmap
in interface Barrel
setBitmap
in class Group
label
- the label of the requested Bitmapbitmap
- Bitmap of removed documents when label is nullpublic long size()
Group
size
in interface Barrel
size
in class Group
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |