Class ReftableBatchRefUpdate
java.lang.Object
org.eclipse.jgit.lib.BatchRefUpdate
org.eclipse.jgit.internal.storage.reftable.ReftableBatchRefUpdate
- Direct Known Subclasses:
DfsReftableBatchRefUpdate,FileReftableDatabase.FileReftableBatchRefUpdate
BatchRefUpdate for Reftable based RefDatabase.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Lockprivate final ReftableDatabaseprivate final RepositoryFields inherited from class org.eclipse.jgit.lib.BatchRefUpdate
MAX_WAIT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedReftableBatchRefUpdate(RefDatabase refdb, ReftableDatabase reftableDb, Lock lock, Repository repository) Initialize. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidapplyUpdates(List<Ref> newRefs, List<ReceiveCommand> pending) Implements the storage-specific part of the update.private booleancheckConflicting(List<ReceiveCommand> pending) private booleancheckExpected(List<ReceiveCommand> pending) private booleancheckNonFastForwards(RevWalk rw, List<ReceiveCommand> pending) private booleancheckObjectExistence(RevWalk rw, List<ReceiveCommand> pending) voidexecute(RevWalk rw, ProgressMonitor pm, List<String> options) Execute this batch update.private List<ReceiveCommand>private static booleanmatchOld(ReceiveCommand cmd, Ref ref) toNewRefs(RevWalk rw, List<ReceiveCommand> pending) private Stringprotected voidwrite(ReftableWriter writer, List<Ref> newRefs, List<ReceiveCommand> pending) Writes the refs to the writer, and calls finish.private voidwriteLog(ReftableWriter writer, long updateIndex, List<ReceiveCommand> pending) Methods inherited from class org.eclipse.jgit.lib.BatchRefUpdate
addCommand, addCommand, addCommand, addPrefixesTo, addProposedTimestamp, blockUntilTimestamps, disableRefLog, execute, getCommands, getPrefixes, getProposedTimestamps, getPushCertificate, getPushOptions, getRefLogIdent, getRefLogMessage, getRefLogMessage, isAllowNonFastForwards, isAtomic, isForceRefLog, isForceRefLog, isRefLogDisabled, isRefLogDisabled, isRefLogIncludingResult, isRefLogIncludingResult, newUpdate, setAllowNonFastForwards, setAtomic, setForceRefLog, setPushCertificate, setPushOptions, setRefLogIdent, setRefLogMessage, toString
-
Field Details
-
lock
-
refDb
-
repository
-
-
Constructor Details
-
ReftableBatchRefUpdate
protected ReftableBatchRefUpdate(RefDatabase refdb, ReftableDatabase reftableDb, Lock lock, Repository repository) Initialize.- Parameters:
refdb- The RefDatabasereftableDb- The ReftableDatabaselock- A lock protecting the refdatabase's staterepository- The repository on which this update will run
-
-
Method Details
-
execute
Execute this batch update.The default implementation of this method performs a sequential reference update over each reference.
Implementations must respect the atomicity requirements of the underlying database as described in
BatchRefUpdate.setAtomic(boolean)andRefDatabase.performsAtomicTransactions().- Overrides:
executein classBatchRefUpdate- Parameters:
rw- a RevWalk to parse tags in case the storage system wants to store them pre-peeled, a common performance optimization.pm- progress monitor to receive update status on.options- a list of option strings; set null to execute without
-
applyUpdates
protected abstract void applyUpdates(List<Ref> newRefs, List<ReceiveCommand> pending) throws IOException Implements the storage-specific part of the update.- Parameters:
newRefs- the new refs to createpending- the pending receive commands to be executed- Throws:
IOException- if any of the writes fail.
-
getPending
-
checkObjectExistence
- Throws:
IOException
-
checkNonFastForwards
- Throws:
IOException
-
checkConflicting
- Throws:
IOException
-
checkExpected
- Throws:
IOException
-
matchOld
-
write
protected void write(ReftableWriter writer, List<Ref> newRefs, List<ReceiveCommand> pending) throws IOException Writes the refs to the writer, and calls finish.- Parameters:
writer- the writer on which we should write.newRefs- the ref data to write..pending- the log data to write.- Throws:
IOException- in case of problems.
-
writeLog
private void writeLog(ReftableWriter writer, long updateIndex, List<ReceiveCommand> pending) throws IOException - Throws:
IOException
-
toResultString
-
toNewRefs
- Throws:
IOException
-