executorclient

package
v1.3.7-prerelease21 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package executorclient is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLocalPassthroughMode indicates that the heartbeat loop should stop due to local passthrough mode
	ErrLocalPassthroughMode = errors.New("local passthrough mode: stopping heartbeat loop")
)

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 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
}

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 ExecutorMetadata map[string]string

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]) 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.

func (*MockExecutor[SP]) Stop

func (m *MockExecutor[SP]) Stop()

Stop 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]) 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 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

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) Start

func (m *MockShardProcessor) Start(ctx context.Context) error

Start mocks base method.

func (*MockShardProcessor) Stop

func (m *MockShardProcessor) Stop()

Stop 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

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) Start

Start indicates an expected call of Start.

func (*MockShardProcessorMockRecorder) Stop

Stop indicates an expected call of Stop.

type Params

type Params[SP ShardProcessor] struct {
	fx.In

	YarpcClient           sharddistributorv1.ShardDistributorExecutorAPIYARPCClient
	MetricsScope          tally.Scope
	Logger                log.Logger
	ShardProcessorFactory ShardProcessorFactory[SP]
	Config                clientcommon.Config
	TimeSource            clock.TimeSource
	Metadata              ExecutorMetadata `optional:"true"`
}

type ShardProcessor

type ShardProcessor interface {
	Start(ctx context.Context) error
	Stop()
	GetShardReport() ShardReport
}

type ShardProcessorFactory

type ShardProcessorFactory[SP ShardProcessor] interface {
	NewShardProcessor(shardID string) (SP, error)
}

type ShardReport

type ShardReport struct {
	ShardLoad float64
	Status    types.ShardStatus
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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