Class ReftableBatchRefUpdate

    • Constructor Detail

      • ReftableBatchRefUpdate

        protected ReftableBatchRefUpdate​(RefDatabase refdb,
                                         ReftableDatabase reftableDb,
                                         Lock lock,
                                         Repository repository)
        refdb - The RefDatabase
        reftableDb - The ReftableDatabase
        lock - A lock protecting the refdatabase's state
        repository - The repository on which this update will run
    • Method Detail

      • execute

        public void execute​(RevWalk rw,
                            ProgressMonitor pm,
                            List<String> options)
        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) and RefDatabase.performsAtomicTransactions().

        execute in class BatchRefUpdate
        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.
        newRefs - the new refs to create
        pending - the pending receive commands to be executed
        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.
        writer - the writer on which we should write.
        newRefs - the ref data to write..
        pending - the log data to write.
        IOException - in case of problems.