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 |
---|---|
static com.google.common.util.concurrent.CheckedFuture<?,java.io.IOException> |
allAsList(java.util.List<? extends com.google.common.util.concurrent.ListenableFuture<?>> futures) |
void |
delete(Change.Id id)
Synchronously delete a change.
|
com.google.common.util.concurrent.CheckedFuture<?,java.io.IOException> |
deleteAsync(Change.Id id)
Start deleting a change.
|
void |
index(ChangeData cd)
Synchronously index a change.
|
void |
index(ReviewDb db,
Change change)
Synchronously index a change.
|
void |
index(ReviewDb db,
Project.NameKey project,
Change.Id changeId)
Synchronously index a change.
|
com.google.common.util.concurrent.CheckedFuture<?,java.io.IOException> |
indexAsync(Project.NameKey project,
Change.Id id)
Start indexing a change.
|
com.google.common.util.concurrent.CheckedFuture<?,java.io.IOException> |
indexAsync(Project.NameKey project,
java.util.Collection<Change.Id> ids)
Start indexing multiple changes in parallel.
|
com.google.common.util.concurrent.CheckedFuture<java.lang.Boolean,java.io.IOException> |
reindexIfStale(Project.NameKey project,
Change.Id id)
Asynchronously check if a change is stale, and reindex if it is.
|
public static com.google.common.util.concurrent.CheckedFuture<?,java.io.IOException> allAsList(java.util.List<? extends com.google.common.util.concurrent.ListenableFuture<?>> futures)
public com.google.common.util.concurrent.CheckedFuture<?,java.io.IOException> indexAsync(Project.NameKey project, Change.Id id)
id
- change to index.public com.google.common.util.concurrent.CheckedFuture<?,java.io.IOException> indexAsync(Project.NameKey project, java.util.Collection<Change.Id> ids)
ids
- changes to index.public void index(ChangeData cd) throws java.io.IOException
cd
- change to index.java.io.IOException
public void index(ReviewDb db, Change change) throws java.io.IOException, com.google.gwtorm.server.OrmException
db
- review database.change
- change to index.java.io.IOException
com.google.gwtorm.server.OrmException
public void index(ReviewDb db, Project.NameKey project, Change.Id changeId) throws java.io.IOException, com.google.gwtorm.server.OrmException
db
- review database.project
- the project to which the change belongs.changeId
- ID of the change to index.java.io.IOException
com.google.gwtorm.server.OrmException
public com.google.common.util.concurrent.CheckedFuture<?,java.io.IOException> deleteAsync(Change.Id id)
id
- change to delete.public void delete(Change.Id id) throws java.io.IOException
id
- change ID to delete.java.io.IOException
public com.google.common.util.concurrent.CheckedFuture<java.lang.Boolean,java.io.IOException> 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.