Documentation ¶
Overview ¶
Package archiver is a generated GoMock package.
Index ¶
- Constants
- Variables
- func ConvertSearchAttrToBytes(searchAttrStr map[string]string) map[string][]byte
- func TagLoggerWithArchiveHistoryRequestAndURI(logger log.Logger, request *ArchiveHistoryRequest, URI string) log.Logger
- func TagLoggerWithArchiveVisibilityRequestAndURI(logger log.Logger, request *ArchiveVisibilityRequest, URI string) log.Logger
- func ValidateGetRequest(request *GetHistoryRequest) error
- func ValidateHistoryArchiveRequest(request *ArchiveHistoryRequest) error
- func ValidateQueryRequest(request *QueryVisibilityRequest) error
- func ValidateVisibilityArchivalRequest(request *ArchiveVisibilityRequest) error
- type ArchivalConfig
- type ArchivalMetadata
- type ArchivalStatus
- type ArchiveFeatureCatalog
- type ArchiveHistoryRequest
- type ArchiveOption
- type ArchiveVisibilityRequest
- type GetHistoryRequest
- type GetHistoryResponse
- type HistoryArchiver
- type HistoryArchiverMock
- type HistoryBlob
- type HistoryBlobHeader
- type HistoryBootstrapContainer
- type HistoryIterator
- type MockArchivalMetadata
- type MockHistoryIterator
- type MockHistoryIteratorMockRecorder
- type MockSizeEstimator
- type MockSizeEstimatorMockRecorder
- type NonRetriableError
- type ProgressManager
- type QueryVisibilityRequest
- type QueryVisibilityResponse
- type SizeEstimator
- type URI
- type VisibilityArchiver
- type VisibilityArchiverMock
- func (_m *VisibilityArchiverMock) Archive(_a0 context.Context, _a1 URI, _a2 *ArchiveVisibilityRequest, ...) error
- func (_m *VisibilityArchiverMock) Query(_a0 context.Context, _a1 URI, _a2 *QueryVisibilityRequest) (*QueryVisibilityResponse, error)
- func (_m *VisibilityArchiverMock) ValidateURI(uri URI) error
- type VisibilityBootstrapContainer
Constants ¶
const ( // ArchiveNonRetriableErrorMsg is the log message when the Archive() method encounters a non-retriable error ArchiveNonRetriableErrorMsg = "Archive method encountered an non-retriable error." // ArchiveTransientErrorMsg is the log message when the Archive() method encounters a transient error ArchiveTransientErrorMsg = "Archive method encountered a transient error." // ErrReasonInvalidURI is the error reason for invalid URI ErrReasonInvalidURI = "URI is invalid" // ErrReasonInvalidArchiveRequest is the error reason for invalid archive request ErrReasonInvalidArchiveRequest = "archive request is invalid" // ErrReasonConstructHistoryIterator is the error reason for failing to construct history iterator ErrReasonConstructHistoryIterator = "failed to construct history iterator" // ErrReasonReadHistory is the error reason for failing to read history ErrReasonReadHistory = "failed to read history batches" // ErrReasonHistoryMutated is the error reason for mutated history ErrReasonHistoryMutated = "history was mutated" )
Variables ¶
var ( // ErrInvalidURI is the error for invalid URI ErrInvalidURI = errors.New("URI is invalid") // ErrURISchemeMismatch is the error for mismatch between URI scheme and archiver ErrURISchemeMismatch = errors.New("URI scheme does not match the archiver") // ErrHistoryMutated is the error for mutated history ErrHistoryMutated = errors.New("history was mutated") // ErrContextTimeout is the error for context timeout ErrContextTimeout = errors.New("archive aborted because context timed out") // ErrInvalidGetHistoryRequest is the error for invalid GetHistory request ErrInvalidGetHistoryRequest = errors.New("get archived history request is invalid") // ErrInvalidQueryVisibilityRequest is the error for invalid Query Visibility request ErrInvalidQueryVisibilityRequest = errors.New("query visiblity request is invalid") // ErrNextPageTokenCorrupted is the error for corrupted GetHistory token ErrNextPageTokenCorrupted = errors.New("next page token is corrupted") // ErrHistoryNotExist is the error for non-exist history ErrHistoryNotExist = errors.New("requested workflow history does not exist") )
Functions ¶
func ConvertSearchAttrToBytes ¶ added in v0.9.3
ConvertSearchAttrToBytes converts search attribute value from string back to byte array
func TagLoggerWithArchiveHistoryRequestAndURI ¶ added in v0.9.0
func TagLoggerWithArchiveHistoryRequestAndURI(logger log.Logger, request *ArchiveHistoryRequest, URI string) log.Logger
TagLoggerWithArchiveHistoryRequestAndURI tags logger with fields in the archive history request and the URI
func TagLoggerWithArchiveVisibilityRequestAndURI ¶ added in v0.9.0
func TagLoggerWithArchiveVisibilityRequestAndURI(logger log.Logger, request *ArchiveVisibilityRequest, URI string) log.Logger
TagLoggerWithArchiveVisibilityRequestAndURI tags logger with fields in the archive visibility request and the URI
func ValidateGetRequest ¶ added in v0.9.0
func ValidateGetRequest(request *GetHistoryRequest) error
ValidateGetRequest validates the get archived history request
func ValidateHistoryArchiveRequest ¶ added in v0.9.0
func ValidateHistoryArchiveRequest(request *ArchiveHistoryRequest) error
ValidateHistoryArchiveRequest validates the archive history request
func ValidateQueryRequest ¶ added in v0.9.0
func ValidateQueryRequest(request *QueryVisibilityRequest) error
ValidateQueryRequest validates the query visibility request
func ValidateVisibilityArchivalRequest ¶ added in v0.9.0
func ValidateVisibilityArchivalRequest(request *ArchiveVisibilityRequest) error
ValidateVisibilityArchivalRequest validates the archive visibility request
Types ¶
type ArchivalConfig ¶ added in v0.7.0
type ArchivalConfig interface { ClusterConfiguredForArchival() bool GetClusterStatus() ArchivalStatus ReadEnabled() bool GetDomainDefaultStatus() types.ArchivalStatus GetDomainDefaultURI() string }
ArchivalConfig is an immutable representation of the archival configuration of the cluster This config is determined at cluster startup time
func NewArchivalConfig ¶ added in v0.7.0
func NewArchivalConfig( staticClusterStatusStr string, dynamicClusterStatus dynamicconfig.StringPropertyFn, enableRead dynamicconfig.BoolPropertyFn, domainDefaultStatusStr string, domainDefaultURI string, ) ArchivalConfig
NewArchivalConfig constructs a new valid ArchivalConfig
func NewDisabledArchvialConfig ¶ added in v0.8.0
func NewDisabledArchvialConfig() ArchivalConfig
NewDisabledArchvialConfig returns a disabled ArchivalConfig
type ArchivalMetadata ¶ added in v0.7.0
type ArchivalMetadata interface { GetHistoryConfig() ArchivalConfig GetVisibilityConfig() ArchivalConfig }
ArchivalMetadata provides cluster level archival information
func NewArchivalMetadata ¶ added in v0.7.0
func NewArchivalMetadata( dc *dynamicconfig.Collection, historyStatus string, historyReadEnabled bool, visibilityStatus string, visibilityReadEnabled bool, domainDefaults *config.ArchivalDomainDefaults, ) ArchivalMetadata
NewArchivalMetadata constructs a new ArchivalMetadata
type ArchivalStatus ¶ added in v0.7.0
type ArchivalStatus int
ArchivalStatus represents the archival status of the cluster
const ( // ArchivalDisabled means this cluster is not configured to handle archival ArchivalDisabled ArchivalStatus = iota // ArchivalPaused means this cluster is configured to handle archival but is currently not archiving // This state is not yet implemented, as of now ArchivalPaused is treated the same way as ArchivalDisabled ArchivalPaused // ArchivalEnabled means this cluster is currently archiving ArchivalEnabled )
type ArchiveFeatureCatalog ¶
type ArchiveFeatureCatalog struct { ProgressManager ProgressManager NonRetriableError NonRetriableError }
ArchiveFeatureCatalog is a collection features for the Archive method of History/Visibility Archiver
func GetFeatureCatalog ¶
func GetFeatureCatalog(opts ...ArchiveOption) *ArchiveFeatureCatalog
GetFeatureCatalog applies all the ArchiveOptions to the catalog and returns the catalog. It should be called inside the Archive method.
type ArchiveHistoryRequest ¶
type ArchiveHistoryRequest struct { ShardID int DomainID string DomainName string WorkflowID string RunID string BranchToken []byte NextEventID int64 CloseFailoverVersion int64 }
ArchiveHistoryRequest is request to Archive workflow history
type ArchiveOption ¶
type ArchiveOption func(featureCatalog *ArchiveFeatureCatalog)
ArchiveOption is used to provide options for adding features to the Archive method of History/Visibility Archiver
func GetHeartbeatArchiveOption ¶
func GetHeartbeatArchiveOption() ArchiveOption
GetHeartbeatArchiveOption returns an ArchiveOption for enabling heartbeating. It should be used when the Archive method is invoked inside an activity.
func GetNonRetriableErrorOption ¶ added in v0.7.0
func GetNonRetriableErrorOption(nonRetryableErr error) ArchiveOption
GetNonRetriableErrorOption returns an ArchiveOption so that archiver knows what should be returned when an non-retryable error is encountered.
type ArchiveVisibilityRequest ¶
type ArchiveVisibilityRequest struct { DomainID string DomainName string // doesn't need to be archived WorkflowID string RunID string WorkflowTypeName string StartTimestamp int64 ExecutionTimestamp int64 CloseTimestamp int64 CloseStatus types.WorkflowExecutionCloseStatus HistoryLength int64 Memo *types.Memo SearchAttributes map[string]string HistoryArchivalURI string }
ArchiveVisibilityRequest is request to Archive single workflow visibility record
type GetHistoryRequest ¶
type GetHistoryRequest struct { DomainID string WorkflowID string RunID string CloseFailoverVersion *int64 NextPageToken []byte PageSize int }
GetHistoryRequest is the request to Get archived history
type GetHistoryResponse ¶
GetHistoryResponse is the response of Get archived history
type HistoryArchiver ¶
type HistoryArchiver interface { Archive(context.Context, URI, *ArchiveHistoryRequest, ...ArchiveOption) error Get(context.Context, URI, *GetHistoryRequest) (*GetHistoryResponse, error) ValidateURI(URI) error }
HistoryArchiver is used to archive history and read archived history
type HistoryArchiverMock ¶ added in v0.7.0
HistoryArchiverMock is an autogenerated mock type for the HistoryArchiver type
func (*HistoryArchiverMock) Archive ¶ added in v0.7.0
func (_m *HistoryArchiverMock) Archive(ctx context.Context, uri URI, request *ArchiveHistoryRequest, opts ...ArchiveOption) error
Archive provides a mock function with given fields: ctx, uri, request, opts
func (*HistoryArchiverMock) Get ¶ added in v0.7.0
func (_m *HistoryArchiverMock) Get(ctx context.Context, uri URI, request *GetHistoryRequest) (*GetHistoryResponse, error)
Get provides a mock function with given fields: ctx, uri, request
func (*HistoryArchiverMock) ValidateURI ¶ added in v0.7.0
func (_m *HistoryArchiverMock) ValidateURI(uri URI) error
ValidateURI provides a mock function with given fields: uri
type HistoryBlob ¶
type HistoryBlob struct { Header *HistoryBlobHeader `json:"header"` Body []*types.History `json:"body"` }
HistoryBlob is the serializable data that forms the body of a blob
type HistoryBlobHeader ¶
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"` IsLast *bool `json:"is_last,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"` EventCount *int64 `json:"event_count,omitempty"` }
HistoryBlobHeader is the header attached to all history blobs
type HistoryBootstrapContainer ¶
type HistoryBootstrapContainer struct { HistoryV2Manager persistence.HistoryManager Logger log.Logger MetricsClient metrics.Client ClusterMetadata cluster.Metadata DomainCache cache.DomainCache }
HistoryBootstrapContainer contains components needed by all history Archiver implementations
type HistoryIterator ¶
type HistoryIterator interface { Next() (*HistoryBlob, error) HasNext() bool GetState() ([]byte, error) }
HistoryIterator is used to get history batches
func NewHistoryIterator ¶
func NewHistoryIterator( ctx context.Context, request *ArchiveHistoryRequest, historyV2Manager persistence.HistoryManager, targetHistoryBlobSize int, ) HistoryIterator
NewHistoryIterator returns a new HistoryIterator
func NewHistoryIteratorFromState ¶ added in v0.7.0
func NewHistoryIteratorFromState( ctx context.Context, request *ArchiveHistoryRequest, historyV2Manager persistence.HistoryManager, targetHistoryBlobSize int, initialState []byte, ) (HistoryIterator, error)
NewHistoryIteratorFromState returns a new HistoryIterator with specified state
type MockArchivalMetadata ¶ added in v0.7.0
MockArchivalMetadata is an autogenerated mock type for the ArchivalMetadata type
func (*MockArchivalMetadata) GetHistoryConfig ¶ added in v0.7.0
func (_m *MockArchivalMetadata) GetHistoryConfig() ArchivalConfig
GetHistoryConfig provides a mock function with given fields:
func (*MockArchivalMetadata) GetVisibilityConfig ¶ added in v0.7.0
func (_m *MockArchivalMetadata) GetVisibilityConfig() ArchivalConfig
GetVisibilityConfig provides a mock function with given fields:
type MockHistoryIterator ¶
type MockHistoryIterator struct {
// contains filtered or unexported fields
}
MockHistoryIterator is a mock of HistoryIterator interface
func NewMockHistoryIterator ¶
func NewMockHistoryIterator(ctrl *gomock.Controller) *MockHistoryIterator
NewMockHistoryIterator creates a new mock instance
func (*MockHistoryIterator) EXPECT ¶
func (m *MockHistoryIterator) EXPECT() *MockHistoryIteratorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockHistoryIterator) GetState ¶
func (m *MockHistoryIterator) GetState() ([]byte, error)
GetState mocks base method
func (*MockHistoryIterator) HasNext ¶
func (m *MockHistoryIterator) HasNext() bool
HasNext mocks base method
func (*MockHistoryIterator) Next ¶
func (m *MockHistoryIterator) Next() (*HistoryBlob, error)
Next mocks base method
type MockHistoryIteratorMockRecorder ¶
type MockHistoryIteratorMockRecorder struct {
// contains filtered or unexported fields
}
MockHistoryIteratorMockRecorder is the mock recorder for MockHistoryIterator
func (*MockHistoryIteratorMockRecorder) GetState ¶
func (mr *MockHistoryIteratorMockRecorder) GetState() *gomock.Call
GetState indicates an expected call of GetState
func (*MockHistoryIteratorMockRecorder) HasNext ¶
func (mr *MockHistoryIteratorMockRecorder) HasNext() *gomock.Call
HasNext indicates an expected call of HasNext
func (*MockHistoryIteratorMockRecorder) Next ¶
func (mr *MockHistoryIteratorMockRecorder) Next() *gomock.Call
Next indicates an expected call of Next
type MockSizeEstimator ¶ added in v0.16.0
type MockSizeEstimator struct {
// contains filtered or unexported fields
}
MockSizeEstimator is a mock of SizeEstimator interface
func NewMockSizeEstimator ¶ added in v0.16.0
func NewMockSizeEstimator(ctrl *gomock.Controller) *MockSizeEstimator
NewMockSizeEstimator creates a new mock instance
func (*MockSizeEstimator) EXPECT ¶ added in v0.16.0
func (m *MockSizeEstimator) EXPECT() *MockSizeEstimatorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockSizeEstimator) EstimateSize ¶ added in v0.16.0
func (m *MockSizeEstimator) EstimateSize(v interface{}) (int, error)
EstimateSize mocks base method
type MockSizeEstimatorMockRecorder ¶ added in v0.16.0
type MockSizeEstimatorMockRecorder struct {
// contains filtered or unexported fields
}
MockSizeEstimatorMockRecorder is the mock recorder for MockSizeEstimator
func (*MockSizeEstimatorMockRecorder) EstimateSize ¶ added in v0.16.0
func (mr *MockSizeEstimatorMockRecorder) EstimateSize(v interface{}) *gomock.Call
EstimateSize indicates an expected call of EstimateSize
type NonRetriableError ¶ added in v0.7.0
type NonRetriableError func() error
NonRetriableError returns an error indicating archiver has encountered an non-retriable error
type ProgressManager ¶
type ProgressManager interface { RecordProgress(ctx context.Context, progress interface{}) error LoadProgress(ctx context.Context, valuePtr interface{}) error HasProgress(ctx context.Context) bool }
ProgressManager is used to record and load archive progress
type QueryVisibilityRequest ¶ added in v0.9.0
type QueryVisibilityRequest struct { DomainID string PageSize int NextPageToken []byte Query string }
QueryVisibilityRequest is the request to query archived visibility records
type QueryVisibilityResponse ¶ added in v0.9.0
type QueryVisibilityResponse struct { Executions []*types.WorkflowExecutionInfo NextPageToken []byte }
QueryVisibilityResponse is the response of querying archived visibility records
type SizeEstimator ¶
SizeEstimator is used to estimate the size of any object
func NewJSONSizeEstimator ¶
func NewJSONSizeEstimator() SizeEstimator
NewJSONSizeEstimator returns a new SizeEstimator which uses json encoding to estimate size
type URI ¶ added in v0.7.0
type URI interface { Scheme() string Path() string Hostname() string Port() string Username() string Password() string String() string Opaque() string Query() map[string][]string }
URI identifies the archival resource to which records are written to and read from.
type VisibilityArchiver ¶
type VisibilityArchiver interface { Archive(context.Context, URI, *ArchiveVisibilityRequest, ...ArchiveOption) error Query(context.Context, URI, *QueryVisibilityRequest) (*QueryVisibilityResponse, error) ValidateURI(URI) error }
VisibilityArchiver is used to archive visibility and read archived visibility
type VisibilityArchiverMock ¶ added in v0.7.0
VisibilityArchiverMock is an autogenerated mock type for the VisibilityArchiver type
func (*VisibilityArchiverMock) Archive ¶ added in v0.9.0
func (_m *VisibilityArchiverMock) Archive(_a0 context.Context, _a1 URI, _a2 *ArchiveVisibilityRequest, _a3 ...ArchiveOption) error
Archive provides a mock function with given fields: _a0, _a1, _a2, _a3
func (*VisibilityArchiverMock) Query ¶ added in v0.9.0
func (_m *VisibilityArchiverMock) Query(_a0 context.Context, _a1 URI, _a2 *QueryVisibilityRequest) (*QueryVisibilityResponse, error)
Query provides a mock function with given fields: _a0, _a1, _a2
func (*VisibilityArchiverMock) ValidateURI ¶ added in v0.7.0
func (_m *VisibilityArchiverMock) ValidateURI(uri URI) error
ValidateURI provides a mock function with given fields: uri
type VisibilityBootstrapContainer ¶
type VisibilityBootstrapContainer struct { Logger log.Logger MetricsClient metrics.Client ClusterMetadata cluster.Metadata DomainCache cache.DomainCache }
VisibilityBootstrapContainer contains components needed by all visibility Archiver implementations
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package filestore is a generated GoMock package.
|
Package filestore is a generated GoMock package. |
Package gcloud is a generated GoMock package.
|
Package gcloud is a generated GoMock package. |
Package s3store is a generated GoMock package.
|
Package s3store is a generated GoMock package. |