Top Description Fields Constructors Methods
org.eclipse.jgit.internal.storage.reftable

public abstract Class ReftableBatchRefUpdate

extends BatchRefUpdate
Class Inheritance
Known Direct Subclasses
org.eclipse.jgit.internal.storage.dfs.DfsReftableBatchRefUpdate, org.eclipse.jgit.internal.storage.file.FileReftableDatabase.FileReftableBatchRefUpdate
Imports
org.eclipse.jgit.annotations.Nullable, org.eclipse.jgit.errors.MissingObjectException, org.eclipse.jgit.internal.JGitText, org.eclipse.jgit.lib.AnyObjectId, .BatchRefUpdate, .ObjectId, .ObjectIdRef, .PersonIdent, .ProgressMonitor, .Ref, .RefDatabase, .ReflogEntry, .Repository, .SymbolicRef, org.eclipse.jgit.revwalk.RevObject, .RevTag, .RevWalk, org.eclipse.jgit.transport.ReceiveCommand, java.io.IOException, java.util.ArrayList, .Collections, .HashMap, .List, .Map, .Set, .TreeSet, java.util.concurrent.locks.Lock, java.util.stream.Collectors

org.eclipse.jgit.lib.BatchRefUpdate for Reftable based RefDatabase.

Field Summary

Modifier and TypeField and Description
private final Lock
private final ReftableDatabase
private final Repository
Inherited from org.eclipse.jgit.lib.BatchRefUpdate:
MAX_WAIT

Constructor Summary

AccessConstructor and Description
protected
ReftableBatchRefUpdate(RefDatabase
The RefDatabase
refDb
,
ReftableDatabase
The ReftableDatabase
reftableDb
,
Lock
A lock protecting the refdatabase's state
lock
,
Repository
The repository on which this update will run
repository
)

Initialize.

Method Summary

Modifier and TypeMethod and Description
protected abstract void
applyUpdates(List<Ref>
the new refs to create
newRefs
,
List<ReceiveCommand>
the pending receive commands to be executed
pending
)

Implements the storage-specific part of the update.

private boolean
private boolean
private boolean
private boolean
public void
execute(RevWalk
a RevWalk to parse tags in case the storage system wants to store them pre-peeled, a common performance optimization.
rw
,
ProgressMonitor
progress monitor to receive update status on.
pm
,
List<String>
a list of option strings; set null to execute without
options
)

Overrides org.eclipse.jgit.lib.BatchRefUpdate.execute.

Execute this batch update.

private List<ReceiveCommand>
private static boolean
private static List<Ref>
private String
protected void
write(ReftableWriter
the writer on which we should write.
writer
,
List<Ref>
the ref data to write..
newRefs
,
List<ReceiveCommand>
the log data to write.
pending
)

Writes the refs to the writer, and calls finish.

private void
writeLog(ReftableWriter writer, long updateIndex, List<ReceiveCommand> pending)

Inherited from org.eclipse.jgit.lib.BatchRefUpdate:
addCommandaddCommandaddCommandaddPrefixesToaddProposedTimestampblockUntilTimestampsdisableRefLogexecutegetCommandsgetPrefixesgetProposedTimestampsgetPushCertificategetPushOptionsgetRefDatabasegetRefLogIdentgetRefLogMessagegetRefLogMessageisAllowNonFastForwardsisAtomicisForceRefLogisForceRefLogisRefLogDisabledisRefLogDisabledisRefLogIncludingResultisRefLogIncludingResultnewUpdatesetAllowNonFastForwardssetAtomicsetForceRefLogsetPushCertificatesetPushOptionssetRefLogIdentsetRefLogMessagetoString

Field Detail

lockback to summary
private final Lock lock
refDbback to summary
private final ReftableDatabase refDb
repositoryback to summary
private final Repository repository

Constructor Detail

ReftableBatchRefUpdateback to summary
protected ReftableBatchRefUpdate(RefDatabase refDb, ReftableDatabase reftableDb, Lock lock, Repository repository)

Initialize.

Parameters
refDb:RefDatabase

The RefDatabase

reftableDb:ReftableDatabase

The ReftableDatabase

lock:Lock

A lock protecting the refdatabase's state

repository:Repository

The repository on which this update will run

Method Detail

applyUpdatesback to summary
protected abstract void applyUpdates(List<Ref> newRefs, List<ReceiveCommand> pending) throws IOException

Implements the storage-specific part of the update.

Parameters
newRefs:List<Ref>

the new refs to create

pending:List<ReceiveCommand>

the pending receive commands to be executed

Exceptions
IOException:
if any of the writes fail.
checkConflictingback to summary
private boolean checkConflicting(List<ReceiveCommand> pending) throws IOException
checkExpectedback to summary
private boolean checkExpected(List<ReceiveCommand> pending) throws IOException
checkNonFastForwardsback to summary
private boolean checkNonFastForwards(RevWalk rw, List<ReceiveCommand> pending) throws IOException
checkObjectExistenceback to summary
private boolean checkObjectExistence(RevWalk rw, List<ReceiveCommand> pending) throws IOException
executeback to summary
public void execute(RevWalk rw, ProgressMonitor pm, List<String> options)

Overrides org.eclipse.jgit.lib.BatchRefUpdate.execute.

Doc from org.eclipse.jgit.lib.BatchRefUpdate.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 setAtomic(boolean) and org.eclipse.jgit.lib.RefDatabase#performsAtomicTransactions().

Parameters
rw:RevWalk

a RevWalk to parse tags in case the storage system wants to store them pre-peeled, a common performance optimization.

pm:ProgressMonitor

progress monitor to receive update status on.

options:List<String>

a list of option strings; set null to execute without

Annotations
@Override
getPendingback to summary
private List<ReceiveCommand> getPending()
matchOldback to summary
private static boolean matchOld(ReceiveCommand cmd, Ref ref)
toNewRefsback to summary
private static List<Ref> toNewRefs(RevWalk rw, List<ReceiveCommand> pending) throws IOException
toResultStringback to summary
private String toResultString(ReceiveCommand cmd)
writeback to summary
protected void write(ReftableWriter writer, List<Ref> newRefs, List<ReceiveCommand> pending) throws IOException

Writes the refs to the writer, and calls finish.

Parameters
writer:ReftableWriter

the writer on which we should write.

newRefs:List<Ref>

the ref data to write..

pending:List<ReceiveCommand>

the log data to write.

Exceptions
IOException:
in case of problems.
writeLogback to summary
private void writeLog(ReftableWriter writer, long updateIndex, List<ReceiveCommand> pending) throws IOException