// CountClosedWorkflowExecutions executes http://docs.aws.amazon.com/amazonswf/latest/apireference/API_CountClosedWorkflowExecutions.html
777845
func (c *Client) CountClosedWorkflowExecutions(request CountClosedWorkflowExecutionsRequest) (*CountResponse, error) {
	resp := &CountResponse{}
	err := c.swfReqWithResponse("CountClosedWorkflowExecutions", request, resp)
	return resp, err
}
1167960
func (s *HistoryEvent) SetWorkflowExecutionFailedEventAttributes(v *WorkflowExecutionFailedEventAttributes) *HistoryEvent {
	s.WorkflowExecutionFailedEventAttributes = v
	return s
}
1285494
func (c *Client) ListWorkflowTypes(request ListWorkflowTypesRequest) (*ListWorkflowTypesResponse, error) {
	resp := &ListWorkflowTypesResponse{}
	err := c.swfReqWithResponse("ListWorkflowTypes", request, resp)
	return resp, err
}
42977
func (f *Facade) FinishActions(args params.ActionExecutionResults) params.ErrorResults {
	actionFn := common.AuthAndActionFromTagFn(f.accessMachine, f.backend.ActionByTag)
	return common.FinishActions(args, actionFn)
}
609503
func (q *Query) ExecWithCount() (int, error) {
	count := int64(0)
	return int(count), q.Connection.timeFunc("Exec", func() error {
		sql, args := q.ToSQL(nil)
		log(logging.SQL, sql, args...)
		result, err := q.Connection.Store.Exec(sql, args...)
		if err != nil {
			return err
		}

		count, err = result.RowsAffected()
		return err
	})
}
147129
func CloseWorkflowRemoveIncompatibleDecisionInterceptor() DecisionInterceptor {
	return &FuncInterceptor{
		AfterDecisionFn: func(decision *swf.PollForDecisionTaskOutput, ctx *FSMContext, outcome *Outcome) {
			closingDecisionFound := false
			// Search for close decisions
			for _, d := range outcome.Decisions {
				if stringsContain(CloseDecisionTypes(), *d.DecisionType) {
					closingDecisionFound = true
				}
			}

			// If we have a complete decision, search for banned decisions and drop them.
			if closingDecisionFound {
				var decisions []*swf.Decision
				for _, d := range outcome.Decisions {
					if stringsContain(CloseDecisionIncompatableDecisionTypes(), *d.DecisionType) {
						logf(ctx, "fn=CloseWorkflowRemoveIncompatibleDecisionInterceptor at=remove decision-type=%s", *d.DecisionType)
						continue
					}
					decisions = append(decisions, d)
				}
				outcome.Decisions = decisions
			}
		},
	}
}
729384
func (ssa *SQLStorageAuthority) countCertificatesByExactNameImpl(
	db dbSelector,
	domain string,
	earliest,
	latest time.Time,
) (int, error) {
	return ssa.countCertificates(db, domain, earliest, latest, countCertificatesExactSelect)
}
458895
func (s *Subscriptions) IsClosed() bool {
	s.lock.RLock()
	defer s.lock.RUnlock()
	return s.closed
}
554425
func IsExpectedWSCloseError(err error) bool {
	return err == io.EOF || err == io.ErrClosedPipe || websocket.IsCloseError(err,
		websocket.CloseNormalClosure,
		websocket.CloseGoingAway,
		websocket.CloseNoStatusReceived,
		websocket.CloseAbnormalClosure,
	)
}
1184576
func (s *workflowLister) Workflows(namespace string) WorkflowNamespaceLister {
	return workflowNamespaceLister{indexer: s.indexer, namespace: namespace}
}
488496
func CompleteWorkflow() Decider {
	return func(ctx *FSMContext, h *swf.HistoryEvent, data interface{}) Outcome {
		Log.Printf("at=complete-workflow workflowId=%s", LS(ctx.WorkflowId))
		return ctx.CompleteWorkflow(data)
	}
}
826826
func (tpc *TwoPC) CountUnresolvedRedo(ctx context.Context, unresolvedTime time.Time) (int64, error) {
	conn, err := tpc.readPool.Get(ctx)
	if err != nil {
		return 0, err
	}
	defer conn.Recycle()

	bindVars := map[string]*querypb.BindVariable{
		"time_created": sqltypes.Int64BindVariable(unresolvedTime.UnixNano()),
	}
	qr, err := tpc.read(ctx, conn, tpc.countUnresolvedRedo, bindVars)
	if err != nil {
		return 0, err
	}
	if len(qr.Rows) < 1 {
		return 0, nil
	}
	v, _ := sqltypes.ToInt64(qr.Rows[0][0])
	return v, nil
}
843801
func (s *HistoryEvent) SetChildWorkflowExecutionFailedEventAttributes(v *ChildWorkflowExecutionFailedEventAttributes) *HistoryEvent {
	s.ChildWorkflowExecutionFailedEventAttributes = v
	return s
}
1262164
func (s *ChildWorkflowExecutionFailedEventAttributes) SetWorkflowExecution(v *WorkflowExecution) *ChildWorkflowExecutionFailedEventAttributes {
	s.WorkflowExecution = v
	return s
}
1223387
func (c *Client) TerminateWorkflowExecution(request TerminateWorkflowExecution) error {
	err := c.swfReqNoResponse("TerminateWorkflowExecution", request)
	return err
}
980577
func (s *WorkflowExecutionOpenCounts) SetOpenChildWorkflowExecutions(v int64) *WorkflowExecutionOpenCounts {
	s.OpenChildWorkflowExecutions = &v
	return s
}
4153
func (e *executor) executeSumCountShard(ctx context.Context, index string, c *pql.Call, shard uint64) (ValCount, error) {
	span, ctx := tracing.StartSpanFromContext(ctx, "Executor.executeSumCountShard")
	defer span.Finish()

	var filter *Row
	if len(c.Children) == 1 {
		row, err := e.executeBitmapCallShard(ctx, index, c.Children[0], shard)
		if err != nil {
			return ValCount{}, errors.Wrap(err, "executing bitmap call")
		}
		filter = row
	}

	fieldName, _ := c.Args["field"].(string)

	field := e.Holder.Field(index, fieldName)
	if field == nil {
		return ValCount{}, nil
	}

	bsig := field.bsiGroup(fieldName)
	if bsig == nil {
		return ValCount{}, nil
	}

	fragment := e.Holder.fragment(index, fieldName, viewBSIGroupPrefix+fieldName, shard)
	if fragment == nil {
		return ValCount{}, nil
	}

	vsum, vcount, err := fragment.sum(filter, bsig.BitDepth())
	if err != nil {
		return ValCount{}, errors.Wrap(err, "computing sum")
	}
	return ValCount{
		Val:   int64(vsum) + (int64(vcount) * bsig.Min),
		Count: int64(vcount),
	}, nil
}