shard

package
v1.2.14-prerelease13 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package shard is a generated GoMock package.

Package shard is a generated GoMock package.

Index

Constants

View Source
const (
	TimeBeforeShardClosedIsError = 10 * time.Second
)

Variables

This section is empty.

Functions

func CreateShardOwnershipLostError

func CreateShardOwnershipLostError(
	currentHost membership.HostInfo,
	ownerHost membership.HostInfo,
) *types.ShardOwnershipLostError

CreateShardOwnershipLostError creates a new shard ownership lost error

func IsShardOwnershiptLostError

func IsShardOwnershiptLostError(err error) bool

IsShardOwnershiptLostError checks if a given error is shard ownership lost error

Types

type Context

type Context interface {
	GetShardID() int
	GetService() resource.Resource
	GetExecutionManager() persistence.ExecutionManager
	GetHistoryManager() persistence.HistoryManager
	GetDomainCache() cache.DomainCache
	GetClusterMetadata() cluster.Metadata
	GetConfig() *config.Config
	GetEventsCache() events.Cache
	GetLogger() log.Logger
	GetThrottledLogger() log.Logger
	GetMetricsClient() metrics.Client
	GetTimeSource() clock.TimeSource
	PreviousShardOwnerWasDifferent() bool

	GetEngine() engine.Engine
	SetEngine(engine.Engine)

	GenerateTransferTaskID() (int64, error)
	GenerateTransferTaskIDs(number int) ([]int64, error)

	GetTransferMaxReadLevel() int64
	UpdateTimerMaxReadLevel(cluster string) time.Time

	SetCurrentTime(cluster string, currentTime time.Time)
	GetCurrentTime(cluster string) time.Time
	GetLastUpdatedTime() time.Time
	GetTimerMaxReadLevel(cluster string) time.Time

	GetTransferAckLevel() int64
	UpdateTransferAckLevel(ackLevel int64) error
	GetTransferClusterAckLevel(cluster string) int64
	UpdateTransferClusterAckLevel(cluster string, ackLevel int64) error
	GetTransferProcessingQueueStates(cluster string) []*types.ProcessingQueueState
	UpdateTransferProcessingQueueStates(cluster string, states []*types.ProcessingQueueState) error

	GetClusterReplicationLevel(cluster string) int64
	UpdateClusterReplicationLevel(cluster string, lastTaskID int64) error

	GetTimerAckLevel() time.Time
	UpdateTimerAckLevel(ackLevel time.Time) error
	GetTimerClusterAckLevel(cluster string) time.Time
	UpdateTimerClusterAckLevel(cluster string, ackLevel time.Time) error
	GetTimerProcessingQueueStates(cluster string) []*types.ProcessingQueueState
	UpdateTimerProcessingQueueStates(cluster string, states []*types.ProcessingQueueState) error

	UpdateTransferFailoverLevel(failoverID string, level TransferFailoverLevel) error
	DeleteTransferFailoverLevel(failoverID string) error
	GetAllTransferFailoverLevels() map[string]TransferFailoverLevel

	UpdateTimerFailoverLevel(failoverID string, level TimerFailoverLevel) error
	DeleteTimerFailoverLevel(failoverID string) error
	GetAllTimerFailoverLevels() map[string]TimerFailoverLevel

	GetDomainNotificationVersion() int64
	UpdateDomainNotificationVersion(domainNotificationVersion int64) error

	GetWorkflowExecution(ctx context.Context, request *persistence.GetWorkflowExecutionRequest) (*persistence.GetWorkflowExecutionResponse, error)
	CreateWorkflowExecution(ctx context.Context, request *persistence.CreateWorkflowExecutionRequest) (*persistence.CreateWorkflowExecutionResponse, error)
	UpdateWorkflowExecution(ctx context.Context, request *persistence.UpdateWorkflowExecutionRequest) (*persistence.UpdateWorkflowExecutionResponse, error)
	ConflictResolveWorkflowExecution(ctx context.Context, request *persistence.ConflictResolveWorkflowExecutionRequest) (*persistence.ConflictResolveWorkflowExecutionResponse, error)
	AppendHistoryV2Events(ctx context.Context, request *persistence.AppendHistoryNodesRequest, domainID string, execution types.WorkflowExecution) (*persistence.AppendHistoryNodesResponse, error)

	ReplicateFailoverMarkers(ctx context.Context, markers []*persistence.FailoverMarkerTask) error
	AddingPendingFailoverMarker(*types.FailoverMarkerAttributes) error
	ValidateAndUpdateFailoverMarkers() ([]*types.FailoverMarkerAttributes, error)
}

Context represents a history engine shard

type Controller

type Controller interface {
	common.Daemon

	// PrepareToStop starts the graceful shutdown process for controller
	PrepareToStop()

	GetEngine(workflowID string) (engine.Engine, error)
	GetEngineForShard(shardID int) (engine.Engine, error)
	RemoveEngineForShard(shardID int)

	// Following methods describes the current status of the controller
	// TODO: consider converting to a unified describe method
	Status() int32
	NumShards() int
	ShardIDs() []int32
}

Controller controls history service shards

func NewShardController

func NewShardController(
	resource resource.Resource,
	factory EngineFactory,
	config *config.Config,
) Controller

NewShardController creates a new shard controller

type EngineFactory

type EngineFactory interface {
	CreateEngine(Context) engine.Engine
}

EngineFactory is used to create an instance of sharded history engine

type ErrShardClosed

type ErrShardClosed struct {
	Msg      string
	ClosedAt time.Time
}

func (*ErrShardClosed) Error added in v1.2.10

func (e *ErrShardClosed) Error() string

type MockContext added in v1.2.9

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

MockContext is a mock of Context interface.

func NewMockContext added in v1.2.9

func NewMockContext(ctrl *gomock.Controller) *MockContext

NewMockContext creates a new mock instance.

func (*MockContext) AddingPendingFailoverMarker added in v1.2.9

func (m *MockContext) AddingPendingFailoverMarker(arg0 *types.FailoverMarkerAttributes) error

AddingPendingFailoverMarker mocks base method.

func (*MockContext) AppendHistoryV2Events added in v1.2.9

AppendHistoryV2Events mocks base method.

func (*MockContext) ConflictResolveWorkflowExecution added in v1.2.9

ConflictResolveWorkflowExecution mocks base method.

func (*MockContext) CreateWorkflowExecution added in v1.2.9

CreateWorkflowExecution mocks base method.

func (*MockContext) DeleteTimerFailoverLevel added in v1.2.9

func (m *MockContext) DeleteTimerFailoverLevel(failoverID string) error

DeleteTimerFailoverLevel mocks base method.

func (*MockContext) DeleteTransferFailoverLevel added in v1.2.9

func (m *MockContext) DeleteTransferFailoverLevel(failoverID string) error

DeleteTransferFailoverLevel mocks base method.

func (*MockContext) EXPECT added in v1.2.9

func (m *MockContext) EXPECT() *MockContextMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockContext) GenerateTransferTaskID added in v1.2.9

func (m *MockContext) GenerateTransferTaskID() (int64, error)

GenerateTransferTaskID mocks base method.

func (*MockContext) GenerateTransferTaskIDs added in v1.2.9

func (m *MockContext) GenerateTransferTaskIDs(number int) ([]int64, error)

GenerateTransferTaskIDs mocks base method.

func (*MockContext) GetAllTimerFailoverLevels added in v1.2.9

func (m *MockContext) GetAllTimerFailoverLevels() map[string]TimerFailoverLevel

GetAllTimerFailoverLevels mocks base method.

func (*MockContext) GetAllTransferFailoverLevels added in v1.2.9

func (m *MockContext) GetAllTransferFailoverLevels() map[string]TransferFailoverLevel

GetAllTransferFailoverLevels mocks base method.

func (*MockContext) GetClusterMetadata added in v1.2.9

func (m *MockContext) GetClusterMetadata() cluster.Metadata

GetClusterMetadata mocks base method.

func (*MockContext) GetClusterReplicationLevel added in v1.2.9

func (m *MockContext) GetClusterReplicationLevel(cluster string) int64

GetClusterReplicationLevel mocks base method.

func (*MockContext) GetConfig added in v1.2.9

func (m *MockContext) GetConfig() *config.Config

GetConfig mocks base method.

func (*MockContext) GetCurrentTime added in v1.2.9

func (m *MockContext) GetCurrentTime(cluster string) time.Time

GetCurrentTime mocks base method.

func (*MockContext) GetDomainCache added in v1.2.9

func (m *MockContext) GetDomainCache() cache.DomainCache

GetDomainCache mocks base method.

func (*MockContext) GetDomainNotificationVersion added in v1.2.9

func (m *MockContext) GetDomainNotificationVersion() int64

GetDomainNotificationVersion mocks base method.

func (*MockContext) GetEngine added in v1.2.9

func (m *MockContext) GetEngine() engine.Engine

GetEngine mocks base method.

func (*MockContext) GetEventsCache added in v1.2.9

func (m *MockContext) GetEventsCache() events.Cache

GetEventsCache mocks base method.

func (*MockContext) GetExecutionManager added in v1.2.9

func (m *MockContext) GetExecutionManager() persistence.ExecutionManager

GetExecutionManager mocks base method.

func (*MockContext) GetHistoryManager added in v1.2.9

func (m *MockContext) GetHistoryManager() persistence.HistoryManager

GetHistoryManager mocks base method.

func (*MockContext) GetLastUpdatedTime added in v1.2.9

func (m *MockContext) GetLastUpdatedTime() time.Time

GetLastUpdatedTime mocks base method.

func (*MockContext) GetLogger added in v1.2.9

func (m *MockContext) GetLogger() log.Logger

GetLogger mocks base method.

func (*MockContext) GetMetricsClient added in v1.2.9

func (m *MockContext) GetMetricsClient() metrics.Client

GetMetricsClient mocks base method.

func (*MockContext) GetService added in v1.2.9

func (m *MockContext) GetService() resource.Resource

GetService mocks base method.

func (*MockContext) GetShardID added in v1.2.9

func (m *MockContext) GetShardID() int

GetShardID mocks base method.

func (*MockContext) GetThrottledLogger added in v1.2.9

func (m *MockContext) GetThrottledLogger() log.Logger

GetThrottledLogger mocks base method.

func (*MockContext) GetTimeSource added in v1.2.9

func (m *MockContext) GetTimeSource() clock.TimeSource

GetTimeSource mocks base method.

func (*MockContext) GetTimerAckLevel added in v1.2.9

func (m *MockContext) GetTimerAckLevel() time.Time

GetTimerAckLevel mocks base method.

func (*MockContext) GetTimerClusterAckLevel added in v1.2.9

func (m *MockContext) GetTimerClusterAckLevel(cluster string) time.Time

GetTimerClusterAckLevel mocks base method.

func (*MockContext) GetTimerMaxReadLevel added in v1.2.9

func (m *MockContext) GetTimerMaxReadLevel(cluster string) time.Time

GetTimerMaxReadLevel mocks base method.

func (*MockContext) GetTimerProcessingQueueStates added in v1.2.9

func (m *MockContext) GetTimerProcessingQueueStates(cluster string) []*types.ProcessingQueueState

GetTimerProcessingQueueStates mocks base method.

func (*MockContext) GetTransferAckLevel added in v1.2.9

func (m *MockContext) GetTransferAckLevel() int64

GetTransferAckLevel mocks base method.

func (*MockContext) GetTransferClusterAckLevel added in v1.2.9

func (m *MockContext) GetTransferClusterAckLevel(cluster string) int64

GetTransferClusterAckLevel mocks base method.

func (*MockContext) GetTransferMaxReadLevel added in v1.2.9

func (m *MockContext) GetTransferMaxReadLevel() int64

GetTransferMaxReadLevel mocks base method.

func (*MockContext) GetTransferProcessingQueueStates added in v1.2.9

func (m *MockContext) GetTransferProcessingQueueStates(cluster string) []*types.ProcessingQueueState

GetTransferProcessingQueueStates mocks base method.

func (*MockContext) GetWorkflowExecution added in v1.2.9

GetWorkflowExecution mocks base method.

func (*MockContext) PreviousShardOwnerWasDifferent added in v1.2.9

func (m *MockContext) PreviousShardOwnerWasDifferent() bool

PreviousShardOwnerWasDifferent mocks base method.

func (*MockContext) ReplicateFailoverMarkers added in v1.2.9

func (m *MockContext) ReplicateFailoverMarkers(ctx context.Context, markers []*persistence.FailoverMarkerTask) error

ReplicateFailoverMarkers mocks base method.

func (*MockContext) SetCurrentTime added in v1.2.9

func (m *MockContext) SetCurrentTime(cluster string, currentTime time.Time)

SetCurrentTime mocks base method.

func (*MockContext) SetEngine added in v1.2.9

func (m *MockContext) SetEngine(arg0 engine.Engine)

SetEngine mocks base method.

func (*MockContext) UpdateClusterReplicationLevel added in v1.2.9

func (m *MockContext) UpdateClusterReplicationLevel(cluster string, lastTaskID int64) error

UpdateClusterReplicationLevel mocks base method.

func (*MockContext) UpdateDomainNotificationVersion added in v1.2.9

func (m *MockContext) UpdateDomainNotificationVersion(domainNotificationVersion int64) error

UpdateDomainNotificationVersion mocks base method.

func (*MockContext) UpdateTimerAckLevel added in v1.2.9

func (m *MockContext) UpdateTimerAckLevel(ackLevel time.Time) error

UpdateTimerAckLevel mocks base method.

func (*MockContext) UpdateTimerClusterAckLevel added in v1.2.9

func (m *MockContext) UpdateTimerClusterAckLevel(cluster string, ackLevel time.Time) error

UpdateTimerClusterAckLevel mocks base method.

func (*MockContext) UpdateTimerFailoverLevel added in v1.2.9

func (m *MockContext) UpdateTimerFailoverLevel(failoverID string, level TimerFailoverLevel) error

UpdateTimerFailoverLevel mocks base method.

func (*MockContext) UpdateTimerMaxReadLevel added in v1.2.9

func (m *MockContext) UpdateTimerMaxReadLevel(cluster string) time.Time

UpdateTimerMaxReadLevel mocks base method.

func (*MockContext) UpdateTimerProcessingQueueStates added in v1.2.9

func (m *MockContext) UpdateTimerProcessingQueueStates(cluster string, states []*types.ProcessingQueueState) error

UpdateTimerProcessingQueueStates mocks base method.

func (*MockContext) UpdateTransferAckLevel added in v1.2.9

func (m *MockContext) UpdateTransferAckLevel(ackLevel int64) error

UpdateTransferAckLevel mocks base method.

func (*MockContext) UpdateTransferClusterAckLevel added in v1.2.9

func (m *MockContext) UpdateTransferClusterAckLevel(cluster string, ackLevel int64) error

UpdateTransferClusterAckLevel mocks base method.

func (*MockContext) UpdateTransferFailoverLevel added in v1.2.9

func (m *MockContext) UpdateTransferFailoverLevel(failoverID string, level TransferFailoverLevel) error

UpdateTransferFailoverLevel mocks base method.

func (*MockContext) UpdateTransferProcessingQueueStates added in v1.2.9

func (m *MockContext) UpdateTransferProcessingQueueStates(cluster string, states []*types.ProcessingQueueState) error

UpdateTransferProcessingQueueStates mocks base method.

func (*MockContext) UpdateWorkflowExecution added in v1.2.9

UpdateWorkflowExecution mocks base method.

func (*MockContext) ValidateAndUpdateFailoverMarkers added in v1.2.9

func (m *MockContext) ValidateAndUpdateFailoverMarkers() ([]*types.FailoverMarkerAttributes, error)

ValidateAndUpdateFailoverMarkers mocks base method.

type MockContextMockRecorder added in v1.2.9

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

MockContextMockRecorder is the mock recorder for MockContext.

func (*MockContextMockRecorder) AddingPendingFailoverMarker added in v1.2.9

func (mr *MockContextMockRecorder) AddingPendingFailoverMarker(arg0 interface{}) *gomock.Call

AddingPendingFailoverMarker indicates an expected call of AddingPendingFailoverMarker.

func (*MockContextMockRecorder) AppendHistoryV2Events added in v1.2.9

func (mr *MockContextMockRecorder) AppendHistoryV2Events(ctx, request, domainID, execution interface{}) *gomock.Call

AppendHistoryV2Events indicates an expected call of AppendHistoryV2Events.

func (*MockContextMockRecorder) ConflictResolveWorkflowExecution added in v1.2.9

func (mr *MockContextMockRecorder) ConflictResolveWorkflowExecution(ctx, request interface{}) *gomock.Call

ConflictResolveWorkflowExecution indicates an expected call of ConflictResolveWorkflowExecution.

func (*MockContextMockRecorder) CreateWorkflowExecution added in v1.2.9

func (mr *MockContextMockRecorder) CreateWorkflowExecution(ctx, request interface{}) *gomock.Call

CreateWorkflowExecution indicates an expected call of CreateWorkflowExecution.

func (*MockContextMockRecorder) DeleteTimerFailoverLevel added in v1.2.9

func (mr *MockContextMockRecorder) DeleteTimerFailoverLevel(failoverID interface{}) *gomock.Call

DeleteTimerFailoverLevel indicates an expected call of DeleteTimerFailoverLevel.

func (*MockContextMockRecorder) DeleteTransferFailoverLevel added in v1.2.9

func (mr *MockContextMockRecorder) DeleteTransferFailoverLevel(failoverID interface{}) *gomock.Call

DeleteTransferFailoverLevel indicates an expected call of DeleteTransferFailoverLevel.

func (*MockContextMockRecorder) GenerateTransferTaskID added in v1.2.9

func (mr *MockContextMockRecorder) GenerateTransferTaskID() *gomock.Call

GenerateTransferTaskID indicates an expected call of GenerateTransferTaskID.

func (*MockContextMockRecorder) GenerateTransferTaskIDs added in v1.2.9

func (mr *MockContextMockRecorder) GenerateTransferTaskIDs(number interface{}) *gomock.Call

GenerateTransferTaskIDs indicates an expected call of GenerateTransferTaskIDs.

func (*MockContextMockRecorder) GetAllTimerFailoverLevels added in v1.2.9

func (mr *MockContextMockRecorder) GetAllTimerFailoverLevels() *gomock.Call

GetAllTimerFailoverLevels indicates an expected call of GetAllTimerFailoverLevels.

func (*MockContextMockRecorder) GetAllTransferFailoverLevels added in v1.2.9

func (mr *MockContextMockRecorder) GetAllTransferFailoverLevels() *gomock.Call

GetAllTransferFailoverLevels indicates an expected call of GetAllTransferFailoverLevels.

func (*MockContextMockRecorder) GetClusterMetadata added in v1.2.9

func (mr *MockContextMockRecorder) GetClusterMetadata() *gomock.Call

GetClusterMetadata indicates an expected call of GetClusterMetadata.

func (*MockContextMockRecorder) GetClusterReplicationLevel added in v1.2.9

func (mr *MockContextMockRecorder) GetClusterReplicationLevel(cluster interface{}) *gomock.Call

GetClusterReplicationLevel indicates an expected call of GetClusterReplicationLevel.

func (*MockContextMockRecorder) GetConfig added in v1.2.9

func (mr *MockContextMockRecorder) GetConfig() *gomock.Call

GetConfig indicates an expected call of GetConfig.

func (*MockContextMockRecorder) GetCurrentTime added in v1.2.9

func (mr *MockContextMockRecorder) GetCurrentTime(cluster interface{}) *gomock.Call

GetCurrentTime indicates an expected call of GetCurrentTime.

func (*MockContextMockRecorder) GetDomainCache added in v1.2.9

func (mr *MockContextMockRecorder) GetDomainCache() *gomock.Call

GetDomainCache indicates an expected call of GetDomainCache.

func (*MockContextMockRecorder) GetDomainNotificationVersion added in v1.2.9

func (mr *MockContextMockRecorder) GetDomainNotificationVersion() *gomock.Call

GetDomainNotificationVersion indicates an expected call of GetDomainNotificationVersion.

func (*MockContextMockRecorder) GetEngine added in v1.2.9

func (mr *MockContextMockRecorder) GetEngine() *gomock.Call

GetEngine indicates an expected call of GetEngine.

func (*MockContextMockRecorder) GetEventsCache added in v1.2.9

func (mr *MockContextMockRecorder) GetEventsCache() *gomock.Call

GetEventsCache indicates an expected call of GetEventsCache.

func (*MockContextMockRecorder) GetExecutionManager added in v1.2.9

func (mr *MockContextMockRecorder) GetExecutionManager() *gomock.Call

GetExecutionManager indicates an expected call of GetExecutionManager.

func (*MockContextMockRecorder) GetHistoryManager added in v1.2.9

func (mr *MockContextMockRecorder) GetHistoryManager() *gomock.Call

GetHistoryManager indicates an expected call of GetHistoryManager.

func (*MockContextMockRecorder) GetLastUpdatedTime added in v1.2.9

func (mr *MockContextMockRecorder) GetLastUpdatedTime() *gomock.Call

GetLastUpdatedTime indicates an expected call of GetLastUpdatedTime.

func (*MockContextMockRecorder) GetLogger added in v1.2.9

func (mr *MockContextMockRecorder) GetLogger() *gomock.Call

GetLogger indicates an expected call of GetLogger.

func (*MockContextMockRecorder) GetMetricsClient added in v1.2.9

func (mr *MockContextMockRecorder) GetMetricsClient() *gomock.Call

GetMetricsClient indicates an expected call of GetMetricsClient.

func (*MockContextMockRecorder) GetService added in v1.2.9

func (mr *MockContextMockRecorder) GetService() *gomock.Call

GetService indicates an expected call of GetService.

func (*MockContextMockRecorder) GetShardID added in v1.2.9

func (mr *MockContextMockRecorder) GetShardID() *gomock.Call

GetShardID indicates an expected call of GetShardID.

func (*MockContextMockRecorder) GetThrottledLogger added in v1.2.9

func (mr *MockContextMockRecorder) GetThrottledLogger() *gomock.Call

GetThrottledLogger indicates an expected call of GetThrottledLogger.

func (*MockContextMockRecorder) GetTimeSource added in v1.2.9

func (mr *MockContextMockRecorder) GetTimeSource() *gomock.Call

GetTimeSource indicates an expected call of GetTimeSource.

func (*MockContextMockRecorder) GetTimerAckLevel added in v1.2.9

func (mr *MockContextMockRecorder) GetTimerAckLevel() *gomock.Call

GetTimerAckLevel indicates an expected call of GetTimerAckLevel.

func (*MockContextMockRecorder) GetTimerClusterAckLevel added in v1.2.9

func (mr *MockContextMockRecorder) GetTimerClusterAckLevel(cluster interface{}) *gomock.Call

GetTimerClusterAckLevel indicates an expected call of GetTimerClusterAckLevel.

func (*MockContextMockRecorder) GetTimerMaxReadLevel added in v1.2.9

func (mr *MockContextMockRecorder) GetTimerMaxReadLevel(cluster interface{}) *gomock.Call

GetTimerMaxReadLevel indicates an expected call of GetTimerMaxReadLevel.

func (*MockContextMockRecorder) GetTimerProcessingQueueStates added in v1.2.9

func (mr *MockContextMockRecorder) GetTimerProcessingQueueStates(cluster interface{}) *gomock.Call

GetTimerProcessingQueueStates indicates an expected call of GetTimerProcessingQueueStates.

func (*MockContextMockRecorder) GetTransferAckLevel added in v1.2.9

func (mr *MockContextMockRecorder) GetTransferAckLevel() *gomock.Call

GetTransferAckLevel indicates an expected call of GetTransferAckLevel.

func (*MockContextMockRecorder) GetTransferClusterAckLevel added in v1.2.9

func (mr *MockContextMockRecorder) GetTransferClusterAckLevel(cluster interface{}) *gomock.Call

GetTransferClusterAckLevel indicates an expected call of GetTransferClusterAckLevel.

func (*MockContextMockRecorder) GetTransferMaxReadLevel added in v1.2.9

func (mr *MockContextMockRecorder) GetTransferMaxReadLevel() *gomock.Call

GetTransferMaxReadLevel indicates an expected call of GetTransferMaxReadLevel.

func (*MockContextMockRecorder) GetTransferProcessingQueueStates added in v1.2.9

func (mr *MockContextMockRecorder) GetTransferProcessingQueueStates(cluster interface{}) *gomock.Call

GetTransferProcessingQueueStates indicates an expected call of GetTransferProcessingQueueStates.

func (*MockContextMockRecorder) GetWorkflowExecution added in v1.2.9

func (mr *MockContextMockRecorder) GetWorkflowExecution(ctx, request interface{}) *gomock.Call

GetWorkflowExecution indicates an expected call of GetWorkflowExecution.

func (*MockContextMockRecorder) PreviousShardOwnerWasDifferent added in v1.2.9

func (mr *MockContextMockRecorder) PreviousShardOwnerWasDifferent() *gomock.Call

PreviousShardOwnerWasDifferent indicates an expected call of PreviousShardOwnerWasDifferent.

func (*MockContextMockRecorder) ReplicateFailoverMarkers added in v1.2.9

func (mr *MockContextMockRecorder) ReplicateFailoverMarkers(ctx, markers interface{}) *gomock.Call

ReplicateFailoverMarkers indicates an expected call of ReplicateFailoverMarkers.

func (*MockContextMockRecorder) SetCurrentTime added in v1.2.9

func (mr *MockContextMockRecorder) SetCurrentTime(cluster, currentTime interface{}) *gomock.Call

SetCurrentTime indicates an expected call of SetCurrentTime.

func (*MockContextMockRecorder) SetEngine added in v1.2.9

func (mr *MockContextMockRecorder) SetEngine(arg0 interface{}) *gomock.Call

SetEngine indicates an expected call of SetEngine.

func (*MockContextMockRecorder) UpdateClusterReplicationLevel added in v1.2.9

func (mr *MockContextMockRecorder) UpdateClusterReplicationLevel(cluster, lastTaskID interface{}) *gomock.Call

UpdateClusterReplicationLevel indicates an expected call of UpdateClusterReplicationLevel.

func (*MockContextMockRecorder) UpdateDomainNotificationVersion added in v1.2.9

func (mr *MockContextMockRecorder) UpdateDomainNotificationVersion(domainNotificationVersion interface{}) *gomock.Call

UpdateDomainNotificationVersion indicates an expected call of UpdateDomainNotificationVersion.

func (*MockContextMockRecorder) UpdateTimerAckLevel added in v1.2.9

func (mr *MockContextMockRecorder) UpdateTimerAckLevel(ackLevel interface{}) *gomock.Call

UpdateTimerAckLevel indicates an expected call of UpdateTimerAckLevel.

func (*MockContextMockRecorder) UpdateTimerClusterAckLevel added in v1.2.9

func (mr *MockContextMockRecorder) UpdateTimerClusterAckLevel(cluster, ackLevel interface{}) *gomock.Call

UpdateTimerClusterAckLevel indicates an expected call of UpdateTimerClusterAckLevel.

func (*MockContextMockRecorder) UpdateTimerFailoverLevel added in v1.2.9

func (mr *MockContextMockRecorder) UpdateTimerFailoverLevel(failoverID, level interface{}) *gomock.Call

UpdateTimerFailoverLevel indicates an expected call of UpdateTimerFailoverLevel.

func (*MockContextMockRecorder) UpdateTimerMaxReadLevel added in v1.2.9

func (mr *MockContextMockRecorder) UpdateTimerMaxReadLevel(cluster interface{}) *gomock.Call

UpdateTimerMaxReadLevel indicates an expected call of UpdateTimerMaxReadLevel.

func (*MockContextMockRecorder) UpdateTimerProcessingQueueStates added in v1.2.9

func (mr *MockContextMockRecorder) UpdateTimerProcessingQueueStates(cluster, states interface{}) *gomock.Call

UpdateTimerProcessingQueueStates indicates an expected call of UpdateTimerProcessingQueueStates.

func (*MockContextMockRecorder) UpdateTransferAckLevel added in v1.2.9

func (mr *MockContextMockRecorder) UpdateTransferAckLevel(ackLevel interface{}) *gomock.Call

UpdateTransferAckLevel indicates an expected call of UpdateTransferAckLevel.

func (*MockContextMockRecorder) UpdateTransferClusterAckLevel added in v1.2.9

func (mr *MockContextMockRecorder) UpdateTransferClusterAckLevel(cluster, ackLevel interface{}) *gomock.Call

UpdateTransferClusterAckLevel indicates an expected call of UpdateTransferClusterAckLevel.

func (*MockContextMockRecorder) UpdateTransferFailoverLevel added in v1.2.9

func (mr *MockContextMockRecorder) UpdateTransferFailoverLevel(failoverID, level interface{}) *gomock.Call

UpdateTransferFailoverLevel indicates an expected call of UpdateTransferFailoverLevel.

func (*MockContextMockRecorder) UpdateTransferProcessingQueueStates added in v1.2.9

func (mr *MockContextMockRecorder) UpdateTransferProcessingQueueStates(cluster, states interface{}) *gomock.Call

UpdateTransferProcessingQueueStates indicates an expected call of UpdateTransferProcessingQueueStates.

func (*MockContextMockRecorder) UpdateWorkflowExecution added in v1.2.9

func (mr *MockContextMockRecorder) UpdateWorkflowExecution(ctx, request interface{}) *gomock.Call

UpdateWorkflowExecution indicates an expected call of UpdateWorkflowExecution.

func (*MockContextMockRecorder) ValidateAndUpdateFailoverMarkers added in v1.2.9

func (mr *MockContextMockRecorder) ValidateAndUpdateFailoverMarkers() *gomock.Call

ValidateAndUpdateFailoverMarkers indicates an expected call of ValidateAndUpdateFailoverMarkers.

type MockController

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

MockController is a mock of Controller interface.

func NewMockController

func NewMockController(ctrl *gomock.Controller) *MockController

NewMockController creates a new mock instance.

func (*MockController) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockController) GetEngine

func (m *MockController) GetEngine(workflowID string) (engine.Engine, error)

GetEngine mocks base method.

func (*MockController) GetEngineForShard

func (m *MockController) GetEngineForShard(shardID int) (engine.Engine, error)

GetEngineForShard mocks base method.

func (*MockController) NumShards

func (m *MockController) NumShards() int

NumShards mocks base method.

func (*MockController) PrepareToStop

func (m *MockController) PrepareToStop()

PrepareToStop mocks base method.

func (*MockController) RemoveEngineForShard

func (m *MockController) RemoveEngineForShard(shardID int)

RemoveEngineForShard mocks base method.

func (*MockController) ShardIDs

func (m *MockController) ShardIDs() []int32

ShardIDs mocks base method.

func (*MockController) Start

func (m *MockController) Start()

Start mocks base method.

func (*MockController) Status

func (m *MockController) Status() int32

Status mocks base method.

func (*MockController) Stop

func (m *MockController) Stop()

Stop mocks base method.

type MockControllerMockRecorder

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

MockControllerMockRecorder is the mock recorder for MockController.

func (*MockControllerMockRecorder) GetEngine

func (mr *MockControllerMockRecorder) GetEngine(workflowID interface{}) *gomock.Call

GetEngine indicates an expected call of GetEngine.

func (*MockControllerMockRecorder) GetEngineForShard

func (mr *MockControllerMockRecorder) GetEngineForShard(shardID interface{}) *gomock.Call

GetEngineForShard indicates an expected call of GetEngineForShard.

func (*MockControllerMockRecorder) NumShards

func (mr *MockControllerMockRecorder) NumShards() *gomock.Call

NumShards indicates an expected call of NumShards.

func (*MockControllerMockRecorder) PrepareToStop

func (mr *MockControllerMockRecorder) PrepareToStop() *gomock.Call

PrepareToStop indicates an expected call of PrepareToStop.

func (*MockControllerMockRecorder) RemoveEngineForShard

func (mr *MockControllerMockRecorder) RemoveEngineForShard(shardID interface{}) *gomock.Call

RemoveEngineForShard indicates an expected call of RemoveEngineForShard.

func (*MockControllerMockRecorder) ShardIDs

func (mr *MockControllerMockRecorder) ShardIDs() *gomock.Call

ShardIDs indicates an expected call of ShardIDs.

func (*MockControllerMockRecorder) Start

func (mr *MockControllerMockRecorder) Start() *gomock.Call

Start indicates an expected call of Start.

func (*MockControllerMockRecorder) Status

func (mr *MockControllerMockRecorder) Status() *gomock.Call

Status indicates an expected call of Status.

func (*MockControllerMockRecorder) Stop

Stop indicates an expected call of Stop.

type MockEngineFactory

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

MockEngineFactory is a mock of EngineFactory interface.

func NewMockEngineFactory

func NewMockEngineFactory(ctrl *gomock.Controller) *MockEngineFactory

NewMockEngineFactory creates a new mock instance.

func (*MockEngineFactory) CreateEngine

func (m *MockEngineFactory) CreateEngine(arg0 Context) engine.Engine

CreateEngine mocks base method.

func (*MockEngineFactory) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockEngineFactoryMockRecorder

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

MockEngineFactoryMockRecorder is the mock recorder for MockEngineFactory.

func (*MockEngineFactoryMockRecorder) CreateEngine

func (mr *MockEngineFactoryMockRecorder) CreateEngine(arg0 interface{}) *gomock.Call

CreateEngine indicates an expected call of CreateEngine.

type TestContext

type TestContext struct {
	Resource                        *resource.Test
	MockEventsCache                 *events.MockCache
	MockAddingPendingFailoverMarker func(*types.FailoverMarkerAttributes) error
	// contains filtered or unexported fields
}

TestContext is a test implementation for shard Context interface

func NewTestContext

func NewTestContext(
	t *testing.T,
	ctrl *gomock.Controller,
	shardInfo *persistence.ShardInfo,
	config *config.Config,
) *TestContext

NewTestContext create a new shardContext for test

func (*TestContext) AddingPendingFailoverMarker added in v0.14.0

func (s *TestContext) AddingPendingFailoverMarker(marker *types.FailoverMarkerAttributes) error

func (TestContext) AppendHistoryV2Events

func (s TestContext) AppendHistoryV2Events(
	ctx context.Context,
	request *persistence.AppendHistoryNodesRequest,
	domainID string,
	execution types.WorkflowExecution,
) (*persistence.AppendHistoryNodesResponse, error)

func (TestContext) ConflictResolveWorkflowExecution

func (s TestContext) ConflictResolveWorkflowExecution(
	ctx context.Context,
	request *persistence.ConflictResolveWorkflowExecutionRequest,
) (*persistence.ConflictResolveWorkflowExecutionResponse, error)

func (TestContext) CreateWorkflowExecution

func (s TestContext) CreateWorkflowExecution(
	ctx context.Context,
	request *persistence.CreateWorkflowExecutionRequest,
) (*persistence.CreateWorkflowExecutionResponse, error)

func (TestContext) DeleteTimerFailoverLevel

func (s TestContext) DeleteTimerFailoverLevel(failoverID string) error

func (TestContext) DeleteTransferFailoverLevel

func (s TestContext) DeleteTransferFailoverLevel(failoverID string) error

func (*TestContext) Finish

func (s *TestContext) Finish(
	t mock.TestingT,
)

Finish checks whether expectations are met

func (TestContext) GenerateTransferTaskID

func (s TestContext) GenerateTransferTaskID() (int64, error)

func (TestContext) GenerateTransferTaskIDs

func (s TestContext) GenerateTransferTaskIDs(number int) ([]int64, error)

func (TestContext) GetAllTimerFailoverLevels

func (s TestContext) GetAllTimerFailoverLevels() map[string]TimerFailoverLevel

func (TestContext) GetAllTransferFailoverLevels

func (s TestContext) GetAllTransferFailoverLevels() map[string]TransferFailoverLevel

func (TestContext) GetClusterReplicationLevel

func (s TestContext) GetClusterReplicationLevel(cluster string) int64

func (TestContext) GetConfig

func (s TestContext) GetConfig() *config.Config

func (TestContext) GetCurrentTime

func (s TestContext) GetCurrentTime(cluster string) time.Time

func (TestContext) GetDomainNotificationVersion

func (s TestContext) GetDomainNotificationVersion() int64

func (TestContext) GetEngine

func (s TestContext) GetEngine() engine.Engine

func (TestContext) GetEventsCache

func (s TestContext) GetEventsCache() events.Cache

func (TestContext) GetExecutionManager

func (s TestContext) GetExecutionManager() persistence.ExecutionManager

func (TestContext) GetLastUpdatedTime

func (s TestContext) GetLastUpdatedTime() time.Time

func (TestContext) GetLogger

func (s TestContext) GetLogger() log.Logger

func (TestContext) GetService

func (s TestContext) GetService() resource.Resource

func (TestContext) GetShardID

func (s TestContext) GetShardID() int

func (TestContext) GetThrottledLogger

func (s TestContext) GetThrottledLogger() log.Logger

func (TestContext) GetTimerAckLevel

func (s TestContext) GetTimerAckLevel() time.Time

func (TestContext) GetTimerClusterAckLevel

func (s TestContext) GetTimerClusterAckLevel(cluster string) time.Time

func (TestContext) GetTimerMaxReadLevel

func (s TestContext) GetTimerMaxReadLevel(cluster string) time.Time

func (TestContext) GetTimerProcessingQueueStates added in v0.15.0

func (s TestContext) GetTimerProcessingQueueStates(cluster string) []*types.ProcessingQueueState

func (TestContext) GetTransferAckLevel

func (s TestContext) GetTransferAckLevel() int64

func (TestContext) GetTransferClusterAckLevel

func (s TestContext) GetTransferClusterAckLevel(cluster string) int64

func (TestContext) GetTransferMaxReadLevel

func (s TestContext) GetTransferMaxReadLevel() int64

func (TestContext) GetTransferProcessingQueueStates added in v0.15.0

func (s TestContext) GetTransferProcessingQueueStates(cluster string) []*types.ProcessingQueueState

func (TestContext) GetWorkflowExecution added in v1.2.8

func (s TestContext) GetWorkflowExecution(
	ctx context.Context,
	request *persistence.GetWorkflowExecutionRequest,
) (*persistence.GetWorkflowExecutionResponse, error)

func (TestContext) PreviousShardOwnerWasDifferent

func (s TestContext) PreviousShardOwnerWasDifferent() bool

func (TestContext) ReplicateFailoverMarkers added in v0.14.0

func (s TestContext) ReplicateFailoverMarkers(
	ctx context.Context,
	markers []*persistence.FailoverMarkerTask,
) error

func (TestContext) SetCurrentTime

func (s TestContext) SetCurrentTime(cluster string, currentTime time.Time)

func (TestContext) SetEngine

func (s TestContext) SetEngine(engine engine.Engine)

func (*TestContext) SetEventsCache

func (s *TestContext) SetEventsCache(
	eventsCache events.Cache,
)

SetEventsCache is a test hook for setting events cache

func (*TestContext) ShardInfo

func (s *TestContext) ShardInfo() *persistence.ShardInfo

ShardInfo is a test hook for getting shard info

func (TestContext) UpdateClusterReplicationLevel

func (s TestContext) UpdateClusterReplicationLevel(cluster string, lastTaskID int64) error

func (TestContext) UpdateDomainNotificationVersion

func (s TestContext) UpdateDomainNotificationVersion(domainNotificationVersion int64) error

func (TestContext) UpdateTimerAckLevel

func (s TestContext) UpdateTimerAckLevel(ackLevel time.Time) error

func (TestContext) UpdateTimerClusterAckLevel

func (s TestContext) UpdateTimerClusterAckLevel(cluster string, ackLevel time.Time) error

func (TestContext) UpdateTimerFailoverLevel

func (s TestContext) UpdateTimerFailoverLevel(failoverID string, level TimerFailoverLevel) error

func (TestContext) UpdateTimerMaxReadLevel

func (s TestContext) UpdateTimerMaxReadLevel(cluster string) time.Time

func (TestContext) UpdateTimerProcessingQueueStates added in v0.15.0

func (s TestContext) UpdateTimerProcessingQueueStates(cluster string, states []*types.ProcessingQueueState) error

func (TestContext) UpdateTransferAckLevel

func (s TestContext) UpdateTransferAckLevel(ackLevel int64) error

func (TestContext) UpdateTransferClusterAckLevel

func (s TestContext) UpdateTransferClusterAckLevel(cluster string, ackLevel int64) error

func (TestContext) UpdateTransferFailoverLevel

func (s TestContext) UpdateTransferFailoverLevel(failoverID string, level TransferFailoverLevel) error

func (TestContext) UpdateTransferProcessingQueueStates added in v0.15.0

func (s TestContext) UpdateTransferProcessingQueueStates(cluster string, states []*types.ProcessingQueueState) error

func (TestContext) UpdateWorkflowExecution

func (s TestContext) UpdateWorkflowExecution(
	ctx context.Context,
	request *persistence.UpdateWorkflowExecutionRequest,
) (*persistence.UpdateWorkflowExecutionResponse, error)

func (TestContext) ValidateAndUpdateFailoverMarkers added in v0.14.0

func (s TestContext) ValidateAndUpdateFailoverMarkers() ([]*types.FailoverMarkerAttributes, error)

type TimerFailoverLevel added in v0.22.0

type TimerFailoverLevel struct {
	StartTime    time.Time
	MinLevel     time.Time
	CurrentLevel time.Time
	MaxLevel     time.Time
	DomainIDs    map[string]struct{}
}

TimerFailoverLevel contains domain IDs and corresponding start / end level

type TransferFailoverLevel added in v0.22.0

type TransferFailoverLevel struct {
	StartTime    time.Time
	MinLevel     int64
	CurrentLevel int64
	MaxLevel     int64
	DomainIDs    map[string]struct{}
}

TransferFailoverLevel contains corresponding start / end level

Jump to

Keyboard shortcuts

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