Documentation
¶
Overview ¶
Package executorclient is a generated GoMock package.
Package executorclient is a generated GoMock package.
Index ¶
- Variables
- func Module[SP ShardProcessor]() fx.Option
- func ModuleWithNamespace[SP ShardProcessor](namespace string) fx.Option
- func NewMeteredShardDistributorExecutorClient(client sharddistributorexecutor.Client, metricsScope tally.Scope) sharddistributorexecutor.Client
- type Client
- type Executor
- type ExecutorMetadata
- type MockClient
- type MockClientMockRecorder
- type MockExecutor
- func (m *MockExecutor[SP]) AssignShardsFromLocalLogic(ctx context.Context, shardAssignment map[string]*types.ShardAssignment) error
- func (m *MockExecutor[SP]) EXPECT() *MockExecutorMockRecorder[SP]
- func (m *MockExecutor[SP]) GetMetadata() map[string]string
- func (m *MockExecutor[SP]) GetNamespace() string
- func (m *MockExecutor[SP]) GetShardProcess(ctx context.Context, shardID string) (SP, error)
- func (m *MockExecutor[SP]) IsOnboardedToSD() bool
- func (m *MockExecutor[SP]) RemoveShardsFromLocalLogic(shardIDs []string) error
- func (m *MockExecutor[SP]) SetMetadata(metadata map[string]string)
- func (m *MockExecutor[SP]) Start(ctx context.Context)
- func (m *MockExecutor[SP]) Stop()
- type MockExecutorMockRecorder
- func (mr *MockExecutorMockRecorder[SP]) AssignShardsFromLocalLogic(ctx, shardAssignment any) *gomock.Call
- func (mr *MockExecutorMockRecorder[SP]) GetMetadata() *gomock.Call
- func (mr *MockExecutorMockRecorder[SP]) GetNamespace() *gomock.Call
- func (mr *MockExecutorMockRecorder[SP]) GetShardProcess(ctx, shardID any) *gomock.Call
- func (mr *MockExecutorMockRecorder[SP]) IsOnboardedToSD() *gomock.Call
- func (mr *MockExecutorMockRecorder[SP]) RemoveShardsFromLocalLogic(shardIDs any) *gomock.Call
- func (mr *MockExecutorMockRecorder[SP]) SetMetadata(metadata any) *gomock.Call
- func (mr *MockExecutorMockRecorder[SP]) Start(ctx any) *gomock.Call
- func (mr *MockExecutorMockRecorder[SP]) Stop() *gomock.Call
- type MockShardDistributorExecutorAPIYARPCClient
- type MockShardDistributorExecutorAPIYARPCClientMockRecorder
- type MockShardProcessor
- type MockShardProcessorFactory
- type MockShardProcessorFactoryMockRecorder
- type MockShardProcessorMockRecorder
- type Params
- type ShardProcessor
- type ShardProcessorFactory
- type ShardReport
Constants ¶
This section is empty.
Variables ¶
var ( // ErrLocalPassthroughMode indicates that the heartbeat loop should stop due to local passthrough mode ErrLocalPassthroughMode = errors.New("local passthrough mode: stopping heartbeat loop") // ErrAssignmentDivergenceLocalShard indicates that the local shard is not reported back from the heartbeat ErrAssignmentDivergenceLocalShard = errors.New("assignment divergence: local shard not in heartbeat or not ready") // ErrAssignmentDivergenceHeartbeatShard indicates that the shard in the heartbeat is not present in the local assignment ErrAssignmentDivergenceHeartbeatShard = errors.New("assignment divergence: heartbeat shard not in local") )
var ErrShardProcessNotFound = errors.New("shard process not found")
ErrShardProcessNotFound is returned by GetShardProcess when this host is not assigned the requested shard. Callers that interpret shard ownership should treat this as an ownership-loss signal rather than an internal error.
Functions ¶
func Module ¶
func Module[SP ShardProcessor]() fx.Option
func ModuleWithNamespace ¶
func ModuleWithNamespace[SP ShardProcessor](namespace string) fx.Option
ModuleWithNamespace creates an executor module for a specific namespace
func NewMeteredShardDistributorExecutorClient ¶
func NewMeteredShardDistributorExecutorClient(client sharddistributorexecutor.Client, metricsScope tally.Scope) sharddistributorexecutor.Client
NewShardDistributorExecutorClient creates a new instance of sharddistributorexecutorClient with retry policy
Types ¶
type Client ¶
type Client interface {
Heartbeat(context.Context, *types.ExecutorHeartbeatRequest, ...yarpc.CallOption) (*types.ExecutorHeartbeatResponse, error)
}
type Executor ¶
type Executor[SP ShardProcessor] interface { Start(ctx context.Context) Stop() GetShardProcess(ctx context.Context, shardID string) (SP, error) // Get the namespace this executor is responsible for GetNamespace() string // Set metadata for the executor SetMetadata(metadata map[string]string) // Get the current metadata of the executor GetMetadata() map[string]string // AssignShardsFromLocalLogic is used for the migration during local-passthrough, local-passthrough-shadow, distributed-passthrough AssignShardsFromLocalLogic(ctx context.Context, shardAssignment map[string]*types.ShardAssignment) error // RemoveShardsFromLocalLogic is used for the migration during local-passthrough, local-passthrough-shadow, distributed-passthrough RemoveShardsFromLocalLogic(shardIDs []string) error // IsOnboardedToSD is returning true if the executor relies on SD for distribution IsOnboardedToSD() bool }
func NewExecutor ¶
func NewExecutor[SP ShardProcessor](params Params[SP]) (Executor[SP], error)
NewExecutor creates an executor using auto-selection (single namespace only)
func NewExecutorWithNamespace ¶
func NewExecutorWithNamespace[SP ShardProcessor](params Params[SP], namespace string) (Executor[SP], error)
NewExecutorWithNamespace creates an executor for a specific namespace
type ExecutorMetadata ¶
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface.
func NewMockClient ¶
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (*MockClient) EXPECT ¶
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockClient) Heartbeat ¶
func (m *MockClient) Heartbeat(arg0 context.Context, arg1 *types.ExecutorHeartbeatRequest, arg2 ...yarpc.CallOption) (*types.ExecutorHeartbeatResponse, error)
Heartbeat mocks base method.
type MockClientMockRecorder ¶
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient.
type MockExecutor ¶
type MockExecutor[SP ShardProcessor] struct { // contains filtered or unexported fields }
MockExecutor is a mock of Executor interface.
func NewMockExecutor ¶
func NewMockExecutor[SP ShardProcessor](ctrl *gomock.Controller) *MockExecutor[SP]
NewMockExecutor creates a new mock instance.
func (*MockExecutor[SP]) AssignShardsFromLocalLogic ¶
func (m *MockExecutor[SP]) AssignShardsFromLocalLogic(ctx context.Context, shardAssignment map[string]*types.ShardAssignment) error
AssignShardsFromLocalLogic mocks base method.
func (*MockExecutor[SP]) EXPECT ¶
func (m *MockExecutor[SP]) EXPECT() *MockExecutorMockRecorder[SP]
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockExecutor[SP]) GetMetadata ¶
func (m *MockExecutor[SP]) GetMetadata() map[string]string
GetMetadata mocks base method.
func (*MockExecutor[SP]) GetNamespace ¶
func (m *MockExecutor[SP]) GetNamespace() string
GetNamespace mocks base method.
func (*MockExecutor[SP]) GetShardProcess ¶
func (m *MockExecutor[SP]) GetShardProcess(ctx context.Context, shardID string) (SP, error)
GetShardProcess mocks base method.
func (*MockExecutor[SP]) IsOnboardedToSD ¶
func (m *MockExecutor[SP]) IsOnboardedToSD() bool
IsOnboardedToSD mocks base method.
func (*MockExecutor[SP]) RemoveShardsFromLocalLogic ¶
func (m *MockExecutor[SP]) RemoveShardsFromLocalLogic(shardIDs []string) error
RemoveShardsFromLocalLogic mocks base method.
func (*MockExecutor[SP]) SetMetadata ¶
func (m *MockExecutor[SP]) SetMetadata(metadata map[string]string)
SetMetadata mocks base method.
func (*MockExecutor[SP]) Start ¶
func (m *MockExecutor[SP]) Start(ctx context.Context)
Start mocks base method.
type MockExecutorMockRecorder ¶
type MockExecutorMockRecorder[SP ShardProcessor] struct { // contains filtered or unexported fields }
MockExecutorMockRecorder is the mock recorder for MockExecutor.
func (*MockExecutorMockRecorder[SP]) AssignShardsFromLocalLogic ¶
func (mr *MockExecutorMockRecorder[SP]) AssignShardsFromLocalLogic(ctx, shardAssignment any) *gomock.Call
AssignShardsFromLocalLogic indicates an expected call of AssignShardsFromLocalLogic.
func (*MockExecutorMockRecorder[SP]) GetMetadata ¶
func (mr *MockExecutorMockRecorder[SP]) GetMetadata() *gomock.Call
GetMetadata indicates an expected call of GetMetadata.
func (*MockExecutorMockRecorder[SP]) GetNamespace ¶
func (mr *MockExecutorMockRecorder[SP]) GetNamespace() *gomock.Call
GetNamespace indicates an expected call of GetNamespace.
func (*MockExecutorMockRecorder[SP]) GetShardProcess ¶
func (mr *MockExecutorMockRecorder[SP]) GetShardProcess(ctx, shardID any) *gomock.Call
GetShardProcess indicates an expected call of GetShardProcess.
func (*MockExecutorMockRecorder[SP]) IsOnboardedToSD ¶
func (mr *MockExecutorMockRecorder[SP]) IsOnboardedToSD() *gomock.Call
IsOnboardedToSD indicates an expected call of IsOnboardedToSD.
func (*MockExecutorMockRecorder[SP]) RemoveShardsFromLocalLogic ¶
func (mr *MockExecutorMockRecorder[SP]) RemoveShardsFromLocalLogic(shardIDs any) *gomock.Call
RemoveShardsFromLocalLogic indicates an expected call of RemoveShardsFromLocalLogic.
func (*MockExecutorMockRecorder[SP]) SetMetadata ¶
func (mr *MockExecutorMockRecorder[SP]) SetMetadata(metadata any) *gomock.Call
SetMetadata indicates an expected call of SetMetadata.
func (*MockExecutorMockRecorder[SP]) Start ¶
func (mr *MockExecutorMockRecorder[SP]) Start(ctx any) *gomock.Call
Start indicates an expected call of Start.
func (*MockExecutorMockRecorder[SP]) Stop ¶
func (mr *MockExecutorMockRecorder[SP]) Stop() *gomock.Call
Stop indicates an expected call of Stop.
type MockShardDistributorExecutorAPIYARPCClient ¶
type MockShardDistributorExecutorAPIYARPCClient struct {
// contains filtered or unexported fields
}
MockShardDistributorExecutorAPIYARPCClient is a mock of ShardDistributorExecutorAPIYARPCClient interface.
func NewMockShardDistributorExecutorAPIYARPCClient ¶
func NewMockShardDistributorExecutorAPIYARPCClient(ctrl *gomock.Controller) *MockShardDistributorExecutorAPIYARPCClient
NewMockShardDistributorExecutorAPIYARPCClient creates a new mock instance.
func (*MockShardDistributorExecutorAPIYARPCClient) EXPECT ¶
func (m *MockShardDistributorExecutorAPIYARPCClient) EXPECT() *MockShardDistributorExecutorAPIYARPCClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockShardDistributorExecutorAPIYARPCClient) Heartbeat ¶
func (m *MockShardDistributorExecutorAPIYARPCClient) Heartbeat(arg0 context.Context, arg1 *sharddistributorv1.HeartbeatRequest, arg2 ...yarpc.CallOption) (*sharddistributorv1.HeartbeatResponse, error)
Heartbeat mocks base method.
type MockShardDistributorExecutorAPIYARPCClientMockRecorder ¶
type MockShardDistributorExecutorAPIYARPCClientMockRecorder struct {
// contains filtered or unexported fields
}
MockShardDistributorExecutorAPIYARPCClientMockRecorder is the mock recorder for MockShardDistributorExecutorAPIYARPCClient.
type MockShardProcessor ¶
type MockShardProcessor struct {
// contains filtered or unexported fields
}
MockShardProcessor is a mock of ShardProcessor interface.
func NewMockShardProcessor ¶
func NewMockShardProcessor(ctrl *gomock.Controller) *MockShardProcessor
NewMockShardProcessor creates a new mock instance.
func (*MockShardProcessor) EXPECT ¶
func (m *MockShardProcessor) EXPECT() *MockShardProcessorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockShardProcessor) GetShardReport ¶
func (m *MockShardProcessor) GetShardReport() ShardReport
GetShardReport mocks base method.
func (*MockShardProcessor) SetShardStatus ¶
func (m *MockShardProcessor) SetShardStatus(arg0 types.ShardStatus)
SetShardStatus mocks base method.
type MockShardProcessorFactory ¶
type MockShardProcessorFactory[SP ShardProcessor] struct { // contains filtered or unexported fields }
MockShardProcessorFactory is a mock of ShardProcessorFactory interface.
func NewMockShardProcessorFactory ¶
func NewMockShardProcessorFactory[SP ShardProcessor](ctrl *gomock.Controller) *MockShardProcessorFactory[SP]
NewMockShardProcessorFactory creates a new mock instance.
func (*MockShardProcessorFactory[SP]) EXPECT ¶
func (m *MockShardProcessorFactory[SP]) EXPECT() *MockShardProcessorFactoryMockRecorder[SP]
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockShardProcessorFactory[SP]) NewShardProcessor ¶
func (m *MockShardProcessorFactory[SP]) NewShardProcessor(shardID string) (SP, error)
NewShardProcessor mocks base method.
type MockShardProcessorFactoryMockRecorder ¶
type MockShardProcessorFactoryMockRecorder[SP ShardProcessor] struct { // contains filtered or unexported fields }
MockShardProcessorFactoryMockRecorder is the mock recorder for MockShardProcessorFactory.
func (*MockShardProcessorFactoryMockRecorder[SP]) NewShardProcessor ¶
func (mr *MockShardProcessorFactoryMockRecorder[SP]) NewShardProcessor(shardID any) *gomock.Call
NewShardProcessor indicates an expected call of NewShardProcessor.
type MockShardProcessorMockRecorder ¶
type MockShardProcessorMockRecorder struct {
// contains filtered or unexported fields
}
MockShardProcessorMockRecorder is the mock recorder for MockShardProcessor.
func (*MockShardProcessorMockRecorder) GetShardReport ¶
func (mr *MockShardProcessorMockRecorder) GetShardReport() *gomock.Call
GetShardReport indicates an expected call of GetShardReport.
func (*MockShardProcessorMockRecorder) SetShardStatus ¶
func (mr *MockShardProcessorMockRecorder) SetShardStatus(arg0 any) *gomock.Call
SetShardStatus indicates an expected call of SetShardStatus.
func (*MockShardProcessorMockRecorder) Start ¶
func (mr *MockShardProcessorMockRecorder) Start(ctx any) *gomock.Call
Start indicates an expected call of Start.
func (*MockShardProcessorMockRecorder) Stop ¶
func (mr *MockShardProcessorMockRecorder) Stop() *gomock.Call
Stop indicates an expected call of Stop.
type Params ¶
type Params[SP ShardProcessor] struct { fx.In ExecutorClient Client MetricsScope tally.Scope Logger log.Logger ShardProcessorFactory ShardProcessorFactory[SP] Config clientcommon.Config TimeSource clock.TimeSource Metadata ExecutorMetadata `optional:"true"` DrainObserver clientcommon.DrainSignalObserver `optional:"true"` }
type ShardProcessor ¶
type ShardProcessor interface {
Start(ctx context.Context) error
Stop()
GetShardReport() ShardReport
SetShardStatus(types.ShardStatus)
}
type ShardProcessorFactory ¶
type ShardProcessorFactory[SP ShardProcessor] interface { NewShardProcessor(shardID string) (SP, error) }
type ShardReport ¶
type ShardReport struct {
ShardLoad float64
Status types.ShardStatus
}