eventhandler

package
v1.24.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package eventhandler is a generated GoMock package.

Package eventhandler is a generated GoMock package.

Package eventhandler is a generated GoMock package.

Package eventhandler is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HistoryBatch

type HistoryBatch struct {
	VersionHistory *historyspb.VersionHistory
	RawEventBatch  *commonpb.DataBlob
}

type HistoryEventsHandler

type HistoryEventsHandler interface {
	HandleHistoryEvents(
		ctx context.Context,
		sourceClusterName string,
		workflowKey definition.WorkflowKey,
		baseExecutionInfo *workflowpb.BaseExecutionInfo,
		versionHistoryItems []*historyspb.VersionHistoryItem,
		historyEvents [][]*historypb.HistoryEvent,
		newEvents []*historypb.HistoryEvent,
		newRunID string,
	) error
}

HistoryEventsHandler is to handle all cases that add history events from remote cluster to current cluster. so it can be used by: 1. ExecutableHistoryTask to replicate events 2. When HistoryResender trying to add events (currently triggered by RetryReplication error, which still need to handle import case)

func NewHistoryEventsHandler

func NewHistoryEventsHandler(
	clusterMetadata cluster.Metadata,
	localHandler LocalGeneratedEventsHandler,
	remoteHandler RemoteGeneratedEventsHandler,
) HistoryEventsHandler

type HistoryPaginatedFetcher

type HistoryPaginatedFetcher interface {
	GetSingleWorkflowHistoryPaginatedIterator(
		ctx context.Context,
		remoteClusterName string,
		namespaceID namespace.ID,
		workflowID string,
		runID string,
		startEventID int64,
		startEventVersion int64,
		endEventID int64,
		endEventVersion int64,
	) collection.Iterator[HistoryBatch]
}

HistoryPaginatedFetcher is the interface for fetching history from remote cluster Start and End event ID is inclusive.

type HistoryPaginatedFetcherImpl

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

func NewHistoryPaginatedFetcher

func NewHistoryPaginatedFetcher(
	namespaceRegistry namespace.Registry,
	clientBean client.Bean,
	serializer serialization.Serializer,
	rereplicationTimeout dynamicconfig.DurationPropertyFnWithNamespaceIDFilter,
	logger log.Logger,
) *HistoryPaginatedFetcherImpl

func (*HistoryPaginatedFetcherImpl) GetSingleWorkflowHistoryPaginatedIterator

func (n *HistoryPaginatedFetcherImpl) GetSingleWorkflowHistoryPaginatedIterator(
	ctx context.Context,
	remoteClusterName string,
	namespaceID namespace.ID,
	workflowID string,
	runID string,
	startEventID int64,
	startEventVersion int64,
	endEventID int64,
	endEventVersion int64,
) collection.Iterator[HistoryBatch]

type LocalGeneratedEventsHandler

type LocalGeneratedEventsHandler interface {
	HandleLocalGeneratedHistoryEvents(
		ctx context.Context,
		remoteCluster string,
		workflowKey definition.WorkflowKey,
		versionHistoryItems []*historyspb.VersionHistoryItem,
		localEvents [][]*historypb.HistoryEvent,
	) error
}

func NewLocalEventsHandler

func NewLocalEventsHandler(
	clusterMetadata cluster.Metadata,
	shardController shard.Controller,
	logger log.Logger,
	eventSerializer serialization.Serializer,
	historyPaginatedFetcher HistoryPaginatedFetcher,
) LocalGeneratedEventsHandler

type MockHistoryEventsHandler

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

MockHistoryEventsHandler is a mock of HistoryEventsHandler interface.

func NewMockHistoryEventsHandler

func NewMockHistoryEventsHandler(ctrl *gomock.Controller) *MockHistoryEventsHandler

NewMockHistoryEventsHandler creates a new mock instance.

func (*MockHistoryEventsHandler) EXPECT

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

func (*MockHistoryEventsHandler) HandleHistoryEvents

func (m *MockHistoryEventsHandler) HandleHistoryEvents(ctx context.Context, sourceClusterName string, workflowKey definition.WorkflowKey, baseExecutionInfo *workflow.BaseExecutionInfo, versionHistoryItems []*history0.VersionHistoryItem, historyEvents [][]*history.HistoryEvent, newEvents []*history.HistoryEvent, newRunID string) error

HandleHistoryEvents mocks base method.

type MockHistoryEventsHandlerMockRecorder

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

MockHistoryEventsHandlerMockRecorder is the mock recorder for MockHistoryEventsHandler.

func (*MockHistoryEventsHandlerMockRecorder) HandleHistoryEvents

func (mr *MockHistoryEventsHandlerMockRecorder) HandleHistoryEvents(ctx, sourceClusterName, workflowKey, baseExecutionInfo, versionHistoryItems, historyEvents, newEvents, newRunID interface{}) *gomock.Call

HandleHistoryEvents indicates an expected call of HandleHistoryEvents.

type MockHistoryPaginatedFetcher

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

MockHistoryPaginatedFetcher is a mock of HistoryPaginatedFetcher interface.

func NewMockHistoryPaginatedFetcher

func NewMockHistoryPaginatedFetcher(ctrl *gomock.Controller) *MockHistoryPaginatedFetcher

NewMockHistoryPaginatedFetcher creates a new mock instance.

func (*MockHistoryPaginatedFetcher) EXPECT

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

func (*MockHistoryPaginatedFetcher) GetSingleWorkflowHistoryPaginatedIterator

func (m *MockHistoryPaginatedFetcher) GetSingleWorkflowHistoryPaginatedIterator(ctx context.Context, remoteClusterName string, namespaceID namespace.ID, workflowID, runID string, startEventID, startEventVersion, endEventID, endEventVersion int64) collection.Iterator[HistoryBatch]

GetSingleWorkflowHistoryPaginatedIterator mocks base method.

type MockHistoryPaginatedFetcherMockRecorder

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

MockHistoryPaginatedFetcherMockRecorder is the mock recorder for MockHistoryPaginatedFetcher.

func (*MockHistoryPaginatedFetcherMockRecorder) GetSingleWorkflowHistoryPaginatedIterator

func (mr *MockHistoryPaginatedFetcherMockRecorder) GetSingleWorkflowHistoryPaginatedIterator(ctx, remoteClusterName, namespaceID, workflowID, runID, startEventID, startEventVersion, endEventID, endEventVersion interface{}) *gomock.Call

GetSingleWorkflowHistoryPaginatedIterator indicates an expected call of GetSingleWorkflowHistoryPaginatedIterator.

type MockLocalGeneratedEventsHandler

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

MockLocalGeneratedEventsHandler is a mock of LocalGeneratedEventsHandler interface.

func NewMockLocalGeneratedEventsHandler

func NewMockLocalGeneratedEventsHandler(ctrl *gomock.Controller) *MockLocalGeneratedEventsHandler

NewMockLocalGeneratedEventsHandler creates a new mock instance.

func (*MockLocalGeneratedEventsHandler) EXPECT

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

func (*MockLocalGeneratedEventsHandler) HandleLocalGeneratedHistoryEvents

func (m *MockLocalGeneratedEventsHandler) HandleLocalGeneratedHistoryEvents(ctx context.Context, remoteCluster string, workflowKey definition.WorkflowKey, versionHistoryItems []*history0.VersionHistoryItem, localEvents [][]*history.HistoryEvent) error

HandleLocalGeneratedHistoryEvents mocks base method.

type MockLocalGeneratedEventsHandlerMockRecorder

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

MockLocalGeneratedEventsHandlerMockRecorder is the mock recorder for MockLocalGeneratedEventsHandler.

func (*MockLocalGeneratedEventsHandlerMockRecorder) HandleLocalGeneratedHistoryEvents

func (mr *MockLocalGeneratedEventsHandlerMockRecorder) HandleLocalGeneratedHistoryEvents(ctx, remoteCluster, workflowKey, versionHistoryItems, localEvents interface{}) *gomock.Call

HandleLocalGeneratedHistoryEvents indicates an expected call of HandleLocalGeneratedHistoryEvents.

type MockRemoteGeneratedEventsHandler

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

MockRemoteGeneratedEventsHandler is a mock of RemoteGeneratedEventsHandler interface.

func NewMockRemoteGeneratedEventsHandler

func NewMockRemoteGeneratedEventsHandler(ctrl *gomock.Controller) *MockRemoteGeneratedEventsHandler

NewMockRemoteGeneratedEventsHandler creates a new mock instance.

func (*MockRemoteGeneratedEventsHandler) EXPECT

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

func (*MockRemoteGeneratedEventsHandler) HandleRemoteGeneratedHistoryEvents

func (m *MockRemoteGeneratedEventsHandler) HandleRemoteGeneratedHistoryEvents(ctx context.Context, workflowKey definition.WorkflowKey, baseExecutionInfo *workflow.BaseExecutionInfo, versionHistoryItems []*history0.VersionHistoryItem, historyEvents [][]*history.HistoryEvent, newEvents []*history.HistoryEvent, newRunID string) error

HandleRemoteGeneratedHistoryEvents mocks base method.

type MockRemoteGeneratedEventsHandlerMockRecorder

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

MockRemoteGeneratedEventsHandlerMockRecorder is the mock recorder for MockRemoteGeneratedEventsHandler.

func (*MockRemoteGeneratedEventsHandlerMockRecorder) HandleRemoteGeneratedHistoryEvents

func (mr *MockRemoteGeneratedEventsHandlerMockRecorder) HandleRemoteGeneratedHistoryEvents(ctx, workflowKey, baseExecutionInfo, versionHistoryItems, historyEvents, newEvents, newRunID interface{}) *gomock.Call

HandleRemoteGeneratedHistoryEvents indicates an expected call of HandleRemoteGeneratedHistoryEvents.

type RemoteGeneratedEventsHandler

type RemoteGeneratedEventsHandler interface {
	HandleRemoteGeneratedHistoryEvents(
		ctx context.Context,
		workflowKey definition.WorkflowKey,
		baseExecutionInfo *workflowpb.BaseExecutionInfo,
		versionHistoryItems []*historyspb.VersionHistoryItem,
		historyEvents [][]*historypb.HistoryEvent,
		newEvents []*historypb.HistoryEvent,
		newRunID string,
	) error
}

func NewRemoteGeneratedEventsHandler

func NewRemoteGeneratedEventsHandler(shardController shard.Controller) RemoteGeneratedEventsHandler

Jump to

Keyboard shortcuts

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