public class BatchUpdate
extends java.lang.Object
implements java.lang.AutoCloseable
An update operation can be divided into three phases:
Depending on the backend used, each step might support batching, for example
in a BatchRefUpdate or one or more database transactions. All
operations in one phase must complete successfully before proceeding to the
next phase.
| Modifier and Type | Class and Description |
|---|---|
class |
BatchUpdate.ChangeContext |
class |
BatchUpdate.Context |
static interface |
BatchUpdate.Factory |
static class |
BatchUpdate.InsertChangeOp |
static class |
BatchUpdate.Listener
Interface for listening during batch update execution.
|
static class |
BatchUpdate.Op |
static class |
BatchUpdate.Order
Order of execution of the various phases.
|
class |
BatchUpdate.RepoContext |
static class |
BatchUpdate.RepoOnlyOp |
| Modifier and Type | Method and Description |
|---|---|
BatchUpdate |
addOp(com.google.gerrit.reviewdb.client.Change.Id id,
BatchUpdate.Op op) |
BatchUpdate |
addRepoOnlyOp(BatchUpdate.RepoOnlyOp op) |
void |
close() |
void |
execute() |
void |
execute(BatchUpdate.Listener listener) |
org.eclipse.jgit.lib.ObjectInserter |
getObjectInserter() |
org.eclipse.jgit.lib.Repository |
getRepository() |
org.eclipse.jgit.revwalk.RevWalk |
getRevWalk() |
CurrentUser |
getUser() |
BatchUpdate |
insertChange(BatchUpdate.InsertChangeOp op) |
BatchUpdate |
setOrder(BatchUpdate.Order order) |
BatchUpdate |
setRepository(org.eclipse.jgit.lib.Repository repo,
org.eclipse.jgit.revwalk.RevWalk revWalk,
org.eclipse.jgit.lib.ObjectInserter inserter) |
BatchUpdate |
setRequestId(RequestId requestId) |
BatchUpdate |
updateChangesInParallel()
Execute
Op#updateChange(ChangeContext) in parallel for each change. |
public void close()
close in interface java.lang.AutoCloseablepublic BatchUpdate setRequestId(RequestId requestId)
public BatchUpdate setRepository(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.revwalk.RevWalk revWalk, org.eclipse.jgit.lib.ObjectInserter inserter)
public BatchUpdate setOrder(BatchUpdate.Order order)
public BatchUpdate updateChangesInParallel()
Op#updateChange(ChangeContext) in parallel for each change.public CurrentUser getUser()
public org.eclipse.jgit.lib.Repository getRepository()
throws java.io.IOException
java.io.IOExceptionpublic org.eclipse.jgit.revwalk.RevWalk getRevWalk()
throws java.io.IOException
java.io.IOExceptionpublic org.eclipse.jgit.lib.ObjectInserter getObjectInserter()
throws java.io.IOException
java.io.IOExceptionpublic BatchUpdate addOp(com.google.gerrit.reviewdb.client.Change.Id id, BatchUpdate.Op op)
public BatchUpdate addRepoOnlyOp(BatchUpdate.RepoOnlyOp op)
public BatchUpdate insertChange(BatchUpdate.InsertChangeOp op)
public void execute()
throws UpdateException,
com.google.gerrit.extensions.restapi.RestApiException
UpdateExceptioncom.google.gerrit.extensions.restapi.RestApiExceptionpublic void execute(BatchUpdate.Listener listener) throws UpdateException, com.google.gerrit.extensions.restapi.RestApiException
UpdateExceptioncom.google.gerrit.extensions.restapi.RestApiException