// GetWorkerAll returns all workers from database.
163868
func (c *ApiController) GetWorkersAll() {
	log.Info("Get all workers")

	workers := models.GetAllWorkers()

	c.Data["json"] = workers
	c.ServeJson()
}
62887
func (d *HypervPS4Driver) GetVirtualMachineNetworkAdapterAddress(vmName string) (string, error) {
	return hyperv.GetVirtualMachineNetworkAdapterAddress(vmName)
}
284277
func (r *GormWorkItemRepository) LoadBatchFromDB(ctx context.Context, ids []uuid.UUID) ([]WorkItemStorage, error) {
	log.Info(nil, map[string]interface{}{
		"wi_ids": ids,
	}, "Loading work items")

	res := []WorkItemStorage{}
	tx := r.db.Model(WorkItemStorage{}).Where("id IN (?)", ids).Find(&res)
	if tx.Error != nil {
		return nil, errors.NewInternalError(ctx, tx.Error)
	}
	return res, nil
}
1295326
func (c *Client) GetJob(appID, jobID string) (*ct.Job, error) {
	job := &ct.Job{}
	return job, c.Get(fmt.Sprintf("/apps/%s/jobs/%s", appID, jobID), job)
}
1120610
func (s *BulkProcessorService) Workers(num int) *BulkProcessorService {
	s.numWorkers = num
	return s
}
1028412
func (ts *Server) GetWorkflow(ctx context.Context, uuid string) (*WorkflowInfo, error) {
	// Read the file.
	filePath := pathForWorkflow(uuid)
	contents, version, err := ts.globalCell.Get(ctx, filePath)
	if err != nil {
		return nil, err
	}

	// Unpack the contents.
	w := &workflowpb.Workflow{}
	if err := proto.Unmarshal(contents, w); err != nil {
		return nil, err
	}

	return &WorkflowInfo{
		version:  version,
		Workflow: w,
	}, nil
}
938477
func (c *Client) GetTaskResult(id int) []string {
	l, _ := c.GetTaskOutput(id, "result")
	return l
}
92269
func (g *BlockGate) GetChainWork(hash *chainhash.Hash) (string, error) {
	return GetChainWork(g.client, hash)
}
1279153
func getResourceIter(context structs.Context, aclObj *acl.ACL, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {
	switch context {
	case structs.Jobs:
		return state.JobsByIDPrefix(ws, namespace, prefix)
	case structs.Evals:
		return state.EvalsByIDPrefix(ws, namespace, prefix)
	case structs.Allocs:
		return state.AllocsByIDPrefix(ws, namespace, prefix)
	case structs.Nodes:
		return state.NodesByIDPrefix(ws, prefix)
	case structs.Deployments:
		return state.DeploymentsByIDPrefix(ws, namespace, prefix)
	default:
		return getEnterpriseResourceIter(context, aclObj, namespace, prefix, ws, state)
	}
}
546984
func (_class DRTaskClass) GetIntroducedSRs(sessionID SessionRef, self DRTaskRef) (_retval []SRRef, _err error) {
	_method := "DR_task.get_introduced_SRs"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertDRTaskRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertSRRefSetToGo(_method + " -> ", _result.Value)
	return
}
770140
func (e *IndexLookUpExecutor) startTableWorker(ctx context.Context, workCh <-chan *lookupTableTask) {
	lookupConcurrencyLimit := e.ctx.GetSessionVars().IndexLookupConcurrency
	e.tblWorkerWg.Add(lookupConcurrencyLimit)
	for i := 0; i < lookupConcurrencyLimit; i++ {
		worker := &tableWorker{
			idxLookup:      e,
			workCh:         workCh,
			finished:       e.finished,
			buildTblReader: e.buildTableReader,
			keepOrder:      e.keepOrder,
			handleIdx:      e.handleIdx,
			isCheckOp:      e.isCheckOp,
			memTracker:     memory.NewTracker(tableWorkerLabel, -1),
		}
		worker.memTracker.AttachTo(e.memTracker)
		ctx1, cancel := context.WithCancel(ctx)
		go func() {
			worker.pickAndExecTask(ctx1)
			cancel()
			e.tblWorkerWg.Done()
		}()
	}
}
854975
func (api *TasksAPI) GetAll(options *TaskGetOptions) (result *TaskList, err error) {
	uri := api.client.Endpoint + taskUrl
	if options != nil {
		uri += getQueryString(options)
	}
	res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
	if err != nil {
		return
	}

	result = &TaskList{}
	err = json.Unmarshal(res, result)

	return
}
3597
func getWorkItemsByFilterExpression(ctx context.Context, db application.DB, filterExpression string, filterParentexists *bool, offset *int, limit *int) ([]workitem.WorkItem, link.WorkItemLinkList, link.AncestorList, error) {
	var result []workitem.WorkItem
	var childLinks link.WorkItemLinkList
	var parents link.AncestorList
	err := application.Transactional(db, func(appl application.Application) error {
		var err error
		// add tree option to query if not already present
		var reqMap map[string]interface{}
		err = json.Unmarshal([]byte(filterExpression), &reqMap)
		if err != nil {
			return errs.Errorf("error unmarshalling query expression for CSV filtering: %s", filterExpression)
		}
		if _, ok := reqMap["$OPTS"]; !ok {
			reqMap["$OPTS"] = make(map[string]interface{})
		}
		// Set "tree-view" to true. We always want tree-view to be enabled
		(reqMap["$OPTS"].(map[string]interface{}))["tree-view"] = true
		updatedFilterExpression, err := json.Marshal(reqMap)
		if err != nil {
			return errs.Errorf("error adding tree opt to query expression for CSV filtering: %s", filterExpression)
		}
		// execute query
		result, _, parents, childLinks, err = appl.SearchItems().Filter(ctx, string(updatedFilterExpression), filterParentexists, offset, limit)
		if err != nil {
			log.Error(ctx, map[string]interface{}{
				"err":               err,
				"filter_expression": filterExpression,
			}, "unable to list the work items")
			return errs.Wrapf(err, "error executing filter expression for CSV filtering: %s", filterExpression)
		}
		return nil
	})
	return result, childLinks, parents, err
}
1160763
func getTaskBucket(tx *boltdd.Tx, allocID, taskName string) (*boltdd.Bucket, error) {
	alloc, err := getAllocationBucket(tx, allocID)
	if err != nil {
		return nil, err
	}

	// Retrieve the specific task bucket
	w := tx.Writable()
	key := taskBucketName(taskName)
	task := alloc.Bucket(key)
	if task == nil {
		if !w {
			return nil, fmt.Errorf("Task bucket doesn't exist and transaction is not writable")
		}

		task, err = alloc.CreateBucket(key)
		if err != nil {
			return nil, err
		}
	}

	return task, nil
}
350972
func (job *QorJob) GetJob() *Job {
	if job.Job != nil {
		return job.Job
	}
	return nil
}
1331167
func getWorkItemsOfLinks(ctx context.Context, appl application.Application, req *http.Request, linksDataArr []*app.WorkItemLinkData) ([]*app.WorkItem, error) {
	// Build our "set" of distinct work item IDs
	idMap := map[uuid.UUID]struct{}{}
	idArr := []uuid.UUID{}
	for _, linkData := range linksDataArr {
		src := linkData.Relationships.Source.Data.ID
		tgt := linkData.Relationships.Target.Data.ID
		if _, ok := idMap[src]; !ok {
			idMap[src] = struct{}{}
			idArr = append(idArr, src)
		}
		if _, ok := idMap[tgt]; !ok {
			idMap[tgt] = struct{}{}
			idArr = append(idArr, tgt)
		}
	}

	// Fetch all work items specified in the array
	res := []*app.WorkItem{}
	for _, id := range idArr {
		wi, err := appl.WorkItems().LoadByID(ctx, id)
		if err != nil {
			return nil, errs.WithStack(err)
		}
		wit, err := appl.WorkItemTypes().Load(ctx, wi.Type)
		if err != nil {
			return nil, errs.Wrapf(err, "failed to load work item type: %s", wi.Type)
		}
		converted, err := ConvertWorkItem(req, *wit, *wi)
		if err != nil {
			return nil, errs.WithStack(err)
		}
		res = append(res, converted)
	}
	return res, nil
}
1217910
func (a *Client) GetWorkflows(params *GetWorkflowsParams, authInfo runtime.ClientAuthInfoWriter) (*GetWorkflowsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetWorkflowsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetWorkflows",
		Method:             "GET",
		PathPattern:        "/workflows",
		ProducesMediaTypes: []string{"application/json", "application/x-gzip"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetWorkflowsReader{formats: a.formats},
		AuthInfo:           authInfo,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetWorkflowsOK), nil
}