RTJobRunner

package
v0.0.0-...-2dbb50e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandSubstitutes

func ExpandSubstitutes(string_to_expand string, substitutes map[string]*SubstituteData) []map[string]string

func ProcessJobsFromJSON

func ProcessJobsFromJSON(filename string, jh *JobHandler, num_to_run_simultaneously int) error

Types

type BasicResponseResult

type BasicResponseResult struct {
	Err    error
	Result Result
}

func (BasicResponseResult) GetError

func (this BasicResponseResult) GetError() error

func (BasicResponseResult) GetResult

func (this BasicResponseResult) GetResult() Result

type CreateWorkerFunction

type CreateWorkerFunction func() Worker

type JSONCommands

type JSONCommands struct {
	CommandToExecute string                     `json:"commandToExecute"`
	Substitutes      map[string]*SubstituteData `json:"substitutes,omitempty"`
}

type JSONFields

type JSONFields struct {
	AdditionalStatements []string               `json:"additionalStatements,omitempty"`
	ExtraFields          map[string]interface{} `json:"extraFields,omitempty"`
}

type JSONJob

type JSONJob struct {
	JSONCommands
	JSONFields
}

type JSONJobContainer

type JSONJobContainer struct {
	PostJobs      []*JSONJobContainer `json: "postJobs"`
	PreJobs       []*JSONJobContainer `json: "preJobs"`
	Job           *JSONJob            `json: "job"`
	Name          string              `json: "name"`
	NumIterations int                 `json: "numIterations"`
	Attributes    map[string]string   `json: "attributes"`
}

func CreateJHJSONParserString

func CreateJHJSONParserString() *JSONJobContainer

func (JSONJobContainer) GetJob

func (this JSONJobContainer) GetJob() *JSONJob

func (JSONJobContainer) GetName

func (this JSONJobContainer) GetName() string

func (JSONJobContainer) GetPostJobs

func (this JSONJobContainer) GetPostJobs() []*JSONJobContainer

func (JSONJobContainer) GetPreJobs

func (this JSONJobContainer) GetPreJobs() []*JSONJobContainer

type JSONJobProcessor

type JSONJobProcessor struct {
	Name             string
	CommandToExecute string
	OriginalJSONJob  *JSONJob
}

func (JSONJobProcessor) GetName

func (this JSONJobProcessor) GetName() string

type JobHandler

type JobHandler struct {
	PrintIndividualResults bool
	PrintPeriodicResults   bool
	PrintStatistics        bool

	Jobs []*JobInfo
	// contains filtered or unexported fields
}

func NewJobHandler

func NewJobHandler(num_to_setup int, createWorkerFunc CreateWorkerFunction) *JobHandler

func (*JobHandler) AddJob

func (this *JobHandler) AddJob(job *JobInfo)

func (*JobHandler) DoneAddingJobs

func (this *JobHandler) DoneAddingJobs()

func (*JobHandler) DoneJob

func (this *JobHandler) DoneJob(job *JobInfo)

func (*JobHandler) GetJob

func (this *JobHandler) GetJob() *JobInfo

func (*JobHandler) GetJobsFromStdin

func (this *JobHandler) GetJobsFromStdin(jhlo JobHandlerLineOutputFilter)

func (*JobHandler) SetPrintIndividualResults

func (this *JobHandler) SetPrintIndividualResults(val bool)

func (*JobHandler) SetPrintPeriodicResults

func (this *JobHandler) SetPrintPeriodicResults(val bool)

func (*JobHandler) SetPrintStatistics

func (this *JobHandler) SetPrintStatistics(val bool)

func (*JobHandler) WaitForJobsToComplete

func (this *JobHandler) WaitForJobsToComplete()

type JobHandlerLineOutputFilter

type JobHandlerLineOutputFilter func(string) Request //line - outputline - if outputline is empty - dont add anything

type JobInfo

type JobInfo struct {
	Resp Response
	Req  Request
	// contains filtered or unexported fields
}

func NewRTRequestResultObject

func NewRTRequestResultObject(req Request) *JobInfo

func (JobInfo) JobTime

func (this JobInfo) JobTime() time.Duration

type KV

type KV struct {
	// contains filtered or unexported fields
}

type Request

type Request interface {
	GetName() string
}

type Response

type Response interface {
	GetError() error
	GetResult() Result
}

type Result

type Result interface{}

type StringRequest

type StringRequest struct {
	Str string
}

func (StringRequest) GetName

func (this StringRequest) GetName() string

func (StringRequest) GetStr

func (this StringRequest) GetStr() string

type SubstituteData

type SubstituteData struct {
	NumToGenerate int    `json: "numToGenerate,omitempty"`
	Type          string `json: "type,omitempty"` //can be "int|string|random|gaussian"
	Upper         int    `json: "upper,omitempty"`
	Lower         int    `json: "lower,omitempty"`
}

type Worker

type Worker interface {
	PreRun()
	PostRun()
	Run(id int, jh *JobHandler)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL