Class DummyChangeIndex
- java.lang.Object
-
- com.google.gerrit.server.index.change.DummyChangeIndex
-
- All Implemented Interfaces:
Index<Change.Id,ChangeData>
,ChangeIndex
public class DummyChangeIndex extends Object implements ChangeIndex
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.gerrit.server.index.change.ChangeIndex
ChangeIndex.Factory
-
-
Constructor Summary
Constructors Constructor Description DummyChangeIndex()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close this index.void
delete(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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.gerrit.server.index.change.ChangeIndex
keyPredicate
-
-
-
-
Method Detail
-
getSchema
public Schema<ChangeData> getSchema()
- Specified by:
getSchema
in interfaceIndex<Change.Id,ChangeData>
- Returns:
- the schema version used by this index.
-
close
public void close()
Description copied from interface:Index
Close this index.- Specified by:
close
in interfaceIndex<Change.Id,ChangeData>
-
replace
public void replace(ChangeData cd)
Description copied from interface:Index
Update a document in the 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.
- Specified by:
replace
in interfaceIndex<Change.Id,ChangeData>
- Parameters:
cd
- document object
-
delete
public void delete(Change.Id id)
Description copied from interface:Index
Delete a document from the index by key.- Specified by:
delete
in interfaceIndex<Change.Id,ChangeData>
- Parameters:
id
- document key
-
deleteAll
public void deleteAll()
Description copied from interface:Index
Delete all documents from the index.- Specified by:
deleteAll
in interfaceIndex<Change.Id,ChangeData>
-
getSource
public ChangeDataSource getSource(Predicate<ChangeData> p, QueryOptions opts)
Description copied from interface:Index
Convert the given operator predicate into a source searching the index and returning only the documents matching that predicate.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).
- Specified by:
getSource
in interfaceIndex<Change.Id,ChangeData>
- Parameters:
p
- the predicate to match. Must be a tree containing only AND, OR, or NOT predicates as internal nodes, andIndexPredicate
s as leaves.opts
- query options not implied by the predicate, such as start and limit.- Returns:
- a source of documents matching the predicate, returned in a defined order depending on the type of documents.
-
markReady
public void markReady(boolean ready)
Description copied from interface:Index
Mark whether this index is up-to-date and ready to serve reads.- Specified by:
markReady
in interfaceIndex<Change.Id,ChangeData>
- Parameters:
ready
- whether the index is ready
-
getMaxLimit
public int getMaxLimit()
-
-