Documentation ¶
Index ¶
- Constants
- func ArchivalDeleteHistoryActivity(ctx context.Context, request ArchiveRequest) error
- func ArchivalUploadActivity(ctx context.Context, request ArchiveRequest) error
- func ArchiveSystemWorkflow(ctx workflow.Context, carryoverRequests []ArchiveRequest) error
- func ConvertHeaderToTags(header *HistoryBlobHeader) (map[string]string, error)
- func NewHistoryBlobKey(domainID, workflowID, runID, pageToken string) (blob.Key, error)
- func NewReplayBarkLogger(logger bark.Logger, ctx workflow.Context, enableLogInReplay bool) bark.Logger
- func NewReplayMetricsClient(client metrics.Client, ctx workflow.Context) metrics.Client
- type ArchivalClient
- type ArchivalClientMock
- type ArchiveRequest
- type Config
- type HistoryBlob
- type HistoryBlobHeader
- type HistoryBlobIterator
- type HistoryBlobIteratorMock
- type SysWorker
- type SysWorkerContainer
Constants ¶
const (
// SystemDomainName is domain name for all system workflows
SystemDomainName = "cadence-system"
)
Variables ¶
This section is empty.
Functions ¶
func ArchivalDeleteHistoryActivity ¶ added in v0.5.3
func ArchivalDeleteHistoryActivity(ctx context.Context, request ArchiveRequest) error
ArchivalDeleteHistoryActivity deletes the workflow execution history from persistence. All retryable errors are retried forever. If an error is returned it is of type archivalActivityNonRetryableErr.
func ArchivalUploadActivity ¶ added in v0.5.3
func ArchivalUploadActivity(ctx context.Context, request ArchiveRequest) error
ArchivalUploadActivity does the following three things: 1. Read history from persistence 2. Construct blobs 3. Upload blobs It is assumed that history is immutable when this activity is running. Under this assumption this activity is idempotent. If an error is returned it will be of type archivalActivityNonRetryableErr. All retryable errors are retried forever.
func ArchiveSystemWorkflow ¶ added in v0.5.3
func ArchiveSystemWorkflow(ctx workflow.Context, carryoverRequests []ArchiveRequest) error
ArchiveSystemWorkflow is the system workflow which archives and deletes history
func ConvertHeaderToTags ¶ added in v0.5.2
func ConvertHeaderToTags(header *HistoryBlobHeader) (map[string]string, error)
ConvertHeaderToTags converts header into metadata tags for blob
func NewHistoryBlobKey ¶ added in v0.5.2
NewHistoryBlobKey returns a key for history blob
Types ¶
type ArchivalClient ¶
type ArchivalClient interface {
Archive(*ArchiveRequest) error
}
ArchivalClient is used to archive workflow histories
func NewArchivalClient ¶
func NewArchivalClient( publicClient public.Client, numSWFn dynamicconfig.IntPropertyFn, ) ArchivalClient
NewArchivalClient creates a new ArchivalClient
type ArchivalClientMock ¶ added in v0.5.3
ArchivalClientMock is an autogenerated mock type for the ArchivalClient type
func (*ArchivalClientMock) Archive ¶ added in v0.5.3
func (_m *ArchivalClientMock) Archive(_a0 *ArchiveRequest) error
Archive provides a mock function with given fields: _a0
type ArchiveRequest ¶
type ArchiveRequest struct { DomainID string WorkflowID string RunID string EventStoreVersion int32 BranchToken []byte LastFirstEventID int64 CloseFailoverVersion int64 }
ArchiveRequest is request to Archive
type Config ¶
type Config struct { EnableArchivalCompression dynamicconfig.BoolPropertyFnWithDomainFilter HistoryPageSize dynamicconfig.IntPropertyFnWithDomainFilter TargetArchivalBlobSize dynamicconfig.IntPropertyFnWithDomainFilter }
Config for SysWorker
type HistoryBlob ¶ added in v0.5.2
type HistoryBlob struct { Header *HistoryBlobHeader `json:"header"` Body *shared.History `json:"body"` }
HistoryBlob is the serializable data that forms the body of a blob
type HistoryBlobHeader ¶ added in v0.5.2
type HistoryBlobHeader struct { DomainName *string `json:"domain_name,omitempty"` DomainID *string `json:"domain_id,omitempty"` WorkflowID *string `json:"workflow_id,omitempty"` RunID *string `json:"run_id,omitempty"` CurrentPageToken *string `json:"current_page_token,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` FirstFailoverVersion *int64 `json:"first_failover_version,omitempty"` LastFailoverVersion *int64 `json:"last_failover_version,omitempty"` FirstEventID *int64 `json:"first_event_id,omitempty"` LastEventID *int64 `json:"last_event_id,omitempty"` UploadDateTime *string `json:"upload_date_time,omitempty"` UploadCluster *string `json:"upload_cluster,omitempty"` EventCount *int64 `json:"event_count,omitempty"` CloseFailoverVersion *int64 `json:"close_failover_version,omitempty"` }
HistoryBlobHeader is the header attached to all history blobs
type HistoryBlobIterator ¶ added in v0.5.3
type HistoryBlobIterator interface { Next() (*HistoryBlob, error) HasNext() bool }
HistoryBlobIterator is used to get history blobs
func NewHistoryBlobIterator ¶ added in v0.5.3
func NewHistoryBlobIterator( logger bark.Logger, metricsClient metrics.Client, request ArchiveRequest, container *SysWorkerContainer, domainName string, clusterName string, ) HistoryBlobIterator
NewHistoryBlobIterator returns a new HistoryBlobIterator
type HistoryBlobIteratorMock ¶ added in v0.5.3
HistoryBlobIteratorMock is an autogenerated mock type for the HistoryBlobIterator type
func (*HistoryBlobIteratorMock) HasNext ¶ added in v0.5.3
func (_m *HistoryBlobIteratorMock) HasNext() bool
HasNext provides a mock function with given fields:
func (*HistoryBlobIteratorMock) Next ¶ added in v0.5.3
func (_m *HistoryBlobIteratorMock) Next() (*HistoryBlob, error)
Next provides a mock function with given fields:
type SysWorker ¶
type SysWorker interface { Start() error Stop() }
SysWorker is a cadence client worker which enables running arbitrary system workflows
func NewSysWorker ¶
func NewSysWorker(container *SysWorkerContainer) SysWorker
NewSysWorker returns a new SysWorker
type SysWorkerContainer ¶ added in v0.5.3
type SysWorkerContainer struct { PublicClient public.Client MetricsClient metrics.Client Logger bark.Logger ClusterMetadata cluster.Metadata HistoryManager persistence.HistoryManager HistoryV2Manager persistence.HistoryV2Manager Blobstore blobstore.Client DomainCache cache.DomainCache Config *Config HistoryBlobIterator HistoryBlobIterator // this is only set in testing code }
SysWorkerContainer contains everything needed to bootstrap SysWorker and all hosted system workflows