schedulerpb

package
v0.0.0-...-f8e07d0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthScheduler = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowScheduler   = fmt.Errorf("proto: integer overflow")
)

Functions

func RegisterBlockBuilderSchedulerServer

func RegisterBlockBuilderSchedulerServer(s *grpc.Server, srv BlockBuilderSchedulerServer)

Types

type AssignJobRequest

type AssignJobRequest struct {
	WorkerId string `protobuf:"bytes,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"`
}

func (*AssignJobRequest) Descriptor

func (*AssignJobRequest) Descriptor() ([]byte, []int)

func (*AssignJobRequest) Equal

func (this *AssignJobRequest) Equal(that interface{}) bool

func (*AssignJobRequest) GetWorkerId

func (m *AssignJobRequest) GetWorkerId() string

func (*AssignJobRequest) GoString

func (this *AssignJobRequest) GoString() string

func (*AssignJobRequest) Marshal

func (m *AssignJobRequest) Marshal() (dAtA []byte, err error)

func (*AssignJobRequest) MarshalTo

func (m *AssignJobRequest) MarshalTo(dAtA []byte) (int, error)

func (*AssignJobRequest) MarshalToSizedBuffer

func (m *AssignJobRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AssignJobRequest) ProtoMessage

func (*AssignJobRequest) ProtoMessage()

func (*AssignJobRequest) Reset

func (m *AssignJobRequest) Reset()

func (*AssignJobRequest) Size

func (m *AssignJobRequest) Size() (n int)

func (*AssignJobRequest) String

func (this *AssignJobRequest) String() string

func (*AssignJobRequest) Unmarshal

func (m *AssignJobRequest) Unmarshal(dAtA []byte) error

func (*AssignJobRequest) XXX_DiscardUnknown

func (m *AssignJobRequest) XXX_DiscardUnknown()

func (*AssignJobRequest) XXX_Marshal

func (m *AssignJobRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AssignJobRequest) XXX_Merge

func (m *AssignJobRequest) XXX_Merge(src proto.Message)

func (*AssignJobRequest) XXX_Size

func (m *AssignJobRequest) XXX_Size() int

func (*AssignJobRequest) XXX_Unmarshal

func (m *AssignJobRequest) XXX_Unmarshal(b []byte) error

type AssignJobResponse

type AssignJobResponse struct {
	Key  *JobKey  `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Spec *JobSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"`
}

func (*AssignJobResponse) Descriptor

func (*AssignJobResponse) Descriptor() ([]byte, []int)

func (*AssignJobResponse) Equal

func (this *AssignJobResponse) Equal(that interface{}) bool

func (*AssignJobResponse) GetKey

func (m *AssignJobResponse) GetKey() *JobKey

func (*AssignJobResponse) GetSpec

func (m *AssignJobResponse) GetSpec() *JobSpec

func (*AssignJobResponse) GoString

func (this *AssignJobResponse) GoString() string

func (*AssignJobResponse) Marshal

func (m *AssignJobResponse) Marshal() (dAtA []byte, err error)

func (*AssignJobResponse) MarshalTo

func (m *AssignJobResponse) MarshalTo(dAtA []byte) (int, error)

func (*AssignJobResponse) MarshalToSizedBuffer

func (m *AssignJobResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AssignJobResponse) ProtoMessage

func (*AssignJobResponse) ProtoMessage()

func (*AssignJobResponse) Reset

func (m *AssignJobResponse) Reset()

func (*AssignJobResponse) Size

func (m *AssignJobResponse) Size() (n int)

func (*AssignJobResponse) String

func (this *AssignJobResponse) String() string

func (*AssignJobResponse) Unmarshal

func (m *AssignJobResponse) Unmarshal(dAtA []byte) error

func (*AssignJobResponse) XXX_DiscardUnknown

func (m *AssignJobResponse) XXX_DiscardUnknown()

func (*AssignJobResponse) XXX_Marshal

func (m *AssignJobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AssignJobResponse) XXX_Merge

func (m *AssignJobResponse) XXX_Merge(src proto.Message)

func (*AssignJobResponse) XXX_Size

func (m *AssignJobResponse) XXX_Size() int

func (*AssignJobResponse) XXX_Unmarshal

func (m *AssignJobResponse) XXX_Unmarshal(b []byte) error

type BlockBuilderSchedulerClient

type BlockBuilderSchedulerClient interface {
	AssignJob(ctx context.Context, in *AssignJobRequest, opts ...grpc.CallOption) (*AssignJobResponse, error)
	UpdateJob(ctx context.Context, in *UpdateJobRequest, opts ...grpc.CallOption) (*UpdateJobResponse, error)
}

BlockBuilderSchedulerClient is the client API for BlockBuilderScheduler service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewBlockBuilderSchedulerClient

func NewBlockBuilderSchedulerClient(cc *grpc.ClientConn) BlockBuilderSchedulerClient

type BlockBuilderSchedulerServer

type BlockBuilderSchedulerServer interface {
	AssignJob(context.Context, *AssignJobRequest) (*AssignJobResponse, error)
	UpdateJob(context.Context, *UpdateJobRequest) (*UpdateJobResponse, error)
}

BlockBuilderSchedulerServer is the server API for BlockBuilderScheduler service.

type JobKey

type JobKey struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Epoch int64  `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"`
}

func (*JobKey) Descriptor

func (*JobKey) Descriptor() ([]byte, []int)

func (*JobKey) Equal

func (this *JobKey) Equal(that interface{}) bool

func (*JobKey) GetEpoch

func (m *JobKey) GetEpoch() int64

func (*JobKey) GetId

func (m *JobKey) GetId() string

func (*JobKey) GoString

func (this *JobKey) GoString() string

func (*JobKey) Marshal

func (m *JobKey) Marshal() (dAtA []byte, err error)

func (*JobKey) MarshalTo

func (m *JobKey) MarshalTo(dAtA []byte) (int, error)

func (*JobKey) MarshalToSizedBuffer

func (m *JobKey) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*JobKey) ProtoMessage

func (*JobKey) ProtoMessage()

func (*JobKey) Reset

func (m *JobKey) Reset()

func (*JobKey) Size

func (m *JobKey) Size() (n int)

func (*JobKey) String

func (this *JobKey) String() string

func (*JobKey) Unmarshal

func (m *JobKey) Unmarshal(dAtA []byte) error

func (*JobKey) XXX_DiscardUnknown

func (m *JobKey) XXX_DiscardUnknown()

func (*JobKey) XXX_Marshal

func (m *JobKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*JobKey) XXX_Merge

func (m *JobKey) XXX_Merge(src proto.Message)

func (*JobKey) XXX_Size

func (m *JobKey) XXX_Size() int

func (*JobKey) XXX_Unmarshal

func (m *JobKey) XXX_Unmarshal(b []byte) error

type JobSpec

type JobSpec struct {
	Topic          string    `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	Partition      int32     `protobuf:"varint,2,opt,name=partition,proto3" json:"partition,omitempty"`
	StartOffset    int64     `protobuf:"varint,3,opt,name=start_offset,json=startOffset,proto3" json:"start_offset,omitempty"`
	EndOffset      int64     `protobuf:"varint,4,opt,name=end_offset,json=endOffset,proto3" json:"end_offset,omitempty"`
	CommitRecTs    time.Time `protobuf:"bytes,5,opt,name=commitRecTs,proto3,stdtime" json:"commitRecTs"`
	LastSeenOffset int64     `protobuf:"varint,6,opt,name=lastSeenOffset,proto3" json:"lastSeenOffset,omitempty"`
	LastBlockEndTs time.Time `protobuf:"bytes,7,opt,name=lastBlockEndTs,proto3,stdtime" json:"lastBlockEndTs"`
}

func (*JobSpec) Descriptor

func (*JobSpec) Descriptor() ([]byte, []int)

func (*JobSpec) Equal

func (this *JobSpec) Equal(that interface{}) bool

func (*JobSpec) GetCommitRecTs

func (m *JobSpec) GetCommitRecTs() time.Time

func (*JobSpec) GetEndOffset

func (m *JobSpec) GetEndOffset() int64

func (*JobSpec) GetLastBlockEndTs

func (m *JobSpec) GetLastBlockEndTs() time.Time

func (*JobSpec) GetLastSeenOffset

func (m *JobSpec) GetLastSeenOffset() int64

func (*JobSpec) GetPartition

func (m *JobSpec) GetPartition() int32

func (*JobSpec) GetStartOffset

func (m *JobSpec) GetStartOffset() int64

func (*JobSpec) GetTopic

func (m *JobSpec) GetTopic() string

func (*JobSpec) GoString

func (this *JobSpec) GoString() string

func (*JobSpec) Marshal

func (m *JobSpec) Marshal() (dAtA []byte, err error)

func (*JobSpec) MarshalTo

func (m *JobSpec) MarshalTo(dAtA []byte) (int, error)

func (*JobSpec) MarshalToSizedBuffer

func (m *JobSpec) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*JobSpec) ProtoMessage

func (*JobSpec) ProtoMessage()

func (*JobSpec) Reset

func (m *JobSpec) Reset()

func (*JobSpec) Size

func (m *JobSpec) Size() (n int)

func (*JobSpec) String

func (this *JobSpec) String() string

func (*JobSpec) Unmarshal

func (m *JobSpec) Unmarshal(dAtA []byte) error

func (*JobSpec) XXX_DiscardUnknown

func (m *JobSpec) XXX_DiscardUnknown()

func (*JobSpec) XXX_Marshal

func (m *JobSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*JobSpec) XXX_Merge

func (m *JobSpec) XXX_Merge(src proto.Message)

func (*JobSpec) XXX_Size

func (m *JobSpec) XXX_Size() int

func (*JobSpec) XXX_Unmarshal

func (m *JobSpec) XXX_Unmarshal(b []byte) error

type SchedulerClient

type SchedulerClient interface {
	Run(context.Context)
	GetJob(context.Context) (JobKey, JobSpec, error)
	CompleteJob(JobKey) error
}

SchedulerClient is a client for the scheduler service. It encapsulates the communication style expected by the scheduler service:

  • AssignJob is polled repeatedly until a job is available.
  • UpdateJob is called periodically to update the status of all known jobs.

SchedulerClient maintains a history of locally-known jobs that are expired some time after completion.

func NewSchedulerClient

func NewSchedulerClient(workerID string, scheduler BlockBuilderSchedulerClient, logger log.Logger,
	updateInterval time.Duration, maxUpdateAge time.Duration) (SchedulerClient, error)

NewSchedulerClient creates a new SchedulerClient around the given scheduler service client. The client will inform the scheduler service about jobs once per updateInterval, and will forget about jobs that have been complete for at least maxUpdateAge. Thus maxUpdateAge should be at least twice updateInterval.

type UnimplementedBlockBuilderSchedulerServer

type UnimplementedBlockBuilderSchedulerServer struct {
}

UnimplementedBlockBuilderSchedulerServer can be embedded to have forward compatible implementations.

func (*UnimplementedBlockBuilderSchedulerServer) AssignJob

func (*UnimplementedBlockBuilderSchedulerServer) UpdateJob

type UpdateJobRequest

type UpdateJobRequest struct {
	Key      *JobKey  `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	WorkerId string   `protobuf:"bytes,2,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"`
	Spec     *JobSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"`
	Complete bool     `protobuf:"varint,4,opt,name=complete,proto3" json:"complete,omitempty"`
}

func (*UpdateJobRequest) Descriptor

func (*UpdateJobRequest) Descriptor() ([]byte, []int)

func (*UpdateJobRequest) Equal

func (this *UpdateJobRequest) Equal(that interface{}) bool

func (*UpdateJobRequest) GetComplete

func (m *UpdateJobRequest) GetComplete() bool

func (*UpdateJobRequest) GetKey

func (m *UpdateJobRequest) GetKey() *JobKey

func (*UpdateJobRequest) GetSpec

func (m *UpdateJobRequest) GetSpec() *JobSpec

func (*UpdateJobRequest) GetWorkerId

func (m *UpdateJobRequest) GetWorkerId() string

func (*UpdateJobRequest) GoString

func (this *UpdateJobRequest) GoString() string

func (*UpdateJobRequest) Marshal

func (m *UpdateJobRequest) Marshal() (dAtA []byte, err error)

func (*UpdateJobRequest) MarshalTo

func (m *UpdateJobRequest) MarshalTo(dAtA []byte) (int, error)

func (*UpdateJobRequest) MarshalToSizedBuffer

func (m *UpdateJobRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*UpdateJobRequest) ProtoMessage

func (*UpdateJobRequest) ProtoMessage()

func (*UpdateJobRequest) Reset

func (m *UpdateJobRequest) Reset()

func (*UpdateJobRequest) Size

func (m *UpdateJobRequest) Size() (n int)

func (*UpdateJobRequest) String

func (this *UpdateJobRequest) String() string

func (*UpdateJobRequest) Unmarshal

func (m *UpdateJobRequest) Unmarshal(dAtA []byte) error

func (*UpdateJobRequest) XXX_DiscardUnknown

func (m *UpdateJobRequest) XXX_DiscardUnknown()

func (*UpdateJobRequest) XXX_Marshal

func (m *UpdateJobRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpdateJobRequest) XXX_Merge

func (m *UpdateJobRequest) XXX_Merge(src proto.Message)

func (*UpdateJobRequest) XXX_Size

func (m *UpdateJobRequest) XXX_Size() int

func (*UpdateJobRequest) XXX_Unmarshal

func (m *UpdateJobRequest) XXX_Unmarshal(b []byte) error

type UpdateJobResponse

type UpdateJobResponse struct {
}

func (*UpdateJobResponse) Descriptor

func (*UpdateJobResponse) Descriptor() ([]byte, []int)

func (*UpdateJobResponse) Equal

func (this *UpdateJobResponse) Equal(that interface{}) bool

func (*UpdateJobResponse) GoString

func (this *UpdateJobResponse) GoString() string

func (*UpdateJobResponse) Marshal

func (m *UpdateJobResponse) Marshal() (dAtA []byte, err error)

func (*UpdateJobResponse) MarshalTo

func (m *UpdateJobResponse) MarshalTo(dAtA []byte) (int, error)

func (*UpdateJobResponse) MarshalToSizedBuffer

func (m *UpdateJobResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*UpdateJobResponse) ProtoMessage

func (*UpdateJobResponse) ProtoMessage()

func (*UpdateJobResponse) Reset

func (m *UpdateJobResponse) Reset()

func (*UpdateJobResponse) Size

func (m *UpdateJobResponse) Size() (n int)

func (*UpdateJobResponse) String

func (this *UpdateJobResponse) String() string

func (*UpdateJobResponse) Unmarshal

func (m *UpdateJobResponse) Unmarshal(dAtA []byte) error

func (*UpdateJobResponse) XXX_DiscardUnknown

func (m *UpdateJobResponse) XXX_DiscardUnknown()

func (*UpdateJobResponse) XXX_Marshal

func (m *UpdateJobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpdateJobResponse) XXX_Merge

func (m *UpdateJobResponse) XXX_Merge(src proto.Message)

func (*UpdateJobResponse) XXX_Size

func (m *UpdateJobResponse) XXX_Size() int

func (*UpdateJobResponse) XXX_Unmarshal

func (m *UpdateJobResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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