Documentation ¶
Overview ¶
Package queue is a generated GoMock package.
Index ¶
- type DomainFilter
- type MockProcessingQueue
- func (m *MockProcessingQueue) AddTasks(arg0 map[task.Key]task.Task, arg1 bool)
- func (m *MockProcessingQueue) EXPECT() *MockProcessingQueueMockRecorder
- func (m *MockProcessingQueue) Merge(arg0 ProcessingQueue) []ProcessingQueue
- func (m *MockProcessingQueue) Split(arg0 ProcessingQueueSplitPolicy) []ProcessingQueue
- func (m *MockProcessingQueue) State() ProcessingQueueState
- func (m *MockProcessingQueue) UpdateAckLevel()
- type MockProcessingQueueCollection
- func (m *MockProcessingQueueCollection) ActiveQueue() ProcessingQueue
- func (m *MockProcessingQueueCollection) AddTasks(arg0 map[task.Key]task.Task, arg1 bool)
- func (m *MockProcessingQueueCollection) EXPECT() *MockProcessingQueueCollectionMockRecorder
- func (m *MockProcessingQueueCollection) Level() int
- func (m *MockProcessingQueueCollection) Merge(arg0 []ProcessingQueue)
- func (m *MockProcessingQueueCollection) Queues() []ProcessingQueue
- func (m *MockProcessingQueueCollection) Split(arg0 ProcessingQueueSplitPolicy) []ProcessingQueue
- type MockProcessingQueueCollectionMockRecorder
- func (mr *MockProcessingQueueCollectionMockRecorder) ActiveQueue() *gomock.Call
- func (mr *MockProcessingQueueCollectionMockRecorder) AddTasks(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockProcessingQueueCollectionMockRecorder) Level() *gomock.Call
- func (mr *MockProcessingQueueCollectionMockRecorder) Merge(arg0 interface{}) *gomock.Call
- func (mr *MockProcessingQueueCollectionMockRecorder) Queues() *gomock.Call
- func (mr *MockProcessingQueueCollectionMockRecorder) Split(arg0 interface{}) *gomock.Call
- type MockProcessingQueueManager
- type MockProcessingQueueManagerMockRecorder
- type MockProcessingQueueMockRecorder
- func (mr *MockProcessingQueueMockRecorder) AddTasks(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockProcessingQueueMockRecorder) Merge(arg0 interface{}) *gomock.Call
- func (mr *MockProcessingQueueMockRecorder) Split(arg0 interface{}) *gomock.Call
- func (mr *MockProcessingQueueMockRecorder) State() *gomock.Call
- func (mr *MockProcessingQueueMockRecorder) UpdateAckLevel() *gomock.Call
- type MockProcessingQueueSplitPolicy
- type MockProcessingQueueSplitPolicyMockRecorder
- type MockProcessingQueueState
- func (m *MockProcessingQueueState) AckLevel() task.Key
- func (m *MockProcessingQueueState) DomainFilter() DomainFilter
- func (m *MockProcessingQueueState) EXPECT() *MockProcessingQueueStateMockRecorder
- func (m *MockProcessingQueueState) Level() int
- func (m *MockProcessingQueueState) MaxLevel() task.Key
- func (m *MockProcessingQueueState) ReadLevel() task.Key
- type MockProcessingQueueStateMockRecorder
- func (mr *MockProcessingQueueStateMockRecorder) AckLevel() *gomock.Call
- func (mr *MockProcessingQueueStateMockRecorder) DomainFilter() *gomock.Call
- func (mr *MockProcessingQueueStateMockRecorder) Level() *gomock.Call
- func (mr *MockProcessingQueueStateMockRecorder) MaxLevel() *gomock.Call
- func (mr *MockProcessingQueueStateMockRecorder) ReadLevel() *gomock.Call
- type ProcessingQueue
- type ProcessingQueueCollection
- type ProcessingQueueManager
- type ProcessingQueueSplitPolicy
- func NewAggregatedSplitPolicy(policies ...ProcessingQueueSplitPolicy) ProcessingQueueSplitPolicy
- func NewPendingTaskSplitPolicy(pendingTaskThreshold map[int]int, lookAheadFunc lookAheadFunc, ...) ProcessingQueueSplitPolicy
- func NewSelectedDomainSplitPolicy(domainIDs map[string]struct{}, newQueueLevel int) ProcessingQueueSplitPolicy
- func NewStuckTaskSplitPolicy(attemptThreshold map[int]int, maxNewQueueLevel int) ProcessingQueueSplitPolicy
- type ProcessingQueueState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DomainFilter ¶
type DomainFilter struct { DomainIDs map[string]struct{} // by default, a DomainFilter matches domains listed in the Domains field // if reverseMatch is true then the DomainFilter matches domains that are // not in the Domains field. ReverseMatch bool }
DomainFilter filters domain
func NewDomainFilter ¶
func NewDomainFilter( domainIDs map[string]struct{}, reverseMatch bool, ) DomainFilter
NewDomainFilter creates a new domain filter
func (DomainFilter) Exclude ¶
func (f DomainFilter) Exclude(domainIDs map[string]struct{}) DomainFilter
Exclude removes domainIDs from the domainID set specified by the filter
func (DomainFilter) Filter ¶
func (f DomainFilter) Filter(domainID string) bool
Filter returns true if domainID is in the domainID set specified by the filter
func (DomainFilter) Include ¶
func (f DomainFilter) Include(domainIDs map[string]struct{}) DomainFilter
Include adds more domainIDs to the domainID set specified by the filter
func (DomainFilter) Merge ¶
func (f DomainFilter) Merge(f2 DomainFilter) DomainFilter
Merge merges the domainID sets specified by two domain filters
type MockProcessingQueue ¶
type MockProcessingQueue struct {
// contains filtered or unexported fields
}
MockProcessingQueue is a mock of ProcessingQueue interface
func NewMockProcessingQueue ¶
func NewMockProcessingQueue(ctrl *gomock.Controller) *MockProcessingQueue
NewMockProcessingQueue creates a new mock instance
func (*MockProcessingQueue) EXPECT ¶
func (m *MockProcessingQueue) EXPECT() *MockProcessingQueueMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockProcessingQueue) Merge ¶
func (m *MockProcessingQueue) Merge(arg0 ProcessingQueue) []ProcessingQueue
Merge mocks base method
func (*MockProcessingQueue) Split ¶
func (m *MockProcessingQueue) Split(arg0 ProcessingQueueSplitPolicy) []ProcessingQueue
Split mocks base method
func (*MockProcessingQueue) State ¶
func (m *MockProcessingQueue) State() ProcessingQueueState
State mocks base method
func (*MockProcessingQueue) UpdateAckLevel ¶
func (m *MockProcessingQueue) UpdateAckLevel()
UpdateAckLevel mocks base method
type MockProcessingQueueCollection ¶
type MockProcessingQueueCollection struct {
// contains filtered or unexported fields
}
MockProcessingQueueCollection is a mock of ProcessingQueueCollection interface
func NewMockProcessingQueueCollection ¶
func NewMockProcessingQueueCollection(ctrl *gomock.Controller) *MockProcessingQueueCollection
NewMockProcessingQueueCollection creates a new mock instance
func (*MockProcessingQueueCollection) ActiveQueue ¶
func (m *MockProcessingQueueCollection) ActiveQueue() ProcessingQueue
ActiveQueue mocks base method
func (*MockProcessingQueueCollection) EXPECT ¶
func (m *MockProcessingQueueCollection) EXPECT() *MockProcessingQueueCollectionMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockProcessingQueueCollection) Level ¶
func (m *MockProcessingQueueCollection) Level() int
Level mocks base method
func (*MockProcessingQueueCollection) Merge ¶
func (m *MockProcessingQueueCollection) Merge(arg0 []ProcessingQueue)
Merge mocks base method
func (*MockProcessingQueueCollection) Queues ¶
func (m *MockProcessingQueueCollection) Queues() []ProcessingQueue
Queues mocks base method
func (*MockProcessingQueueCollection) Split ¶
func (m *MockProcessingQueueCollection) Split(arg0 ProcessingQueueSplitPolicy) []ProcessingQueue
Split mocks base method
type MockProcessingQueueCollectionMockRecorder ¶
type MockProcessingQueueCollectionMockRecorder struct {
// contains filtered or unexported fields
}
MockProcessingQueueCollectionMockRecorder is the mock recorder for MockProcessingQueueCollection
func (*MockProcessingQueueCollectionMockRecorder) ActiveQueue ¶
func (mr *MockProcessingQueueCollectionMockRecorder) ActiveQueue() *gomock.Call
ActiveQueue indicates an expected call of ActiveQueue
func (*MockProcessingQueueCollectionMockRecorder) AddTasks ¶
func (mr *MockProcessingQueueCollectionMockRecorder) AddTasks(arg0, arg1 interface{}) *gomock.Call
AddTasks indicates an expected call of AddTasks
func (*MockProcessingQueueCollectionMockRecorder) Level ¶
func (mr *MockProcessingQueueCollectionMockRecorder) Level() *gomock.Call
Level indicates an expected call of Level
func (*MockProcessingQueueCollectionMockRecorder) Merge ¶
func (mr *MockProcessingQueueCollectionMockRecorder) Merge(arg0 interface{}) *gomock.Call
Merge indicates an expected call of Merge
func (*MockProcessingQueueCollectionMockRecorder) Queues ¶
func (mr *MockProcessingQueueCollectionMockRecorder) Queues() *gomock.Call
Queues indicates an expected call of Queues
func (*MockProcessingQueueCollectionMockRecorder) Split ¶
func (mr *MockProcessingQueueCollectionMockRecorder) Split(arg0 interface{}) *gomock.Call
Split indicates an expected call of Split
type MockProcessingQueueManager ¶
type MockProcessingQueueManager struct {
// contains filtered or unexported fields
}
MockProcessingQueueManager is a mock of ProcessingQueueManager interface
func NewMockProcessingQueueManager ¶
func NewMockProcessingQueueManager(ctrl *gomock.Controller) *MockProcessingQueueManager
NewMockProcessingQueueManager creates a new mock instance
func (*MockProcessingQueueManager) EXPECT ¶
func (m *MockProcessingQueueManager) EXPECT() *MockProcessingQueueManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockProcessingQueueManager) NotifyNewTasks ¶
func (m *MockProcessingQueueManager) NotifyNewTasks(arg0 []persistence.Task)
NotifyNewTasks mocks base method
func (*MockProcessingQueueManager) Start ¶
func (m *MockProcessingQueueManager) Start()
Start mocks base method
func (*MockProcessingQueueManager) Stop ¶
func (m *MockProcessingQueueManager) Stop()
Stop mocks base method
type MockProcessingQueueManagerMockRecorder ¶
type MockProcessingQueueManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockProcessingQueueManagerMockRecorder is the mock recorder for MockProcessingQueueManager
func (*MockProcessingQueueManagerMockRecorder) NotifyNewTasks ¶
func (mr *MockProcessingQueueManagerMockRecorder) NotifyNewTasks(arg0 interface{}) *gomock.Call
NotifyNewTasks indicates an expected call of NotifyNewTasks
func (*MockProcessingQueueManagerMockRecorder) Start ¶
func (mr *MockProcessingQueueManagerMockRecorder) Start() *gomock.Call
Start indicates an expected call of Start
func (*MockProcessingQueueManagerMockRecorder) Stop ¶
func (mr *MockProcessingQueueManagerMockRecorder) Stop() *gomock.Call
Stop indicates an expected call of Stop
type MockProcessingQueueMockRecorder ¶
type MockProcessingQueueMockRecorder struct {
// contains filtered or unexported fields
}
MockProcessingQueueMockRecorder is the mock recorder for MockProcessingQueue
func (*MockProcessingQueueMockRecorder) AddTasks ¶
func (mr *MockProcessingQueueMockRecorder) AddTasks(arg0, arg1 interface{}) *gomock.Call
AddTasks indicates an expected call of AddTasks
func (*MockProcessingQueueMockRecorder) Merge ¶
func (mr *MockProcessingQueueMockRecorder) Merge(arg0 interface{}) *gomock.Call
Merge indicates an expected call of Merge
func (*MockProcessingQueueMockRecorder) Split ¶
func (mr *MockProcessingQueueMockRecorder) Split(arg0 interface{}) *gomock.Call
Split indicates an expected call of Split
func (*MockProcessingQueueMockRecorder) State ¶
func (mr *MockProcessingQueueMockRecorder) State() *gomock.Call
State indicates an expected call of State
func (*MockProcessingQueueMockRecorder) UpdateAckLevel ¶
func (mr *MockProcessingQueueMockRecorder) UpdateAckLevel() *gomock.Call
UpdateAckLevel indicates an expected call of UpdateAckLevel
type MockProcessingQueueSplitPolicy ¶
type MockProcessingQueueSplitPolicy struct {
// contains filtered or unexported fields
}
MockProcessingQueueSplitPolicy is a mock of ProcessingQueueSplitPolicy interface
func NewMockProcessingQueueSplitPolicy ¶
func NewMockProcessingQueueSplitPolicy(ctrl *gomock.Controller) *MockProcessingQueueSplitPolicy
NewMockProcessingQueueSplitPolicy creates a new mock instance
func (*MockProcessingQueueSplitPolicy) EXPECT ¶
func (m *MockProcessingQueueSplitPolicy) EXPECT() *MockProcessingQueueSplitPolicyMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockProcessingQueueSplitPolicy) Evaluate ¶
func (m *MockProcessingQueueSplitPolicy) Evaluate(arg0 ProcessingQueue) []ProcessingQueueState
Evaluate mocks base method
type MockProcessingQueueSplitPolicyMockRecorder ¶
type MockProcessingQueueSplitPolicyMockRecorder struct {
// contains filtered or unexported fields
}
MockProcessingQueueSplitPolicyMockRecorder is the mock recorder for MockProcessingQueueSplitPolicy
func (*MockProcessingQueueSplitPolicyMockRecorder) Evaluate ¶
func (mr *MockProcessingQueueSplitPolicyMockRecorder) Evaluate(arg0 interface{}) *gomock.Call
Evaluate indicates an expected call of Evaluate
type MockProcessingQueueState ¶
type MockProcessingQueueState struct {
// contains filtered or unexported fields
}
MockProcessingQueueState is a mock of ProcessingQueueState interface
func NewMockProcessingQueueState ¶
func NewMockProcessingQueueState(ctrl *gomock.Controller) *MockProcessingQueueState
NewMockProcessingQueueState creates a new mock instance
func (*MockProcessingQueueState) AckLevel ¶
func (m *MockProcessingQueueState) AckLevel() task.Key
AckLevel mocks base method
func (*MockProcessingQueueState) DomainFilter ¶
func (m *MockProcessingQueueState) DomainFilter() DomainFilter
DomainFilter mocks base method
func (*MockProcessingQueueState) EXPECT ¶
func (m *MockProcessingQueueState) EXPECT() *MockProcessingQueueStateMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockProcessingQueueState) Level ¶
func (m *MockProcessingQueueState) Level() int
Level mocks base method
func (*MockProcessingQueueState) MaxLevel ¶
func (m *MockProcessingQueueState) MaxLevel() task.Key
MaxLevel mocks base method
func (*MockProcessingQueueState) ReadLevel ¶
func (m *MockProcessingQueueState) ReadLevel() task.Key
ReadLevel mocks base method
type MockProcessingQueueStateMockRecorder ¶
type MockProcessingQueueStateMockRecorder struct {
// contains filtered or unexported fields
}
MockProcessingQueueStateMockRecorder is the mock recorder for MockProcessingQueueState
func (*MockProcessingQueueStateMockRecorder) AckLevel ¶
func (mr *MockProcessingQueueStateMockRecorder) AckLevel() *gomock.Call
AckLevel indicates an expected call of AckLevel
func (*MockProcessingQueueStateMockRecorder) DomainFilter ¶
func (mr *MockProcessingQueueStateMockRecorder) DomainFilter() *gomock.Call
DomainFilter indicates an expected call of DomainFilter
func (*MockProcessingQueueStateMockRecorder) Level ¶
func (mr *MockProcessingQueueStateMockRecorder) Level() *gomock.Call
Level indicates an expected call of Level
func (*MockProcessingQueueStateMockRecorder) MaxLevel ¶
func (mr *MockProcessingQueueStateMockRecorder) MaxLevel() *gomock.Call
MaxLevel indicates an expected call of MaxLevel
func (*MockProcessingQueueStateMockRecorder) ReadLevel ¶
func (mr *MockProcessingQueueStateMockRecorder) ReadLevel() *gomock.Call
ReadLevel indicates an expected call of ReadLevel
type ProcessingQueue ¶
type ProcessingQueue interface { State() ProcessingQueueState Split(ProcessingQueueSplitPolicy) []ProcessingQueue Merge(ProcessingQueue) []ProcessingQueue AddTasks(map[task.Key]task.Task, bool) UpdateAckLevel() }
ProcessingQueue is responsible for keeping track of the state of tasks within the scope defined by its state; it can also be split into multiple ProcessingQueues with non-overlapping scope or be merged with another ProcessingQueue
func NewProcessingQueue ¶
func NewProcessingQueue( state ProcessingQueueState, logger log.Logger, metricsClient metrics.Client, ) ProcessingQueue
NewProcessingQueue creates a new processing queue based on its state
type ProcessingQueueCollection ¶
type ProcessingQueueCollection interface { Level() int Queues() []ProcessingQueue ActiveQueue() ProcessingQueue AddTasks(map[task.Key]task.Task, bool) UpdateAckLevels() Split(ProcessingQueueSplitPolicy) []ProcessingQueue Merge([]ProcessingQueue) }
ProcessingQueueCollection manages a list of non-overlapping ProcessingQueues and keep track of the current active ProcessingQueue
func NewProcessingQueueCollection ¶
func NewProcessingQueueCollection( level int, queues []ProcessingQueue, ) ProcessingQueueCollection
NewProcessingQueueCollection creates a new collection for non-overlapping queues
type ProcessingQueueManager ¶
type ProcessingQueueManager interface { common.Daemon NotifyNewTasks([]persistence.Task) }
ProcessingQueueManager manages a set of ProcessingQueueCollection and controls the event loop for loading tasks, updating and persisting ProcessingQueueStates, spliting/merging ProcessingQueue, etc.
type ProcessingQueueSplitPolicy ¶
type ProcessingQueueSplitPolicy interface {
Evaluate(ProcessingQueue) []ProcessingQueueState
}
ProcessingQueueSplitPolicy determines if one ProcessingQueue should be split into multiple ProcessingQueues
func NewAggregatedSplitPolicy ¶
func NewAggregatedSplitPolicy( policies ...ProcessingQueueSplitPolicy, ) ProcessingQueueSplitPolicy
NewAggregatedSplitPolicy creates a new processing queue split policy that which combines other policies. Policies are evaluated in the order they passed in, and if one policy returns an non-empty result, that result will be returned as is and policies after that one will not be evaluated
func NewPendingTaskSplitPolicy ¶
func NewPendingTaskSplitPolicy( pendingTaskThreshold map[int]int, lookAheadFunc lookAheadFunc, maxNewQueueLevel int, ) ProcessingQueueSplitPolicy
NewPendingTaskSplitPolicy creates a new processing queue split policy based on the number of pending tasks
func NewSelectedDomainSplitPolicy ¶
func NewSelectedDomainSplitPolicy( domainIDs map[string]struct{}, newQueueLevel int, ) ProcessingQueueSplitPolicy
NewSelectedDomainSplitPolicy creates a new processing queue split policy that splits out specific domainIDs
func NewStuckTaskSplitPolicy ¶
func NewStuckTaskSplitPolicy( attemptThreshold map[int]int, maxNewQueueLevel int, ) ProcessingQueueSplitPolicy
NewStuckTaskSplitPolicy creates a new processing queue split policy based on the number of task attempts tasks
type ProcessingQueueState ¶
type ProcessingQueueState interface { Level() int AckLevel() task.Key ReadLevel() task.Key MaxLevel() task.Key DomainFilter() DomainFilter }
ProcessingQueueState indicates the scope of a task processing queue and its current progress
func NewProcessingQueueState ¶
func NewProcessingQueueState( level int, ackLevel task.Key, maxLevel task.Key, domainFilter DomainFilter, ) ProcessingQueueState
NewProcessingQueueState creates a new state instance for processing queue readLevel will be set to the same value as ackLevel