Documentation
¶
Overview ¶
Package api is a generated GoMock package.
Index ¶
- Variables
- func CreateMutableState(shard historyi.ShardContext, namespaceEntry *namespace.Namespace, ...) (historyi.MutableState, error)
- func DeserializeHistoryToken(bytes []byte) (*tokenspb.HistoryContinuation, error)
- func DeserializeRawHistoryToken(bytes []byte) (*tokenspb.RawHistoryContinuation, error)
- func FixFollowEvents(ctx context.Context, versionChecker headers.VersionChecker, ...) error
- func GenerateFirstWorkflowTask(mutableState historyi.MutableState, ...) (int64, error)
- func GeneratePaginationToken(request *historyservice.GetWorkflowExecutionRawHistoryRequest, ...) *tokenspb.RawHistoryContinuation
- func GeneratePaginationTokenV2Request(request *historyservice.GetWorkflowExecutionRawHistoryV2Request, ...) *tokenspb.RawHistoryContinuation
- func GetActiveNamespace(shard historyi.ShardContext, namespaceUUID namespace.ID) (*namespace.Namespace, error)
- func GetActivityScheduledEventID(activityID string, mutableState historyi.MutableState) (int64, error)
- func GetAndUpdateWorkflowWithConsistencyCheck(ctx context.Context, reqClock *clockspb.VectorClock, ...) (retError error)
- func GetAndUpdateWorkflowWithNew(ctx context.Context, reqClock *clockspb.VectorClock, ...) (retError error)
- func GetHistory(ctx context.Context, shardContext historyi.ShardContext, ...) (*historypb.History, []byte, error)
- func GetHistoryReverse(ctx context.Context, shardContext historyi.ShardContext, ...) (*historypb.History, []byte, int64, error)
- func GetMutableState(ctx context.Context, shardContext historyi.ShardContext, ...) (_ *historyservice.GetMutableStateResponse, retError error)
- func GetMutableStateWithConsistencyCheck(ctx context.Context, shardContext historyi.ShardContext, ...) (_ *historyservice.GetMutableStateResponse, retError error)
- func GetOrPollMutableState(ctx context.Context, shardContext historyi.ShardContext, ...) (*historyservice.GetMutableStateResponse, error)
- func GetRawHistory(ctx context.Context, shardContext historyi.ShardContext, ...) ([]*commonpb.DataBlob, []byte, error)
- func GetTaskCategory(categoryID int, registry tasks.TaskCategoryRegistry) (tasks.Category, error)
- func IsHistoryEventOnCurrentBranch(mutableState historyi.MutableState, eventID int64, eventVersion int64) (bool, error)
- func IsRetryableError(err error) bool
- func MigrateWorkflowIdReusePolicyForRunningWorkflow(wfIDReusePolicy *enumspb.WorkflowIdReusePolicy, ...)
- func MutableStateToGetResponse(mutableState historyi.MutableState) (*historyservice.GetMutableStateResponse, error)
- func NewWorkflowVersionCheck(shard historyi.ShardContext, prevLastWriteVersion int64, ...) error
- func NewWorkflowWithSignal(shard historyi.ShardContext, namespaceEntry *namespace.Namespace, ...) (historyi.MutableState, error)
- func OverrideStartWorkflowExecutionRequest(request *workflowservice.StartWorkflowExecutionRequest, operation string, ...)
- func ProcessInternalRawHistory(requestContext context.Context, saProvider searchattribute.Provider, ...) error
- func ProcessOutgoingSearchAttributes(saProvider searchattribute.Provider, ...) error
- func ResolveWorkflowIDReusePolicy(workflowKey definition.WorkflowKey, ...) error
- func SerializeHistoryToken(token *tokenspb.HistoryContinuation) ([]byte, error)
- func SerializeRawHistoryToken(token *tokenspb.RawHistoryContinuation) ([]byte, error)
- func SetActivityTaskRunID(ctx context.Context, token *tokenspb.Task, ...) error
- func TrimHistoryNode(ctx context.Context, shardContext historyi.ShardContext, ...)
- func UpdateWorkflowWithNew(shardContext historyi.ShardContext, ctx context.Context, ...) (retError error)
- func ValidateNamespaceUUID(namespaceUUID namespace.ID) error
- func ValidatePaginationToken(request *historyservice.GetWorkflowExecutionRawHistoryRequest, ...) error
- func ValidatePaginationTokenV2Request(request *historyservice.GetWorkflowExecutionRawHistoryV2Request, ...) error
- func ValidateReplicationConfig(clusterMetadata cluster.Metadata) error
- func ValidateSignal(ctx context.Context, shard historyi.ShardContext, ...) error
- func ValidateStart(ctx context.Context, shard historyi.ShardContext, ...) error
- func ValidateStartWorkflowExecutionRequest(ctx context.Context, request *workflowservice.StartWorkflowExecutionRequest, ...) error
- func VerifyHistoryIsComplete(firstEvent *historyspb.StrippedHistoryEvent, ...) error
- type CommandAttrValidator
- func (v *CommandAttrValidator) ValidateActivityCancelAttributes(attributes *commandpb.RequestCancelActivityTaskCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateActivityScheduleAttributes(namespaceID namespace.ID, ...) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateCancelExternalWorkflowExecutionAttributes(namespaceID namespace.ID, targetNamespaceID namespace.ID, ...) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateCancelWorkflowExecutionAttributes(attributes *commandpb.CancelWorkflowExecutionCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateCommandSequence(commands []*commandpb.Command) error
- func (v *CommandAttrValidator) ValidateCompleteWorkflowExecutionAttributes(attributes *commandpb.CompleteWorkflowExecutionCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateContinueAsNewWorkflowExecutionAttributes(namespaceName namespace.Name, ...) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateFailWorkflowExecutionAttributes(attributes *commandpb.FailWorkflowExecutionCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateModifyWorkflowProperties(attributes *commandpb.ModifyWorkflowPropertiesCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateProtocolMessageAttributes(namespaceID namespace.ID, ...) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateRecordMarkerAttributes(attributes *commandpb.RecordMarkerCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateSignalExternalWorkflowExecutionAttributes(namespaceID namespace.ID, targetNamespaceID namespace.ID, ...) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateStartChildExecutionAttributes(namespaceID namespace.ID, targetNamespaceID namespace.ID, ...) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateTimerCancelAttributes(attributes *commandpb.CancelTimerCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateTimerScheduleAttributes(attributes *commandpb.StartTimerCommandAttributes) (enumspb.WorkflowTaskFailedCause, error)
- func (v *CommandAttrValidator) ValidateUpsertWorkflowSearchAttributes(namespaceName namespace.Name, ...) (enumspb.WorkflowTaskFailedCause, error)
- type CreateOrUpdateLeaseFunc
- type MockWorkflowConsistencyChecker
- func (m *MockWorkflowConsistencyChecker) EXPECT() *MockWorkflowConsistencyCheckerMockRecorder
- func (m *MockWorkflowConsistencyChecker) GetCurrentRunID(ctx context.Context, namespaceID, workflowID string, ...) (string, error)
- func (m *MockWorkflowConsistencyChecker) GetWorkflowCache() cache.Cache
- func (m *MockWorkflowConsistencyChecker) GetWorkflowLease(ctx context.Context, reqClock *clock.VectorClock, ...) (WorkflowLease, error)
- func (m *MockWorkflowConsistencyChecker) GetWorkflowLeaseWithConsistencyCheck(ctx context.Context, reqClock *clock.VectorClock, ...) (WorkflowLease, error)
- type MockWorkflowConsistencyCheckerMockRecorder
- func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetCurrentRunID(ctx, namespaceID, workflowID, lockPriority any) *gomock.Call
- func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowCache() *gomock.Call
- func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowLease(ctx, reqClock, workflowKey, lockPriority any) *gomock.Call
- func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowLeaseWithConsistencyCheck(ctx, reqClock, consistencyPredicate, workflowKey, lockPriority any) *gomock.Call
- type MutableStateConsistencyPredicate
- type UpdateWorkflowAction
- type UpdateWorkflowActionFunc
- type VersionedRunID
- type WorkflowConsistencyChecker
- type WorkflowConsistencyCheckerImpl
- func (c *WorkflowConsistencyCheckerImpl) GetCurrentRunID(ctx context.Context, namespaceID string, workflowID string, ...) (runID string, retErr error)
- func (c *WorkflowConsistencyCheckerImpl) GetWorkflowCache() wcache.Cache
- func (c *WorkflowConsistencyCheckerImpl) GetWorkflowLease(ctx context.Context, reqClock *clockspb.VectorClock, ...) (WorkflowLease, error)
- func (c *WorkflowConsistencyCheckerImpl) GetWorkflowLeaseWithConsistencyCheck(ctx context.Context, reqClock *clockspb.VectorClock, ...) (WorkflowLease, error)
- type WorkflowLease
Constants ¶
This section is empty.
Variables ¶
var ( UpdateWorkflowWithNewWorkflowTask = &UpdateWorkflowAction{ CreateWorkflowTask: true, } UpdateWorkflowWithoutWorkflowTask = &UpdateWorkflowAction{ CreateWorkflowTask: false, } UpdateWorkflowTerminate = &UpdateWorkflowAction{ CreateWorkflowTask: false, AbortUpdates: true, } )
var ErrUseCurrentExecution = errors.New("ErrUseCurrentExecution")
ErrUseCurrentExecution is a sentinel error to indicate to the caller to use the current workflow execution instead of creating a new one
Functions ¶
func CreateMutableState ¶
func CreateMutableState( shard historyi.ShardContext, namespaceEntry *namespace.Namespace, executionTimeout *durationpb.Duration, runTimeout *durationpb.Duration, workflowID string, runID string, ) (historyi.MutableState, error)
func DeserializeHistoryToken ¶ added in v1.23.0
func DeserializeHistoryToken(bytes []byte) (*tokenspb.HistoryContinuation, error)
NOTE: DO NOT MODIFY UNLESS ALSO APPLIED TO ./service/frontend/token_deprecated.go
func DeserializeRawHistoryToken ¶ added in v1.23.0
func DeserializeRawHistoryToken(bytes []byte) (*tokenspb.RawHistoryContinuation, error)
NOTE: DO NOT MODIFY UNLESS ALSO APPLIED TO ./service/frontend/token_deprecated.go
func FixFollowEvents ¶ added in v1.27.2
func GenerateFirstWorkflowTask ¶
func GenerateFirstWorkflowTask( mutableState historyi.MutableState, parentInfo *workflowspb.ParentExecutionInfo, startEvent *historypb.HistoryEvent, bypassTaskGeneration bool, ) (int64, error)
func GeneratePaginationToken ¶ added in v1.23.0
func GeneratePaginationToken( request *historyservice.GetWorkflowExecutionRawHistoryRequest, versionHistories *historyspb.VersionHistories, ) *tokenspb.RawHistoryContinuation
func GeneratePaginationTokenV2Request ¶ added in v1.24.0
func GeneratePaginationTokenV2Request( request *historyservice.GetWorkflowExecutionRawHistoryV2Request, versionHistories *historyspb.VersionHistories, ) *tokenspb.RawHistoryContinuation
NOTE: DO NOT MODIFY UNLESS ALSO APPLIED TO ./service/frontend/token_deprecated.go
func GetActiveNamespace ¶ added in v1.18.0
func GetActivityScheduledEventID ¶ added in v1.18.0
func GetActivityScheduledEventID( activityID string, mutableState historyi.MutableState, ) (int64, error)
func GetAndUpdateWorkflowWithConsistencyCheck ¶ added in v1.25.0
func GetAndUpdateWorkflowWithConsistencyCheck( ctx context.Context, reqClock *clockspb.VectorClock, consistencyCheckFn MutableStateConsistencyPredicate, workflowKey definition.WorkflowKey, action UpdateWorkflowActionFunc, newWorkflowFn func() (historyi.WorkflowContext, historyi.MutableState, error), shardContext historyi.ShardContext, workflowConsistencyChecker WorkflowConsistencyChecker, ) (retError error)
func GetAndUpdateWorkflowWithNew ¶ added in v1.18.0
func GetAndUpdateWorkflowWithNew( ctx context.Context, reqClock *clockspb.VectorClock, workflowKey definition.WorkflowKey, action UpdateWorkflowActionFunc, newWorkflowFn func() (historyi.WorkflowContext, historyi.MutableState, error), shard historyi.ShardContext, workflowConsistencyChecker WorkflowConsistencyChecker, ) (retError error)
func GetHistory ¶ added in v1.23.0
func GetHistory( ctx context.Context, shardContext historyi.ShardContext, namespaceID namespace.ID, execution *commonpb.WorkflowExecution, firstEventID int64, nextEventID int64, pageSize int32, nextPageToken []byte, transientWorkflowTaskInfo *historyspb.TransientWorkflowTaskInfo, branchToken []byte, persistenceVisibilityMgr manager.VisibilityManager, ) (*historypb.History, []byte, error)
func GetHistoryReverse ¶ added in v1.23.0
func GetHistoryReverse( ctx context.Context, shardContext historyi.ShardContext, namespaceID namespace.ID, execution *commonpb.WorkflowExecution, nextEventID int64, lastFirstTxnID int64, pageSize int32, nextPageToken []byte, branchToken []byte, persistenceVisibilityMgr manager.VisibilityManager, ) (*historypb.History, []byte, int64, error)
func GetMutableState ¶ added in v1.19.0
func GetMutableState( ctx context.Context, shardContext historyi.ShardContext, workflowKey definition.WorkflowKey, workflowConsistencyChecker WorkflowConsistencyChecker, ) (_ *historyservice.GetMutableStateResponse, retError error)
func GetMutableStateWithConsistencyCheck ¶ added in v1.26.2
func GetMutableStateWithConsistencyCheck( ctx context.Context, shardContext historyi.ShardContext, workflowKey definition.WorkflowKey, currentVersion int64, currentEventID int64, versionedTransition *persistencespb.VersionedTransition, workflowConsistencyChecker WorkflowConsistencyChecker, ) (_ *historyservice.GetMutableStateResponse, retError error)
func GetOrPollMutableState ¶ added in v1.19.0
func GetOrPollMutableState( ctx context.Context, shardContext historyi.ShardContext, request *historyservice.GetMutableStateRequest, workflowConsistencyChecker WorkflowConsistencyChecker, eventNotifier events.Notifier, ) (*historyservice.GetMutableStateResponse, error)
func GetRawHistory ¶ added in v1.23.0
func GetRawHistory( ctx context.Context, shardContext historyi.ShardContext, namespaceID namespace.ID, execution *commonpb.WorkflowExecution, firstEventID int64, nextEventID int64, pageSize int32, token []byte, transientWorkflowTaskInfo *historyspb.TransientWorkflowTaskInfo, branchToken []byte, ) ([]*commonpb.DataBlob, []byte, error)
func GetTaskCategory ¶ added in v1.23.0
func IsHistoryEventOnCurrentBranch ¶ added in v1.19.0
func IsRetryableError ¶ added in v1.17.3
func MigrateWorkflowIdReusePolicyForRunningWorkflow ¶ added in v1.24.0
func MigrateWorkflowIdReusePolicyForRunningWorkflow( wfIDReusePolicy *enumspb.WorkflowIdReusePolicy, wfIDConflictPolicy *enumspb.WorkflowIdConflictPolicy, )
func MutableStateToGetResponse ¶ added in v1.19.0
func MutableStateToGetResponse( mutableState historyi.MutableState, ) (*historyservice.GetMutableStateResponse, error)
func NewWorkflowVersionCheck ¶
func NewWorkflowVersionCheck( shard historyi.ShardContext, prevLastWriteVersion int64, newMutableState historyi.MutableState, ) error
func NewWorkflowWithSignal ¶
func NewWorkflowWithSignal( shard historyi.ShardContext, namespaceEntry *namespace.Namespace, workflowID string, runID string, startRequest *historyservice.StartWorkflowExecutionRequest, signalWithStartRequest *workflowservice.SignalWithStartWorkflowExecutionRequest, ) (historyi.MutableState, error)
func OverrideStartWorkflowExecutionRequest ¶ added in v1.18.0
func OverrideStartWorkflowExecutionRequest( request *workflowservice.StartWorkflowExecutionRequest, operation string, shard historyi.ShardContext, metricsHandler metrics.Handler, )
func ProcessInternalRawHistory ¶ added in v1.27.2
func ProcessInternalRawHistory( requestContext context.Context, saProvider searchattribute.Provider, saMapperProvider searchattribute.MapperProvider, response *historyservice.GetWorkflowExecutionHistoryResponse, visibilityManager manager.VisibilityManager, versionChecker headers.VersionChecker, ns namespace.Name, isCloseEventOnly bool, ) error
ProcessInternalRawHistory processes history in the field response.History. History service can send history events in response.History.Events. In that case, process the events and move them to response.Response.History. Usually this is done by history service but when history.sendRawHistoryBetweenInternalServices is enabled, history service sends raw history events to frontend without any processing.
func ProcessOutgoingSearchAttributes ¶ added in v1.23.0
func ProcessOutgoingSearchAttributes( saProvider searchattribute.Provider, saMapperProvider searchattribute.MapperProvider, events []*historypb.HistoryEvent, ns namespace.Name, persistenceVisibilityMgr manager.VisibilityManager, ) error
func ResolveWorkflowIDReusePolicy ¶ added in v1.27.0
func ResolveWorkflowIDReusePolicy( workflowKey definition.WorkflowKey, currentStatus enumspb.WorkflowExecutionStatus, currentRequestIDs map[string]*persistencespb.RequestIDInfo, wfIDReusePolicy enumspb.WorkflowIdReusePolicy, ) error
func SerializeHistoryToken ¶ added in v1.23.0
func SerializeHistoryToken(token *tokenspb.HistoryContinuation) ([]byte, error)
NOTE: DO NOT MODIFY UNLESS ALSO APPLIED TO ./service/frontend/token_deprecated.go
func SerializeRawHistoryToken ¶ added in v1.23.0
func SerializeRawHistoryToken(token *tokenspb.RawHistoryContinuation) ([]byte, error)
NOTE: DO NOT MODIFY UNLESS ALSO APPLIED TO ./service/frontend/token_deprecated.go
func SetActivityTaskRunID ¶ added in v1.18.0
func TrimHistoryNode ¶ added in v1.23.0
func TrimHistoryNode( ctx context.Context, shardContext historyi.ShardContext, workflowConsistencyChecker WorkflowConsistencyChecker, eventNotifier events.Notifier, namespaceID string, workflowID string, runID string, )
func UpdateWorkflowWithNew ¶
func UpdateWorkflowWithNew( shardContext historyi.ShardContext, ctx context.Context, workflowLease WorkflowLease, action UpdateWorkflowActionFunc, newWorkflowFn func() (historyi.WorkflowContext, historyi.MutableState, error), ) (retError error)
func ValidateNamespaceUUID ¶ added in v1.18.0
func ValidatePaginationToken ¶ added in v1.23.0
func ValidatePaginationToken( request *historyservice.GetWorkflowExecutionRawHistoryRequest, token *tokenspb.RawHistoryContinuation, ) error
func ValidatePaginationTokenV2Request ¶ added in v1.24.0
func ValidatePaginationTokenV2Request( request *historyservice.GetWorkflowExecutionRawHistoryV2Request, token *tokenspb.RawHistoryContinuation, ) error
NOTE: DO NOT MODIFY UNLESS ALSO APPLIED TO ./service/frontend/token_deprecated.go
func ValidateReplicationConfig ¶ added in v1.19.0
func ValidateSignal ¶
func ValidateSignal( ctx context.Context, shard historyi.ShardContext, mutableState historyi.MutableState, signalPayloadSize int, operation string, ) error
func ValidateStart ¶
func ValidateStartWorkflowExecutionRequest ¶ added in v1.18.0
func VerifyHistoryIsComplete ¶ added in v1.27.2
func VerifyHistoryIsComplete( firstEvent *historyspb.StrippedHistoryEvent, lastEvent *historyspb.StrippedHistoryEvent, eventCount int, expectedFirstEventID int64, expectedLastEventID int64, isFirstPage bool, isLastPage bool, pageSize int, ) error
Types ¶
type CommandAttrValidator ¶ added in v1.26.2
type CommandAttrValidator struct {
// contains filtered or unexported fields
}
func NewCommandAttrValidator ¶ added in v1.26.2
func NewCommandAttrValidator( namespaceRegistry namespace.Registry, config *configs.Config, searchAttributesValidator *searchattribute.Validator, ) *CommandAttrValidator
func (*CommandAttrValidator) ValidateActivityCancelAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateActivityCancelAttributes( attributes *commandpb.RequestCancelActivityTaskCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateActivityScheduleAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateActivityScheduleAttributes( namespaceID namespace.ID, attributes *commandpb.ScheduleActivityTaskCommandAttributes, runTimeout *durationpb.Duration, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateCancelExternalWorkflowExecutionAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateCancelExternalWorkflowExecutionAttributes( namespaceID namespace.ID, targetNamespaceID namespace.ID, initiatedChildExecutionsInSession map[string]struct{}, attributes *commandpb.RequestCancelExternalWorkflowExecutionCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateCancelWorkflowExecutionAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateCancelWorkflowExecutionAttributes( attributes *commandpb.CancelWorkflowExecutionCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateCommandSequence ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateCommandSequence( commands []*commandpb.Command, ) error
func (*CommandAttrValidator) ValidateCompleteWorkflowExecutionAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateCompleteWorkflowExecutionAttributes( attributes *commandpb.CompleteWorkflowExecutionCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateContinueAsNewWorkflowExecutionAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateContinueAsNewWorkflowExecutionAttributes( namespaceName namespace.Name, attributes *commandpb.ContinueAsNewWorkflowExecutionCommandAttributes, executionInfo *persistencespb.WorkflowExecutionInfo, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateFailWorkflowExecutionAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateFailWorkflowExecutionAttributes( attributes *commandpb.FailWorkflowExecutionCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateModifyWorkflowProperties ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateModifyWorkflowProperties( attributes *commandpb.ModifyWorkflowPropertiesCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateProtocolMessageAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateProtocolMessageAttributes( namespaceID namespace.ID, attributes *commandpb.ProtocolMessageCommandAttributes, runTimeout *durationpb.Duration, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateRecordMarkerAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateRecordMarkerAttributes( attributes *commandpb.RecordMarkerCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateSignalExternalWorkflowExecutionAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateSignalExternalWorkflowExecutionAttributes( namespaceID namespace.ID, targetNamespaceID namespace.ID, attributes *commandpb.SignalExternalWorkflowExecutionCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateStartChildExecutionAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateStartChildExecutionAttributes( namespaceID namespace.ID, targetNamespaceID namespace.ID, targetNamespace namespace.Name, attributes *commandpb.StartChildWorkflowExecutionCommandAttributes, parentInfo *persistencespb.WorkflowExecutionInfo, defaultWorkflowTaskTimeoutFn dynamicconfig.DurationPropertyFnWithNamespaceFilter, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateTimerCancelAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateTimerCancelAttributes( attributes *commandpb.CancelTimerCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateTimerScheduleAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateTimerScheduleAttributes( attributes *commandpb.StartTimerCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
func (*CommandAttrValidator) ValidateUpsertWorkflowSearchAttributes ¶ added in v1.26.2
func (v *CommandAttrValidator) ValidateUpsertWorkflowSearchAttributes( namespaceName namespace.Name, attributes *commandpb.UpsertWorkflowSearchAttributesCommandAttributes, ) (enumspb.WorkflowTaskFailedCause, error)
type CreateOrUpdateLeaseFunc ¶ added in v1.26.2
type CreateOrUpdateLeaseFunc func( WorkflowLease, historyi.ShardContext, historyi.MutableState, ) (WorkflowLease, error)
type MockWorkflowConsistencyChecker ¶ added in v1.26.0
type MockWorkflowConsistencyChecker struct {
// contains filtered or unexported fields
}
MockWorkflowConsistencyChecker is a mock of WorkflowConsistencyChecker interface.
func NewMockWorkflowConsistencyChecker ¶ added in v1.26.0
func NewMockWorkflowConsistencyChecker(ctrl *gomock.Controller) *MockWorkflowConsistencyChecker
NewMockWorkflowConsistencyChecker creates a new mock instance.
func (*MockWorkflowConsistencyChecker) EXPECT ¶ added in v1.26.0
func (m *MockWorkflowConsistencyChecker) EXPECT() *MockWorkflowConsistencyCheckerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockWorkflowConsistencyChecker) GetCurrentRunID ¶ added in v1.26.0
func (m *MockWorkflowConsistencyChecker) GetCurrentRunID(ctx context.Context, namespaceID, workflowID string, lockPriority locks.Priority) (string, error)
GetCurrentRunID mocks base method.
func (*MockWorkflowConsistencyChecker) GetWorkflowCache ¶ added in v1.26.0
func (m *MockWorkflowConsistencyChecker) GetWorkflowCache() cache.Cache
GetWorkflowCache mocks base method.
func (*MockWorkflowConsistencyChecker) GetWorkflowLease ¶ added in v1.26.0
func (m *MockWorkflowConsistencyChecker) GetWorkflowLease(ctx context.Context, reqClock *clock.VectorClock, workflowKey definition.WorkflowKey, lockPriority locks.Priority) (WorkflowLease, error)
GetWorkflowLease mocks base method.
func (*MockWorkflowConsistencyChecker) GetWorkflowLeaseWithConsistencyCheck ¶ added in v1.26.0
func (m *MockWorkflowConsistencyChecker) GetWorkflowLeaseWithConsistencyCheck(ctx context.Context, reqClock *clock.VectorClock, consistencyPredicate MutableStateConsistencyPredicate, workflowKey definition.WorkflowKey, lockPriority locks.Priority) (WorkflowLease, error)
GetWorkflowLeaseWithConsistencyCheck mocks base method.
type MockWorkflowConsistencyCheckerMockRecorder ¶ added in v1.26.0
type MockWorkflowConsistencyCheckerMockRecorder struct {
// contains filtered or unexported fields
}
MockWorkflowConsistencyCheckerMockRecorder is the mock recorder for MockWorkflowConsistencyChecker.
func (*MockWorkflowConsistencyCheckerMockRecorder) GetCurrentRunID ¶ added in v1.26.0
func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetCurrentRunID(ctx, namespaceID, workflowID, lockPriority any) *gomock.Call
GetCurrentRunID indicates an expected call of GetCurrentRunID.
func (*MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowCache ¶ added in v1.26.0
func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowCache() *gomock.Call
GetWorkflowCache indicates an expected call of GetWorkflowCache.
func (*MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowLease ¶ added in v1.26.0
func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowLease(ctx, reqClock, workflowKey, lockPriority any) *gomock.Call
GetWorkflowLease indicates an expected call of GetWorkflowLease.
func (*MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowLeaseWithConsistencyCheck ¶ added in v1.26.0
func (mr *MockWorkflowConsistencyCheckerMockRecorder) GetWorkflowLeaseWithConsistencyCheck(ctx, reqClock, consistencyPredicate, workflowKey, lockPriority any) *gomock.Call
GetWorkflowLeaseWithConsistencyCheck indicates an expected call of GetWorkflowLeaseWithConsistencyCheck.
type MutableStateConsistencyPredicate ¶
type MutableStateConsistencyPredicate func(mutableState historyi.MutableState) bool
type UpdateWorkflowAction ¶
type UpdateWorkflowActionFunc ¶
type UpdateWorkflowActionFunc func(WorkflowLease) (*UpdateWorkflowAction, error)
func ResolveDuplicateWorkflowID ¶ added in v1.24.0
func ResolveDuplicateWorkflowID( shardContext historyi.ShardContext, workflowKey definition.WorkflowKey, namespaceEntry *namespace.Namespace, newRunID string, currentState enumsspb.WorkflowExecutionState, currentStatus enumspb.WorkflowExecutionStatus, currentRequestIDs map[string]*persistencespb.RequestIDInfo, wfIDReusePolicy enumspb.WorkflowIdReusePolicy, wfIDConflictPolicy enumspb.WorkflowIdConflictPolicy, currentWorkflowStartTime time.Time, parentExecutionInfo *workflowspb.ParentExecutionInfo, childWorkflowOnly bool, ) (UpdateWorkflowActionFunc, error)
ResolveDuplicateWorkflowID determines how to resolve a workflow ID duplication upon workflow start according to the WorkflowIdReusePolicy (for *completed* workflow) or WorkflowIdConflictPolicy (for *running* workflow).
NOTE: this function assumes the workflow id reuse policy Terminate-if-Running has been migrated to the workflow id conflict policy Terminate-Existing before it is invoked.
An action (ie "mitigate and allow"), an error (ie "deny") or neither (ie "allow") is returned.
func ResolveWorkflowIDConflictPolicy ¶ added in v1.27.0
func ResolveWorkflowIDConflictPolicy( shardContext historyi.ShardContext, workflowKey definition.WorkflowKey, namespaceEntry *namespace.Namespace, newRunID string, currentRequestIDs map[string]*persistencespb.RequestIDInfo, wfIDConflictPolicy enumspb.WorkflowIdConflictPolicy, currentWorkflowStartTime time.Time, parentExecutionInfo *workflowspb.ParentExecutionInfo, childWorkflowOnly bool, ) (UpdateWorkflowActionFunc, error)
type VersionedRunID ¶ added in v1.24.0
type WorkflowConsistencyChecker ¶
type WorkflowConsistencyChecker interface { GetWorkflowCache() wcache.Cache GetCurrentRunID( ctx context.Context, namespaceID string, workflowID string, lockPriority locks.Priority, ) (string, error) GetWorkflowLease( ctx context.Context, reqClock *clockspb.VectorClock, workflowKey definition.WorkflowKey, lockPriority locks.Priority, ) (WorkflowLease, error) GetWorkflowLeaseWithConsistencyCheck( ctx context.Context, reqClock *clockspb.VectorClock, consistencyPredicate MutableStateConsistencyPredicate, workflowKey definition.WorkflowKey, lockPriority locks.Priority, ) (WorkflowLease, error) }
type WorkflowConsistencyCheckerImpl ¶
type WorkflowConsistencyCheckerImpl struct {
// contains filtered or unexported fields
}
func NewWorkflowConsistencyChecker ¶
func NewWorkflowConsistencyChecker( shardContext historyi.ShardContext, workflowCache wcache.Cache, ) *WorkflowConsistencyCheckerImpl
func (*WorkflowConsistencyCheckerImpl) GetCurrentRunID ¶
func (*WorkflowConsistencyCheckerImpl) GetWorkflowCache ¶ added in v1.19.0
func (c *WorkflowConsistencyCheckerImpl) GetWorkflowCache() wcache.Cache
func (*WorkflowConsistencyCheckerImpl) GetWorkflowLease ¶ added in v1.24.0
func (c *WorkflowConsistencyCheckerImpl) GetWorkflowLease( ctx context.Context, reqClock *clockspb.VectorClock, workflowKey definition.WorkflowKey, lockPriority locks.Priority, ) (WorkflowLease, error)
func (*WorkflowConsistencyCheckerImpl) GetWorkflowLeaseWithConsistencyCheck ¶ added in v1.25.0
func (c *WorkflowConsistencyCheckerImpl) GetWorkflowLeaseWithConsistencyCheck( ctx context.Context, reqClock *clockspb.VectorClock, consistencyPredicate MutableStateConsistencyPredicate, workflowKey definition.WorkflowKey, lockPriority locks.Priority, ) (WorkflowLease, error)
The code below should be used when custom workflow state validation is required. If consistencyPredicate failed (thus detecting a stale workflow state) workflow state will be cleared, and mutable state will be reloaded.
type WorkflowLease ¶ added in v1.24.0
type WorkflowLease interface { GetContext() historyi.WorkflowContext GetMutableState() historyi.MutableState GetReleaseFn() historyi.ReleaseWorkflowContextFunc }
func NewWorkflowLease ¶ added in v1.24.0
func NewWorkflowLease( wfContext historyi.WorkflowContext, releaseFn historyi.ReleaseWorkflowContextFunc, mutableState historyi.MutableState, ) WorkflowLease
func NewWorkflowLeaseAndContext ¶ added in v1.26.2
func NewWorkflowLeaseAndContext( existingLease WorkflowLease, shardCtx historyi.ShardContext, ms historyi.MutableState, ) (WorkflowLease, error)
NOTE: must implement CreateOrUpdateLeaseFunc.
Source Files
¶
- activity_util.go
- command_attr_validator.go
- consistency_checker.go
- consistency_checker_mock.go
- create_workflow_util.go
- get_history_util.go
- get_workflow_util.go
- namespace.go
- replication_util.go
- retry_util.go
- signal_workflow_util.go
- task_category.go
- token.go
- trim_history_util.go
- update_workflow_util.go
- workflow_id_dedup.go
- workflow_lease.go
Directories
¶
Path | Synopsis |
---|---|
Package getdlqtasks contains the logic to implement the historyservice.HistoryServiceServer.GetDLQTasks API.
|
Package getdlqtasks contains the logic to implement the historyservice.HistoryServiceServer.GetDLQTasks API. |