public class TankerImplSecure extends TankerImpl
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(); } }
Constructor and Description |
---|
TankerImplSecure() |
Modifier and Type | Method and Description |
---|---|
void |
append(BarrelReader barrelReader)
Appends a reader to this tanker.
|
void |
close()
Closes this tanker.
|
void |
commit()
Commits all the changes.
|
HashMap<Long,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(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(String label)
Return the Bitmap of a given label.
|
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.
|
int |
getRootVersionID() |
void |
initializeTankerSecure(String indexDir,
DataRepository repo,
boolean useBerkeleyGP,
boolean MTE,
int capacity,
int mergeFactor,
String lockServerConfigFilename,
int indexConstPeriodOfTime)
Initializations of the tanker.
|
void |
initializeTankerSecure(String indexDir,
DataRepository repo,
boolean useBerkeleyGP,
boolean MTE,
int capacity,
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.
|
Properties |
loadState()
Read properties of the Tanker
|
BarrelReader |
open()
Deprecated.
|
IListReader |
openIList(String term,
boolean clean)
Deprecated.
|
IListReader |
openIListSecure(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,
String query,
long max_hits2scan,
double pg_rerank,
String... controls)
Deprecated.
|
void |
query(Query q,
ResultList result)
Deprecated.
|
QueryResponse |
querySecure(int offset,
int length,
int p,
String query,
long max_hits2scan,
double pg_rerank,
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(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).
|
initializeTanker, initializeTanker
getCache, initializeCache, initializeCache, initializeCache, initializeCache, query, resolve
public void initializeTankerSecure(String indexDir, DataRepository repo, boolean useBerkeleyGP, boolean MTE, int capacity, String lockServerConfigFilename, int indexConstPeriodOfTime) throws IOException
null
, then file locking is used. It must be in
java.util.Properties format.indexDir
- repo
- useBerkeleyGP
- MTE
- capacity
- lockServerConfigFilename
- indexConstPeriodOfTime
- IOException
public void initializeTankerSecure(String indexDir, DataRepository repo, boolean useBerkeleyGP, boolean MTE, int capacity, int mergeFactor, String lockServerConfigFilename, int indexConstPeriodOfTime) throws IOException
null
, then file locking is used. It must be in
java.util.Properties format.indexDir
- repo
- useBerkeleyGP
- MTE
- capacity
- mergeFactor
- lockServerConfigFilename
- indexConstPeriodOfTime
- IOException
@Deprecated public BarrelReader open()
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(String term, boolean clean)
Group
public IListReader openIListSecure(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, String query, long max_hits2scan, double pg_rerank, String... controls) throws ParseException
Group
ControlsHandlerGlad
handler.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 tokens (String)ParseException
- if there is difficulty parsing the querypublic QueryResponse querySecure(int offset, int length, int p, String query, long max_hits2scan, double pg_rerank, 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
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 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 removepublic void removeDoc(long id, int revision)
id
- uid of the documentrevision
- revision of the documentpublic HashMap<Long,Boolean> commitWithResults()
public void commit()
commit
in interface Barrel
commit
in class TankerImpl
public void reloadIndex(int indexConstPeriodOfTime) throws IOException
indexConstPeriodOfTime
- 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 AutoCloseable
close
in interface Barrel
close
in interface BarrelWriter
close
in class TankerImpl
public void optimize()
@Deprecated public Sequence<Barrel> elements()
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 Properties loadState() throws IOException
TankerImpl
loadState
in class TankerImpl
IOException
public int getRootVersionID()
getRootVersionID
in class Tanker
public boolean isDirty()
Tanker
public long deleted()
Group
public Sequence<? extends IListMetadata> expand(String expr)
Group
public void forEach(Task<Barrel> task)
Group
public Bitmap getBitmap(String label)
Barrel
public CWI getCWI(HashSet<Token> terms)
Group
public IListMetadata getIListMeta(String term)
Group
getIListMeta
in interface Barrel
getIListMeta
in class Group
term
- the termpublic DocumentData getMeta(long uid)
Group
public void iterate(Request<Barrel> task)
Group
public void setBitmap(String label, Bitmap bitmap)
Barrel
Copyright © 2016 Egothor. All Rights Reserved.