Documentation ¶
Overview ¶
Package shard is a generated GoMock package.
Index ¶
- Variables
- func CreateShardOwnershipLostError(currentHost membership.HostInfo, ownerHost membership.HostInfo) *types.ShardOwnershipLostError
- func IsShardOwnershiptLostError(err error) bool
- type Context
- type Controller
- type EngineFactory
- type MockController
- func (m *MockController) EXPECT() *MockControllerMockRecorder
- func (m *MockController) GetEngine(workflowID string) (engine.Engine, error)
- func (m *MockController) GetEngineForShard(shardID int) (engine.Engine, error)
- func (m *MockController) NumShards() int
- func (m *MockController) PrepareToStop()
- func (m *MockController) RemoveEngineForShard(shardID int)
- func (m *MockController) ShardIDs() []int32
- func (m *MockController) Start()
- func (m *MockController) Status() int32
- func (m *MockController) Stop()
- type MockControllerMockRecorder
- func (mr *MockControllerMockRecorder) GetEngine(workflowID interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) GetEngineForShard(shardID interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) NumShards() *gomock.Call
- func (mr *MockControllerMockRecorder) PrepareToStop() *gomock.Call
- func (mr *MockControllerMockRecorder) RemoveEngineForShard(shardID interface{}) *gomock.Call
- func (mr *MockControllerMockRecorder) ShardIDs() *gomock.Call
- func (mr *MockControllerMockRecorder) Start() *gomock.Call
- func (mr *MockControllerMockRecorder) Status() *gomock.Call
- func (mr *MockControllerMockRecorder) Stop() *gomock.Call
- type MockEngineFactory
- type MockEngineFactoryMockRecorder
- type TestContext
- func (s TestContext) AddingPendingFailoverMarker(marker *types.FailoverMarkerAttributes) error
- func (s TestContext) AppendHistoryV2Events(ctx context.Context, request *persistence.AppendHistoryNodesRequest, ...) (*persistence.AppendHistoryNodesResponse, error)
- func (s TestContext) ConflictResolveWorkflowExecution(ctx context.Context, ...) (*persistence.ConflictResolveWorkflowExecutionResponse, error)
- func (s TestContext) CreateWorkflowExecution(ctx context.Context, request *persistence.CreateWorkflowExecutionRequest) (*persistence.CreateWorkflowExecutionResponse, error)
- func (s TestContext) DeleteTimerFailoverLevel(failoverID string) error
- func (s TestContext) DeleteTransferFailoverLevel(failoverID string) error
- func (s *TestContext) Finish(t mock.TestingT)
- func (s TestContext) GenerateTransferTaskID() (int64, error)
- func (s TestContext) GenerateTransferTaskIDs(number int) ([]int64, error)
- func (s TestContext) GetAllTimerFailoverLevels() map[string]TimerFailoverLevel
- func (s TestContext) GetAllTransferFailoverLevels() map[string]TransferFailoverLevel
- func (s TestContext) GetClusterReplicationLevel(cluster string) int64
- func (s TestContext) GetConfig() *config.Config
- func (s TestContext) GetCrossClusterProcessingQueueStates(cluster string) []*types.ProcessingQueueState
- func (s TestContext) GetCurrentTime(cluster string) time.Time
- func (s TestContext) GetDomainNotificationVersion() int64
- func (s TestContext) GetEngine() engine.Engine
- func (s TestContext) GetEventsCache() events.Cache
- func (s TestContext) GetExecutionManager() persistence.ExecutionManager
- func (s TestContext) GetLastUpdatedTime() time.Time
- func (s TestContext) GetLogger() log.Logger
- func (s TestContext) GetService() resource.Resource
- func (s TestContext) GetShardID() int
- func (s TestContext) GetThrottledLogger() log.Logger
- func (s TestContext) GetTimerAckLevel() time.Time
- func (s TestContext) GetTimerClusterAckLevel(cluster string) time.Time
- func (s TestContext) GetTimerMaxReadLevel(cluster string) time.Time
- func (s TestContext) GetTimerProcessingQueueStates(cluster string) []*types.ProcessingQueueState
- func (s TestContext) GetTransferAckLevel() int64
- func (s TestContext) GetTransferClusterAckLevel(cluster string) int64
- func (s TestContext) GetTransferMaxReadLevel() int64
- func (s TestContext) GetTransferProcessingQueueStates(cluster string) []*types.ProcessingQueueState
- func (s TestContext) PreviousShardOwnerWasDifferent() bool
- func (s TestContext) ReplicateFailoverMarkers(ctx context.Context, markers []*persistence.FailoverMarkerTask) error
- func (s TestContext) SetCurrentTime(cluster string, currentTime time.Time)
- func (s TestContext) SetEngine(engine engine.Engine)
- func (s *TestContext) SetEventsCache(eventsCache events.Cache)
- func (s *TestContext) ShardInfo() *persistence.ShardInfo
- func (s TestContext) UpdateClusterReplicationLevel(cluster string, lastTaskID int64) error
- func (s TestContext) UpdateCrossClusterProcessingQueueStates(cluster string, states []*types.ProcessingQueueState) error
- func (s TestContext) UpdateDomainNotificationVersion(domainNotificationVersion int64) error
- func (s TestContext) UpdateTimerAckLevel(ackLevel time.Time) error
- func (s TestContext) UpdateTimerClusterAckLevel(cluster string, ackLevel time.Time) error
- func (s TestContext) UpdateTimerFailoverLevel(failoverID string, level TimerFailoverLevel) error
- func (s TestContext) UpdateTimerMaxReadLevel(cluster string) time.Time
- func (s TestContext) UpdateTimerProcessingQueueStates(cluster string, states []*types.ProcessingQueueState) error
- func (s TestContext) UpdateTransferAckLevel(ackLevel int64) error
- func (s TestContext) UpdateTransferClusterAckLevel(cluster string, ackLevel int64) error
- func (s TestContext) UpdateTransferFailoverLevel(failoverID string, level TransferFailoverLevel) error
- func (s TestContext) UpdateTransferProcessingQueueStates(cluster string, states []*types.ProcessingQueueState) error
- func (s TestContext) UpdateWorkflowExecution(ctx context.Context, request *persistence.UpdateWorkflowExecutionRequest) (*persistence.UpdateWorkflowExecutionResponse, error)
- func (s TestContext) ValidateAndUpdateFailoverMarkers() ([]*types.FailoverMarkerAttributes, error)
- type TimerFailoverLevel
- type TransferFailoverLevel
Constants ¶
This section is empty.
Variables ¶
var ( // ErrShardClosed is returned when shard is closed and a req cannot be processed ErrShardClosed = errors.New("shard closed") )
Functions ¶
func CreateShardOwnershipLostError ¶
func CreateShardOwnershipLostError( currentHost membership.HostInfo, ownerHost membership.HostInfo, ) *types.ShardOwnershipLostError
CreateShardOwnershipLostError creates a new shard ownership lost error
func IsShardOwnershiptLostError ¶
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 GetCrossClusterProcessingQueueStates(cluster string) []*types.ProcessingQueueState UpdateCrossClusterProcessingQueueStates(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 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 ¶
EngineFactory is used to create an instance of sharded history engine
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 ¶
func (m *MockController) EXPECT() *MockControllerMockRecorder
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.
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 ¶
func (mr *MockControllerMockRecorder) Stop() *gomock.Call
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 ¶
func (m *MockEngineFactory) EXPECT() *MockEngineFactoryMockRecorder
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 // contains filtered or unexported fields }
TestContext is a test implementation for shard Context interface
func NewTestContext ¶
func NewTestContext( 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 (TestContext) DeleteTransferFailoverLevel ¶
func (*TestContext) Finish ¶
func (s *TestContext) Finish( t mock.TestingT, )
Finish checks whether expectations are met
func (TestContext) GenerateTransferTaskID ¶
func (TestContext) GenerateTransferTaskIDs ¶
func (TestContext) GetAllTimerFailoverLevels ¶
func (s TestContext) GetAllTimerFailoverLevels() map[string]TimerFailoverLevel
func (TestContext) GetAllTransferFailoverLevels ¶
func (s TestContext) GetAllTransferFailoverLevels() map[string]TransferFailoverLevel
func (TestContext) GetClusterReplicationLevel ¶
func (TestContext) GetCrossClusterProcessingQueueStates ¶ added in v0.22.0
func (s TestContext) GetCrossClusterProcessingQueueStates(cluster string) []*types.ProcessingQueueState
func (TestContext) GetCurrentTime ¶
func (TestContext) GetDomainNotificationVersion ¶
func (s TestContext) GetDomainNotificationVersion() int64
func (TestContext) GetEventsCache ¶
func (TestContext) GetExecutionManager ¶
func (s TestContext) GetExecutionManager() persistence.ExecutionManager
func (TestContext) GetLastUpdatedTime ¶
func (TestContext) GetService ¶
func (TestContext) GetShardID ¶
func (s TestContext) GetShardID() int
func (TestContext) GetThrottledLogger ¶
func (TestContext) GetTimerAckLevel ¶
func (TestContext) GetTimerClusterAckLevel ¶
func (TestContext) GetTimerMaxReadLevel ¶
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 (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) 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 (*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 (TestContext) UpdateCrossClusterProcessingQueueStates ¶ added in v0.22.0
func (s TestContext) UpdateCrossClusterProcessingQueueStates(cluster string, states []*types.ProcessingQueueState) error
func (TestContext) UpdateDomainNotificationVersion ¶
func (TestContext) UpdateTimerAckLevel ¶
func (TestContext) UpdateTimerClusterAckLevel ¶
func (TestContext) UpdateTimerFailoverLevel ¶
func (s TestContext) UpdateTimerFailoverLevel(failoverID string, level TimerFailoverLevel) error
func (TestContext) UpdateTimerMaxReadLevel ¶
func (TestContext) UpdateTimerProcessingQueueStates ¶ added in v0.15.0
func (s TestContext) UpdateTimerProcessingQueueStates(cluster string, states []*types.ProcessingQueueState) error
func (TestContext) UpdateTransferAckLevel ¶
func (TestContext) UpdateTransferClusterAckLevel ¶
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)