public class ChangeIndexer
extends java.lang.Object
Indexing is run in the background, as it may require substantial work to compute some of the fields and/or update the index.
Modifier and Type | Class and Description |
---|---|
static interface |
ChangeIndexer.Factory |
Modifier and Type | Method and Description |
---|---|
void |
delete(Change.Id id)
Synchronously delete a change.
|
com.google.common.util.concurrent.ListenableFuture<?> |
deleteAsync(Change.Id id)
Start deleting a change.
|
void |
index(Change change)
Synchronously index a change.
|
void |
index(ChangeData cd)
Synchronously index a change, then check if the index is stale due to a race condition.
|
void |
index(Project.NameKey project,
Change.Id changeId)
Synchronously index a change.
|
com.google.common.util.concurrent.ListenableFuture<?> |
indexAsync(Project.NameKey project,
Change.Id id)
Start indexing a change.
|
com.google.common.util.concurrent.ListenableFuture<?> |
indexAsync(Project.NameKey project,
java.util.Collection<Change.Id> ids)
Start indexing multiple changes in parallel.
|
com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> |
reindexIfStale(Project.NameKey project,
Change.Id id)
Asynchronously check if a change is stale, and reindex if it is.
|
public com.google.common.util.concurrent.ListenableFuture<?> indexAsync(Project.NameKey project, Change.Id id)
id
- change to index.public com.google.common.util.concurrent.ListenableFuture<?> indexAsync(Project.NameKey project, java.util.Collection<Change.Id> ids)
ids
- changes to index.public void index(ChangeData cd)
cd
- change to index.public void index(Change change)
change
- change to index.public void index(Project.NameKey project, Change.Id changeId)
project
- the project to which the change belongs.changeId
- ID of the change to index.public com.google.common.util.concurrent.ListenableFuture<?> deleteAsync(Change.Id id)
id
- change to delete.public void delete(Change.Id id)
id
- change ID to delete.public com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> reindexIfStale(Project.NameKey project, Change.Id id)
Always run on the batch executor, even if this indexer instance is configured to use a different executor.
project
- the project to which the change belongs.id
- ID of the change to index.