archiver

package
v1.3.7-prerelease21 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 30 Imported by: 3

Documentation

Overview

Package archiver is a generated GoMock package.

Package archiver is a generated GoMock package.

Package archiver is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxArchivalIterationTimeout added in v0.5.9

func MaxArchivalIterationTimeout() time.Duration

MaxArchivalIterationTimeout returns the max allowed timeout for a single iteration of archival workflow

func NewReplayMetricsClient

func NewReplayMetricsClient(client metrics.Client, ctx workflow.Context) metrics.Client

NewReplayMetricsClient creates a metrics client which is aware of cadence's replay mode

func NewReplayMetricsScope added in v0.5.9

func NewReplayMetricsScope(scope metrics.Scope, ctx workflow.Context) metrics.Scope

NewReplayMetricsScope creates a metrics scope which is aware of cadence's replay mode

Types

type ArchivalTarget added in v0.11.0

type ArchivalTarget int

ArchivalTarget is either history or visibility

const (
	// ArchiveTargetHistory is the archive target for workflow history
	ArchiveTargetHistory ArchivalTarget = iota
	// ArchiveTargetVisibility is the archive target for workflow visibility record
	ArchiveTargetVisibility
)

type ArchiveRequest

type ArchiveRequest struct {
	DomainID   string
	DomainName string
	WorkflowID string
	RunID      string

	// history archival
	ShardID              int
	BranchToken          []byte
	NextEventID          int64
	CloseFailoverVersion int64
	URI                  string // should be historyURI, but keep the existing name for backward compatibility

	// visibility archival
	WorkflowTypeName   string
	StartTimestamp     int64
	ExecutionTimestamp int64
	CloseTimestamp     int64
	CloseStatus        types.WorkflowExecutionCloseStatus
	HistoryLength      int64
	Memo               *types.Memo
	SearchAttributes   map[string][]byte
	VisibilityURI      string

	// archival targets: history and/or visibility
	Targets []ArchivalTarget
}

ArchiveRequest is the request signal sent to the archival workflow

type BootstrapContainer

type BootstrapContainer struct {
	PublicClient     workflowserviceclient.Interface
	MetricsClient    metrics.Client
	Logger           log.Logger
	HistoryV2Manager persistence.HistoryManager
	DomainCache      cache.DomainCache
	Config           *Config
	ArchiverProvider provider.ArchiverProvider
}

BootstrapContainer contains everything need for bootstrapping

type Client

type Client interface {
	Archive(context.Context, *ClientRequest) (*ClientResponse, error)
}

Client is used to archive workflow histories

func NewClient

func NewClient(
	metricsClient metrics.Client,
	logger log.Logger,
	publicClient workflowserviceclient.Interface,
	numWorkflows dynamicproperties.IntPropertyFn,
	requestRateLimiter quotas.Limiter,
	inlineHistoryRateLimiter quotas.Limiter,
	inlineVisibilityRateLimiter quotas.Limiter,
	archiverProvider provider.ArchiverProvider,
	archivingIncompleteHistory dynamicproperties.BoolPropertyFn,
) Client

NewClient creates a new Client

type ClientRequest added in v0.7.0

type ClientRequest struct {
	ArchiveRequest       *ArchiveRequest
	CallerService        string
	AttemptArchiveInline bool
}

ClientRequest is the archive request sent to the archiver client

type ClientResponse added in v0.8.0

type ClientResponse struct {
	HistoryArchivedInline bool
}

ClientResponse is the archive response returned from the archiver client

type ClientWorker

type ClientWorker interface {
	Start() error
	Stop()
}

ClientWorker is a cadence client worker

func NewClientWorker

func NewClientWorker(container *BootstrapContainer) ClientWorker

NewClientWorker returns a new ClientWorker

type Config

type Config struct {
	ArchiverConcurrency             dynamicproperties.IntPropertyFn
	ArchivalsPerIteration           dynamicproperties.IntPropertyFn
	TimeLimitPerArchivalIteration   dynamicproperties.DurationPropertyFn
	AllowArchivingIncompleteHistory dynamicproperties.BoolPropertyFn
}

Config for ClientWorker

type Handler added in v0.7.0

type Handler interface {
	Start()
	Finished() []uint64
}

Handler is used to process archival requests

func NewHandler added in v0.7.0

func NewHandler(
	ctx workflow.Context,
	logger log.Logger,
	metricsClient metrics.Client,
	concurrency int,
	requestCh workflow.Channel,
) Handler

NewHandler returns a new Handler

type MockClient added in v1.3.6

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

MockClient is a mock of Client interface.

func NewMockClient added in v1.3.6

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) Archive added in v1.3.6

func (m *MockClient) Archive(arg0 context.Context, arg1 *ClientRequest) (*ClientResponse, error)

Archive mocks base method.

func (*MockClient) EXPECT added in v1.3.6

func (m *MockClient) EXPECT() *MockClientMockRecorder

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

type MockClientMockRecorder added in v1.3.6

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) Archive added in v1.3.6

func (mr *MockClientMockRecorder) Archive(arg0, arg1 any) *gomock.Call

Archive indicates an expected call of Archive.

type MockHandler added in v0.7.0

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

MockHandler is a mock of Handler interface.

func NewMockHandler added in v1.3.6

func NewMockHandler(ctrl *gomock.Controller) *MockHandler

NewMockHandler creates a new mock instance.

func (*MockHandler) EXPECT added in v1.3.6

func (m *MockHandler) EXPECT() *MockHandlerMockRecorder

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

func (*MockHandler) Finished added in v0.7.0

func (m *MockHandler) Finished() []uint64

Finished mocks base method.

func (*MockHandler) Start added in v0.7.0

func (m *MockHandler) Start()

Start mocks base method.

type MockHandlerMockRecorder added in v1.3.6

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

MockHandlerMockRecorder is the mock recorder for MockHandler.

func (*MockHandlerMockRecorder) Finished added in v1.3.6

func (mr *MockHandlerMockRecorder) Finished() *gomock.Call

Finished indicates an expected call of Finished.

func (*MockHandlerMockRecorder) Start added in v1.3.6

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

Start indicates an expected call of Start.

type MockPump added in v1.3.6

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

MockPump is a mock of Pump interface.

func NewMockPump added in v1.3.6

func NewMockPump(ctrl *gomock.Controller) *MockPump

NewMockPump creates a new mock instance.

func (*MockPump) EXPECT added in v1.3.6

func (m *MockPump) EXPECT() *MockPumpMockRecorder

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

func (*MockPump) Run added in v1.3.6

func (m *MockPump) Run() PumpResult

Run mocks base method.

type MockPumpMockRecorder added in v1.3.6

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

MockPumpMockRecorder is the mock recorder for MockPump.

func (*MockPumpMockRecorder) Run added in v1.3.6

func (mr *MockPumpMockRecorder) Run() *gomock.Call

Run indicates an expected call of Run.

type Pump

type Pump interface {
	Run() PumpResult
}

Pump pumps archival requests into request channel

func NewPump

func NewPump(
	ctx workflow.Context,
	logger log.Logger,
	metricsClient metrics.Client,
	carryover []ArchiveRequest,
	timeout time.Duration,
	requestLimit int,
	requestCh workflow.Channel,
	signalCh workflow.Channel,
) Pump

NewPump returns a new Pump

type PumpResult

type PumpResult struct {
	PumpedHashes          []uint64
	UnhandledCarryover    []ArchiveRequest
	TimeoutWithoutSignals bool
}

PumpResult is the result of pumping requests into request channel

Jump to

Keyboard shortcuts

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