Reconstructs the execution pipelines for this execution stage.
553174
void reconstructExecutionPipelines() {

		Iterator<ExecutionGroupVertex> it = this.stageMembers.iterator();
		final Set<ExecutionVertex> alreadyVisited = new HashSet<ExecutionVertex>();

		while (it.hasNext()) {

			final ExecutionGroupVertex groupVertex = it.next();

			// We only look at input vertices first
			if (!groupVertex.isInputVertex()) {
				continue;
			}

			final Iterator<ExecutionVertex> vertexIt = groupVertex.iterator();
			while (vertexIt.hasNext()) {

				final ExecutionVertex vertex = vertexIt.next();
				reconstructExecutionPipeline(vertex, true, alreadyVisited);
			}
		}

		it = this.stageMembers.iterator();
		alreadyVisited.clear();

		while (it.hasNext()) {

			final ExecutionGroupVertex groupVertex = it.next();

			// We only look at input vertices first
			if (!groupVertex.isOutputVertex()) {
				continue;
			}

			final Iterator<ExecutionVertex> vertexIt = groupVertex.iterator();
			while (vertexIt.hasNext()) {

				final ExecutionVertex vertex = vertexIt.next();
				reconstructExecutionPipeline(vertex, false, alreadyVisited);
			}
		}
	}
805877
private function buildPipeline()
    {
        $nextCallable = function ($item) {
            // the final callable is a no-op
        };

        foreach ($this->getStepsSortedDescByPriority() as $step) {
            $nextCallable = function ($item) use ($step, $nextCallable) {
                return $step->process($item, $nextCallable);
            };
        }

        return $nextCallable;
    }
702012
def rebuild(self):
        """"""
        movi = self.riff.find('LIST', 'movi')
        movi.chunks = self.combine_streams()
        self.rebuild_index()
655094
def rebuild( self ):
        
        self._buildData.clear()
        self._dateGrid.clear()
        self._dateTimeGrid.clear()
        
        curr_min = self._minimumDate
        curr_max = self._maximumDate
        
        self._maximumDate = QDate()
        self._minimumDate = QDate()
        
        self.markForRebuild(False)
        
        # rebuilds the month view
        if ( self.currentMode() == XCalendarScene.Mode.Month ):
            self.rebuildMonth()
        elif ( self.currentMode() in (XCalendarScene.Mode.Week,
                                      XCalendarScene.Mode.Day)):
            self.rebuildDays()
        
        # rebuild the items in the scene
        items = sorted(self.items())
        for item in items:
            item.setPos(0, 0)
            item.hide()
        
        for item in items:
            if ( isinstance(item, XCalendarItem) ):
                item.rebuild()
        
        if ( curr_min != self._minimumDate or curr_max != self._maximumDate ):
            parent = self.parent()
            if ( parent and not parent.signalsBlocked() ):
                parent.dateRangeChanged.emit(self._minimumDate, 
                                             self._maximumDate)
1129400
protected function _process()
	{
		$this->_msg('Rebuilding catalog index for performance data', 0);

		$catalogManager = MShop_Catalog_Manager_Factory::createManager( $this->_getContext() );
		$catalogManager->getSubManager( 'index' )->rebuildIndex();

		$this->_status( 'done' );
	}
1355132
def prepare_onetime_pipeline():
    """"""
    runner = ForemastRunner()
    runner.write_configs()
    runner.create_pipeline(onetime=os.getenv('ENV'))
    runner.cleanup()
637315
public void reconstitute(BaseDestinationHandler destinationHandler, 
                           SIMPTransactionManager txManager, 
                           ProducerInputHandler inputHandler)
    throws MessageStoreException, SIException
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "reconstitute", new Object[] {destinationHandler, txManager, inputHandler}); 

    super.reconstitute(destinationHandler, txManager);
    
    reconstituteTargetStreams(inputHandler);
          
    if (tc.isEntryEnabled())
      SibTr.exit(tc, "reconstitute");           
  }
454295
protected function rebuildCache()
    {
        $this->cache = stream_get_meta_data($this->stream);
        $this->cache[self::IS_LOCAL] = stream_is_local($this->stream);
        $this->cache[self::IS_READABLE] = isset(self::$readWriteHash['read'][$this->cache['mode']]);
        $this->cache[self::IS_WRITABLE] = isset(self::$readWriteHash['write'][$this->cache['mode']]);
    }
724066
def add_after(self, pipeline):
        
        if not isinstance(pipeline, Pipeline):
            pipeline = Pipeline(pipeline)
        self.pipes = self.pipes[:] + pipeline.pipes[:]
        return self
1349991
def pipeline(steps, initial=None):
    

    def apply(result, step):
        return step(result)

    return reduce(apply, steps, initial)
346775
private void processStages() {

        // Locate the next step to execute.
        ModelNode primaryResponse = null;
        Step step;
        do {
            step = steps.get(currentStage).pollFirst();
            if (step == null) {

                if (currentStage == Stage.MODEL && addModelValidationSteps()) {
                    continue;
                }
                // No steps remain in this stage; give subclasses a chance to check status
                // and approve moving to the next stage
                if (!tryStageCompleted(currentStage)) {
                    // Can't continue
                    resultAction = ResultAction.ROLLBACK;
                    executeResultHandlerPhase(null);
                    return;
                }
                // Proceed to the next stage
                if (currentStage.hasNext()) {
                    currentStage = currentStage.next();
                    if (currentStage == Stage.VERIFY) {
                        // a change was made to the runtime. Thus, we must wait
                        // for stability before resuming in to verify.
                        try {
                            awaitServiceContainerStability();
                        } catch (InterruptedException e) {
                            cancelled = true;
                            handleContainerStabilityFailure(primaryResponse, e);
                            executeResultHandlerPhase(null);
                            return;
                        }  catch (TimeoutException te) {
                            // The service container is in an unknown state; but we don't require restart
                            // because rollback may allow the container to stabilize. We force require-restart
                            // in the rollback handling if the container cannot stabilize (see OperationContextImpl.releaseStepLocks)
                            //processState.setRestartRequired();  // don't use our restartRequired() method as this is not reversible in rollback
                            handleContainerStabilityFailure(primaryResponse, te);
                            executeResultHandlerPhase(null);
                            return;
                        }
                    }
                }
            } else {
                // The response to the first step is what goes to the outside caller
                if (primaryResponse == null) {
                    primaryResponse = step.response;
                }
                // Execute the step, but make sure we always finalize any steps
                Throwable toThrow = null;
                // Whether to return after try/finally
                boolean exit = false;
                try {
                    CapabilityRegistry.RuntimeStatus stepStatus = getStepExecutionStatus(step);
                    if (stepStatus == RuntimeCapabilityRegistry.RuntimeStatus.NORMAL) {
                        executeStep(step);
                    } else {
                        String header = stepStatus == RuntimeCapabilityRegistry.RuntimeStatus.RESTART_REQUIRED
                                ? OPERATION_REQUIRES_RESTART : OPERATION_REQUIRES_RELOAD;
                        step.response.get(RESPONSE_HEADERS, header).set(true);
                    }
                } catch (RuntimeException | Error re) {
                    resultAction = ResultAction.ROLLBACK;
                    toThrow = re;
                } finally {
                    // See if executeStep put us in a state where we shouldn't do any more
                    if (toThrow != null || !canContinueProcessing()) {
                        // We're done.
                        executeResultHandlerPhase(toThrow);
                        exit = true; // we're on the return path
                    }
                }
                if (exit) {
                    return;
                }
            }
        } while (currentStage != Stage.DONE);

        assert primaryResponse != null; // else ModelControllerImpl executed an op with no steps

        // All steps ran and canContinueProcessing returned true for the last one, so...
        executeDoneStage(primaryResponse);
    }
504395
def rebuild( self ):
        
        scene       = self.scene()
        if not scene:
            return
        
        self._subpaths = []
        
        grid        = scene.gridRect()
        typ         = self.chartType()
        
        hruler      = scene.horizontalRuler()
        vruler      = scene.verticalRuler()
        
        path        = QPainterPath()
        area        = QPainterPath()
        
        self._buildData.clear()
        self._buildData['path_area'] = area
        
        self.setPos(0, 0)
        
        # draw a line item
        if typ == XChartScene.Type.Line:
            first = True
            pos   = None
            home  = None
            self._ellipses = []
            
            points = self.points()
            if ( self.orientation() == Qt.Horizontal ):
                points.sort(hruler.compareValues, key = lambda x: x[0])
            else:
                points.sort(vruler.compareValues, key = lambda y: y[1])
                points.reverse()
            
            for x, y in self.points():
                pos = scene.mapFromChart(x, y)
                if first:
                    home = QPointF(pos.x(), grid.bottom())
                    area.moveTo(home)
                    area.lineTo(pos)
                    path.moveTo(pos)
                    
                    self._ellipses.append(pos)
                    
                    first = False
                else:
                    path.lineTo(pos)
                    area.lineTo(pos)
                    
                    self._ellipses.append(pos)
            
            if pos and home:
                area.lineTo(pos.x(), grid.bottom())
                area.lineTo(home)
        
        # draw a bar item
        elif typ == XChartScene.Type.Bar:
            barsize = self.barSize()
            horiz   = self.orientation() == Qt.Horizontal
            
            for x, y in self.points():
                pos = scene.mapFromChart(x, y)
                subpath = QPainterPath()
                if horiz:
                    r = min(grid.bottom() - pos.y(), 8)
                    
                    subpath.moveTo(pos.x() - barsize / 2.0, grid.bottom())
                    subpath.lineTo(pos.x() - barsize / 2.0, pos.y() + r)
                    subpath.quadTo(pos.x() - barsize / 2.0, pos.y(),
                                   pos.x() - barsize / 2.0 + r, pos.y())
                    
                    subpath.lineTo(pos.x() + barsize / 2.0 - r, pos.y())
                    subpath.quadTo(pos.x() + barsize / 2.0, pos.y(),
                                   pos.x() + barsize / 2.0, pos.y() + r)
                    
                    subpath.lineTo(pos.x() + barsize / 2.0, grid.bottom())
                    subpath.lineTo(pos.x() - barsize / 2.0, grid.bottom())
                else:
                    subpath.moveTo(grid.left(), pos.y() - barsize / 2.0)
                    subpath.lineTo(pos.x(),     pos.y() - barsize / 2.0)
                    subpath.lineTo(pos.x(),     pos.y() + barsize / 2.0)
                    subpath.lineTo(grid.left(), pos.y() + barsize / 2.0)
                    subpath.lineTo(grid.left(), pos.y() - barsize / 2.0)
                
                path.addPath(subpath)
                self._subpaths.append((x, y, subpath))
        
        # draw a pie chart
        elif typ == XChartScene.Type.Pie:
            if self.orientation() == Qt.Horizontal:
                key_index   = 0
                value_index = 1
                value_ruler = self.verticalRuler()
            else:
                key_index   = 1
                value_index = 0
                value_ruler = self.horizontalRuler()
        
            pie_values = {}
            
            for point in self.points():
                key     = point[key_index]
                value   = point[value_index]
                
                pie_values.setdefault(key, [])
                pie_values[key].append(value)
        
            for key, values in pie_values.items():
                pie_values[key] = value_ruler.calcTotal(values)
            
            total = max(1, value_ruler.calcTotal(pie_values.values()))
            
            # calculate drawing parameters
            center   = self.pieCenter()
            radius   = self.radius()
            diameter = radius * 2
            angle    = 0
            bound    = QRectF(-radius, -radius, diameter, diameter)
            
            for key, value in sorted(pie_values.items(), key = lambda x: x[1]):
                # calculate the percentage
                perc  = float(value) / total
                
                # calculate the angle as the perc * 360
                item_angle = perc * 360
                self.setPos(center)
                
                sub_path = QPainterPath()
                sub_path.arcTo(bound, angle, item_angle)
                sub_path.lineTo(0, 0)
                
                path.addPath(sub_path)
                self._subpaths.append((key, value, sub_path))
                
                angle += item_angle
                
        self.setPath(path)
        self._dirty = False
1100399
public function rebuild()
    {
        $this->cache->erase();
        $this->reset();
        $this->warmUpCache();
        $this->cache->save();
    }
744534
private void recovery(Long pipelineId) {
        List<Long> currentProcessIds = stageMonitor.getCurrentProcessIds(false);
        for (Long processId : currentProcessIds) {
            String path = StagePathUtils.getProcess(pipelineId, processId);
            try {
                byte[] bytes = zookeeper.readData(path);
                ProcessNodeEventData nodeData = JsonUtils.unmarshalFromByte(bytes, ProcessNodeEventData.class);
                if (nodeData.getStatus().isUnUsed()) {// 加入未使用的processId
                    addReply(processId);
                }
            } catch (ZkException e) {
                logger.error("SelectStageListener", e);
            }
        }
    }
871114
def add_rebuild(subparsers):
    """"""
    rebuild_parser = subparsers.add_parser(
        'rebuild', help=runner.rebuild_pipelines.__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    rebuild_parser.set_defaults(func=runner.rebuild_pipelines)
    rebuild_parser.add_argument('-a', '--all', action='store_true', help='Rebuild all Pipelines')
    rebuild_parser.add_argument(
        'project',
        nargs='?',
        default=os.getenv('REBUILD_PROJECT'),
        help='Project to rebuild, overrides $REBUILD_PROJECT')
124389
private function buildProcessors()
    {
        $this->processors = [];

        if (!empty($this->initialData[self::PROCESSORS])) {
            $groups = [];
            if (!empty($this->initialData[self::GROUPS])) {
                $groups = $this->initialData[self::GROUPS];
            }

            $startCommonProcessors = [];
            $endCommonProcessors = [];
            if (!empty($this->initialData[self::PROCESSORS][self::NO_ACTION])) {
                foreach ($this->initialData[self::PROCESSORS][self::NO_ACTION] as $priority => $priorityData) {
                    foreach ($priorityData as $processor) {
                        if ($priority < 0) {
                            $endCommonProcessors[$priority][] = $processor;
                        } else {
                            $startCommonProcessors[$priority][] = $processor;
                        }
                    }
                }
                $startCommonProcessors = $this->sortByPriorityAndFlatten($startCommonProcessors);
                $endCommonProcessors = $this->sortByPriorityAndFlatten($endCommonProcessors);
                unset($this->initialData[self::PROCESSORS][self::NO_ACTION]);
            }

            foreach ($this->initialData[self::PROCESSORS] as $action => $actionData) {
                $this->processors[$action] = \array_merge(
                    $startCommonProcessors,
                    $this->getSortedProcessors($action, $actionData, $groups),
                    $endCommonProcessors
                );
            }
        }
    }
536602
public void reinitialize() {
        inputWindow = new SccpFlowControlWindow(new SequenceNumberImpl(0), maximumWindowSize);
        outputWindow = new SccpFlowControlWindow(new SequenceNumberImpl(0), maximumWindowSize);

        sendSequenceNumberExpectedAtInput = new SequenceNumberImpl(0);
        // inputWindow.setLowerEdge(sendSequenceNumberExpectedAtInput);

        lastReceiveSequenceNumberReceived = new SequenceNumberImpl(0);

        sendSequenceNumber = new SequenceNumberImpl(0, false, true);
        expectingFirstMessageInputAfterInit = true;
    }