Back to godoc.org

Package archiver

v0.8.6
Latest Go to latest

The highest tagged major version is .

Published: Aug 27, 2019 | License: MIT | Module: github.com/h7kanna/cadence

Index

func MaxArchivalIterationTimeout

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

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

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

type ArchiveRequest

type ArchiveRequest struct {
	ShardID              int
	DomainID             string
	DomainName           string
	WorkflowID           string
	RunID                string
	EventStoreVersion    int32
	BranchToken          []byte
	NextEventID          int64
	CloseFailoverVersion int64
	URI                  string
}

ArchiveRequest is the request signal sent to the archiver workflow

type BootstrapContainer

type BootstrapContainer struct {
	PublicClient     workflowserviceclient.Interface
	MetricsClient    metrics.Client
	Logger           log.Logger
	HistoryManager   persistence.HistoryManager
	HistoryV2Manager persistence.HistoryV2Manager
	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 dynamicconfig.IntPropertyFn,
	requestRPS dynamicconfig.IntPropertyFn,
	archiverProvider provider.ArchiverProvider,
) Client

NewClient creates a new Client

type ClientMock

type ClientMock struct {
	mock.Mock
}

ClientMock is an autogenerated mock type for the Client type

func (*ClientMock) Archive

func (_m *ClientMock) Archive(_a0 context.Context, _a1 *ClientRequest) (*ClientResponse, error)

Archive provides a mock function with given fields: _a0, _a1

type ClientRequest

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

ClientRequest is the archive request sent to the archiver client

type ClientResponse

type ClientResponse struct {
	ArchivedInline 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           dynamicconfig.IntPropertyFn
	ArchivalsPerIteration         dynamicconfig.IntPropertyFn
	TimeLimitPerArchivalIteration dynamicconfig.DurationPropertyFn
}

Config for ClientWorker

type Handler

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

Handler is used to process archival requests

func NewHandler

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

NewHandler returns a new Handler

type MockHandler

type MockHandler struct {
	mock.Mock
}

MockHandler is an autogenerated mock type for the Archiver type

func (*MockHandler) Finished

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

Finished provides a mock function with given fields:

func (*MockHandler) Start

func (_m *MockHandler) Start()

Start provides a mock function with given fields:

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 PumpMock

type PumpMock struct {
	mock.Mock
}

PumpMock is an autogenerated mock type for the Pump type

func (*PumpMock) Run

func (_m *PumpMock) Run() PumpResult

Run provides a mock function with given fields:

type PumpResult

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

PumpResult is the result of pumping requests into request channel

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier