// NewExecutionAbnormalFinish creates an Execution in the ABNORMAL_FINISH state.
504412
func NewExecutionAbnormalFinish(af *AbnormalFinish) *Execution {
	return &Execution{
		Data: &Execution_Data{
			ExecutionType: &Execution_Data_AbnormalFinish{af}}}
}
109779
func NewGroupByFinal(ctx *plan.Context, p *plan.GroupBy) *GroupByFinal {
	m := &GroupByFinal{
		TaskBase: NewTaskBase(ctx),
		p:        p,
		complete: make(chan bool),
	}
	return m
}
192823
func (j *Job) AddAffinity(a *Affinity) *Job {
	j.Affinities = append(j.Affinities, a)
	return j
}
1277371
func (x *Big) IsSubnormal() bool {
	return x.IsFinite() && x.adjusted() < x.Context.minScale()
}
400558
func (mc *MergeControl) mergeFinish(merge *OneMerge) {
	// forceMerge, addIndexes or abortAllmerges may be waiting on
	// merges to finish
	// notifyAll()

	// It's possible we are called twice, eg if there was an error
	// inside mergeInit()
	if merge.registerDone {
		for _, info := range merge.segments {
			delete(mc.mergingSegments, info)
		}
		merge.registerDone = false
	}

	delete(mc.runningMerges, merge)
	if len(mc.runningMerges) == 0 {
		mc.mergeSignal.Signal()
	}
}
1231300
func (sc SigChain) GetExpectedNextHighSkip(mctx MetaContext, uid keybase1.UID) (HighSkip, error) {
	if sc.localChainNextHighSkipOverride != nil {
		return *sc.localChainNextHighSkipOverride, nil
	}
	if len(sc.chainLinks) == 0 {
		return NewInitialHighSkip(), nil
	}
	return sc.GetLastLink().ExpectedNextHighSkip(mctx, uid)
}
570541
func makeAbsoluteIfNecessary(current, root string) (string, error) {
	currentUri, err := url.Parse(current)
	if err != nil {
		return "", err
	}

	if currentUri.IsAbs() {
		return current, nil
	}

	rootUri, err := url.Parse(root)
	if err != nil {
		return "", err
	}

	currentUri.Scheme = rootUri.Scheme
	currentUri.Host = rootUri.Host
	currentUri.User = rootUri.User

	return currentUri.String(), nil
}
254301
func ProbeExecution(argv, env []string, cwd string) *Execution {
	if env == nil {
		env = os.Environ()
	}
	if cwd == "" {
		cwd, _ = os.Getwd()
	}
	return probeExecutionImpl(argv, env, cwd)
}
473882
func NewExecuteSQLArgs(databaseID ID, query string) *ExecuteSQLArgs {
	args := new(ExecuteSQLArgs)
	args.DatabaseID = databaseID
	args.Query = query
	return args
}
431220
func NewCompletion(cancel context.CancelFunc, callback func(err error)) *Completion {
	return &Completion{
		cancel:    cancel,
		completed: make(chan struct{}),
		callback:  callback,
	}
}
762684
func NewDiscoverySupport(v Verifier, e Evaluator, chanConf ChannelConfigGetter) *DiscoverySupport {
	return &DiscoverySupport{Verifier: v, Evaluator: e, ChannelConfigGetter: chanConf}
}
26196
func newRunAutomaton(a *Automaton, maxInterval int, tablesize bool) *RunAutomaton {
	a = determinize(a)
	size := a.numStates()
	if size < 1 {
		size = 1
	}
	points := a.startPoints()
	nPoints := len(points)
	ans := &RunAutomaton{
		maxInterval: maxInterval,
		automaton:   a,
		points:      points,
		initial:     0,
		size:        size,
		accept:      make([]bool, size),
		transitions: make([]int, size*nPoints),
	}
	for i, _ := range ans.transitions {
		ans.transitions[i] = -1
	}
	for n := 0; n < size; n++ {
		ans.accept[n] = a.IsAccept(n)
		for c, point := range ans.points {
			dest := a.step(n, point)
			assert(dest == -1 || dest < size)
			ans.transitions[n*nPoints+c] = dest
		}
	}
	// Set alphabet table for optimal run performance.
	if tablesize {
		panic("not implemented yet")
	}
	return ans
}
610742
func NewProjectionLimit(ctx *plan.Context, p *plan.Projection) *Projection {
	s := &Projection{
		TaskBase: NewTaskBase(ctx),
		p:        p,
	}
	s.Handler = s.limitEvaluator()
	return s
}
1269577
func (s *ConfigRule) SetMaximumExecutionFrequency(v string) *ConfigRule {
	s.MaximumExecutionFrequency = &v
	return s
}
13680
func NewNumericRangeInclusiveQuery(min, max *float64, minInclusive, maxInclusive *bool) *NumericRangeQuery {
	return &NumericRangeQuery{
		Min:          min,
		Max:          max,
		InclusiveMin: minInclusive,
		InclusiveMax: maxInclusive,
	}
}
755584
func NewExecutionFinished(result *JsonResult) *Execution {
	return &Execution{
		Data: &Execution_Data{
			ExecutionType: &Execution_Data_Finished_{
				&Execution_Data_Finished{Data: result}}}}
}
662225
func (s *JobFlowDetail) SetExecutionStatusDetail(v *JobFlowExecutionStatusDetail) *JobFlowDetail {
	s.ExecutionStatusDetail = v
	return s
}