executorclient

package
v1.3.7-prerelease13 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 added in v1.3.5

func ModuleWithNamespace[SP ShardProcessor](namespace string) fx.Option

ModuleWithNamespace creates an executor module for a specific namespace

func NewMeteredShardDistributorExecutorClient added in v1.3.4

func NewMeteredShardDistributorExecutorClient(client sharddistributorexecutor.Client, metricsScope tally.Scope) sharddistributorexecutor.Client

NewShardDistributorExecutorClient creates a new instance of sharddistributorexecutorClient with retry policy

Types

type Config

type Config struct {
	Namespaces []NamespaceConfig `yaml:"namespaces"`
}

Config represents configuration for multiple namespaces

func (*Config) GetConfigForNamespace added in v1.3.5

func (c *Config) GetConfigForNamespace(namespace string) (*NamespaceConfig, error)

GetConfigForNamespace returns the config for a specific namespace

func (*Config) GetSingleConfig added in v1.3.5

func (c *Config) GetSingleConfig() (*NamespaceConfig, error)

GetSingleConfig returns the config if there's exactly one namespace, otherwise returns an error

func (*Config) Validate added in v1.3.5

func (c *Config) Validate() error

Validate validates the configuration

type Executor

type Executor[SP ShardProcessor] interface {
	Start(ctx context.Context)
	Stop()

	GetShardProcess(ctx context.Context, shardID string) (SP, error)
	// Used during the migration during local-passthrough and local-passthrough-shadow
	AssignShardsFromLocalLogic(ctx context.Context, shardAssignment map[string]*types.ShardAssignment)
}

func NewExecutor

func NewExecutor[SP ShardProcessor](params Params[SP]) (Executor[SP], error)

NewExecutor creates an executor using auto-selection (single namespace only)

func NewExecutorWithNamespace added in v1.3.5

func NewExecutorWithNamespace[SP ShardProcessor](params Params[SP], namespace string) (Executor[SP], error)

NewExecutorWithNamespace creates an executor for a specific namespace

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)

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

func (m *MockExecutor[SP]) GetShardProcess(ctx context.Context, shardID string) (SP, error)

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

func (mr *MockExecutorMockRecorder[SP]) GetShardProcess(ctx, shardID any) *gomock.Call

GetShardProcess indicates an expected call of GetShardProcess.

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 added in v1.3.5

func (m *MockShardProcessor) GetShardReport() ShardReport

GetShardReport mocks base method.

func (*MockShardProcessor) Start

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

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 added in v1.3.5

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 NamespaceConfig added in v1.3.5

type NamespaceConfig struct {
	Namespace         string        `yaml:"namespace"`
	HeartBeatInterval time.Duration `yaml:"heartbeat_interval"`
	MigrationMode     string        `yaml:"migration_mode"`
}

NamespaceConfig represents configuration for a single namespace

func (*NamespaceConfig) GetMigrationMode

func (nc *NamespaceConfig) GetMigrationMode() types.MigrationMode

GetMigrationMode converts the string migration mode to types.MigrationMode using the shared configMode map

type Params

type Params[SP ShardProcessor] struct {
	fx.In

	YarpcClient           sharddistributorv1.ShardDistributorExecutorAPIYARPCClient
	MetricsScope          tally.Scope
	Logger                log.Logger
	ShardProcessorFactory ShardProcessorFactory[SP]
	Config                Config
	TimeSource            clock.TimeSource
}

type ShardProcessor

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

type ShardProcessorFactory

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

type ShardReport added in v1.3.5

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