move back to partition leader's node.
437137
private void checkExportStreamMastership() {
        for (Initiator initiator : m_iv2Initiators.values()) {
            if (initiator.getPartitionId() != MpInitiator.MP_INIT_PID) {
                SpInitiator spInitiator = (SpInitiator)initiator;
                if (spInitiator.isLeader()) {
                    ExportManager.instance().takeMastership(spInitiator.getPartitionId());
                }
            }
        }
    }
521650
void retriggerSubpartitionRequest(int subpartitionIndex) throws IOException, InterruptedException {
		checkState(partitionRequestClient != null, "Missing initial subpartition request.");

		if (increaseBackoff()) {
			partitionRequestClient.requestSubpartition(
				partitionId, subpartitionIndex, this, getCurrentBackoff());
		} else {
			failPartitionRequest();
		}
	}
430822
def resetToPreviousLoc(self):
        
        self.rect.left = self.startDraggingX
        self.rect.top = self.startDraggingY
283135
def _move_node_file(path, old_id, new_id):
    
    root = os.path.join(path, "project-files")
    if os.path.exists(root):
        for dirname in os.listdir(root):
            module_dir = os.path.join(root, dirname)
            if os.path.isdir(module_dir):
                node_dir = os.path.join(module_dir, old_id)
                if os.path.exists(node_dir):
                    shutil.move(node_dir, os.path.join(module_dir, new_id))
726043
def _walk_to_root(path, break_at=None):
    
    if not os.path.exists(path):  # pragma: no cover
        raise IOError("Starting path not found")

    if os.path.isfile(path):  # pragma: no cover
        path = os.path.dirname(path)

    last_dir = None
    current_dir = os.path.abspath(path)
    paths = []
    while last_dir != current_dir:
        paths.append(current_dir)
        paths.append(os.path.join(current_dir, "config"))
        if break_at and current_dir == os.path.abspath(break_at):  # noqa
            logger.debug("Reached the %s directory, breaking.", break_at)
            break
        parent_dir = os.path.abspath(os.path.join(current_dir, os.path.pardir))
        last_dir, current_dir = current_dir, parent_dir
    return paths
203939
def move_backward(self):
        """"""
        self.at(ardrone.at.pcmd, True, 0, self.speed, 0, 0)
576882
def need_offset_reset(self, partition, offset_reset_strategy=None):
        
        if offset_reset_strategy is None:
            offset_reset_strategy = self._default_offset_reset_strategy
        self.assignment[partition].await_reset(offset_reset_strategy)
942408
public void reloadPartitions() {

        if (partitions == null) {
            initializePartitions();
            partitions.updateCache();
        } else {

            Partitions loadedPartitions = loadPartitions();
            if (TopologyComparators.isChanged(getPartitions(), loadedPartitions)) {

                logger.debug("Using a new cluster topology");

                List<RedisClusterNode> before = new ArrayList<RedisClusterNode>(getPartitions());
                List<RedisClusterNode> after = new ArrayList<RedisClusterNode>(loadedPartitions);

                getResources().eventBus().publish(new ClusterTopologyChangedEvent(before, after));
            }

            this.partitions.reload(loadedPartitions.getPartitions());
        }

        updatePartitionsInConnections();
    }
1250659
def do_move_to(self, element, decl, pseudo):
        """"""
        target = serialize(decl.value).strip()
        step = self.state[self.state['current_step']]
        elem = self.current_target().tree

        #  Find if the current node already has a move, and remove it.
        actions = step['actions']
        for pos, action in enumerate(reversed(actions)):
            if action[0] == 'move' and action[1] == elem:
                target_index = - pos - 1
                actions[target_index:] = actions[target_index+1:]
                break

        _, valstep = self.lookup('pending', target)
        if not valstep:
            step['pending'][target] = [('move', elem)]
        else:
            self.state[valstep]['pending'][target].append(('move', elem))
583654
def move_to_top(self):
        """"""
        self.current_item = self.root
        for f in self._hooks["top"]:
            f(self)
        return self
610361
private void migrateGroups() throws Exception
   {
      Session session = service.getStorageSession();
      try
      {
         if (session.itemExists(groupsStorageOld))
         {
            NodeIterator iterator = ((ExtendedNode)session.getItem(groupsStorageOld)).getNodesLazily();
            GroupHandlerImpl gh = ((GroupHandlerImpl)service.getGroupHandler());
            while (iterator.hasNext())
            {
               Node oldGroupNode = iterator.nextNode();
               gh.migrateGroup(oldGroupNode);
               migrateGroups(oldGroupNode);
            }
         }
      }
      finally
      {
         session.logout();
      }
   }
201328
function(node, state, leaving) {
        for (let i = 0; i < state.currentSegments.length; ++i) {
            const segInternal = state.currentSegments[i].internal;

            if (leaving) {
                segInternal.exitNodes.push(node);
            } else {
                segInternal.nodes.push(node);
            }
        }

        debug([
            `${state.currentSegments.map(getId).join(",")})`,
            `${node.type}${leaving ? ":exit" : ""}`
        ].join(" "));
    }
803439
private void setMigratePartitionLeaderStatus(MigratePartitionLeaderMessage message) {

        //The host with old partition leader is down.
        if (message.isStatusReset()) {
            m_migratePartitionLeaderStatus = MigratePartitionLeaderStatus.NONE;
            return;
        }

        if (m_migratePartitionLeaderStatus == MigratePartitionLeaderStatus.NONE) {
            //txn draining notification from the old leader arrives before this site is promoted
            m_migratePartitionLeaderStatus = MigratePartitionLeaderStatus.TXN_DRAINED;
        } else if (m_migratePartitionLeaderStatus == MigratePartitionLeaderStatus.TXN_RESTART) {
            //if the new leader has been promoted, stop restarting txns.
            m_migratePartitionLeaderStatus = MigratePartitionLeaderStatus.NONE;
        }

        tmLog.info("MigratePartitionLeader new leader " +
                CoreUtils.hsIdToString(m_hsId) + " is notified by previous leader " +
                CoreUtils.hsIdToString(message.getPriorLeaderHSID()) + ". status:" + m_migratePartitionLeaderStatus);
    }
1317117
def reboot(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The stop action must be called with -a or --action.'
        )

    log.info('Rebooting node %s', name)

    instance_id = _get_node(name)['InstanceId']

    params = {'Action': 'RebootInstance',
              'InstanceId': instance_id}
    result = query(params)

    return result
184909
def pop(self: BoardT) -> Move:
        
        move = self.move_stack.pop()
        self._stack.pop().restore(self)
        return move
109579
private void moveOldStructure() throws Exception
   {
      ExtendedSession session = (ExtendedSession)service.getStorageSession();
      try
      {
         if (session.itemExists(storagePathOld))
         {
            return;
         }
         else
         {
            session.move(service.getStoragePath(), storagePathOld, false);
            session.save();
         }
      }
      finally
      {
         session.logout();
      }
   }
9642
private void nodeNotOwnsBackup(InternalPartitionImpl partition) {
        int partitionId = getPartitionId();
        int replicaIndex = getReplicaIndex();
        NodeEngine nodeEngine = getNodeEngine();

        ILogger logger = getLogger();
        if (logger.isFinestEnabled()) {
            int currentReplicaIndex = partition.getReplicaIndex(PartitionReplica.from(nodeEngine.getLocalMember()));
            logger.finest(
                    "This node is not backup replica of partitionId=" + partitionId + ", replicaIndex=" + replicaIndex
                            + " anymore. current replicaIndex=" + currentReplicaIndex);
        }

        if (operations != null) {
            PartitionReplica replica = partition.getReplica(replicaIndex);
            Member targetMember = null;
            if (replica != null) {
                ClusterServiceImpl clusterService = (ClusterServiceImpl) nodeEngine.getClusterService();
                targetMember = clusterService.getMember(replica.address(), replica.uuid());
            }
            Throwable throwable = new WrongTargetException(nodeEngine.getLocalMember(), targetMember, partitionId,
                    replicaIndex, getClass().getName());
            for (Operation op : operations) {
                prepareOperation(op);
                onOperationFailure(op, throwable);
            }
        }
    }