Rollback to the specified push version

@param rollbackToDir The version directory to rollback to
508734
public void rollback(File rollbackToDir) {
        logger.info("Rolling back store '" + getName() + "'");
        fileModificationLock.writeLock().lock();
        try {
            if(rollbackToDir == null)
                throw new VoldemortException("Version directory specified to rollback is null");

            if(!rollbackToDir.exists())
                throw new VoldemortException("Version directory " + rollbackToDir.getAbsolutePath()
                                             + " specified to rollback does not exist");

            long versionId = ReadOnlyUtils.getVersionId(rollbackToDir);
            if(versionId == -1)
                throw new VoldemortException("Cannot parse version id");

            File[] backUpDirs = ReadOnlyUtils.getVersionDirs(storeDir, versionId, Long.MAX_VALUE);
            if(backUpDirs == null || backUpDirs.length <= 1) {
                logger.warn("No rollback performed since there are no back-up directories");
                return;
            }
            backUpDirs = ReadOnlyUtils.findKthVersionedDir(backUpDirs, 0, backUpDirs.length - 1);

            if(isOpen)
                close();

            // open the rollback directory
            open(rollbackToDir);

            // back-up all other directories
            DateFormat df = new SimpleDateFormat("MM-dd-yyyy");
            for(int index = 1; index < backUpDirs.length; index++) {
                Utils.move(backUpDirs[index], new File(storeDir, backUpDirs[index].getName() + "."
                                                                 + df.format(new Date()) + ".bak"));
            }

        } finally {
            fileModificationLock.writeLock().unlock();
            logger.info("Rollback operation completed on '" + getName() + "', releasing lock.");
        }
    }
1350233
def rollback             (self, n=None):
		""""""
		
		if n is None:
			if self.haveSnapshots: return self.fromSnapshot(self.latestLink)
			else:                  return self.fromScratch()
		elif isinstance(n, int):
			loadSnapshotPath = self.getFullPathToSnapshot(n)
			assert(os.path.isdir(loadSnapshotPath))
			return self.__markLatest(n).fromSnapshot(loadSnapshotPath)
		else:
			raise ValueError("n must be int, or None!")
368473
void rollback(long fromTransactionId) {
        long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "rollback", fromTransactionId);
        List<Long> rolledBack = new ArrayList<>();
        while (!this.transactions.isEmpty() && this.transactions.peekLast().getTransactionId() >= fromTransactionId) {
            ContainerMetadataUpdateTransaction txn = this.transactions.removeLast();
            txn.seal();
            rolledBack.add(txn.getTransactionId());
        }

        // At this point, the transaction list is either empty or its last one is sealed; any further changes would
        // require creating a new transaction.
        LoggerHelpers.traceLeave(log, this.traceObjectId, "rollback", traceId, rolledBack);
    }
1341377
@Override
	public void rollback() {
		Optional<LocalTransactionContext> txContext = currentTxContext();
		if (txContext.isPresent()) {
			txContext.get().rollback();
		} else {
			this.unmanagedTransaction.ifPresent(LocalTransactionContext::rollback);
		}
	}
1116589
public void rollback() {
        try {
            ldapOperations.unbind(dn);
        } catch (Exception e) {
            log.warn("Failed to rollback, dn:" + dn.toString(), e);
        }
    }
866882
def rollback(self):
        """"""
        if not self._moved_paths.can_rollback:
            logger.error(
                "Can't roll back %s; was not uninstalled",
                self.dist.project_name,
            )
            return False
        logger.info('Rolling back uninstall of %s', self.dist.project_name)
        self._moved_paths.rollback()
        for pth in self.pth.values():
            pth.rollback()
868893
void rollbackResources()
    {
        final boolean traceOn = TraceComponent.isAnyTracingEnabled();

        if (traceOn && tc.isEntryEnabled())
            Tr.entry(tc, "rollbackResources", this);

        distributeEnd(XAResource.TMFAIL);
        _outcome = false;
        _retryRequired = distributeOutcome();

        if (traceOn && tc.isEntryEnabled())
            Tr.exit(tc, "rollbackResources", _retryRequired);
    }
906338
public void rollback_only()
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "rollback_only");

        try
        {
            _transaction.setRollbackOnly();
            _transaction.subRollback();
        } catch (Throwable exc)
        {
            FFDCFilter.processException(exc, "com.ibm.tx.remote.TransactionWrapper.rollback_only", "813", this);
            if (tc.isEventEnabled())
                Tr.event(tc, "rollback_only caught exception setting coordinator rollback_only", exc);
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "rollback_only");
    }
1270704
public void rollback()
        throws DBException, RemoteException
    {
        BaseTransport transport = this.createProxyTransport(ROLLBACK);
        Object strReturn = transport.sendMessageAndGetReply();
        Object objReturn = transport.convertReturnObject(strReturn);
        this.checkDBException(objReturn);
    }
436165
func RollbackVersion(ver int32) RollbackOption {
	return func(opts *options) {
		opts.rollbackReq.Version = ver
	}
}
697077
public void registerVersion(Version versionToAdd) {
    String versionName = keyHandler.handle(versionToAdd.getName());
    versions.put(versionName, versionToAdd);
    notifyReportableObservers(versionToAdd);
  }
1151621
public function rollBack($toLevel = NULL) {
        if ($this->transactions == 1) {
            $this->transactions = 0;

            $this->transaction->rollBack();
        } else {
            --$this->transactions;
        }

        $this->fireConnectionEvent('rollingBack');
    }
796564
function rollbackPublish() {
			try {
				chkoutRun(options.distBranch, function() {
					var cph = cmd('git rev-parse HEAD');
					if (pubHash && pubHash !== cph) {
						cmd('git checkout -qf ' + pubHash);
						cmd('git commit -q -m "Rollback: ' + tmpltData.distBranchPubMsg + '"');
						cmd('git push -f ' + options.repoName + ' ' + options.distBranch);
					} else if (!pubHash) {
						cmd('git push ' + options.repoName + ' --delete ' + options.distBranch);
					} else {
						rbot.log.verbose('Skipping rollback for ' + options.distBranch + ' for hash "' + pubHash
								+ '" (current hash: "' + cph + '")');
					}
				});
			} catch (e) {
				var msg = 'Failed to rollback publish branch changes!';
				rollCall.error(msg, e);
			}
		}
900505
public void syncPersistNewDirectory(MutableInodeDirectory dir)
      throws InvalidPathException, FileDoesNotExistException, IOException {
    dir.setPersistenceState(PersistenceState.TO_BE_PERSISTED);
    syncPersistDirectory(dir).ifPresent(status -> {
      // If the directory already exists in the UFS, update our metadata to match the UFS.
      dir.setOwner(status.getOwner())
          .setGroup(status.getGroup())
          .setMode(status.getMode());

      Long lastModificationTime = status.getLastModifiedTime();
      if (lastModificationTime != null) {
        dir.setLastModificationTimeMs(lastModificationTime, true);
      }
    });
    dir.setPersistenceState(PersistenceState.PERSISTED);
  }
782689
protected function _rollbackCopyPackage()
    {
        if (!empty($this->_plugin['name'])) {
            $destinationPath = normalizePath(ROOT . "/plugins/{$this->_plugin['name']}/");
            if (is_dir($destinationPath) && is_writable($destinationPath)) {
                $dst = new Folder($destinationPath);
                $dst->delete();
            }
        }
    }
984589
public function rollbackSingle($version)
    {
        // Validate $version and safely cast
        if (isset($version) && !is_numeric($version) && $version !== self::LIVE) {
            throw new InvalidArgumentException("Invalid rollback source version $version");
        }
        if (isset($version) && is_numeric($version)) {
            $version = (int)$version;
        }
        // Copy version between stage
        $owner = $this->owner;
        $owner->invokeWithExtensions('onBeforeRollbackSingle', $version);
        $owner->copyVersionToStage($version, self::DRAFT);
        $owner->invokeWithExtensions('onAfterRollbackSingle', $version);
    }
510339
def rolledback!(force_restore_state = false) #:nodoc:
      run_callbacks :rollback
    ensure
      IdentityMap.remove(self) if IdentityMap.enabled?
      restore_transaction_record_state(force_restore_state)
    end