public class DummyChangeIndex extends java.lang.Object implements ChangeIndex
ChangeIndex.Factory
Constructor and Description |
---|
DummyChangeIndex() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this index.
|
void |
delete(com.google.gerrit.reviewdb.client.Change.Id id)
Delete a document from the index by key.
|
void |
deleteAll()
Delete all documents from the index.
|
int |
getMaxLimit() |
Schema<ChangeData> |
getSchema() |
ChangeDataSource |
getSource(Predicate<ChangeData> p,
QueryOptions opts)
Convert the given operator predicate into a source searching the index and
returning only the documents matching that predicate.
|
void |
markReady(boolean ready)
Mark whether this index is up-to-date and ready to serve reads.
|
void |
replace(ChangeData cd)
Update a document in the index.
|
void |
stop()
Stop and await termination of all executor threads
|
public Schema<ChangeData> getSchema()
getSchema
in interface Index<com.google.gerrit.reviewdb.client.Change.Id,ChangeData>
public void close()
Index
close
in interface Index<com.google.gerrit.reviewdb.client.Change.Id,ChangeData>
public void replace(ChangeData cd) throws java.io.IOException
Index
Semantically equivalent to deleting the document and reinserting it with new field values. A document that does not already exist is created. Results may not be immediately visible to searchers, but should be visible within a reasonable amount of time.
replace
in interface Index<com.google.gerrit.reviewdb.client.Change.Id,ChangeData>
cd
- document objectjava.io.IOException
public void delete(com.google.gerrit.reviewdb.client.Change.Id id) throws java.io.IOException
Index
delete
in interface Index<com.google.gerrit.reviewdb.client.Change.Id,ChangeData>
id
- document keyjava.io.IOException
public void deleteAll() throws java.io.IOException
Index
deleteAll
in interface Index<com.google.gerrit.reviewdb.client.Change.Id,ChangeData>
java.io.IOException
public ChangeDataSource getSource(Predicate<ChangeData> p, QueryOptions opts)
Index
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 Index<com.google.gerrit.reviewdb.client.Change.Id,ChangeData>
p
- the predicate to match. Must be a tree containing only AND, OR,
or NOT predicates as internal nodes, and IndexPredicate
s as
leaves.opts
- query options not implied by the predicate, such as start and
limit.public void markReady(boolean ready) throws java.io.IOException
Index
markReady
in interface Index<com.google.gerrit.reviewdb.client.Change.Id,ChangeData>
ready
- whether the index is readyjava.io.IOException
public int getMaxLimit()
public void stop()
Index
stop
in interface Index<com.google.gerrit.reviewdb.client.Change.Id,ChangeData>