public class DummyIndex extends java.lang.Object implements ChangeIndex
Constructor and Description |
---|
DummyIndex() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this index.
|
void |
delete(ChangeData cd)
Delete a change document from the index.
|
void |
delete(int id)
Delete a change document from the index by id.
|
void |
deleteAll()
Delete all change documents from the index.
|
Schema<ChangeData> |
getSchema() |
ChangeDataSource |
getSource(Predicate<ChangeData> p,
int start,
int limit)
Convert the given operator predicate into a source searching the index and
returning only the documents matching that predicate.
|
void |
insert(ChangeData cd)
Insert a change document into the index.
|
void |
markReady(boolean ready)
Mark whether this index is up-to-date and ready to serve reads.
|
void |
replace(ChangeData cd)
Update a change document in the index.
|
public Schema<ChangeData> getSchema()
getSchema
in interface ChangeIndex
public void close()
ChangeIndex
close
in interface ChangeIndex
public void insert(ChangeData cd) throws java.io.IOException
ChangeIndex
Results may not be immediately visible to searchers, but should be visible within a reasonable amount of time.
insert
in interface ChangeIndex
cd
- change documentjava.io.IOException
- if the change could not be inserted.public void replace(ChangeData cd) throws java.io.IOException
ChangeIndex
Semantically equivalent to deleting the document and reinserting it with new field values. Results may not be immediately visible to searchers, but should be visible within a reasonable amount of time.
replace
in interface ChangeIndex
cd
- change documentjava.io.IOException
public void delete(ChangeData cd) throws java.io.IOException
ChangeIndex
delete
in interface ChangeIndex
cd
- change documentjava.io.IOException
public void deleteAll() throws java.io.IOException
ChangeIndex
deleteAll
in interface ChangeIndex
java.io.IOException
public ChangeDataSource getSource(Predicate<ChangeData> p, int start, int limit) throws com.google.gerrit.server.query.QueryParseException
ChangeIndex
This method may be called multiple times for variations on the same predicate or multiple predicate subtrees in the course of processing a single query, so it should not have any side effects (e.g. starting a search in the background).
getSource
in interface ChangeIndex
p
- the predicate to match. Must be a tree containing only AND, OR,
or NOT predicates as internal nodes, and IndexPredicate
s as
leaves.start
- offset in results list at which to start returning results.limit
- maximum number of results to return.sortkey_after
predicate (with a cut point not at Long.MAX_VALUE
) is provided,
in which case the source should return documents in ascending sort key
order starting from the sort key cut point.com.google.gerrit.server.query.QueryParseException
- if the predicate could not be converted to an
indexed data source.public void markReady(boolean ready) throws java.io.IOException
ChangeIndex
markReady
in interface ChangeIndex
ready
- whether the index is readyjava.io.IOException
public void delete(int id) throws java.io.IOException
ChangeIndex
delete
in interface ChangeIndex
id
- change document idjava.io.IOException