Module org.eclipse.jgit
Class ReftableBatchRefUpdate
java.lang.Object
org.eclipse.jgit.lib.BatchRefUpdate
org.eclipse.jgit.internal.storage.reftable.ReftableBatchRefUpdate
- Direct Known Subclasses:
DfsReftableBatchRefUpdate
BatchRefUpdate
for Reftable based RefDatabase.-
Field Summary
Fields inherited from class org.eclipse.jgit.lib.BatchRefUpdate
MAX_WAIT
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ReftableBatchRefUpdate
(RefDatabase refDb, ReftableDatabase reftableDb, Lock lock, Repository repository) Initialize. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
applyUpdates
(List<Ref> newRefs, List<ReceiveCommand> pending) Implements the storage-specific part of the update.void
execute
(RevWalk rw, ProgressMonitor pm, List<String> options) Execute this batch update.protected void
write
(ReftableWriter writer, List<Ref> newRefs, List<ReceiveCommand> pending) Writes the refs to the writer, and calls finish.Methods inherited from class org.eclipse.jgit.lib.BatchRefUpdate
addCommand, addCommand, addCommand, addPrefixesTo, addProposedTimestamp, blockUntilTimestamps, disableRefLog, execute, getCommands, getPrefixes, getProposedTimestamps, getPushCertificate, getPushOptions, getRefDatabase, getRefLogIdent, getRefLogMessage, getRefLogMessage, isAllowNonFastForwards, isAtomic, isForceRefLog, isForceRefLog, isRefLogDisabled, isRefLogDisabled, isRefLogIncludingResult, isRefLogIncludingResult, newUpdate, setAllowNonFastForwards, setAtomic, setForceRefLog, setPushCertificate, setPushOptions, setRefLogIdent, setRefLogMessage, toString
-
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
Description copied from class:BatchRefUpdate
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:
execute
in 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.
-
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.
-