forge_cluster

package
v0.51.6 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClusterTypeID is the type identifier for a Cluster.
	ClusterTypeID = "forge/cluster"

	// PredClusterToJob is the predicate linking Cluster to a Job.
	PredClusterToJob = quad.IRI("forge/cluster-job")
	// PredClusterToWorker is the predicate linking Cluster to a Worker.
	PredClusterToWorker = quad.IRI("forge/cluster-worker")
)

Variables

View Source
var ClusterAssignJobOpId = ClusterTypeID + "/assign-job"

ClusterAssignJobOpId is the cluster assign job operation id.

View Source
var ClusterAssignPeerOpId = ClusterTypeID + "/assign-peer"

ClusterAssignPeerOpId is the cluster assign peer operation id.

View Source
var ClusterAssignTaskOpId = ClusterTypeID + "/assign-task"

ClusterAssignTaskOpId is the cluster assign task operation id.

View Source
var ClusterAssignWorkerOpId = ClusterTypeID + "/assign-worker"

ClusterAssignWorkerOpId is the cluster assign job operation id.

View Source
var ClusterCompleteJobOpId = ClusterTypeID + "/complete-job"

ClusterCompleteJobOpId is the cluster complete job operation id.

View Source
var ClusterCreateOpId = ClusterTypeID + "/create"

ClusterCreateOpId is the Cluster create operation id.

View Source
var ClusterStartJobOpId = ClusterTypeID + "/start-job"

ClusterStartJobOpId is the cluster start job operation id.

Functions

func AssignClusterLeaderPeer

func AssignClusterLeaderPeer(
	ctx context.Context,
	w world.WorldState,
	sender peer.ID,
	clusterKey string, leaderPeer peer.ID,
) (uint64, bool, error)

AssignClusterLeaderPeer assigns the Cluster controller peer. Returns seqno, sysErr, error.

func AssignJobToCluster

func AssignJobToCluster(
	ctx context.Context,
	w world.WorldState,
	clusterKey, jobKey string,
	sender peer.ID,
) (uint64, bool, error)

AssignJobToCluster assigns an existing Job object to a Cluster. Returns seqno, sysErr, error.

func AssignTaskToCluster

func AssignTaskToCluster(
	ctx context.Context,
	w world.WorldState,
	clusterKey, jobKey, taskKey string,
	sender peer.ID,
) (uint64, bool, error)

AssignTaskToCluster assigns an existing Task object to a Cluster. Returns seqno, sysErr, error.

func AssignWorkerToCluster

func AssignWorkerToCluster(
	ctx context.Context,
	w world.WorldState,
	clusterKey, workerKey string,
	sender peer.ID,
) (uint64, bool, error)

AssignWorkerToCluster assigns an existing Worker object to a Cluster. Returns seqno, sysErr, error.

func CheckClusterHasJob

func CheckClusterHasJob(ctx context.Context, w world.WorldState, clusterKey, jobKey string) (bool, error)

CheckClusterHasJob checks if the cluster is linked to a job.

func CheckClusterType

func CheckClusterType(ctx context.Context, ws world.WorldState, objKey string) error

CheckClusterType checks the type graph quad for a cluster.

func CollectClusterJobs

func CollectClusterJobs(
	ctx context.Context,
	ws world.WorldState,
	clusterKeys ...string,
) ([]*forge_job.Job, []string, error)

CollectClusterJobs collects all active Job linked to by the Cluster. If any of the linked states are invalid, returns an error.

func CollectClusterWorkers

func CollectClusterWorkers(
	ctx context.Context,
	ws world.WorldState,
	clusterKeys ...string,
) ([]*forge_worker.Worker, []string, error)

CollectClusterWorkers collects all Worker linked to by the Cluster. If any of the linked states are invalid, returns an error.

func CompleteJob

func CompleteJob(
	ctx context.Context,
	w world.WorldState,
	clusterKey, jobKey string,
	sender peer.ID,
) (uint64, bool, error)

CompleteJob starts an existing Job linked to the Cluster. Returns seqno, sysErr, error.

func CreateCluster

func CreateCluster(
	ctx context.Context,
	w world.WorldState,
	clusterKey string,
	name string,
	clusterPeerID peer.ID,
	sender peer.ID,
) (uint64, bool, error)

CreateCluster stores a Cluster in a object associated with an existing Cluster. Optionally creates keypairs linked to the Cluster. Returns seqno, sysErr, error.

func EnsureClusterHasJob

func EnsureClusterHasJob(ctx context.Context, w world.WorldState, clusterKey, jobKey string) error

EnsureClusterHasJob checks if the cluster has the job and returns an error otherwise.

func ListClusterJobs

func ListClusterJobs(ctx context.Context, w world.WorldState, clusterKeys ...string) ([]string, error)

ListClusterJobs lists all Job object keys that are linked to by the Cluster.

func ListClusterWorkers

func ListClusterWorkers(ctx context.Context, w world.WorldState, clusterKeys ...string) ([]string, error)

ListClusterWorkers lists all Worker object keys that are linked to by the Cluster.

func LookupClusterOp

func LookupClusterOp(ctx context.Context, opTypeID string) (world.Operation, error)

LookupClusterOp performs the lookup operation for the Cluster op types.

func NewClusterBlock

func NewClusterBlock() block.Block

NewClusterBlock constructs a new Cluster block.

func NewClusterToJobQuad

func NewClusterToJobQuad(clusterObjKey, jobObjKey string) world.GraphQuad

NewClusterToJobQuad creates a quad linking a Cluster to a Job.

func NewClusterToWorkerQuad

func NewClusterToWorkerQuad(clusterObjKey, workerObjKey string) world.GraphQuad

NewClusterToWorkerQuad creates a quad linking a Cluster to a Worker.

func StartJob

func StartJob(
	ctx context.Context,
	w world.WorldState,
	clusterKey, jobKey string,
	sender peer.ID,
) (uint64, bool, error)

StartJob starts an existing Job linked to the Cluster. Returns seqno, sysErr, error.

Types

type Cluster

type Cluster struct {

	// Name is the cluster name.
	// Should be user-readable: like "my-cluster-1"
	// Must be a valid DNS label as defined in RFC 1123.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// PeerId is the identifier of the peer controlling the Cluster.
	// This peer runs the high-level cluster scheduler.
	// Cannot be empty.
	PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// contains filtered or unexported fields
}

Cluster associates a set of Worker with a list of Jobs. The name is used for API calls and command-line / UI tools.

Graph links: - forge/cluster-job: links to ongoing Jobs managed by the Cluster. - forge/cluster-worker: links to Worker schedulable in the Cluster.

There are multiple ways to modify Cluster state: - Job, Target, World: can be modified outside of the scope of the Cluster. - Pass, Execution: assigned peer can submit tx to update w/ validation. - Cluster: assigned peer ID can submit forge/cluster/tx w/ validation. - Cluster: can be updated w/ ops: ClusterCreate, ClusterAssignJob, ClusterDelete

func LookupCluster

func LookupCluster(ctx context.Context, ws world.WorldState, objKey string) (*Cluster, world.ObjectState, error)

LookupCluster looks up a cluster in the world.

func UnmarshalCluster

func UnmarshalCluster(ctx context.Context, bcs *block.Cursor) (*Cluster, error)

UnmarshalCluster unmarshals a worker block from the cursor.

func (*Cluster) CloneMessageVT

func (m *Cluster) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Cluster) CloneVT

func (m *Cluster) CloneVT() *Cluster

func (*Cluster) EqualMessageVT

func (this *Cluster) EqualMessageVT(thatMsg any) bool

func (*Cluster) EqualVT

func (this *Cluster) EqualVT(that *Cluster) bool

func (*Cluster) GetName

func (x *Cluster) GetName() string

func (*Cluster) GetPeerId

func (x *Cluster) GetPeerId() string

func (*Cluster) MarshalBlock

func (e *Cluster) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*Cluster) MarshalJSON

func (x *Cluster) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Cluster to JSON.

func (*Cluster) MarshalProtoJSON

func (x *Cluster) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Cluster message to JSON.

func (*Cluster) MarshalProtoText

func (x *Cluster) MarshalProtoText() string

func (*Cluster) MarshalToSizedBufferVT

func (m *Cluster) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Cluster) MarshalToVT

func (m *Cluster) MarshalToVT(dAtA []byte) (int, error)

func (*Cluster) MarshalVT

func (m *Cluster) MarshalVT() (dAtA []byte, err error)

func (*Cluster) ParsePeerID

func (e *Cluster) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID field.

func (*Cluster) ProtoMessage

func (*Cluster) ProtoMessage()

func (*Cluster) Reset

func (x *Cluster) Reset()

func (*Cluster) SizeVT

func (m *Cluster) SizeVT() (n int)

func (*Cluster) String

func (x *Cluster) String() string

func (*Cluster) UnmarshalBlock

func (e *Cluster) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*Cluster) UnmarshalJSON

func (x *Cluster) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Cluster from JSON.

func (*Cluster) UnmarshalProtoJSON

func (x *Cluster) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Cluster message from JSON.

func (*Cluster) UnmarshalVT

func (m *Cluster) UnmarshalVT(dAtA []byte) error

func (*Cluster) Validate

func (e *Cluster) Validate() error

Validate performs cursory checks of the Cluster object.

type ClusterAssignJobOp

type ClusterAssignJobOp struct {

	// ClusterKey is the object key for the Cluster.
	ClusterKey string `protobuf:"bytes,1,opt,name=cluster_key,json=clusterKey,proto3" json:"clusterKey,omitempty"`
	// JobKey is the object key for the Job.
	JobKey string `protobuf:"bytes,2,opt,name=job_key,json=jobKey,proto3" json:"jobKey,omitempty"`
	// contains filtered or unexported fields
}

ClusterAssignJobOp assigns a Job to a Cluster.

func NewClusterAssignJobOp

func NewClusterAssignJobOp(clusterKey, jobKey string) *ClusterAssignJobOp

NewClusterAssignJobOp constructs a new ClusterAssignJobOp block.

func (*ClusterAssignJobOp) ApplyWorldObjectOp

func (o *ClusterAssignJobOp) ApplyWorldObjectOp(
	ctx context.Context,
	le *logrus.Entry,
	objectHandle world.ObjectState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldObjectOp applies the operation to a world object handle.

func (*ClusterAssignJobOp) ApplyWorldOp

func (o *ClusterAssignJobOp) ApplyWorldOp(
	ctx context.Context,
	le *logrus.Entry,
	worldHandle world.WorldState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldOp applies the operation as a world operation.

func (*ClusterAssignJobOp) CloneMessageVT

func (m *ClusterAssignJobOp) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*ClusterAssignJobOp) CloneVT

func (m *ClusterAssignJobOp) CloneVT() *ClusterAssignJobOp

func (*ClusterAssignJobOp) EqualMessageVT

func (this *ClusterAssignJobOp) EqualMessageVT(thatMsg any) bool

func (*ClusterAssignJobOp) EqualVT

func (this *ClusterAssignJobOp) EqualVT(that *ClusterAssignJobOp) bool

func (*ClusterAssignJobOp) GetClusterKey

func (x *ClusterAssignJobOp) GetClusterKey() string

func (*ClusterAssignJobOp) GetJobKey

func (x *ClusterAssignJobOp) GetJobKey() string

func (*ClusterAssignJobOp) GetOperationTypeId

func (o *ClusterAssignJobOp) GetOperationTypeId() string

GetOperationTypeId returns the operation type identifier.

func (*ClusterAssignJobOp) MarshalBlock

func (o *ClusterAssignJobOp) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*ClusterAssignJobOp) MarshalJSON

func (x *ClusterAssignJobOp) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ClusterAssignJobOp to JSON.

func (*ClusterAssignJobOp) MarshalProtoJSON

func (x *ClusterAssignJobOp) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ClusterAssignJobOp message to JSON.

func (*ClusterAssignJobOp) MarshalProtoText

func (x *ClusterAssignJobOp) MarshalProtoText() string

func (*ClusterAssignJobOp) MarshalToSizedBufferVT

func (m *ClusterAssignJobOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ClusterAssignJobOp) MarshalToVT

func (m *ClusterAssignJobOp) MarshalToVT(dAtA []byte) (int, error)

func (*ClusterAssignJobOp) MarshalVT

func (m *ClusterAssignJobOp) MarshalVT() (dAtA []byte, err error)

func (*ClusterAssignJobOp) ProtoMessage

func (*ClusterAssignJobOp) ProtoMessage()

func (*ClusterAssignJobOp) Reset

func (x *ClusterAssignJobOp) Reset()

func (*ClusterAssignJobOp) SizeVT

func (m *ClusterAssignJobOp) SizeVT() (n int)

func (*ClusterAssignJobOp) String

func (x *ClusterAssignJobOp) String() string

func (*ClusterAssignJobOp) UnmarshalBlock

func (o *ClusterAssignJobOp) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*ClusterAssignJobOp) UnmarshalJSON

func (x *ClusterAssignJobOp) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ClusterAssignJobOp from JSON.

func (*ClusterAssignJobOp) UnmarshalProtoJSON

func (x *ClusterAssignJobOp) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ClusterAssignJobOp message from JSON.

func (*ClusterAssignJobOp) UnmarshalVT

func (m *ClusterAssignJobOp) UnmarshalVT(dAtA []byte) error

func (*ClusterAssignJobOp) Validate

func (o *ClusterAssignJobOp) Validate() error

Validate performs cursory validation of the operation. Should not block.

type ClusterAssignPeerOp

type ClusterAssignPeerOp struct {

	// ClusterKey is the object key for the Cluster.
	ClusterKey string `protobuf:"bytes,1,opt,name=cluster_key,json=clusterKey,proto3" json:"clusterKey,omitempty"`
	// PeerId is the updated peer id for the cluster.
	// Cannot be empty.
	PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// contains filtered or unexported fields
}

ClusterAssignPeerOp sets the peer_id for the Cluster controller. Creates and/or links to a Keypair for the peer id.

func NewClusterAssignPeerOp

func NewClusterAssignPeerOp(clusterKey string, peerID peer.ID) *ClusterAssignPeerOp

NewClusterAssignPeerOp constructs a new ClusterAssignPeerOp block.

func (*ClusterAssignPeerOp) ApplyWorldObjectOp

func (o *ClusterAssignPeerOp) ApplyWorldObjectOp(
	ctx context.Context,
	le *logrus.Entry,
	objectHandle world.ObjectState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldObjectOp applies the operation to a world object handle.

func (*ClusterAssignPeerOp) ApplyWorldOp

func (o *ClusterAssignPeerOp) ApplyWorldOp(
	ctx context.Context,
	le *logrus.Entry,
	worldHandle world.WorldState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldOp applies the operation as a world operation.

func (*ClusterAssignPeerOp) CloneMessageVT

func (*ClusterAssignPeerOp) CloneVT

func (*ClusterAssignPeerOp) EqualMessageVT

func (this *ClusterAssignPeerOp) EqualMessageVT(thatMsg any) bool

func (*ClusterAssignPeerOp) EqualVT

func (this *ClusterAssignPeerOp) EqualVT(that *ClusterAssignPeerOp) bool

func (*ClusterAssignPeerOp) GetClusterKey

func (x *ClusterAssignPeerOp) GetClusterKey() string

func (*ClusterAssignPeerOp) GetOperationTypeId

func (o *ClusterAssignPeerOp) GetOperationTypeId() string

GetOperationTypeId returns the operation type identifier.

func (*ClusterAssignPeerOp) GetPeerId

func (x *ClusterAssignPeerOp) GetPeerId() string

func (*ClusterAssignPeerOp) MarshalBlock

func (o *ClusterAssignPeerOp) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*ClusterAssignPeerOp) MarshalJSON

func (x *ClusterAssignPeerOp) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ClusterAssignPeerOp to JSON.

func (*ClusterAssignPeerOp) MarshalProtoJSON

func (x *ClusterAssignPeerOp) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ClusterAssignPeerOp message to JSON.

func (*ClusterAssignPeerOp) MarshalProtoText

func (x *ClusterAssignPeerOp) MarshalProtoText() string

func (*ClusterAssignPeerOp) MarshalToSizedBufferVT

func (m *ClusterAssignPeerOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ClusterAssignPeerOp) MarshalToVT

func (m *ClusterAssignPeerOp) MarshalToVT(dAtA []byte) (int, error)

func (*ClusterAssignPeerOp) MarshalVT

func (m *ClusterAssignPeerOp) MarshalVT() (dAtA []byte, err error)

func (*ClusterAssignPeerOp) ParsePeerID

func (o *ClusterAssignPeerOp) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID field.

func (*ClusterAssignPeerOp) ProtoMessage

func (*ClusterAssignPeerOp) ProtoMessage()

func (*ClusterAssignPeerOp) Reset

func (x *ClusterAssignPeerOp) Reset()

func (*ClusterAssignPeerOp) SizeVT

func (m *ClusterAssignPeerOp) SizeVT() (n int)

func (*ClusterAssignPeerOp) String

func (x *ClusterAssignPeerOp) String() string

func (*ClusterAssignPeerOp) UnmarshalBlock

func (o *ClusterAssignPeerOp) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*ClusterAssignPeerOp) UnmarshalJSON

func (x *ClusterAssignPeerOp) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ClusterAssignPeerOp from JSON.

func (*ClusterAssignPeerOp) UnmarshalProtoJSON

func (x *ClusterAssignPeerOp) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ClusterAssignPeerOp message from JSON.

func (*ClusterAssignPeerOp) UnmarshalVT

func (m *ClusterAssignPeerOp) UnmarshalVT(dAtA []byte) error

func (*ClusterAssignPeerOp) Validate

func (o *ClusterAssignPeerOp) Validate() error

Validate performs cursory validation of the operation. Should not block.

type ClusterAssignTaskOp

type ClusterAssignTaskOp struct {

	// ClusterKey is the object key for the Cluster.
	ClusterKey string `protobuf:"bytes,1,opt,name=cluster_key,json=clusterKey,proto3" json:"clusterKey,omitempty"`
	// JobKey is the object key for the Job.
	JobKey string `protobuf:"bytes,2,opt,name=job_key,json=jobKey,proto3" json:"jobKey,omitempty"`
	// TaskKey is the object key for the Task.
	TaskKey string `protobuf:"bytes,3,opt,name=task_key,json=taskKey,proto3" json:"taskKey,omitempty"`
	// contains filtered or unexported fields
}

ClusterAssignTaskOp sets the peer_id for a Task to the Cluster peer ID. Verifies that the cluster, job, and task are linked properly.

func NewClusterAssignTaskOp

func NewClusterAssignTaskOp(clusterKey, jobKey, taskKey string) *ClusterAssignTaskOp

NewClusterAssignTaskOp constructs a new ClusterAssignTaskOp block.

func (*ClusterAssignTaskOp) ApplyWorldObjectOp

func (o *ClusterAssignTaskOp) ApplyWorldObjectOp(
	ctx context.Context,
	le *logrus.Entry,
	objectHandle world.ObjectState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldObjectOp applies the operation to a world object handle.

func (*ClusterAssignTaskOp) ApplyWorldOp

func (o *ClusterAssignTaskOp) ApplyWorldOp(
	ctx context.Context,
	le *logrus.Entry,
	worldHandle world.WorldState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldOp applies the operation as a world operation.

func (*ClusterAssignTaskOp) CloneMessageVT

func (*ClusterAssignTaskOp) CloneVT

func (*ClusterAssignTaskOp) EqualMessageVT

func (this *ClusterAssignTaskOp) EqualMessageVT(thatMsg any) bool

func (*ClusterAssignTaskOp) EqualVT

func (this *ClusterAssignTaskOp) EqualVT(that *ClusterAssignTaskOp) bool

func (*ClusterAssignTaskOp) GetClusterKey

func (x *ClusterAssignTaskOp) GetClusterKey() string

func (*ClusterAssignTaskOp) GetJobKey

func (x *ClusterAssignTaskOp) GetJobKey() string

func (*ClusterAssignTaskOp) GetOperationTypeId

func (o *ClusterAssignTaskOp) GetOperationTypeId() string

GetOperationTypeId returns the operation type identifier.

func (*ClusterAssignTaskOp) GetTaskKey

func (x *ClusterAssignTaskOp) GetTaskKey() string

func (*ClusterAssignTaskOp) MarshalBlock

func (o *ClusterAssignTaskOp) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*ClusterAssignTaskOp) MarshalJSON

func (x *ClusterAssignTaskOp) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ClusterAssignTaskOp to JSON.

func (*ClusterAssignTaskOp) MarshalProtoJSON

func (x *ClusterAssignTaskOp) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ClusterAssignTaskOp message to JSON.

func (*ClusterAssignTaskOp) MarshalProtoText

func (x *ClusterAssignTaskOp) MarshalProtoText() string

func (*ClusterAssignTaskOp) MarshalToSizedBufferVT

func (m *ClusterAssignTaskOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ClusterAssignTaskOp) MarshalToVT

func (m *ClusterAssignTaskOp) MarshalToVT(dAtA []byte) (int, error)

func (*ClusterAssignTaskOp) MarshalVT

func (m *ClusterAssignTaskOp) MarshalVT() (dAtA []byte, err error)

func (*ClusterAssignTaskOp) ProtoMessage

func (*ClusterAssignTaskOp) ProtoMessage()

func (*ClusterAssignTaskOp) Reset

func (x *ClusterAssignTaskOp) Reset()

func (*ClusterAssignTaskOp) SizeVT

func (m *ClusterAssignTaskOp) SizeVT() (n int)

func (*ClusterAssignTaskOp) String

func (x *ClusterAssignTaskOp) String() string

func (*ClusterAssignTaskOp) UnmarshalBlock

func (o *ClusterAssignTaskOp) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*ClusterAssignTaskOp) UnmarshalJSON

func (x *ClusterAssignTaskOp) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ClusterAssignTaskOp from JSON.

func (*ClusterAssignTaskOp) UnmarshalProtoJSON

func (x *ClusterAssignTaskOp) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ClusterAssignTaskOp message from JSON.

func (*ClusterAssignTaskOp) UnmarshalVT

func (m *ClusterAssignTaskOp) UnmarshalVT(dAtA []byte) error

func (*ClusterAssignTaskOp) Validate

func (o *ClusterAssignTaskOp) Validate() error

Validate performs cursory validation of the operation. Should not block.

type ClusterAssignWorkerOp

type ClusterAssignWorkerOp struct {

	// ClusterKey is the object key for the Cluster.
	ClusterKey string `protobuf:"bytes,1,opt,name=cluster_key,json=clusterKey,proto3" json:"clusterKey,omitempty"`
	// WorkerKey is the object key for the Worker.
	WorkerKey string `protobuf:"bytes,2,opt,name=worker_key,json=workerKey,proto3" json:"workerKey,omitempty"`
	// contains filtered or unexported fields
}

ClusterAssignWorkerOp assigns a Worker to a Cluster.

func NewClusterAssignWorkerOp

func NewClusterAssignWorkerOp(clusterKey, workerKey string) *ClusterAssignWorkerOp

NewClusterAssignWorkerOp constructs a new ClusterAssignWorkerOp block.

func (*ClusterAssignWorkerOp) ApplyWorldObjectOp

func (o *ClusterAssignWorkerOp) ApplyWorldObjectOp(
	ctx context.Context,
	le *logrus.Entry,
	objectHandle world.ObjectState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldObjectOp applies the operation to a world object handle.

func (*ClusterAssignWorkerOp) ApplyWorldOp

func (o *ClusterAssignWorkerOp) ApplyWorldOp(
	ctx context.Context,
	le *logrus.Entry,
	worldHandle world.WorldState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldOp applies the operation as a world operation.

func (*ClusterAssignWorkerOp) CloneMessageVT

func (*ClusterAssignWorkerOp) CloneVT

func (*ClusterAssignWorkerOp) EqualMessageVT

func (this *ClusterAssignWorkerOp) EqualMessageVT(thatMsg any) bool

func (*ClusterAssignWorkerOp) EqualVT

func (this *ClusterAssignWorkerOp) EqualVT(that *ClusterAssignWorkerOp) bool

func (*ClusterAssignWorkerOp) GetClusterKey

func (x *ClusterAssignWorkerOp) GetClusterKey() string

func (*ClusterAssignWorkerOp) GetOperationTypeId

func (o *ClusterAssignWorkerOp) GetOperationTypeId() string

GetOperationTypeId returns the operation type identifier.

func (*ClusterAssignWorkerOp) GetWorkerKey

func (x *ClusterAssignWorkerOp) GetWorkerKey() string

func (*ClusterAssignWorkerOp) MarshalBlock

func (o *ClusterAssignWorkerOp) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*ClusterAssignWorkerOp) MarshalJSON

func (x *ClusterAssignWorkerOp) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ClusterAssignWorkerOp to JSON.

func (*ClusterAssignWorkerOp) MarshalProtoJSON

func (x *ClusterAssignWorkerOp) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ClusterAssignWorkerOp message to JSON.

func (*ClusterAssignWorkerOp) MarshalProtoText

func (x *ClusterAssignWorkerOp) MarshalProtoText() string

func (*ClusterAssignWorkerOp) MarshalToSizedBufferVT

func (m *ClusterAssignWorkerOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ClusterAssignWorkerOp) MarshalToVT

func (m *ClusterAssignWorkerOp) MarshalToVT(dAtA []byte) (int, error)

func (*ClusterAssignWorkerOp) MarshalVT

func (m *ClusterAssignWorkerOp) MarshalVT() (dAtA []byte, err error)

func (*ClusterAssignWorkerOp) ProtoMessage

func (*ClusterAssignWorkerOp) ProtoMessage()

func (*ClusterAssignWorkerOp) Reset

func (x *ClusterAssignWorkerOp) Reset()

func (*ClusterAssignWorkerOp) SizeVT

func (m *ClusterAssignWorkerOp) SizeVT() (n int)

func (*ClusterAssignWorkerOp) String

func (x *ClusterAssignWorkerOp) String() string

func (*ClusterAssignWorkerOp) UnmarshalBlock

func (o *ClusterAssignWorkerOp) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*ClusterAssignWorkerOp) UnmarshalJSON

func (x *ClusterAssignWorkerOp) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ClusterAssignWorkerOp from JSON.

func (*ClusterAssignWorkerOp) UnmarshalProtoJSON

func (x *ClusterAssignWorkerOp) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ClusterAssignWorkerOp message from JSON.

func (*ClusterAssignWorkerOp) UnmarshalVT

func (m *ClusterAssignWorkerOp) UnmarshalVT(dAtA []byte) error

func (*ClusterAssignWorkerOp) Validate

func (o *ClusterAssignWorkerOp) Validate() error

Validate performs cursory validation of the operation. Should not block.

type ClusterCompleteJobOp

type ClusterCompleteJobOp struct {

	// ClusterKey is the object key for the Cluster.
	ClusterKey string `protobuf:"bytes,1,opt,name=cluster_key,json=clusterKey,proto3" json:"clusterKey,omitempty"`
	// JobKey is the object key for the Job.
	JobKey string `protobuf:"bytes,2,opt,name=job_key,json=jobKey,proto3" json:"jobKey,omitempty"`
	// contains filtered or unexported fields
}

ClusterCompleteJobOp transitions a assigned Job from RUNNING to COMPLETE.

Must be in the RUNNING state. All assigned Task must be in COMPLETE state. If any failed, the Job will also fail.

func NewClusterCompleteJobOp

func NewClusterCompleteJobOp(clusterKey, jobKey string) *ClusterCompleteJobOp

NewClusterCompleteJobOp constructs a new ClusterCompleteJobOp block.

func (*ClusterCompleteJobOp) ApplyWorldObjectOp

func (o *ClusterCompleteJobOp) ApplyWorldObjectOp(
	ctx context.Context,
	le *logrus.Entry,
	objectHandle world.ObjectState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldObjectOp applies the operation to a world object handle.

func (*ClusterCompleteJobOp) ApplyWorldOp

func (o *ClusterCompleteJobOp) ApplyWorldOp(
	ctx context.Context,
	le *logrus.Entry,
	worldHandle world.WorldState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldOp applies the operation as a world operation.

func (*ClusterCompleteJobOp) CloneMessageVT

func (*ClusterCompleteJobOp) CloneVT

func (*ClusterCompleteJobOp) EqualMessageVT

func (this *ClusterCompleteJobOp) EqualMessageVT(thatMsg any) bool

func (*ClusterCompleteJobOp) EqualVT

func (this *ClusterCompleteJobOp) EqualVT(that *ClusterCompleteJobOp) bool

func (*ClusterCompleteJobOp) GetClusterKey

func (x *ClusterCompleteJobOp) GetClusterKey() string

func (*ClusterCompleteJobOp) GetJobKey

func (x *ClusterCompleteJobOp) GetJobKey() string

func (*ClusterCompleteJobOp) GetOperationTypeId

func (o *ClusterCompleteJobOp) GetOperationTypeId() string

GetOperationTypeId returns the operation type identifier.

func (*ClusterCompleteJobOp) MarshalBlock

func (o *ClusterCompleteJobOp) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*ClusterCompleteJobOp) MarshalJSON

func (x *ClusterCompleteJobOp) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ClusterCompleteJobOp to JSON.

func (*ClusterCompleteJobOp) MarshalProtoJSON

func (x *ClusterCompleteJobOp) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ClusterCompleteJobOp message to JSON.

func (*ClusterCompleteJobOp) MarshalProtoText

func (x *ClusterCompleteJobOp) MarshalProtoText() string

func (*ClusterCompleteJobOp) MarshalToSizedBufferVT

func (m *ClusterCompleteJobOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ClusterCompleteJobOp) MarshalToVT

func (m *ClusterCompleteJobOp) MarshalToVT(dAtA []byte) (int, error)

func (*ClusterCompleteJobOp) MarshalVT

func (m *ClusterCompleteJobOp) MarshalVT() (dAtA []byte, err error)

func (*ClusterCompleteJobOp) ProtoMessage

func (*ClusterCompleteJobOp) ProtoMessage()

func (*ClusterCompleteJobOp) Reset

func (x *ClusterCompleteJobOp) Reset()

func (*ClusterCompleteJobOp) SizeVT

func (m *ClusterCompleteJobOp) SizeVT() (n int)

func (*ClusterCompleteJobOp) String

func (x *ClusterCompleteJobOp) String() string

func (*ClusterCompleteJobOp) UnmarshalBlock

func (o *ClusterCompleteJobOp) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*ClusterCompleteJobOp) UnmarshalJSON

func (x *ClusterCompleteJobOp) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ClusterCompleteJobOp from JSON.

func (*ClusterCompleteJobOp) UnmarshalProtoJSON

func (x *ClusterCompleteJobOp) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ClusterCompleteJobOp message from JSON.

func (*ClusterCompleteJobOp) UnmarshalVT

func (m *ClusterCompleteJobOp) UnmarshalVT(dAtA []byte) error

func (*ClusterCompleteJobOp) Validate

func (o *ClusterCompleteJobOp) Validate() error

Validate performs cursory validation of the operation. Should not block.

type ClusterCreateOp

type ClusterCreateOp struct {

	// ClusterKey is the object key for the new Cluster.
	ClusterKey string `protobuf:"bytes,1,opt,name=cluster_key,json=clusterKey,proto3" json:"clusterKey,omitempty"`
	// Name is the name to create.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// PeerId is the identifier of the peer controlling the Cluster.
	// This peer runs the high-level cluster scheduler.
	// Cannot be empty.
	PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// contains filtered or unexported fields
}

ClusterCreateOp creates a new Cluster.

func NewClusterCreateOp

func NewClusterCreateOp(clusterKey, name string, peerID peer.ID) *ClusterCreateOp

NewClusterCreateOp constructs a new ClusterCreateOp block.

func (*ClusterCreateOp) ApplyWorldObjectOp

func (o *ClusterCreateOp) ApplyWorldObjectOp(
	ctx context.Context,
	le *logrus.Entry,
	objectHandle world.ObjectState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldObjectOp applies the operation to a world object handle.

func (*ClusterCreateOp) ApplyWorldOp

func (o *ClusterCreateOp) ApplyWorldOp(
	ctx context.Context,
	le *logrus.Entry,
	worldHandle world.WorldState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldOp applies the operation as a world operation.

func (*ClusterCreateOp) BuildCluster

func (o *ClusterCreateOp) BuildCluster() *Cluster

BuildCluster builds the Cluster object from the create op.

func (*ClusterCreateOp) CloneMessageVT

func (m *ClusterCreateOp) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*ClusterCreateOp) CloneVT

func (m *ClusterCreateOp) CloneVT() *ClusterCreateOp

func (*ClusterCreateOp) EqualMessageVT

func (this *ClusterCreateOp) EqualMessageVT(thatMsg any) bool

func (*ClusterCreateOp) EqualVT

func (this *ClusterCreateOp) EqualVT(that *ClusterCreateOp) bool

func (*ClusterCreateOp) GetClusterKey

func (x *ClusterCreateOp) GetClusterKey() string

func (*ClusterCreateOp) GetName

func (x *ClusterCreateOp) GetName() string

func (*ClusterCreateOp) GetOperationTypeId

func (o *ClusterCreateOp) GetOperationTypeId() string

GetOperationTypeId returns the operation type identifier.

func (*ClusterCreateOp) GetPeerId

func (x *ClusterCreateOp) GetPeerId() string

func (*ClusterCreateOp) MarshalBlock

func (o *ClusterCreateOp) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*ClusterCreateOp) MarshalJSON

func (x *ClusterCreateOp) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ClusterCreateOp to JSON.

func (*ClusterCreateOp) MarshalProtoJSON

func (x *ClusterCreateOp) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ClusterCreateOp message to JSON.

func (*ClusterCreateOp) MarshalProtoText

func (x *ClusterCreateOp) MarshalProtoText() string

func (*ClusterCreateOp) MarshalToSizedBufferVT

func (m *ClusterCreateOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ClusterCreateOp) MarshalToVT

func (m *ClusterCreateOp) MarshalToVT(dAtA []byte) (int, error)

func (*ClusterCreateOp) MarshalVT

func (m *ClusterCreateOp) MarshalVT() (dAtA []byte, err error)

func (*ClusterCreateOp) ProtoMessage

func (*ClusterCreateOp) ProtoMessage()

func (*ClusterCreateOp) Reset

func (x *ClusterCreateOp) Reset()

func (*ClusterCreateOp) SizeVT

func (m *ClusterCreateOp) SizeVT() (n int)

func (*ClusterCreateOp) String

func (x *ClusterCreateOp) String() string

func (*ClusterCreateOp) UnmarshalBlock

func (o *ClusterCreateOp) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*ClusterCreateOp) UnmarshalJSON

func (x *ClusterCreateOp) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ClusterCreateOp from JSON.

func (*ClusterCreateOp) UnmarshalProtoJSON

func (x *ClusterCreateOp) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ClusterCreateOp message from JSON.

func (*ClusterCreateOp) UnmarshalVT

func (m *ClusterCreateOp) UnmarshalVT(dAtA []byte) error

func (*ClusterCreateOp) Validate

func (o *ClusterCreateOp) Validate() error

Validate performs cursory validation of the operation. PeerId is optional here: defaults to sender in ApplyWorldOp.

type ClusterStartJobOp

type ClusterStartJobOp struct {

	// ClusterKey is the object key for the Cluster.
	ClusterKey string `protobuf:"bytes,1,opt,name=cluster_key,json=clusterKey,proto3" json:"clusterKey,omitempty"`
	// JobKey is the object key for the Job.
	JobKey string `protobuf:"bytes,2,opt,name=job_key,json=jobKey,proto3" json:"jobKey,omitempty"`
	// contains filtered or unexported fields
}

ClusterStartJobOp transitions a assigned Job from PENDING to RUNNING.

func NewClusterStartJobOp

func NewClusterStartJobOp(clusterKey, jobKey string) *ClusterStartJobOp

NewClusterStartJobOp constructs a new ClusterStartJobOp block.

func (*ClusterStartJobOp) ApplyWorldObjectOp

func (o *ClusterStartJobOp) ApplyWorldObjectOp(
	ctx context.Context,
	le *logrus.Entry,
	objectHandle world.ObjectState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldObjectOp applies the operation to a world object handle.

func (*ClusterStartJobOp) ApplyWorldOp

func (o *ClusterStartJobOp) ApplyWorldOp(
	ctx context.Context,
	le *logrus.Entry,
	worldHandle world.WorldState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldOp applies the operation as a world operation.

func (*ClusterStartJobOp) CloneMessageVT

func (m *ClusterStartJobOp) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*ClusterStartJobOp) CloneVT

func (m *ClusterStartJobOp) CloneVT() *ClusterStartJobOp

func (*ClusterStartJobOp) EqualMessageVT

func (this *ClusterStartJobOp) EqualMessageVT(thatMsg any) bool

func (*ClusterStartJobOp) EqualVT

func (this *ClusterStartJobOp) EqualVT(that *ClusterStartJobOp) bool

func (*ClusterStartJobOp) GetClusterKey

func (x *ClusterStartJobOp) GetClusterKey() string

func (*ClusterStartJobOp) GetJobKey

func (x *ClusterStartJobOp) GetJobKey() string

func (*ClusterStartJobOp) GetOperationTypeId

func (o *ClusterStartJobOp) GetOperationTypeId() string

GetOperationTypeId returns the operation type identifier.

func (*ClusterStartJobOp) MarshalBlock

func (o *ClusterStartJobOp) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*ClusterStartJobOp) MarshalJSON

func (x *ClusterStartJobOp) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ClusterStartJobOp to JSON.

func (*ClusterStartJobOp) MarshalProtoJSON

func (x *ClusterStartJobOp) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ClusterStartJobOp message to JSON.

func (*ClusterStartJobOp) MarshalProtoText

func (x *ClusterStartJobOp) MarshalProtoText() string

func (*ClusterStartJobOp) MarshalToSizedBufferVT

func (m *ClusterStartJobOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ClusterStartJobOp) MarshalToVT

func (m *ClusterStartJobOp) MarshalToVT(dAtA []byte) (int, error)

func (*ClusterStartJobOp) MarshalVT

func (m *ClusterStartJobOp) MarshalVT() (dAtA []byte, err error)

func (*ClusterStartJobOp) ProtoMessage

func (*ClusterStartJobOp) ProtoMessage()

func (*ClusterStartJobOp) Reset

func (x *ClusterStartJobOp) Reset()

func (*ClusterStartJobOp) SizeVT

func (m *ClusterStartJobOp) SizeVT() (n int)

func (*ClusterStartJobOp) String

func (x *ClusterStartJobOp) String() string

func (*ClusterStartJobOp) UnmarshalBlock

func (o *ClusterStartJobOp) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*ClusterStartJobOp) UnmarshalJSON

func (x *ClusterStartJobOp) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ClusterStartJobOp from JSON.

func (*ClusterStartJobOp) UnmarshalProtoJSON

func (x *ClusterStartJobOp) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ClusterStartJobOp message from JSON.

func (*ClusterStartJobOp) UnmarshalVT

func (m *ClusterStartJobOp) UnmarshalVT(dAtA []byte) error

func (*ClusterStartJobOp) Validate

func (o *ClusterStartJobOp) Validate() error

Validate performs cursory validation of the operation. Should not block.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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