Documentation ¶
Overview ¶
Package common is a generated GoMock package.
Index ¶
- Constants
- Variables
- func ExecutionOpen(execution interface{}) bool
- func ExecutionStillExists(exec *Execution, pr PersistenceRetryer) (bool, error)
- func ExecutionStillOpen(exec *Execution, pr PersistenceRetryer) (bool, error)
- func GetBranchToken(entity *persistence.ListConcreteExecutionsEntity, ...) ([]byte, string, string, error)
- func Open(state int) bool
- func ValidateConcreteExecution(concreteExecution *ConcreteExecution) error
- func ValidateCurrentExecution(currentExecution *CurrentExecution) error
- type CheckResult
- type CheckResultType
- type ConcreteExecution
- type ControlFlowFailure
- type CurrentExecution
- type Execution
- type ExecutionIterator
- type ExecutionWriter
- type Extension
- type FixOutputEntity
- type FixResult
- type FixResultType
- type Fixer
- type Invariant
- type InvariantCollection
- type InvariantManager
- type InvariantType
- type Keys
- type ManagerCheckResult
- type ManagerFixResult
- type MockExecutionIterator
- type MockExecutionIteratorMockRecorder
- type MockExecutionWriter
- type MockExecutionWriterMockRecorder
- type MockFixer
- type MockFixerMockRecorder
- type MockInvariant
- type MockInvariantManager
- type MockInvariantManagerMockRecorder
- type MockInvariantMockRecorder
- type MockPersistenceRetryer
- func (m *MockPersistenceRetryer) DeleteCurrentWorkflowExecution(request *persistence.DeleteCurrentWorkflowExecutionRequest) error
- func (m *MockPersistenceRetryer) DeleteWorkflowExecution(arg0 *persistence.DeleteWorkflowExecutionRequest) error
- func (m *MockPersistenceRetryer) EXPECT() *MockPersistenceRetryerMockRecorder
- func (m *MockPersistenceRetryer) GetCurrentExecution(arg0 *persistence.GetCurrentExecutionRequest) (*persistence.GetCurrentExecutionResponse, error)
- func (m *MockPersistenceRetryer) GetWorkflowExecution(arg0 *persistence.GetWorkflowExecutionRequest) (*persistence.GetWorkflowExecutionResponse, error)
- func (m *MockPersistenceRetryer) IsWorkflowExecutionExists(request *persistence.IsWorkflowExecutionExistsRequest) (*persistence.IsWorkflowExecutionExistsResponse, error)
- func (m *MockPersistenceRetryer) ListConcreteExecutions(arg0 *persistence.ListConcreteExecutionsRequest) (*persistence.ListConcreteExecutionsResponse, error)
- func (m *MockPersistenceRetryer) ListCurrentExecutions(request *persistence.ListCurrentExecutionsRequest) (*persistence.ListCurrentExecutionsResponse, error)
- func (m *MockPersistenceRetryer) ReadHistoryBranch(arg0 *persistence.ReadHistoryBranchRequest) (*persistence.ReadHistoryBranchResponse, error)
- type MockPersistenceRetryerMockRecorder
- func (mr *MockPersistenceRetryerMockRecorder) DeleteCurrentWorkflowExecution(request interface{}) *gomock.Call
- func (mr *MockPersistenceRetryerMockRecorder) DeleteWorkflowExecution(arg0 interface{}) *gomock.Call
- func (mr *MockPersistenceRetryerMockRecorder) GetCurrentExecution(arg0 interface{}) *gomock.Call
- func (mr *MockPersistenceRetryerMockRecorder) GetWorkflowExecution(arg0 interface{}) *gomock.Call
- func (mr *MockPersistenceRetryerMockRecorder) IsWorkflowExecutionExists(request interface{}) *gomock.Call
- func (mr *MockPersistenceRetryerMockRecorder) ListConcreteExecutions(arg0 interface{}) *gomock.Call
- func (mr *MockPersistenceRetryerMockRecorder) ListCurrentExecutions(request interface{}) *gomock.Call
- func (mr *MockPersistenceRetryerMockRecorder) ReadHistoryBranch(arg0 interface{}) *gomock.Call
- type MockScanOutputIterator
- type MockScanOutputIteratorMockRecorder
- type MockScanner
- type MockScannerMockRecorder
- type PersistenceRetryer
- type ScanOutputEntity
- type ScanOutputIterator
- type ScanType
- type Scanner
- type ShardFixKeys
- type ShardFixReport
- type ShardFixResult
- type ShardFixStats
- type ShardScanKeys
- type ShardScanReport
- type ShardScanResult
- type ShardScanStats
Constants ¶
const ( // CheckResultTypeFailed indicates a failure occurred while attempting to run check CheckResultTypeFailed CheckResultType = "failed" // CheckResultTypeCorrupted indicates check successfully ran and detected a corruption CheckResultTypeCorrupted CheckResultType = "corrupted" // CheckResultTypeHealthy indicates check successfully ran and detected no corruption CheckResultTypeHealthy CheckResultType = "healthy" // FixResultTypeSkipped indicates that fix skipped execution FixResultTypeSkipped FixResultType = "skipped" // FixResultTypeFixed indicates that fix successfully fixed an execution FixResultTypeFixed FixResultType = "fixed" // FixResultTypeFailed indicates that fix attempted to fix an execution but failed to do so FixResultTypeFailed FixResultType = "failed" // HistoryExistsInvariantType asserts that history must exist if concrete execution exists HistoryExistsInvariantType InvariantType = "history_exists" // OpenCurrentExecutionInvariantType asserts that an open concrete execution must have a valid current execution OpenCurrentExecutionInvariantType InvariantType = "open_current_execution" // ConcreteExecutionExistsInvariantType asserts that an open current execution must have a valid concrete execution ConcreteExecutionExistsInvariantType InvariantType = "concrete_execution_exists" // InvariantCollectionMutableState is the collection of invariants relating to mutable state InvariantCollectionMutableState InvariantCollection = 0 // InvariantCollectionHistory is the collection of invariants relating to history InvariantCollectionHistory InvariantCollection = 1 // SkippedExtension is the extension for files which contain skips SkippedExtension Extension = "skipped" // FailedExtension is the extension for files which contain failures FailedExtension Extension = "failed" // FixedExtension is the extension for files which contain fixes FixedExtension Extension = "fixed" // CorruptedExtension is the extension for files which contain corruptions CorruptedExtension Extension = "corrupted" )
Variables ¶
var ( // BlobstoreSeparatorToken is used to separate entries written to blobstore BlobstoreSeparatorToken = []byte("\r\n") // BlobstoreTimeout is the timeout used for blobstore requests BlobstoreTimeout = time.Second * 10 )
Functions ¶
func ExecutionOpen ¶
func ExecutionOpen(execution interface{}) bool
ExecutionOpen returns true if execution state is open false if workflow is closed
func ExecutionStillExists ¶
func ExecutionStillExists( exec *Execution, pr PersistenceRetryer, ) (bool, error)
ExecutionStillExists returns true if execution still exists in persistence, false otherwise. Returns error on failure to confirm.
func ExecutionStillOpen ¶
func ExecutionStillOpen( exec *Execution, pr PersistenceRetryer, ) (bool, error)
ExecutionStillOpen returns true if execution in persistence exists and is open, false otherwise. Returns error on failure to confirm.
func GetBranchToken ¶
func GetBranchToken( entity *persistence.ListConcreteExecutionsEntity, decoder *codec.ThriftRWEncoder, ) ([]byte, string, string, error)
GetBranchToken returns the branchToken, treeID and branchID or error on failure.
func ValidateConcreteExecution ¶
func ValidateConcreteExecution(concreteExecution *ConcreteExecution) error
ValidateConcreteExecution returns an error if ConcreteExecution is not valid, nil otherwise.
func ValidateCurrentExecution ¶
func ValidateCurrentExecution(currentExecution *CurrentExecution) error
ValidateCurrentExecution returns an error if CurrentExecution is not valid, nil otherwise.
Types ¶
type CheckResult ¶
type CheckResult struct { CheckResultType CheckResultType InvariantType InvariantType Info string InfoDetails string }
CheckResult is the result of running Check.
type CheckResultType ¶
type CheckResultType string
CheckResultType is the result type of running an invariant check
type ConcreteExecution ¶
ConcreteExecution is a concrete execution.
type ControlFlowFailure ¶
ControlFlowFailure indicates an error occurred which makes it impossible to even attempt to check or fix one or more execution(s). Note that it is not a ControlFlowFailure if a check or fix fails, it is only a ControlFlowFailure if an error is encountered which makes even attempting to check or fix impossible.
type CurrentExecution ¶
CurrentExecution is a current execution.
type ExecutionIterator ¶
type ExecutionIterator interface { // Next returns the next execution found. Any error reading from underlying store // or converting store entry to Execution will result in an error after which iterator cannot be used. Next() (interface{}, error) // HasNext indicates if the iterator has a next element. If HasNext is true // it is guaranteed that Next will return a nil error and a non-nil Execution. HasNext() bool }
ExecutionIterator gets Executions from underlying store.
func NewPersistenceIterator ¶
func NewPersistenceIterator( pr PersistenceRetryer, pageSize int, shardID int, scanType ScanType, ) ExecutionIterator
NewPersistenceIterator returns a new paginated iterator over persistence
type ExecutionWriter ¶
ExecutionWriter is used to write entities (FixOutputEntity or ScanOutputEntity) to blobstore
func NewBlobstoreWriter ¶
func NewBlobstoreWriter( uuid string, extension Extension, client blobstore.Client, flushThreshold int, ) ExecutionWriter
NewBlobstoreWriter constructs a new blobstore writer
type Extension ¶
type Extension string
Extension is the type which indicates the file extension type
type FixOutputEntity ¶
type FixOutputEntity struct { Execution interface{} Input ScanOutputEntity Result ManagerFixResult }
FixOutputEntity represents a single execution that should be durably recorded by fix. It contains the ScanOutputEntity that was given as input to fix.
type FixResult ¶
type FixResult struct { FixResultType FixResultType InvariantType InvariantType CheckResult CheckResult Info string InfoDetails string }
FixResult is the result of running Fix.
func DeleteExecution ¶
func DeleteExecution( exec interface{}, pr PersistenceRetryer, ) *FixResult
DeleteExecution deletes concrete execution and current execution conditionally on matching runID.
type FixResultType ¶
type FixResultType string
FixResultType is the result type of running an invariant fix
type Fixer ¶
type Fixer interface {
Fix() ShardFixReport
}
Fixer is used to fix all executions in a shard. It is responsible for three things: 1. Confirming that each execution it scans is corrupted. 2. Attempting to fix any confirmed corrupted executions. 3. Recording skipped executions, failed to fix executions and successfully fix executions to durable store. 4. Producing a ShardFixReport
type Invariant ¶
type Invariant interface { Check(interface{}) CheckResult Fix(interface{}) FixResult InvariantType() InvariantType }
Invariant represents an invariant of a single execution. It can be used to check that the execution satisfies the invariant. It can also be used to fix the invariant for an execution.
type InvariantCollection ¶
type InvariantCollection int
InvariantCollection is a type which indicates a collection of invariants
type InvariantManager ¶
type InvariantManager interface { RunChecks(interface{}) ManagerCheckResult RunFixes(interface{}) ManagerFixResult InvariantTypes() []InvariantType }
InvariantManager represents a manager of several invariants. It can be used to run a group of invariant checks or fixes.
type InvariantType ¶
type InvariantType string
InvariantType is the type of an invariant
func InvariantTypePtr ¶
func InvariantTypePtr(t InvariantType) *InvariantType
InvariantTypePtr returns a pointer to InvariantType
type Keys ¶
Keys indicate the keys which were uploaded during a scan or fix. Keys are constructed as uuid_page.extension. MinPage and MaxPage are both inclusive and pages are sequential, meaning from this struct all pages can be deterministically constructed.
type ManagerCheckResult ¶
type ManagerCheckResult struct { CheckResultType CheckResultType DeterminingInvariantType *InvariantType CheckResults []CheckResult }
ManagerCheckResult is the result of running a list of checks
type ManagerFixResult ¶
type ManagerFixResult struct { FixResultType FixResultType DeterminingInvariantType *InvariantType FixResults []FixResult }
ManagerFixResult is the result of running a list of fixes
type MockExecutionIterator ¶
type MockExecutionIterator struct {
// contains filtered or unexported fields
}
MockExecutionIterator is a mock of ExecutionIterator interface
func NewMockExecutionIterator ¶
func NewMockExecutionIterator(ctrl *gomock.Controller) *MockExecutionIterator
NewMockExecutionIterator creates a new mock instance
func (*MockExecutionIterator) EXPECT ¶
func (m *MockExecutionIterator) EXPECT() *MockExecutionIteratorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockExecutionIterator) HasNext ¶
func (m *MockExecutionIterator) HasNext() bool
HasNext mocks base method
func (*MockExecutionIterator) Next ¶
func (m *MockExecutionIterator) Next() (interface{}, error)
Next mocks base method
type MockExecutionIteratorMockRecorder ¶
type MockExecutionIteratorMockRecorder struct {
// contains filtered or unexported fields
}
MockExecutionIteratorMockRecorder is the mock recorder for MockExecutionIterator
func (*MockExecutionIteratorMockRecorder) HasNext ¶
func (mr *MockExecutionIteratorMockRecorder) HasNext() *gomock.Call
HasNext indicates an expected call of HasNext
func (*MockExecutionIteratorMockRecorder) Next ¶
func (mr *MockExecutionIteratorMockRecorder) Next() *gomock.Call
Next indicates an expected call of Next
type MockExecutionWriter ¶
type MockExecutionWriter struct {
// contains filtered or unexported fields
}
MockExecutionWriter is a mock of ExecutionWriter interface
func NewMockExecutionWriter ¶
func NewMockExecutionWriter(ctrl *gomock.Controller) *MockExecutionWriter
NewMockExecutionWriter creates a new mock instance
func (*MockExecutionWriter) Add ¶
func (m *MockExecutionWriter) Add(arg0 interface{}) error
Add mocks base method
func (*MockExecutionWriter) EXPECT ¶
func (m *MockExecutionWriter) EXPECT() *MockExecutionWriterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockExecutionWriter) Flush ¶
func (m *MockExecutionWriter) Flush() error
Flush mocks base method
func (*MockExecutionWriter) FlushedKeys ¶
func (m *MockExecutionWriter) FlushedKeys() *Keys
FlushedKeys mocks base method
type MockExecutionWriterMockRecorder ¶
type MockExecutionWriterMockRecorder struct {
// contains filtered or unexported fields
}
MockExecutionWriterMockRecorder is the mock recorder for MockExecutionWriter
func (*MockExecutionWriterMockRecorder) Add ¶
func (mr *MockExecutionWriterMockRecorder) Add(arg0 interface{}) *gomock.Call
Add indicates an expected call of Add
func (*MockExecutionWriterMockRecorder) Flush ¶
func (mr *MockExecutionWriterMockRecorder) Flush() *gomock.Call
Flush indicates an expected call of Flush
func (*MockExecutionWriterMockRecorder) FlushedKeys ¶
func (mr *MockExecutionWriterMockRecorder) FlushedKeys() *gomock.Call
FlushedKeys indicates an expected call of FlushedKeys
type MockFixer ¶
type MockFixer struct {
// contains filtered or unexported fields
}
MockFixer is a mock of Fixer interface
func NewMockFixer ¶
func NewMockFixer(ctrl *gomock.Controller) *MockFixer
NewMockFixer creates a new mock instance
func (*MockFixer) EXPECT ¶
func (m *MockFixer) EXPECT() *MockFixerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockFixerMockRecorder ¶
type MockFixerMockRecorder struct {
// contains filtered or unexported fields
}
MockFixerMockRecorder is the mock recorder for MockFixer
func (*MockFixerMockRecorder) Fix ¶
func (mr *MockFixerMockRecorder) Fix() *gomock.Call
Fix indicates an expected call of Fix
type MockInvariant ¶
type MockInvariant struct {
// contains filtered or unexported fields
}
MockInvariant is a mock of Invariant interface
func NewMockInvariant ¶
func NewMockInvariant(ctrl *gomock.Controller) *MockInvariant
NewMockInvariant creates a new mock instance
func (*MockInvariant) Check ¶
func (m *MockInvariant) Check(arg0 interface{}) CheckResult
Check mocks base method
func (*MockInvariant) EXPECT ¶
func (m *MockInvariant) EXPECT() *MockInvariantMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockInvariant) Fix ¶
func (m *MockInvariant) Fix(arg0 interface{}) FixResult
Fix mocks base method
func (*MockInvariant) InvariantType ¶
func (m *MockInvariant) InvariantType() InvariantType
InvariantType mocks base method
type MockInvariantManager ¶
type MockInvariantManager struct {
// contains filtered or unexported fields
}
MockInvariantManager is a mock of InvariantManager interface
func NewMockInvariantManager ¶
func NewMockInvariantManager(ctrl *gomock.Controller) *MockInvariantManager
NewMockInvariantManager creates a new mock instance
func (*MockInvariantManager) EXPECT ¶
func (m *MockInvariantManager) EXPECT() *MockInvariantManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockInvariantManager) InvariantTypes ¶
func (m *MockInvariantManager) InvariantTypes() []InvariantType
InvariantTypes mocks base method
func (*MockInvariantManager) RunChecks ¶
func (m *MockInvariantManager) RunChecks(arg0 interface{}) ManagerCheckResult
RunChecks mocks base method
func (*MockInvariantManager) RunFixes ¶
func (m *MockInvariantManager) RunFixes(arg0 interface{}) ManagerFixResult
RunFixes mocks base method
type MockInvariantManagerMockRecorder ¶
type MockInvariantManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockInvariantManagerMockRecorder is the mock recorder for MockInvariantManager
func (*MockInvariantManagerMockRecorder) InvariantTypes ¶
func (mr *MockInvariantManagerMockRecorder) InvariantTypes() *gomock.Call
InvariantTypes indicates an expected call of InvariantTypes
func (*MockInvariantManagerMockRecorder) RunChecks ¶
func (mr *MockInvariantManagerMockRecorder) RunChecks(arg0 interface{}) *gomock.Call
RunChecks indicates an expected call of RunChecks
func (*MockInvariantManagerMockRecorder) RunFixes ¶
func (mr *MockInvariantManagerMockRecorder) RunFixes(arg0 interface{}) *gomock.Call
RunFixes indicates an expected call of RunFixes
type MockInvariantMockRecorder ¶
type MockInvariantMockRecorder struct {
// contains filtered or unexported fields
}
MockInvariantMockRecorder is the mock recorder for MockInvariant
func (*MockInvariantMockRecorder) Check ¶
func (mr *MockInvariantMockRecorder) Check(arg0 interface{}) *gomock.Call
Check indicates an expected call of Check
func (*MockInvariantMockRecorder) Fix ¶
func (mr *MockInvariantMockRecorder) Fix(arg0 interface{}) *gomock.Call
Fix indicates an expected call of Fix
func (*MockInvariantMockRecorder) InvariantType ¶
func (mr *MockInvariantMockRecorder) InvariantType() *gomock.Call
InvariantType indicates an expected call of InvariantType
type MockPersistenceRetryer ¶
type MockPersistenceRetryer struct {
// contains filtered or unexported fields
}
MockPersistenceRetryer is a mock of PersistenceRetryer interface
func NewMockPersistenceRetryer ¶
func NewMockPersistenceRetryer(ctrl *gomock.Controller) *MockPersistenceRetryer
NewMockPersistenceRetryer creates a new mock instance
func (*MockPersistenceRetryer) DeleteCurrentWorkflowExecution ¶
func (m *MockPersistenceRetryer) DeleteCurrentWorkflowExecution(request *persistence.DeleteCurrentWorkflowExecutionRequest) error
DeleteCurrentWorkflowExecution mocks base method
func (*MockPersistenceRetryer) DeleteWorkflowExecution ¶
func (m *MockPersistenceRetryer) DeleteWorkflowExecution(arg0 *persistence.DeleteWorkflowExecutionRequest) error
DeleteWorkflowExecution mocks base method
func (*MockPersistenceRetryer) EXPECT ¶
func (m *MockPersistenceRetryer) EXPECT() *MockPersistenceRetryerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockPersistenceRetryer) GetCurrentExecution ¶
func (m *MockPersistenceRetryer) GetCurrentExecution(arg0 *persistence.GetCurrentExecutionRequest) (*persistence.GetCurrentExecutionResponse, error)
GetCurrentExecution mocks base method
func (*MockPersistenceRetryer) GetWorkflowExecution ¶
func (m *MockPersistenceRetryer) GetWorkflowExecution(arg0 *persistence.GetWorkflowExecutionRequest) (*persistence.GetWorkflowExecutionResponse, error)
GetWorkflowExecution mocks base method
func (*MockPersistenceRetryer) IsWorkflowExecutionExists ¶
func (m *MockPersistenceRetryer) IsWorkflowExecutionExists(request *persistence.IsWorkflowExecutionExistsRequest) (*persistence.IsWorkflowExecutionExistsResponse, error)
IsWorkflowExecutionExists mocks base method
func (*MockPersistenceRetryer) ListConcreteExecutions ¶
func (m *MockPersistenceRetryer) ListConcreteExecutions(arg0 *persistence.ListConcreteExecutionsRequest) (*persistence.ListConcreteExecutionsResponse, error)
ListConcreteExecutions mocks base method
func (*MockPersistenceRetryer) ListCurrentExecutions ¶
func (m *MockPersistenceRetryer) ListCurrentExecutions(request *persistence.ListCurrentExecutionsRequest) (*persistence.ListCurrentExecutionsResponse, error)
ListCurrentExecutions mocks base method
func (*MockPersistenceRetryer) ReadHistoryBranch ¶
func (m *MockPersistenceRetryer) ReadHistoryBranch(arg0 *persistence.ReadHistoryBranchRequest) (*persistence.ReadHistoryBranchResponse, error)
ReadHistoryBranch mocks base method
type MockPersistenceRetryerMockRecorder ¶
type MockPersistenceRetryerMockRecorder struct {
// contains filtered or unexported fields
}
MockPersistenceRetryerMockRecorder is the mock recorder for MockPersistenceRetryer
func (*MockPersistenceRetryerMockRecorder) DeleteCurrentWorkflowExecution ¶
func (mr *MockPersistenceRetryerMockRecorder) DeleteCurrentWorkflowExecution(request interface{}) *gomock.Call
DeleteCurrentWorkflowExecution indicates an expected call of DeleteCurrentWorkflowExecution
func (*MockPersistenceRetryerMockRecorder) DeleteWorkflowExecution ¶
func (mr *MockPersistenceRetryerMockRecorder) DeleteWorkflowExecution(arg0 interface{}) *gomock.Call
DeleteWorkflowExecution indicates an expected call of DeleteWorkflowExecution
func (*MockPersistenceRetryerMockRecorder) GetCurrentExecution ¶
func (mr *MockPersistenceRetryerMockRecorder) GetCurrentExecution(arg0 interface{}) *gomock.Call
GetCurrentExecution indicates an expected call of GetCurrentExecution
func (*MockPersistenceRetryerMockRecorder) GetWorkflowExecution ¶
func (mr *MockPersistenceRetryerMockRecorder) GetWorkflowExecution(arg0 interface{}) *gomock.Call
GetWorkflowExecution indicates an expected call of GetWorkflowExecution
func (*MockPersistenceRetryerMockRecorder) IsWorkflowExecutionExists ¶
func (mr *MockPersistenceRetryerMockRecorder) IsWorkflowExecutionExists(request interface{}) *gomock.Call
IsWorkflowExecutionExists indicates an expected call of IsWorkflowExecutionExists
func (*MockPersistenceRetryerMockRecorder) ListConcreteExecutions ¶
func (mr *MockPersistenceRetryerMockRecorder) ListConcreteExecutions(arg0 interface{}) *gomock.Call
ListConcreteExecutions indicates an expected call of ListConcreteExecutions
func (*MockPersistenceRetryerMockRecorder) ListCurrentExecutions ¶
func (mr *MockPersistenceRetryerMockRecorder) ListCurrentExecutions(request interface{}) *gomock.Call
ListCurrentExecutions indicates an expected call of ListCurrentExecutions
func (*MockPersistenceRetryerMockRecorder) ReadHistoryBranch ¶
func (mr *MockPersistenceRetryerMockRecorder) ReadHistoryBranch(arg0 interface{}) *gomock.Call
ReadHistoryBranch indicates an expected call of ReadHistoryBranch
type MockScanOutputIterator ¶
type MockScanOutputIterator struct {
// contains filtered or unexported fields
}
MockScanOutputIterator is a mock of ScanOutputIterator interface
func NewMockScanOutputIterator ¶
func NewMockScanOutputIterator(ctrl *gomock.Controller) *MockScanOutputIterator
NewMockScanOutputIterator creates a new mock instance
func (*MockScanOutputIterator) EXPECT ¶
func (m *MockScanOutputIterator) EXPECT() *MockScanOutputIteratorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockScanOutputIterator) HasNext ¶
func (m *MockScanOutputIterator) HasNext() bool
HasNext mocks base method
func (*MockScanOutputIterator) Next ¶
func (m *MockScanOutputIterator) Next() (*ScanOutputEntity, error)
Next mocks base method
type MockScanOutputIteratorMockRecorder ¶
type MockScanOutputIteratorMockRecorder struct {
// contains filtered or unexported fields
}
MockScanOutputIteratorMockRecorder is the mock recorder for MockScanOutputIterator
func (*MockScanOutputIteratorMockRecorder) HasNext ¶
func (mr *MockScanOutputIteratorMockRecorder) HasNext() *gomock.Call
HasNext indicates an expected call of HasNext
func (*MockScanOutputIteratorMockRecorder) Next ¶
func (mr *MockScanOutputIteratorMockRecorder) Next() *gomock.Call
Next indicates an expected call of Next
type MockScanner ¶
type MockScanner struct {
// contains filtered or unexported fields
}
MockScanner is a mock of Scanner interface
func NewMockScanner ¶
func NewMockScanner(ctrl *gomock.Controller) *MockScanner
NewMockScanner creates a new mock instance
func (*MockScanner) EXPECT ¶
func (m *MockScanner) EXPECT() *MockScannerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockScannerMockRecorder ¶
type MockScannerMockRecorder struct {
// contains filtered or unexported fields
}
MockScannerMockRecorder is the mock recorder for MockScanner
func (*MockScannerMockRecorder) Scan ¶
func (mr *MockScannerMockRecorder) Scan() *gomock.Call
Scan indicates an expected call of Scan
type PersistenceRetryer ¶
type PersistenceRetryer interface { ListConcreteExecutions(*persistence.ListConcreteExecutionsRequest) (*persistence.ListConcreteExecutionsResponse, error) ListCurrentExecutions(request *persistence.ListCurrentExecutionsRequest) (*persistence.ListCurrentExecutionsResponse, error) GetWorkflowExecution(*persistence.GetWorkflowExecutionRequest) (*persistence.GetWorkflowExecutionResponse, error) GetCurrentExecution(*persistence.GetCurrentExecutionRequest) (*persistence.GetCurrentExecutionResponse, error) IsWorkflowExecutionExists(request *persistence.IsWorkflowExecutionExistsRequest) (*persistence.IsWorkflowExecutionExistsResponse, error) ReadHistoryBranch(*persistence.ReadHistoryBranchRequest) (*persistence.ReadHistoryBranchResponse, error) DeleteWorkflowExecution(*persistence.DeleteWorkflowExecutionRequest) error DeleteCurrentWorkflowExecution(request *persistence.DeleteCurrentWorkflowExecutionRequest) error }
PersistenceRetryer is used to retry requests to persistence
func NewPersistenceRetryer ¶
func NewPersistenceRetryer( execManager persistence.ExecutionManager, historyManager persistence.HistoryManager, ) PersistenceRetryer
NewPersistenceRetryer constructs a new PersistenceRetryer
type ScanOutputEntity ¶
type ScanOutputEntity struct { Execution interface{} Result ManagerCheckResult }
ScanOutputEntity represents a single execution that should be durably recorded by Scan.
type ScanOutputIterator ¶
type ScanOutputIterator interface { // Next returns the next ScanOutputEntity found. Any error reading from underlying store // or converting store entry to ScanOutputEntity will result in an error after which iterator cannot be used. Next() (*ScanOutputEntity, error) // HasNext indicates if the iterator has a next element. If HasNext is true it is // guaranteed that Next will return a nil error and non-nil ScanOutputEntity. HasNext() bool }
ScanOutputIterator gets ScanOutputEntities from underlying store
func NewBlobstoreIterator ¶
func NewBlobstoreIterator( client blobstore.Client, keys Keys, scanType ScanType, ) ScanOutputIterator
NewBlobstoreIterator constructs a new iterator backed by blobstore.
type ScanType ¶
type ScanType int
ScanType is the enum for representing different entity types to scan
type Scanner ¶
type Scanner interface {
Scan() ShardScanReport
}
Scanner is used to scan over all executions in a shard. It is responsible for three things: 1. Checking invariants for each execution. 2. Recording corruption and failures to durable store. 3. Producing a ShardScanReport
type ShardFixKeys ¶
ShardFixKeys are the keys to the blobs that were uploaded during fix. Keys can be nil if there were no uploads.
type ShardFixReport ¶
type ShardFixReport struct { ShardID int Stats ShardFixStats Result ShardFixResult }
ShardFixReport is the report of running Fix on a single shard
type ShardFixResult ¶
type ShardFixResult struct { ShardFixKeys *ShardFixKeys ControlFlowFailure *ControlFlowFailure }
ShardFixResult indicates the result of running fix on a shard. Exactly one of ControlFlowFailure or ShardFixKeys will be non-nil.
type ShardFixStats ¶
type ShardFixStats struct { ExecutionCount int64 FixedCount int64 SkippedCount int64 FailedCount int64 }
ShardFixStats indicates the stats of executions that were handled by shard Fix.
type ShardScanKeys ¶
ShardScanKeys are the keys to the blobs that were uploaded during scan. Keys can be nil if there were no uploads.
type ShardScanReport ¶
type ShardScanReport struct { ShardID int Stats ShardScanStats Result ShardScanResult }
ShardScanReport is the report of running Scan on a single shard.
type ShardScanResult ¶
type ShardScanResult struct { ShardScanKeys *ShardScanKeys ControlFlowFailure *ControlFlowFailure }
ShardScanResult indicates the result of running scan on a shard. Exactly one of ControlFlowFailure or ShardScanKeys will be non-nil
type ShardScanStats ¶
type ShardScanStats struct { ExecutionsCount int64 CorruptedCount int64 CheckFailedCount int64 CorruptionByType map[InvariantType]int64 CorruptedOpenExecutionCount int64 }
ShardScanStats indicates the stats of executions which were handled by shard Scan.