Documentation ¶
Index ¶
- Constants
- Variables
- func NewService(params *service.BootstrapParams) common.Daemon
- type Config
- type Engine
- type EngineFactory
- type Handler
- func (h *Handler) CreateEngine(context ShardContext) Engine
- func (h *Handler) DescribeWorkflowExecution(ctx context.Context, request *hist.DescribeWorkflowExecutionRequest) (*gen.DescribeWorkflowExecutionResponse, error)
- func (h *Handler) GetMutableState(ctx context.Context, getRequest *hist.GetMutableStateRequest) (*hist.GetMutableStateResponse, error)
- func (h *Handler) Health(ctx context.Context) (*health.HealthStatus, error)
- func (h *Handler) RecordActivityTaskHeartbeat(ctx context.Context, wrappedRequest *hist.RecordActivityTaskHeartbeatRequest) (*gen.RecordActivityTaskHeartbeatResponse, error)
- func (h *Handler) RecordActivityTaskStarted(ctx context.Context, recordRequest *hist.RecordActivityTaskStartedRequest) (*hist.RecordActivityTaskStartedResponse, error)
- func (h *Handler) RecordChildExecutionCompleted(ctx context.Context, request *hist.RecordChildExecutionCompletedRequest) error
- func (h *Handler) RecordDecisionTaskStarted(ctx context.Context, recordRequest *hist.RecordDecisionTaskStartedRequest) (*hist.RecordDecisionTaskStartedResponse, error)
- func (h *Handler) RemoveSignalMutableState(ctx context.Context, wrappedRequest *hist.RemoveSignalMutableStateRequest) error
- func (h *Handler) RequestCancelWorkflowExecution(ctx context.Context, request *hist.RequestCancelWorkflowExecutionRequest) error
- func (h *Handler) ResetStickyTaskList(ctx context.Context, resetRequest *hist.ResetStickyTaskListRequest) (*hist.ResetStickyTaskListResponse, error)
- func (h *Handler) RespondActivityTaskCanceled(ctx context.Context, wrappedRequest *hist.RespondActivityTaskCanceledRequest) error
- func (h *Handler) RespondActivityTaskCompleted(ctx context.Context, wrappedRequest *hist.RespondActivityTaskCompletedRequest) error
- func (h *Handler) RespondActivityTaskFailed(ctx context.Context, wrappedRequest *hist.RespondActivityTaskFailedRequest) error
- func (h *Handler) RespondDecisionTaskCompleted(ctx context.Context, wrappedRequest *hist.RespondDecisionTaskCompletedRequest) error
- func (h *Handler) RespondDecisionTaskFailed(ctx context.Context, wrappedRequest *hist.RespondDecisionTaskFailedRequest) error
- func (h *Handler) ScheduleDecisionTask(ctx context.Context, request *hist.ScheduleDecisionTaskRequest) error
- func (h *Handler) SignalWorkflowExecution(ctx context.Context, wrappedRequest *hist.SignalWorkflowExecutionRequest) error
- func (h *Handler) Start() error
- func (h *Handler) StartWorkflowExecution(ctx context.Context, wrappedRequest *hist.StartWorkflowExecutionRequest) (*gen.StartWorkflowExecutionResponse, error)
- func (h *Handler) Stop()
- func (h *Handler) TerminateWorkflowExecution(ctx context.Context, wrappedRequest *hist.TerminateWorkflowExecutionRequest) error
- type MockHistoryEngine
- func (_m *MockHistoryEngine) DescribeWorkflowExecution(request *gohistory.DescribeWorkflowExecutionRequest) (*shared.DescribeWorkflowExecutionResponse, error)
- func (_m *MockHistoryEngine) GetMutableState(ctx context.Context, request *gohistory.GetMutableStateRequest) (*gohistory.GetMutableStateResponse, error)
- func (_m *MockHistoryEngine) RecordActivityTaskHeartbeat(request *gohistory.RecordActivityTaskHeartbeatRequest) (*shared.RecordActivityTaskHeartbeatResponse, error)
- func (_m *MockHistoryEngine) RecordActivityTaskStarted(request *gohistory.RecordActivityTaskStartedRequest) (*gohistory.RecordActivityTaskStartedResponse, error)
- func (_m *MockHistoryEngine) RecordChildExecutionCompleted(request *gohistory.RecordChildExecutionCompletedRequest) error
- func (_m *MockHistoryEngine) RecordDecisionTaskStarted(request *gohistory.RecordDecisionTaskStartedRequest) (*gohistory.RecordDecisionTaskStartedResponse, error)
- func (_m *MockHistoryEngine) RemoveSignalMutableState(request *gohistory.RemoveSignalMutableStateRequest) error
- func (_m *MockHistoryEngine) RequestCancelWorkflowExecution(request *gohistory.RequestCancelWorkflowExecutionRequest) error
- func (_m *MockHistoryEngine) ResetStickyTaskList(request *gohistory.ResetStickyTaskListRequest) (*gohistory.ResetStickyTaskListResponse, error)
- func (_m *MockHistoryEngine) RespondActivityTaskCanceled(request *gohistory.RespondActivityTaskCanceledRequest) error
- func (_m *MockHistoryEngine) RespondActivityTaskCompleted(request *gohistory.RespondActivityTaskCompletedRequest) error
- func (_m *MockHistoryEngine) RespondActivityTaskFailed(request *gohistory.RespondActivityTaskFailedRequest) error
- func (_m *MockHistoryEngine) RespondDecisionTaskCompleted(ctx context.Context, request *gohistory.RespondDecisionTaskCompletedRequest) error
- func (_m *MockHistoryEngine) RespondDecisionTaskFailed(request *gohistory.RespondDecisionTaskFailedRequest) error
- func (_m *MockHistoryEngine) ScheduleDecisionTask(request *gohistory.ScheduleDecisionTaskRequest) error
- func (_m *MockHistoryEngine) SignalWorkflowExecution(request *gohistory.SignalWorkflowExecutionRequest) error
- func (_m *MockHistoryEngine) Start()
- func (_m *MockHistoryEngine) StartWorkflowExecution(request *gohistory.StartWorkflowExecutionRequest) (*shared.StartWorkflowExecutionResponse, error)
- func (_m *MockHistoryEngine) Stop()
- func (_m *MockHistoryEngine) TerminateWorkflowExecution(request *gohistory.TerminateWorkflowExecutionRequest) error
- type MockHistoryEngineFactory
- type SequenceID
- type SequenceNumberGenerator
- type Service
- type ShardContext
- type TestBase
- type TestShardContext
- func (s *TestShardContext) AppendHistoryEvents(request *persistence.AppendHistoryEventsRequest) error
- func (s *TestShardContext) CreateWorkflowExecution(request *persistence.CreateWorkflowExecutionRequest) (*persistence.CreateWorkflowExecutionResponse, error)
- func (s *TestShardContext) GetConfig() *Config
- func (s *TestShardContext) GetDomainCache() cache.DomainCache
- func (s *TestShardContext) GetExecutionManager() persistence.ExecutionManager
- func (s *TestShardContext) GetHistoryManager() persistence.HistoryManager
- func (s *TestShardContext) GetLogger() bark.Logger
- func (s *TestShardContext) GetMetricsClient() metrics.Client
- func (s *TestShardContext) GetNextTransferTaskID() (int64, error)
- func (s *TestShardContext) GetRangeID() int64
- func (s *TestShardContext) GetTimeSource() common.TimeSource
- func (s *TestShardContext) GetTimerAckLevel() time.Time
- func (s *TestShardContext) GetTransferAckLevel() int64
- func (s *TestShardContext) GetTransferMaxReadLevel() int64
- func (s *TestShardContext) GetTransferSequenceNumber() int64
- func (s *TestShardContext) NotifyNewHistoryEvent(event *historyEventNotification) error
- func (s *TestShardContext) Reset()
- func (s *TestShardContext) UpdateTimerAckLevel(ackLevel time.Time) error
- func (s *TestShardContext) UpdateTransferAckLevel(ackLevel int64) error
- func (s *TestShardContext) UpdateWorkflowExecution(request *persistence.UpdateWorkflowExecutionRequest) error
Constants ¶
const ( TimerTaskStatusNone = iota TimerTaskStatusCreated )
Timer task status
const ( TimerTaskStatusCreatedStartToClose = 1 << iota TimerTaskStatusCreatedScheduleToStart TimerTaskStatusCreatedScheduleToClose TimerTaskStatusCreatedHeartbeat )
Activity Timer task status
Variables ¶
var ( // ErrDuplicate is exported temporarily for integration test ErrDuplicate = errors.New("Duplicate task, completing it") // ErrConflict is exported temporarily for integration test ErrConflict = errors.New("Conditional update failed") // ErrMaxAttemptsExceeded is exported temporarily for integration test ErrMaxAttemptsExceeded = errors.New("Maximum attempts exceeded to update history") // ErrStaleState is the error returned during state update indicating that cached mutable state could be stale ErrStaleState = errors.New("Cache mutable state could potentially be stale") // ErrActivityTaskNotFound is the error to indicate activity task could be duplicate and activity already completed ErrActivityTaskNotFound = &workflow.EntityNotExistsError{Message: "Activity task not found."} // ErrWorkflowCompleted is the error to indicate workflow execution already completed ErrWorkflowCompleted = &workflow.EntityNotExistsError{Message: "Workflow execution already completed."} // ErrWorkflowParent is the error to parent execution is given and mismatch ErrWorkflowParent = &workflow.EntityNotExistsError{Message: "Workflow parent does not match."} // ErrDeserializingToken is the error to indicate task token is invalid ErrDeserializingToken = &workflow.BadRequestError{Message: "Error deserializing task token."} // ErrCancellationAlreadyRequested is the error indicating cancellation for target workflow is already requested ErrCancellationAlreadyRequested = &workflow.CancellationAlreadyRequestedError{Message: "Cancellation already requested for this workflow execution."} // FailedWorkflowCloseState is a set of failed workflow close states, used for start workflow policy // for start workflow execution API FailedWorkflowCloseState = map[int]bool{ persistence.WorkflowCloseStatusFailed: true, persistence.WorkflowCloseStatusCanceled: true, persistence.WorkflowCloseStatusTerminated: true, persistence.WorkflowCloseStatusTimedOut: true, } )
var ( // ErrTryLock is a temporary error that is thrown by the API // when it loses the race to create workflow execution context ErrTryLock = &workflow.InternalServiceError{Message: "Failed to acquire lock, backoff and retry"} )
Functions ¶
func NewService ¶
func NewService(params *service.BootstrapParams) common.Daemon
NewService builds a new cadence-history service
Types ¶
type Config ¶ added in v0.3.1
type Config struct { NumberOfShards int // HistoryCache settings HistoryCacheInitialSize int HistoryCacheMaxSize int HistoryCacheTTL time.Duration // ShardController settings RangeSizeBits uint AcquireShardInterval time.Duration // Timeout settings DefaultScheduleToStartActivityTimeoutInSecs int32 DefaultScheduleToCloseActivityTimeoutInSecs int32 DefaultStartToCloseActivityTimeoutInSecs int32 // TimerQueueProcessor settings TimerTaskBatchSize int ProcessTimerTaskWorkerCount int TimerProcessorUpdateFailureRetryCount int TimerProcessorGetFailureRetryCount int TimerProcessorUpdateAckInterval time.Duration TimerProcessorForceUpdateInterval time.Duration // TransferQueueProcessor settings TransferTaskBatchSize int TransferProcessorMaxPollRPS int TransferProcessorMaxPollInterval time.Duration TransferProcessorUpdateAckInterval time.Duration TransferProcessorForceUpdateInterval time.Duration TransferTaskWorkerCount int // Persistence settings ExecutionMgrNumConns int HistoryMgrNumConns int // Time to hold a poll request before returning an empty response // right now only used by GetMutableState LongPollExpirationInterval dynamicconfig.DurationPropertyFn }
Config represents configuration for cadence-history service
func NewConfig ¶ added in v0.3.1
func NewConfig(dc *dynamicconfig.Collection, numberOfShards int) *Config
NewConfig returns new service config with default values
func (*Config) GetShardID ¶ added in v0.3.3
GetShardID return the corresponding shard ID for a given workflow ID
type Engine ¶
type Engine interface { common.Daemon // TODO: Convert workflow.WorkflowExecution to pointer all over the place StartWorkflowExecution(request *h.StartWorkflowExecutionRequest) (*workflow.StartWorkflowExecutionResponse, error) GetMutableState(ctx context.Context, request *h.GetMutableStateRequest) (*h.GetMutableStateResponse, error) ResetStickyTaskList(resetRequest *h.ResetStickyTaskListRequest) (*h.ResetStickyTaskListResponse, error) DescribeWorkflowExecution( request *h.DescribeWorkflowExecutionRequest) (*workflow.DescribeWorkflowExecutionResponse, error) RecordDecisionTaskStarted(request *h.RecordDecisionTaskStartedRequest) (*h.RecordDecisionTaskStartedResponse, error) RecordActivityTaskStarted(request *h.RecordActivityTaskStartedRequest) (*h.RecordActivityTaskStartedResponse, error) RespondDecisionTaskCompleted(ctx context.Context, request *h.RespondDecisionTaskCompletedRequest) error RespondDecisionTaskFailed(request *h.RespondDecisionTaskFailedRequest) error RespondActivityTaskCompleted(request *h.RespondActivityTaskCompletedRequest) error RespondActivityTaskFailed(request *h.RespondActivityTaskFailedRequest) error RespondActivityTaskCanceled(request *h.RespondActivityTaskCanceledRequest) error RecordActivityTaskHeartbeat(request *h.RecordActivityTaskHeartbeatRequest) (*workflow.RecordActivityTaskHeartbeatResponse, error) RequestCancelWorkflowExecution(request *h.RequestCancelWorkflowExecutionRequest) error SignalWorkflowExecution(request *h.SignalWorkflowExecutionRequest) error RemoveSignalMutableState(request *h.RemoveSignalMutableStateRequest) error TerminateWorkflowExecution(request *h.TerminateWorkflowExecutionRequest) error ScheduleDecisionTask(request *h.ScheduleDecisionTaskRequest) error RecordChildExecutionCompleted(request *h.RecordChildExecutionCompletedRequest) error }
Engine represents an interface for managing workflow execution history.
func NewEngineWithShardContext ¶
func NewEngineWithShardContext(shard ShardContext, domainCache cache.DomainCache, visibilityMgr persistence.VisibilityManager, matching matching.Client, historyClient hc.Client, historyEventNotifier historyEventNotifier) Engine
NewEngineWithShardContext creates an instance of history engine
type EngineFactory ¶
type EngineFactory interface {
CreateEngine(context ShardContext) Engine
}
EngineFactory is used to create an instance of sharded history engine
type Handler ¶
Handler - Thrift handler inteface for history service
func NewHandler ¶
func NewHandler(sVice service.Service, config *Config, shardManager persistence.ShardManager, metadataMgr persistence.MetadataManager, visibilityMgr persistence.VisibilityManager, historyMgr persistence.HistoryManager, executionMgrFactory persistence.ExecutionManagerFactory) *Handler
NewHandler creates a thrift handler for the history service
func (*Handler) CreateEngine ¶
func (h *Handler) CreateEngine(context ShardContext) Engine
CreateEngine is implementation for HistoryEngineFactory used for creating the engine instance for shard
func (*Handler) DescribeWorkflowExecution ¶ added in v0.3.3
func (h *Handler) DescribeWorkflowExecution(ctx context.Context, request *hist.DescribeWorkflowExecutionRequest) (*gen.DescribeWorkflowExecutionResponse, error)
DescribeWorkflowExecution returns information about the specified workflow execution.
func (*Handler) GetMutableState ¶ added in v0.3.5
func (h *Handler) GetMutableState(ctx context.Context, getRequest *hist.GetMutableStateRequest) (*hist.GetMutableStateResponse, error)
GetMutableState - returns the id of the next event in the execution's history
func (*Handler) RecordActivityTaskHeartbeat ¶
func (h *Handler) RecordActivityTaskHeartbeat(ctx context.Context, wrappedRequest *hist.RecordActivityTaskHeartbeatRequest) (*gen.RecordActivityTaskHeartbeatResponse, error)
RecordActivityTaskHeartbeat - Record Activity Task Heart beat.
func (*Handler) RecordActivityTaskStarted ¶
func (h *Handler) RecordActivityTaskStarted(ctx context.Context, recordRequest *hist.RecordActivityTaskStartedRequest) (*hist.RecordActivityTaskStartedResponse, error)
RecordActivityTaskStarted - Record Activity Task started.
func (*Handler) RecordChildExecutionCompleted ¶
func (h *Handler) RecordChildExecutionCompleted(ctx context.Context, request *hist.RecordChildExecutionCompletedRequest) error
RecordChildExecutionCompleted is used for reporting the completion of child workflow execution to parent. This is mainly called by transfer queue processor during the processing of DeleteExecution task.
func (*Handler) RecordDecisionTaskStarted ¶
func (h *Handler) RecordDecisionTaskStarted(ctx context.Context, recordRequest *hist.RecordDecisionTaskStartedRequest) (*hist.RecordDecisionTaskStartedResponse, error)
RecordDecisionTaskStarted - Record Decision Task started.
func (*Handler) RemoveSignalMutableState ¶ added in v0.3.6
func (h *Handler) RemoveSignalMutableState(ctx context.Context, wrappedRequest *hist.RemoveSignalMutableStateRequest) error
RemoveSignalMutableState is used to remove a signal request ID that was previously recorded. This is currently used to clean execution info when signal decision finished.
func (*Handler) RequestCancelWorkflowExecution ¶
func (h *Handler) RequestCancelWorkflowExecution(ctx context.Context, request *hist.RequestCancelWorkflowExecutionRequest) error
RequestCancelWorkflowExecution - requests cancellation of a workflow
func (*Handler) ResetStickyTaskList ¶ added in v0.3.7
func (h *Handler) ResetStickyTaskList(ctx context.Context, resetRequest *hist.ResetStickyTaskListRequest) (*hist.ResetStickyTaskListResponse, error)
ResetStickyTaskList reset the volatile information in mutable state of a given workflow. Volatile information are the information related to client, such as: 1. StickyTaskList 2. StickyScheduleToStartTimeout 3. ClientLibraryVersion 4. ClientFeatureVersion 5. ClientImpl
func (*Handler) RespondActivityTaskCanceled ¶
func (h *Handler) RespondActivityTaskCanceled(ctx context.Context, wrappedRequest *hist.RespondActivityTaskCanceledRequest) error
RespondActivityTaskCanceled - records failure of an activity task
func (*Handler) RespondActivityTaskCompleted ¶
func (h *Handler) RespondActivityTaskCompleted(ctx context.Context, wrappedRequest *hist.RespondActivityTaskCompletedRequest) error
RespondActivityTaskCompleted - records completion of an activity task
func (*Handler) RespondActivityTaskFailed ¶
func (h *Handler) RespondActivityTaskFailed(ctx context.Context, wrappedRequest *hist.RespondActivityTaskFailedRequest) error
RespondActivityTaskFailed - records failure of an activity task
func (*Handler) RespondDecisionTaskCompleted ¶
func (h *Handler) RespondDecisionTaskCompleted(ctx context.Context, wrappedRequest *hist.RespondDecisionTaskCompletedRequest) error
RespondDecisionTaskCompleted - records completion of a decision task
func (*Handler) RespondDecisionTaskFailed ¶ added in v0.3.3
func (h *Handler) RespondDecisionTaskFailed(ctx context.Context, wrappedRequest *hist.RespondDecisionTaskFailedRequest) error
RespondDecisionTaskFailed - failed response to decision task
func (*Handler) ScheduleDecisionTask ¶
func (h *Handler) ScheduleDecisionTask(ctx context.Context, request *hist.ScheduleDecisionTaskRequest) error
ScheduleDecisionTask is used for creating a decision task for already started workflow execution. This is mainly used by transfer queue processor during the processing of StartChildWorkflowExecution task, where it first starts child execution without creating the decision task and then calls this API after updating the mutable state of parent execution.
func (*Handler) SignalWorkflowExecution ¶
func (h *Handler) SignalWorkflowExecution(ctx context.Context, wrappedRequest *hist.SignalWorkflowExecutionRequest) error
SignalWorkflowExecution is used to send a signal event to running workflow execution. This results in WorkflowExecutionSignaled event recorded in the history and a decision task being created for the execution.
func (*Handler) StartWorkflowExecution ¶
func (h *Handler) StartWorkflowExecution(ctx context.Context, wrappedRequest *hist.StartWorkflowExecutionRequest) (*gen.StartWorkflowExecutionResponse, error)
StartWorkflowExecution - creates a new workflow execution
func (*Handler) TerminateWorkflowExecution ¶
func (h *Handler) TerminateWorkflowExecution(ctx context.Context, wrappedRequest *hist.TerminateWorkflowExecutionRequest) error
TerminateWorkflowExecution terminates an existing workflow execution by recording WorkflowExecutionTerminated event in the history and immediately terminating the execution instance.
type MockHistoryEngine ¶
MockHistoryEngine is used as mock implementation for HistoryEngine
func (*MockHistoryEngine) DescribeWorkflowExecution ¶ added in v0.3.3
func (_m *MockHistoryEngine) DescribeWorkflowExecution(request *gohistory.DescribeWorkflowExecutionRequest) (*shared.DescribeWorkflowExecutionResponse, error)
DescribeWorkflowExecution is mock implementation for DescribeWorkflowExecution of HistoryEngine
func (*MockHistoryEngine) GetMutableState ¶ added in v0.3.5
func (_m *MockHistoryEngine) GetMutableState(ctx context.Context, request *gohistory.GetMutableStateRequest) (*gohistory.GetMutableStateResponse, error)
GetMutableState is mock implementation for GetMutableState of HistoryEngine
func (*MockHistoryEngine) RecordActivityTaskHeartbeat ¶
func (_m *MockHistoryEngine) RecordActivityTaskHeartbeat(request *gohistory.RecordActivityTaskHeartbeatRequest) (*shared.RecordActivityTaskHeartbeatResponse, error)
RecordActivityTaskHeartbeat is mock implementation for RecordActivityTaskHeartbeat of HistoryEngine
func (*MockHistoryEngine) RecordActivityTaskStarted ¶
func (_m *MockHistoryEngine) RecordActivityTaskStarted(request *gohistory.RecordActivityTaskStartedRequest) (*gohistory.RecordActivityTaskStartedResponse, error)
RecordActivityTaskStarted is mock implementation for RecordActivityTaskStarted of HistoryEngine
func (*MockHistoryEngine) RecordChildExecutionCompleted ¶
func (_m *MockHistoryEngine) RecordChildExecutionCompleted(request *gohistory.RecordChildExecutionCompletedRequest) error
RecordChildExecutionCompleted is mock implementation for CompleteChildExecution of HistoryEngine
func (*MockHistoryEngine) RecordDecisionTaskStarted ¶
func (_m *MockHistoryEngine) RecordDecisionTaskStarted(request *gohistory.RecordDecisionTaskStartedRequest) (*gohistory.RecordDecisionTaskStartedResponse, error)
RecordDecisionTaskStarted is mock implementation for RecordDecisionTaskStarted of HistoryEngine
func (*MockHistoryEngine) RemoveSignalMutableState ¶ added in v0.3.6
func (_m *MockHistoryEngine) RemoveSignalMutableState(request *gohistory.RemoveSignalMutableStateRequest) error
RemoveSignalMutableState is mock implementation for RemoveSignalMutableState of HistoryEngine
func (*MockHistoryEngine) RequestCancelWorkflowExecution ¶
func (_m *MockHistoryEngine) RequestCancelWorkflowExecution(request *gohistory.RequestCancelWorkflowExecutionRequest) error
RequestCancelWorkflowExecution is mock implementation for RequestCancelWorkflowExecution of HistoryEngine
func (*MockHistoryEngine) ResetStickyTaskList ¶ added in v0.3.7
func (_m *MockHistoryEngine) ResetStickyTaskList(request *gohistory.ResetStickyTaskListRequest) (*gohistory.ResetStickyTaskListResponse, error)
ResetStickyTaskList is mock implementation for ResetStickyTaskList of HistoryEngine
func (*MockHistoryEngine) RespondActivityTaskCanceled ¶
func (_m *MockHistoryEngine) RespondActivityTaskCanceled(request *gohistory.RespondActivityTaskCanceledRequest) error
RespondActivityTaskCanceled is mock implementation for RespondActivityTaskCanceled of HistoryEngine
func (*MockHistoryEngine) RespondActivityTaskCompleted ¶
func (_m *MockHistoryEngine) RespondActivityTaskCompleted(request *gohistory.RespondActivityTaskCompletedRequest) error
RespondActivityTaskCompleted is mock implementation for RespondActivityTaskCompleted of HistoryEngine
func (*MockHistoryEngine) RespondActivityTaskFailed ¶
func (_m *MockHistoryEngine) RespondActivityTaskFailed(request *gohistory.RespondActivityTaskFailedRequest) error
RespondActivityTaskFailed is mock implementation for RespondActivityTaskFailed of HistoryEngine
func (*MockHistoryEngine) RespondDecisionTaskCompleted ¶
func (_m *MockHistoryEngine) RespondDecisionTaskCompleted(ctx context.Context, request *gohistory.RespondDecisionTaskCompletedRequest) error
RespondDecisionTaskCompleted is mock implementation for RespondDecisionTaskCompleted of HistoryEngine
func (*MockHistoryEngine) RespondDecisionTaskFailed ¶ added in v0.3.3
func (_m *MockHistoryEngine) RespondDecisionTaskFailed(request *gohistory.RespondDecisionTaskFailedRequest) error
RespondDecisionTaskFailed is mock implementation for RespondDecisionTaskFailed of HistoryEngine
func (*MockHistoryEngine) ScheduleDecisionTask ¶
func (_m *MockHistoryEngine) ScheduleDecisionTask(request *gohistory.ScheduleDecisionTaskRequest) error
ScheduleDecisionTask is mock implementation for ScheduleDecisionTask of HistoryEngine
func (*MockHistoryEngine) SignalWorkflowExecution ¶
func (_m *MockHistoryEngine) SignalWorkflowExecution(request *gohistory.SignalWorkflowExecutionRequest) error
SignalWorkflowExecution is mock implementation for SignalWorkflowExecution of HistoryEngine
func (*MockHistoryEngine) Start ¶
func (_m *MockHistoryEngine) Start()
Start is mock implementation for Start for HistoryEngine
func (*MockHistoryEngine) StartWorkflowExecution ¶
func (_m *MockHistoryEngine) StartWorkflowExecution(request *gohistory.StartWorkflowExecutionRequest) (*shared.StartWorkflowExecutionResponse, error)
StartWorkflowExecution is mock implementation for StartWorkflowExecution of HistoryEngine
func (*MockHistoryEngine) Stop ¶
func (_m *MockHistoryEngine) Stop()
Stop is mock implementation for Stop of HistoryEngine
func (*MockHistoryEngine) TerminateWorkflowExecution ¶
func (_m *MockHistoryEngine) TerminateWorkflowExecution(request *gohistory.TerminateWorkflowExecutionRequest) error
TerminateWorkflowExecution is mock implementation for TerminateWorkflowExecution of HistoryEngine
type MockHistoryEngineFactory ¶
MockHistoryEngineFactory is mock implementation for HistoryEngineFactory
func (*MockHistoryEngineFactory) CreateEngine ¶
func (_m *MockHistoryEngineFactory) CreateEngine(context ShardContext) Engine
CreateEngine is mock implementation for CreateEngine of HistoryEngineFactory
type SequenceID ¶
SequenceID - Visibility timer stamp + Sequence Number.
func (SequenceID) String ¶
func (s SequenceID) String() string
type SequenceNumberGenerator ¶
type SequenceNumberGenerator interface {
NextSeq() int64
}
SequenceNumberGenerator - Generates next sequence number.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents the cadence-history service
type ShardContext ¶
type ShardContext interface { GetExecutionManager() persistence.ExecutionManager GetHistoryManager() persistence.HistoryManager GetDomainCache() cache.DomainCache GetNextTransferTaskID() (int64, error) GetTransferSequenceNumber() int64 GetTransferMaxReadLevel() int64 GetTransferAckLevel() int64 UpdateTransferAckLevel(ackLevel int64) error CreateWorkflowExecution(request *persistence.CreateWorkflowExecutionRequest) ( *persistence.CreateWorkflowExecutionResponse, error) UpdateWorkflowExecution(request *persistence.UpdateWorkflowExecutionRequest) error AppendHistoryEvents(request *persistence.AppendHistoryEventsRequest) error NotifyNewHistoryEvent(event *historyEventNotification) error GetConfig() *Config GetLogger() bark.Logger GetMetricsClient() metrics.Client GetTimerAckLevel() time.Time UpdateTimerAckLevel(ackLevel time.Time) error GetTimeSource() common.TimeSource }
ShardContext represents a history engine shard
type TestBase ¶ added in v0.3.0
type TestBase struct { persistence.TestBase ShardContext *TestShardContext }
TestBase wraps the base setup needed to create workflows over engine layer.
func (*TestBase) SetupWorkflowStore ¶ added in v0.3.0
func (s *TestBase) SetupWorkflowStore()
SetupWorkflowStore to setup workflow test base
func (*TestBase) SetupWorkflowStoreWithOptions ¶ added in v0.3.0
func (s *TestBase) SetupWorkflowStoreWithOptions(options persistence.TestBaseOptions)
SetupWorkflowStoreWithOptions to setup workflow test base
type TestShardContext ¶ added in v0.3.0
TestShardContext shard context for testing.
func (*TestShardContext) AppendHistoryEvents ¶ added in v0.3.0
func (s *TestShardContext) AppendHistoryEvents(request *persistence.AppendHistoryEventsRequest) error
AppendHistoryEvents test implementation
func (*TestShardContext) CreateWorkflowExecution ¶ added in v0.3.0
func (s *TestShardContext) CreateWorkflowExecution(request *persistence.CreateWorkflowExecutionRequest) ( *persistence.CreateWorkflowExecutionResponse, error)
CreateWorkflowExecution test implementation
func (*TestShardContext) GetConfig ¶ added in v0.3.1
func (s *TestShardContext) GetConfig() *Config
GetConfig test implementation
func (*TestShardContext) GetDomainCache ¶ added in v0.3.5
func (s *TestShardContext) GetDomainCache() cache.DomainCache
GetDomainCache test implementation
func (*TestShardContext) GetExecutionManager ¶ added in v0.3.0
func (s *TestShardContext) GetExecutionManager() persistence.ExecutionManager
GetExecutionManager test implementation
func (*TestShardContext) GetHistoryManager ¶ added in v0.3.0
func (s *TestShardContext) GetHistoryManager() persistence.HistoryManager
GetHistoryManager test implementation
func (*TestShardContext) GetLogger ¶ added in v0.3.0
func (s *TestShardContext) GetLogger() bark.Logger
GetLogger test implementation
func (*TestShardContext) GetMetricsClient ¶ added in v0.3.0
func (s *TestShardContext) GetMetricsClient() metrics.Client
GetMetricsClient test implementation
func (*TestShardContext) GetNextTransferTaskID ¶ added in v0.3.0
func (s *TestShardContext) GetNextTransferTaskID() (int64, error)
GetNextTransferTaskID test implementation
func (*TestShardContext) GetRangeID ¶ added in v0.3.0
func (s *TestShardContext) GetRangeID() int64
GetRangeID test implementation
func (*TestShardContext) GetTimeSource ¶ added in v0.3.0
func (s *TestShardContext) GetTimeSource() common.TimeSource
GetTimeSource test implementation
func (*TestShardContext) GetTimerAckLevel ¶ added in v0.3.0
func (s *TestShardContext) GetTimerAckLevel() time.Time
GetTimerAckLevel test implementation
func (*TestShardContext) GetTransferAckLevel ¶ added in v0.3.0
func (s *TestShardContext) GetTransferAckLevel() int64
GetTransferAckLevel test implementation
func (*TestShardContext) GetTransferMaxReadLevel ¶ added in v0.3.0
func (s *TestShardContext) GetTransferMaxReadLevel() int64
GetTransferMaxReadLevel test implementation
func (*TestShardContext) GetTransferSequenceNumber ¶ added in v0.3.0
func (s *TestShardContext) GetTransferSequenceNumber() int64
GetTransferSequenceNumber test implementation
func (*TestShardContext) NotifyNewHistoryEvent ¶ added in v0.3.3
func (s *TestShardContext) NotifyNewHistoryEvent(event *historyEventNotification) error
NotifyNewHistoryEvent test implementation
func (*TestShardContext) Reset ¶ added in v0.3.0
func (s *TestShardContext) Reset()
Reset test implementation
func (*TestShardContext) UpdateTimerAckLevel ¶ added in v0.3.0
func (s *TestShardContext) UpdateTimerAckLevel(ackLevel time.Time) error
UpdateTimerAckLevel test implementation
func (*TestShardContext) UpdateTransferAckLevel ¶ added in v0.3.0
func (s *TestShardContext) UpdateTransferAckLevel(ackLevel int64) error
UpdateTransferAckLevel test implementation
func (*TestShardContext) UpdateWorkflowExecution ¶ added in v0.3.0
func (s *TestShardContext) UpdateWorkflowExecution(request *persistence.UpdateWorkflowExecutionRequest) error
UpdateWorkflowExecution test implementation
Source Files ¶
- MockHistoryEngine.go
- MockHistoryEngineFactory.go
- handler.go
- historyBuilder.go
- historyCache.go
- historyEngine.go
- historyEngineInterfaces.go
- historyEventNotifier.go
- historyTestBase.go
- jsonHistoryEventSerializer.go
- mutableStateBuilder.go
- service.go
- shardContext.go
- shardController.go
- timerBuilder.go
- timerQueueProcessor.go
- transferQueueProcessor.go
- workflowExecutionContext.go