Documentation
¶
Overview ¶
Package state provides representations of the state of a quotascheduler app, as well as transformations that run on a state and ways to persist the state, and emits metrics about the state or its transitions.
Index ¶
- type BatchRunner
- func (b *BatchRunner) Close()
- func (b *BatchRunner) Start(store *nodestore.NodeStore)
- func (b *BatchRunner) TBatchStart()
- func (b *BatchRunner) TBatchWait(requests int)
- func (b *BatchRunner) TryAssign(ctx context.Context, req *swarming.AssignTasksRequest) (atr *swarming.AssignTasksResponse, err error)
- func (b *BatchRunner) TryNotify(ctx context.Context, req *swarming.NotifyTasksRequest) (*swarming.NotifyTasksResponse, error)
- type NodeStoreOperationRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchRunner ¶
type BatchRunner struct {
// contains filtered or unexported fields
}
BatchRunner runs operations in batches.
Requests within a batch are handled in a single read-modify-write transaction, in priority order.
All public methods of BatchRunner are threadsafe.
func NewBatchRunnerForTest ¶
func NewBatchRunnerForTest() *BatchRunner
NewBatchRunnerForTest creates a Batcher for testing purposes.
On a batcher instance created with NewBatchRunnerForTest, the batcher requires calls to TBatchWait and TBatchClose to allow requests to be enqueued and for batches to be allowed to close.
func (*BatchRunner) Close ¶
func (b *BatchRunner) Close()
Close closes a BatchRunner, and waits for it to finish closing.
Any requests that were previously enqueued to this batcher will be allowed to complete. Attempting to send any new requests to this batcher after calling Close will panic.
func (*BatchRunner) Start ¶
func (b *BatchRunner) Start(store *nodestore.NodeStore)
Start starts a BatchRunner (if it hasn't been started already).
It returns immediately.
func (*BatchRunner) TBatchStart ¶
func (b *BatchRunner) TBatchStart()
TBatchStart allows a new batch to start executing, and blocks until it does so.
This is to be used only by tests, on Batcher instances created with NewBatchRunnerForTest.
func (*BatchRunner) TBatchWait ¶
func (b *BatchRunner) TBatchWait(requests int)
TBatchWait blocks until the given number of requests have been included in a batch.
This is to be used only by tests, on Batcher instances created with NewBatchRunnerForTest. Otherwise, this method panics.
func (*BatchRunner) TryAssign ¶
func (b *BatchRunner) TryAssign(ctx context.Context, req *swarming.AssignTasksRequest) (atr *swarming.AssignTasksResponse, err error)
TryAssign runs the given assign request in a batch.
func (*BatchRunner) TryNotify ¶
func (b *BatchRunner) TryNotify(ctx context.Context, req *swarming.NotifyTasksRequest) (*swarming.NotifyTasksResponse, error)
TryNotify runs the given notify request in a batch.
type NodeStoreOperationRunner ¶
type NodeStoreOperationRunner struct {
// contains filtered or unexported fields
}
NodeStoreOperationRunner is a nodestore.Operator implementation for state.Operation.
func NewNodeStoreOperationRunner ¶
func NewNodeStoreOperationRunner(op types.Operation, poolID string) *NodeStoreOperationRunner
NewNodeStoreOperationRunner returns a new operation runner for the given operation.
func (*NodeStoreOperationRunner) Commit ¶
func (n *NodeStoreOperationRunner) Commit(ctx context.Context) error
Commit implements nodestore.Operator.
func (*NodeStoreOperationRunner) Finish ¶
func (n *NodeStoreOperationRunner) Finish(ctx context.Context)
Finish implements nodestore.Operator.
func (*NodeStoreOperationRunner) Modify ¶
func (n *NodeStoreOperationRunner) Modify(ctx context.Context, qs *types.QScheduler) error
Modify implements nodestore.Operator.
Directories
¶
Path | Synopsis |
---|---|
Package metrics provides functions to emit ts_mon and bq metrics.
|
Package metrics provides functions to emit ts_mon and bq metrics. |
Package nodestore implements a datastore-backed persistent store of qscheduler state, that shards state over as many entities as necessary to stay under datastore's single-entity size limit, and uses an in-memory cache to avoid unnecessary datastore reads.
|
Package nodestore implements a datastore-backed persistent store of qscheduler state, that shards state over as many entities as necessary to stay under datastore's single-entity size limit, and uses an in-memory cache to avoid unnecessary datastore reads. |
internal/blob
Package blob defines the proto format used by nodestore.
|
Package blob defines the proto format used by nodestore. |