schedulerpb

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FrontendToSchedulerType_name = map[int32]string{
		0: "INIT",
		1: "ENQUEUE",
		2: "CANCEL",
	}
	FrontendToSchedulerType_value = map[string]int32{
		"INIT":    0,
		"ENQUEUE": 1,
		"CANCEL":  2,
	}
)

Enum value maps for FrontendToSchedulerType.

View Source
var (
	SchedulerToFrontendStatus_name = map[int32]string{
		0: "OK",
		1: "TOO_MANY_REQUESTS_PER_TENANT",
		2: "ERROR",
		3: "SHUTTING_DOWN",
	}
	SchedulerToFrontendStatus_value = map[string]int32{
		"OK":                           0,
		"TOO_MANY_REQUESTS_PER_TENANT": 1,
		"ERROR":                        2,
		"SHUTTING_DOWN":                3,
	}
)

Enum value maps for SchedulerToFrontendStatus.

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrSchedulerIsNotRunning = errors.New("scheduler is not running")
)
View Source
var File_scheduler_schedulerpb_scheduler_proto protoreflect.FileDescriptor
View Source
var SchedulerForFrontend_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "schedulerpb.SchedulerForFrontend",
	HandlerType: (*SchedulerForFrontendServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "FrontendLoop",
			Handler:       _SchedulerForFrontend_FrontendLoop_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "scheduler/schedulerpb/scheduler.proto",
}

SchedulerForFrontend_ServiceDesc is the grpc.ServiceDesc for SchedulerForFrontend service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var SchedulerForQuerier_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "schedulerpb.SchedulerForQuerier",
	HandlerType: (*SchedulerForQuerierServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "NotifyQuerierShutdown",
			Handler:    _SchedulerForQuerier_NotifyQuerierShutdown_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "QuerierLoop",
			Handler:       _SchedulerForQuerier_QuerierLoop_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "scheduler/schedulerpb/scheduler.proto",
}

SchedulerForQuerier_ServiceDesc is the grpc.ServiceDesc for SchedulerForQuerier service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterSchedulerForFrontendServer

func RegisterSchedulerForFrontendServer(s grpc.ServiceRegistrar, srv SchedulerForFrontendServer)

func RegisterSchedulerForQuerierServer

func RegisterSchedulerForQuerierServer(s grpc.ServiceRegistrar, srv SchedulerForQuerierServer)

Types

type FrontendToScheduler

type FrontendToScheduler struct {
	Type FrontendToSchedulerType `protobuf:"varint,1,opt,name=type,proto3,enum=schedulerpb.FrontendToSchedulerType" json:"type,omitempty"`
	// Used by INIT message. Will be put into all requests passed to querier.
	FrontendAddress string `protobuf:"bytes,2,opt,name=frontendAddress,proto3" json:"frontendAddress,omitempty"`
	// Used by ENQUEUE and CANCEL.
	// Each frontend manages its own queryIDs. Different frontends may use same set of query IDs.
	QueryID uint64 `protobuf:"varint,3,opt,name=queryID,proto3" json:"queryID,omitempty"`
	// Following are used by ENQUEUE only.
	UserID       string                `protobuf:"bytes,4,opt,name=userID,proto3" json:"userID,omitempty"`
	HttpRequest  *httpgrpc.HTTPRequest `protobuf:"bytes,5,opt,name=httpRequest,proto3" json:"httpRequest,omitempty"`
	StatsEnabled bool                  `protobuf:"varint,6,opt,name=statsEnabled,proto3" json:"statsEnabled,omitempty"`
	// contains filtered or unexported fields
}

func (*FrontendToScheduler) Descriptor deprecated

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

Deprecated: Use FrontendToScheduler.ProtoReflect.Descriptor instead.

func (*FrontendToScheduler) GetFrontendAddress

func (x *FrontendToScheduler) GetFrontendAddress() string

func (*FrontendToScheduler) GetHttpRequest

func (x *FrontendToScheduler) GetHttpRequest() *httpgrpc.HTTPRequest

func (*FrontendToScheduler) GetQueryID

func (x *FrontendToScheduler) GetQueryID() uint64

func (*FrontendToScheduler) GetStatsEnabled

func (x *FrontendToScheduler) GetStatsEnabled() bool

func (*FrontendToScheduler) GetType

func (*FrontendToScheduler) GetUserID

func (x *FrontendToScheduler) GetUserID() string

func (*FrontendToScheduler) MarshalToSizedBufferVT

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

func (*FrontendToScheduler) MarshalToVT

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

func (*FrontendToScheduler) MarshalVT

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

func (*FrontendToScheduler) ProtoMessage

func (*FrontendToScheduler) ProtoMessage()

func (*FrontendToScheduler) ProtoReflect

func (x *FrontendToScheduler) ProtoReflect() protoreflect.Message

func (*FrontendToScheduler) Reset

func (x *FrontendToScheduler) Reset()

func (*FrontendToScheduler) SizeVT

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

func (*FrontendToScheduler) String

func (x *FrontendToScheduler) String() string

func (*FrontendToScheduler) UnmarshalVT

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

type FrontendToSchedulerType

type FrontendToSchedulerType int32
const (
	FrontendToSchedulerType_INIT    FrontendToSchedulerType = 0
	FrontendToSchedulerType_ENQUEUE FrontendToSchedulerType = 1
	FrontendToSchedulerType_CANCEL  FrontendToSchedulerType = 2
)

func (FrontendToSchedulerType) Descriptor

func (FrontendToSchedulerType) Enum

func (FrontendToSchedulerType) EnumDescriptor deprecated

func (FrontendToSchedulerType) EnumDescriptor() ([]byte, []int)

Deprecated: Use FrontendToSchedulerType.Descriptor instead.

func (FrontendToSchedulerType) Number

func (FrontendToSchedulerType) String

func (x FrontendToSchedulerType) String() string

func (FrontendToSchedulerType) Type

type NotifyQuerierShutdownRequest

type NotifyQuerierShutdownRequest struct {
	QuerierID string `protobuf:"bytes,1,opt,name=querierID,proto3" json:"querierID,omitempty"`
	// contains filtered or unexported fields
}

func (*NotifyQuerierShutdownRequest) Descriptor deprecated

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

Deprecated: Use NotifyQuerierShutdownRequest.ProtoReflect.Descriptor instead.

func (*NotifyQuerierShutdownRequest) GetQuerierID

func (x *NotifyQuerierShutdownRequest) GetQuerierID() string

func (*NotifyQuerierShutdownRequest) MarshalToSizedBufferVT

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

func (*NotifyQuerierShutdownRequest) MarshalToVT

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

func (*NotifyQuerierShutdownRequest) MarshalVT

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

func (*NotifyQuerierShutdownRequest) ProtoMessage

func (*NotifyQuerierShutdownRequest) ProtoMessage()

func (*NotifyQuerierShutdownRequest) ProtoReflect

func (*NotifyQuerierShutdownRequest) Reset

func (x *NotifyQuerierShutdownRequest) Reset()

func (*NotifyQuerierShutdownRequest) SizeVT

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

func (*NotifyQuerierShutdownRequest) String

func (*NotifyQuerierShutdownRequest) UnmarshalVT

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

type NotifyQuerierShutdownResponse

type NotifyQuerierShutdownResponse struct {
	// contains filtered or unexported fields
}

func (*NotifyQuerierShutdownResponse) Descriptor deprecated

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

Deprecated: Use NotifyQuerierShutdownResponse.ProtoReflect.Descriptor instead.

func (*NotifyQuerierShutdownResponse) MarshalToSizedBufferVT

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

func (*NotifyQuerierShutdownResponse) MarshalToVT

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

func (*NotifyQuerierShutdownResponse) MarshalVT

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

func (*NotifyQuerierShutdownResponse) ProtoMessage

func (*NotifyQuerierShutdownResponse) ProtoMessage()

func (*NotifyQuerierShutdownResponse) ProtoReflect

func (*NotifyQuerierShutdownResponse) Reset

func (x *NotifyQuerierShutdownResponse) Reset()

func (*NotifyQuerierShutdownResponse) SizeVT

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

func (*NotifyQuerierShutdownResponse) String

func (*NotifyQuerierShutdownResponse) UnmarshalVT

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

type QuerierToScheduler

type QuerierToScheduler struct {
	QuerierID string `protobuf:"bytes,1,opt,name=querierID,proto3" json:"querierID,omitempty"`
	// contains filtered or unexported fields
}

Querier reports its own clientID when it connects, so that scheduler knows how many *different* queriers are connected. To signal that querier is ready to accept another request, querier sends empty message.

func (*QuerierToScheduler) Descriptor deprecated

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

Deprecated: Use QuerierToScheduler.ProtoReflect.Descriptor instead.

func (*QuerierToScheduler) GetQuerierID

func (x *QuerierToScheduler) GetQuerierID() string

func (*QuerierToScheduler) MarshalToSizedBufferVT

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

func (*QuerierToScheduler) MarshalToVT

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

func (*QuerierToScheduler) MarshalVT

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

func (*QuerierToScheduler) ProtoMessage

func (*QuerierToScheduler) ProtoMessage()

func (*QuerierToScheduler) ProtoReflect

func (x *QuerierToScheduler) ProtoReflect() protoreflect.Message

func (*QuerierToScheduler) Reset

func (x *QuerierToScheduler) Reset()

func (*QuerierToScheduler) SizeVT

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

func (*QuerierToScheduler) String

func (x *QuerierToScheduler) String() string

func (*QuerierToScheduler) UnmarshalVT

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

type SchedulerForFrontendClient

type SchedulerForFrontendClient interface {
	// After calling this method, both Frontend and Scheduler enter a loop. Frontend will keep sending ENQUEUE and
	// CANCEL requests, and scheduler is expected to process them. Scheduler returns one response for each request.
	//
	// Long-running loop is used to detect broken connection between frontend and scheduler. This is important for both
	// parties... if connection breaks, frontend can cancel (and possibly retry on different scheduler) all pending
	// requests sent to this scheduler, while scheduler can cancel queued requests from given frontend.
	FrontendLoop(ctx context.Context, opts ...grpc.CallOption) (SchedulerForFrontend_FrontendLoopClient, error)
}

SchedulerForFrontendClient is the client API for SchedulerForFrontend service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type SchedulerForFrontendServer

type SchedulerForFrontendServer interface {
	// After calling this method, both Frontend and Scheduler enter a loop. Frontend will keep sending ENQUEUE and
	// CANCEL requests, and scheduler is expected to process them. Scheduler returns one response for each request.
	//
	// Long-running loop is used to detect broken connection between frontend and scheduler. This is important for both
	// parties... if connection breaks, frontend can cancel (and possibly retry on different scheduler) all pending
	// requests sent to this scheduler, while scheduler can cancel queued requests from given frontend.
	FrontendLoop(SchedulerForFrontend_FrontendLoopServer) error
	// contains filtered or unexported methods
}

SchedulerForFrontendServer is the server API for SchedulerForFrontend service. All implementations must embed UnimplementedSchedulerForFrontendServer for forward compatibility

type SchedulerForFrontend_FrontendLoopClient

type SchedulerForFrontend_FrontendLoopClient interface {
	Send(*FrontendToScheduler) error
	Recv() (*SchedulerToFrontend, error)
	grpc.ClientStream
}

type SchedulerForFrontend_FrontendLoopServer

type SchedulerForFrontend_FrontendLoopServer interface {
	Send(*SchedulerToFrontend) error
	Recv() (*FrontendToScheduler, error)
	grpc.ServerStream
}

type SchedulerForQuerierClient

type SchedulerForQuerierClient interface {
	// After calling this method, both Querier and Scheduler enter a loop, in which querier waits for
	// "SchedulerToQuerier" messages containing HTTP requests and processes them. After processing the request,
	// querier signals that it is ready to accept another one by sending empty QuerierToScheduler message.
	//
	// Long-running loop is used to detect broken connection between scheduler and querier. This is important
	// for scheduler to keep a list of connected queriers up-to-date.
	QuerierLoop(ctx context.Context, opts ...grpc.CallOption) (SchedulerForQuerier_QuerierLoopClient, error)
	// The querier notifies the query-scheduler that it started a graceful shutdown.
	NotifyQuerierShutdown(ctx context.Context, in *NotifyQuerierShutdownRequest, opts ...grpc.CallOption) (*NotifyQuerierShutdownResponse, error)
}

SchedulerForQuerierClient is the client API for SchedulerForQuerier service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type SchedulerForQuerierServer

type SchedulerForQuerierServer interface {
	// After calling this method, both Querier and Scheduler enter a loop, in which querier waits for
	// "SchedulerToQuerier" messages containing HTTP requests and processes them. After processing the request,
	// querier signals that it is ready to accept another one by sending empty QuerierToScheduler message.
	//
	// Long-running loop is used to detect broken connection between scheduler and querier. This is important
	// for scheduler to keep a list of connected queriers up-to-date.
	QuerierLoop(SchedulerForQuerier_QuerierLoopServer) error
	// The querier notifies the query-scheduler that it started a graceful shutdown.
	NotifyQuerierShutdown(context.Context, *NotifyQuerierShutdownRequest) (*NotifyQuerierShutdownResponse, error)
	// contains filtered or unexported methods
}

SchedulerForQuerierServer is the server API for SchedulerForQuerier service. All implementations must embed UnimplementedSchedulerForQuerierServer for forward compatibility

type SchedulerForQuerier_QuerierLoopClient

type SchedulerForQuerier_QuerierLoopClient interface {
	Send(*QuerierToScheduler) error
	Recv() (*SchedulerToQuerier, error)
	grpc.ClientStream
}

type SchedulerForQuerier_QuerierLoopServer

type SchedulerForQuerier_QuerierLoopServer interface {
	Send(*SchedulerToQuerier) error
	Recv() (*QuerierToScheduler, error)
	grpc.ServerStream
}

type SchedulerToFrontend

type SchedulerToFrontend struct {
	Status SchedulerToFrontendStatus `protobuf:"varint,1,opt,name=status,proto3,enum=schedulerpb.SchedulerToFrontendStatus" json:"status,omitempty"`
	Error  string                    `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*SchedulerToFrontend) Descriptor deprecated

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

Deprecated: Use SchedulerToFrontend.ProtoReflect.Descriptor instead.

func (*SchedulerToFrontend) GetError

func (x *SchedulerToFrontend) GetError() string

func (*SchedulerToFrontend) GetStatus

func (*SchedulerToFrontend) MarshalToSizedBufferVT

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

func (*SchedulerToFrontend) MarshalToVT

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

func (*SchedulerToFrontend) MarshalVT

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

func (*SchedulerToFrontend) ProtoMessage

func (*SchedulerToFrontend) ProtoMessage()

func (*SchedulerToFrontend) ProtoReflect

func (x *SchedulerToFrontend) ProtoReflect() protoreflect.Message

func (*SchedulerToFrontend) Reset

func (x *SchedulerToFrontend) Reset()

func (*SchedulerToFrontend) SizeVT

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

func (*SchedulerToFrontend) String

func (x *SchedulerToFrontend) String() string

func (*SchedulerToFrontend) UnmarshalVT

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

type SchedulerToFrontendStatus

type SchedulerToFrontendStatus int32
const (
	SchedulerToFrontendStatus_OK                           SchedulerToFrontendStatus = 0
	SchedulerToFrontendStatus_TOO_MANY_REQUESTS_PER_TENANT SchedulerToFrontendStatus = 1
	SchedulerToFrontendStatus_ERROR                        SchedulerToFrontendStatus = 2
	SchedulerToFrontendStatus_SHUTTING_DOWN                SchedulerToFrontendStatus = 3
)

func (SchedulerToFrontendStatus) Descriptor

func (SchedulerToFrontendStatus) Enum

func (SchedulerToFrontendStatus) EnumDescriptor deprecated

func (SchedulerToFrontendStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use SchedulerToFrontendStatus.Descriptor instead.

func (SchedulerToFrontendStatus) Number

func (SchedulerToFrontendStatus) String

func (x SchedulerToFrontendStatus) String() string

func (SchedulerToFrontendStatus) Type

type SchedulerToQuerier

type SchedulerToQuerier struct {

	// Query ID as reported by frontend. When querier sends the response back to frontend (using frontendAddress),
	// it identifies the query by using this ID.
	QueryID     uint64                `protobuf:"varint,1,opt,name=queryID,proto3" json:"queryID,omitempty"`
	HttpRequest *httpgrpc.HTTPRequest `protobuf:"bytes,2,opt,name=httpRequest,proto3" json:"httpRequest,omitempty"`
	// Where should querier send HTTP Response to (using FrontendForQuerier interface).
	FrontendAddress string `protobuf:"bytes,3,opt,name=frontendAddress,proto3" json:"frontendAddress,omitempty"`
	// User who initiated the request. Needed to send reply back to frontend.
	UserID string `protobuf:"bytes,4,opt,name=userID,proto3" json:"userID,omitempty"`
	// Whether query statistics tracking should be enabled. The response will include
	// statistics only when this option is enabled.
	StatsEnabled bool `protobuf:"varint,5,opt,name=statsEnabled,proto3" json:"statsEnabled,omitempty"`
	// contains filtered or unexported fields
}

func (*SchedulerToQuerier) Descriptor deprecated

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

Deprecated: Use SchedulerToQuerier.ProtoReflect.Descriptor instead.

func (*SchedulerToQuerier) GetFrontendAddress

func (x *SchedulerToQuerier) GetFrontendAddress() string

func (*SchedulerToQuerier) GetHttpRequest

func (x *SchedulerToQuerier) GetHttpRequest() *httpgrpc.HTTPRequest

func (*SchedulerToQuerier) GetQueryID

func (x *SchedulerToQuerier) GetQueryID() uint64

func (*SchedulerToQuerier) GetStatsEnabled

func (x *SchedulerToQuerier) GetStatsEnabled() bool

func (*SchedulerToQuerier) GetUserID

func (x *SchedulerToQuerier) GetUserID() string

func (*SchedulerToQuerier) MarshalToSizedBufferVT

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

func (*SchedulerToQuerier) MarshalToVT

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

func (*SchedulerToQuerier) MarshalVT

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

func (*SchedulerToQuerier) ProtoMessage

func (*SchedulerToQuerier) ProtoMessage()

func (*SchedulerToQuerier) ProtoReflect

func (x *SchedulerToQuerier) ProtoReflect() protoreflect.Message

func (*SchedulerToQuerier) Reset

func (x *SchedulerToQuerier) Reset()

func (*SchedulerToQuerier) SizeVT

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

func (*SchedulerToQuerier) String

func (x *SchedulerToQuerier) String() string

func (*SchedulerToQuerier) UnmarshalVT

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

type UnimplementedSchedulerForFrontendServer

type UnimplementedSchedulerForFrontendServer struct {
}

UnimplementedSchedulerForFrontendServer must be embedded to have forward compatible implementations.

func (UnimplementedSchedulerForFrontendServer) FrontendLoop

type UnimplementedSchedulerForQuerierServer

type UnimplementedSchedulerForQuerierServer struct {
}

UnimplementedSchedulerForQuerierServer must be embedded to have forward compatible implementations.

func (UnimplementedSchedulerForQuerierServer) QuerierLoop

type UnsafeSchedulerForFrontendServer

type UnsafeSchedulerForFrontendServer interface {
	// contains filtered or unexported methods
}

UnsafeSchedulerForFrontendServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SchedulerForFrontendServer will result in compilation errors.

type UnsafeSchedulerForQuerierServer

type UnsafeSchedulerForQuerierServer interface {
	// contains filtered or unexported methods
}

UnsafeSchedulerForQuerierServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SchedulerForQuerierServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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