Documentation ¶
Index ¶
- Variables
- func RegisterBlockBuilderSchedulerServer(s *grpc.Server, srv BlockBuilderSchedulerServer)
- type AssignJobRequest
- func (*AssignJobRequest) Descriptor() ([]byte, []int)
- func (this *AssignJobRequest) Equal(that interface{}) bool
- func (m *AssignJobRequest) GetWorkerId() string
- func (this *AssignJobRequest) GoString() string
- func (m *AssignJobRequest) Marshal() (dAtA []byte, err error)
- func (m *AssignJobRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *AssignJobRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*AssignJobRequest) ProtoMessage()
- func (m *AssignJobRequest) Reset()
- func (m *AssignJobRequest) Size() (n int)
- func (this *AssignJobRequest) String() string
- func (m *AssignJobRequest) Unmarshal(dAtA []byte) error
- func (m *AssignJobRequest) XXX_DiscardUnknown()
- func (m *AssignJobRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AssignJobRequest) XXX_Merge(src proto.Message)
- func (m *AssignJobRequest) XXX_Size() int
- func (m *AssignJobRequest) XXX_Unmarshal(b []byte) error
- type AssignJobResponse
- func (*AssignJobResponse) Descriptor() ([]byte, []int)
- func (this *AssignJobResponse) Equal(that interface{}) bool
- func (m *AssignJobResponse) GetKey() *JobKey
- func (m *AssignJobResponse) GetSpec() *JobSpec
- func (this *AssignJobResponse) GoString() string
- func (m *AssignJobResponse) Marshal() (dAtA []byte, err error)
- func (m *AssignJobResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *AssignJobResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*AssignJobResponse) ProtoMessage()
- func (m *AssignJobResponse) Reset()
- func (m *AssignJobResponse) Size() (n int)
- func (this *AssignJobResponse) String() string
- func (m *AssignJobResponse) Unmarshal(dAtA []byte) error
- func (m *AssignJobResponse) XXX_DiscardUnknown()
- func (m *AssignJobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AssignJobResponse) XXX_Merge(src proto.Message)
- func (m *AssignJobResponse) XXX_Size() int
- func (m *AssignJobResponse) XXX_Unmarshal(b []byte) error
- type BlockBuilderSchedulerClient
- type BlockBuilderSchedulerServer
- type JobKey
- func (*JobKey) Descriptor() ([]byte, []int)
- func (this *JobKey) Equal(that interface{}) bool
- func (m *JobKey) GetEpoch() int64
- func (m *JobKey) GetId() string
- func (this *JobKey) GoString() string
- func (m *JobKey) Marshal() (dAtA []byte, err error)
- func (m *JobKey) MarshalTo(dAtA []byte) (int, error)
- func (m *JobKey) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*JobKey) ProtoMessage()
- func (m *JobKey) Reset()
- func (m *JobKey) Size() (n int)
- func (this *JobKey) String() string
- func (m *JobKey) Unmarshal(dAtA []byte) error
- func (m *JobKey) XXX_DiscardUnknown()
- func (m *JobKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *JobKey) XXX_Merge(src proto.Message)
- func (m *JobKey) XXX_Size() int
- func (m *JobKey) XXX_Unmarshal(b []byte) error
- type JobSpec
- func (*JobSpec) Descriptor() ([]byte, []int)
- func (this *JobSpec) Equal(that interface{}) bool
- func (m *JobSpec) GetCommitRecTs() time.Time
- func (m *JobSpec) GetEndOffset() int64
- func (m *JobSpec) GetLastBlockEndTs() time.Time
- func (m *JobSpec) GetLastSeenOffset() int64
- func (m *JobSpec) GetPartition() int32
- func (m *JobSpec) GetStartOffset() int64
- func (m *JobSpec) GetTopic() string
- func (this *JobSpec) GoString() string
- func (m *JobSpec) Marshal() (dAtA []byte, err error)
- func (m *JobSpec) MarshalTo(dAtA []byte) (int, error)
- func (m *JobSpec) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*JobSpec) ProtoMessage()
- func (m *JobSpec) Reset()
- func (m *JobSpec) Size() (n int)
- func (this *JobSpec) String() string
- func (m *JobSpec) Unmarshal(dAtA []byte) error
- func (m *JobSpec) XXX_DiscardUnknown()
- func (m *JobSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *JobSpec) XXX_Merge(src proto.Message)
- func (m *JobSpec) XXX_Size() int
- func (m *JobSpec) XXX_Unmarshal(b []byte) error
- type SchedulerClient
- type UnimplementedBlockBuilderSchedulerServer
- type UpdateJobRequest
- func (*UpdateJobRequest) Descriptor() ([]byte, []int)
- func (this *UpdateJobRequest) Equal(that interface{}) bool
- func (m *UpdateJobRequest) GetComplete() bool
- func (m *UpdateJobRequest) GetKey() *JobKey
- func (m *UpdateJobRequest) GetSpec() *JobSpec
- func (m *UpdateJobRequest) GetWorkerId() string
- func (this *UpdateJobRequest) GoString() string
- func (m *UpdateJobRequest) Marshal() (dAtA []byte, err error)
- func (m *UpdateJobRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *UpdateJobRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*UpdateJobRequest) ProtoMessage()
- func (m *UpdateJobRequest) Reset()
- func (m *UpdateJobRequest) Size() (n int)
- func (this *UpdateJobRequest) String() string
- func (m *UpdateJobRequest) Unmarshal(dAtA []byte) error
- func (m *UpdateJobRequest) XXX_DiscardUnknown()
- func (m *UpdateJobRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UpdateJobRequest) XXX_Merge(src proto.Message)
- func (m *UpdateJobRequest) XXX_Size() int
- func (m *UpdateJobRequest) XXX_Unmarshal(b []byte) error
- type UpdateJobResponse
- func (*UpdateJobResponse) Descriptor() ([]byte, []int)
- func (this *UpdateJobResponse) Equal(that interface{}) bool
- func (this *UpdateJobResponse) GoString() string
- func (m *UpdateJobResponse) Marshal() (dAtA []byte, err error)
- func (m *UpdateJobResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *UpdateJobResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*UpdateJobResponse) ProtoMessage()
- func (m *UpdateJobResponse) Reset()
- func (m *UpdateJobResponse) Size() (n int)
- func (this *UpdateJobResponse) String() string
- func (m *UpdateJobResponse) Unmarshal(dAtA []byte) error
- func (m *UpdateJobResponse) XXX_DiscardUnknown()
- func (m *UpdateJobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UpdateJobResponse) XXX_Merge(src proto.Message)
- func (m *UpdateJobResponse) XXX_Size() int
- func (m *UpdateJobResponse) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
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) 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) MarshalToSizedBuffer ¶
func (*JobKey) ProtoMessage ¶
func (*JobKey) ProtoMessage()
func (*JobKey) XXX_DiscardUnknown ¶
func (m *JobKey) XXX_DiscardUnknown()
func (*JobKey) XXX_Marshal ¶
func (*JobKey) XXX_Unmarshal ¶
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) GetCommitRecTs ¶
func (*JobSpec) GetEndOffset ¶
func (*JobSpec) GetLastBlockEndTs ¶
func (*JobSpec) GetLastSeenOffset ¶
func (*JobSpec) GetPartition ¶
func (*JobSpec) GetStartOffset ¶
func (*JobSpec) MarshalToSizedBuffer ¶
func (*JobSpec) ProtoMessage ¶
func (*JobSpec) ProtoMessage()
func (*JobSpec) XXX_DiscardUnknown ¶
func (m *JobSpec) XXX_DiscardUnknown()
func (*JobSpec) XXX_Marshal ¶
func (*JobSpec) XXX_Unmarshal ¶
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) AssignJob(ctx context.Context, req *AssignJobRequest) (*AssignJobResponse, error)
func (*UnimplementedBlockBuilderSchedulerServer) UpdateJob ¶
func (*UnimplementedBlockBuilderSchedulerServer) UpdateJob(ctx context.Context, req *UpdateJobRequest) (*UpdateJobResponse, error)
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) 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