Documentation
¶
Index ¶
- Variables
- func Cleanup(record utils.Record)
- func GetWorkQueueElements(rname string) []utils.Record
- func InWorkQueue(rname string) bool
- func InitCouch(couchUrl, dbName string)
- func Process(record utils.Record)
- type BlockPolicy
- type Dispatcher
- type Job
- type Mask
- type Metrics
- type MonteCarloPolicy
- type Policy
- type ResubmitBlockPolicy
- type WorkQueueElement
- type Worker
- type WorkqueueStatus
Constants ¶
This section is empty.
Variables ¶
var Client *couchdb.Client
Client points to CouchDB client
var DB couchdb.DatabaseService
DB points to CouchDB
var JobQueue chan Job
JobQueue is a buffered channel that we can send work requests on.
Functions ¶
func GetWorkQueueElements ¶
GetWorkQueueElements returns list of request in WorkQueue
func InWorkQueue ¶
InWorkQueue returns if given request name in WorkQueue
Types ¶
type BlockPolicy ¶
BlockPolicy defines block policy
func (*BlockPolicy) Split ¶
func (b *BlockPolicy) Split() []couchdb.CouchDoc
Split method satisfy Policy interface
func (*BlockPolicy) Validate ¶
func (b *BlockPolicy) Validate() bool
Split method satisfy Policy interface
type Dispatcher ¶
type Dispatcher struct { // A pool of workers channels that are registered with the dispatcher JobPool chan chan Job MaxWorkers int }
Dispatcher implementation
func NewDispatcher ¶
func NewDispatcher(maxWorkers, maxQueue int, mfile string, minterval int64) *Dispatcher
NewDispatcher returns new instance of Dispatcher type
func (*Dispatcher) Run ¶
func (d *Dispatcher) Run(rtype string, interval, cleanup int64)
Run function starts the worker and dispatch it as go-routine
type Mask ¶
type Mask struct { InclusiveMask bool FirstEvent int64 LastEvent int64 FirstLumi int LastLumi int FirstRun int LstRun int RunAndLumis map[int][]int }
Mask data structure keeps track of run-lumi
type Metrics ¶
type Metrics struct {
Jobs metrics.Counter // number of jobs
}
Metrics of the agent
var WorkqueueMetrics Metrics
WorkqueueMetrics defines various metrics about the agent work
type MonteCarloPolicy ¶
MonteCarloPolicy defines block policy
func (*MonteCarloPolicy) Split ¶
func (b *MonteCarloPolicy) Split() []couchdb.CouchDoc
Split method satisfy Policy interface
func (*MonteCarloPolicy) Validate ¶
func (b *MonteCarloPolicy) Validate() bool
Split method satisfy Policy interface
type Policy ¶
type Policy interface { Split() []WorkQueueElement Validate() bool }
Policy interface defines policy methods
type ResubmitBlockPolicy ¶
ResubmitBlockPolicy defines block policy
func (*ResubmitBlockPolicy) Split ¶
func (b *ResubmitBlockPolicy) Split() []couchdb.CouchDoc
Split method satisfy Policy interface
func (*ResubmitBlockPolicy) Validate ¶
func (b *ResubmitBlockPolicy) Validate() bool
Split method satisfy Policy interface
type WorkQueueElement ¶
type WorkQueueElement struct { couchdb.Document Inputs map[string][]string // {blockName:sites} ParentData map[string][]string // {blockName:sites} PileupData map[string][]string // {blockName:sites} ParentFlag bool NumberOfLumis int NumberOfFiles int NumberOfEvents int Jobs int OpenForNewData bool NoInputUpdate bool NoPileupUpdate bool WMSpec string Mask map[string]int BlowupFactor int ACDC string RequestName string TaskName string Dbs string SiteWhiteList []string SiteBlackList []string Priority int ParentQueueUrl string ChildQueueUrl string PercentSuccess float32 PercentComplete float32 WMBSUrl string FilesProcessed int StartPolicy string EndPolicy string }
WorkQueueElement structure
func (WorkQueueElement) String ¶
func (w WorkQueueElement) String() string
String function implements Stringer interface
type Worker ¶
type Worker struct { Id int JobPool chan chan Job JobChannel chan Job // contains filtered or unexported fields }
Worker represents the worker that executes the job
type WorkqueueStatus ¶
type WorkqueueStatus struct { Addrs []string `json:"addrs"` // list of all IP addresses TimeStamp int64 `json:"ts"` // time stamp Metrics map[string]int64 `json:"metrics"` // workqueue metrics NumberOfRequests int `json:"nRequests"` // number of requests in workqueue }
WorkqueueStatus data type