Beispiel #1
0
    void MultiPlanRunner::saveState() {
        if (_failure || _killed) { return; }

        if (NULL != _bestPlan) {
            _bestPlan->saveState();
        }
        else {
            allPlansSaveState();
        }
    }
Beispiel #2
0
    void MultiPlanStage::prepareToYield() {
        if (_failure) return;

        // this logic is from multi_plan_runner
        // but does it really make sense to operate on
        // the _bestPlan if we've switched to the backup?

        if (bestPlanChosen()) {
            _candidates[_bestPlanIdx].root->prepareToYield();
            if (hasBackupPlan()) {
                _candidates[_backupPlanIdx].root->prepareToYield();
            }
        }
        else {
            allPlansSaveState();
        }
    }