Documentation
¶
Overview ¶
Package queuev2 is a generated GoMock package.
Package queuev2 is a generated GoMock package.
Package queuev2 is a generated GoMock package.
Package queuev2 is a generated GoMock package.
Index ¶
- func FromPersistenceTaskKey(key *types.TaskKey) persistence.HistoryTaskKey
- func ToPersistenceQueueState(state *QueueState) *types.QueueState
- func ToPersistenceTaskKey(key persistence.HistoryTaskKey) *types.TaskKey
- func ToPersistenceTaskRange(r Range) *types.TaskRange
- func ToPersistenceVirtualQueueState(state []VirtualSliceState) *types.VirtualQueueState
- func ToPersistenceVirtualSliceState(state VirtualSliceState) *types.VirtualSliceState
- type GetTaskProgress
- type GetTaskRequest
- type GetTaskResponse
- type MockPendingTaskTracker
- func (m *MockPendingTaskTracker) AddTask(arg0 task.Task)
- func (m *MockPendingTaskTracker) EXPECT() *MockPendingTaskTrackerMockRecorder
- func (m *MockPendingTaskTracker) GetMinimumTaskKey() (persistence.HistoryTaskKey, bool)
- func (m *MockPendingTaskTracker) GetTasks() map[persistence.HistoryTaskKey]task.Task
- func (m *MockPendingTaskTracker) PruneAckedTasks()
- type MockPendingTaskTrackerMockRecorder
- func (mr *MockPendingTaskTrackerMockRecorder) AddTask(arg0 any) *gomock.Call
- func (mr *MockPendingTaskTrackerMockRecorder) GetMinimumTaskKey() *gomock.Call
- func (mr *MockPendingTaskTrackerMockRecorder) GetTasks() *gomock.Call
- func (mr *MockPendingTaskTrackerMockRecorder) PruneAckedTasks() *gomock.Call
- type MockPredicate
- type MockPredicateMockRecorder
- type MockQueueReader
- type MockQueueReaderMockRecorder
- type MockVirtualSlice
- func (m *MockVirtualSlice) EXPECT() *MockVirtualSliceMockRecorder
- func (m *MockVirtualSlice) GetState() VirtualSliceState
- func (m *MockVirtualSlice) GetTasks(arg0 context.Context, arg1 int) ([]task.Task, error)
- func (m *MockVirtualSlice) HasMoreTasks() bool
- func (m *MockVirtualSlice) TryMergeWithVirtualSlice(arg0 VirtualSlice) ([]VirtualSlice, bool)
- func (m *MockVirtualSlice) TrySplitByTaskKey(arg0 persistence.HistoryTaskKey) (VirtualSlice, VirtualSlice, bool)
- func (m *MockVirtualSlice) UpdateAndGetState() VirtualSliceState
- type MockVirtualSliceMockRecorder
- func (mr *MockVirtualSliceMockRecorder) GetState() *gomock.Call
- func (mr *MockVirtualSliceMockRecorder) GetTasks(arg0, arg1 any) *gomock.Call
- func (mr *MockVirtualSliceMockRecorder) HasMoreTasks() *gomock.Call
- func (mr *MockVirtualSliceMockRecorder) TryMergeWithVirtualSlice(arg0 any) *gomock.Call
- func (mr *MockVirtualSliceMockRecorder) TrySplitByTaskKey(arg0 any) *gomock.Call
- func (mr *MockVirtualSliceMockRecorder) UpdateAndGetState() *gomock.Call
- type PendingTaskTracker
- type Predicate
- type QueueReader
- type QueueState
- type Range
- type VirtualQueue
- type VirtualQueueOptions
- type VirtualSlice
- type VirtualSliceState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromPersistenceTaskKey ¶
func FromPersistenceTaskKey(key *types.TaskKey) persistence.HistoryTaskKey
func ToPersistenceQueueState ¶
func ToPersistenceQueueState(state *QueueState) *types.QueueState
func ToPersistenceTaskKey ¶
func ToPersistenceTaskKey(key persistence.HistoryTaskKey) *types.TaskKey
func ToPersistenceTaskRange ¶
func ToPersistenceVirtualQueueState ¶
func ToPersistenceVirtualQueueState(state []VirtualSliceState) *types.VirtualQueueState
func ToPersistenceVirtualSliceState ¶
func ToPersistenceVirtualSliceState(state VirtualSliceState) *types.VirtualSliceState
Types ¶
type GetTaskProgress ¶ added in v1.3.2
type GetTaskProgress struct {
Range
NextPageToken []byte
NextTaskKey persistence.HistoryTaskKey
}
GetTaskProgress contains the range of the slice to read, the next page token, and the next task key
type GetTaskRequest ¶ added in v1.3.2
type GetTaskRequest struct {
Progress *GetTaskProgress
Predicate Predicate
PageSize int
}
type GetTaskResponse ¶ added in v1.3.2
type GetTaskResponse struct {
Tasks []persistence.Task
Progress *GetTaskProgress
}
type MockPendingTaskTracker ¶ added in v1.3.2
type MockPendingTaskTracker struct {
// contains filtered or unexported fields
}
MockPendingTaskTracker is a mock of PendingTaskTracker interface.
func NewMockPendingTaskTracker ¶ added in v1.3.2
func NewMockPendingTaskTracker(ctrl *gomock.Controller) *MockPendingTaskTracker
NewMockPendingTaskTracker creates a new mock instance.
func (*MockPendingTaskTracker) AddTask ¶ added in v1.3.2
func (m *MockPendingTaskTracker) AddTask(arg0 task.Task)
AddTask mocks base method.
func (*MockPendingTaskTracker) EXPECT ¶ added in v1.3.2
func (m *MockPendingTaskTracker) EXPECT() *MockPendingTaskTrackerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPendingTaskTracker) GetMinimumTaskKey ¶ added in v1.3.2
func (m *MockPendingTaskTracker) GetMinimumTaskKey() (persistence.HistoryTaskKey, bool)
GetMinimumTaskKey mocks base method.
func (*MockPendingTaskTracker) GetTasks ¶ added in v1.3.2
func (m *MockPendingTaskTracker) GetTasks() map[persistence.HistoryTaskKey]task.Task
GetTasks mocks base method.
func (*MockPendingTaskTracker) PruneAckedTasks ¶ added in v1.3.2
func (m *MockPendingTaskTracker) PruneAckedTasks()
PruneAckedTasks mocks base method.
type MockPendingTaskTrackerMockRecorder ¶ added in v1.3.2
type MockPendingTaskTrackerMockRecorder struct {
// contains filtered or unexported fields
}
MockPendingTaskTrackerMockRecorder is the mock recorder for MockPendingTaskTracker.
func (*MockPendingTaskTrackerMockRecorder) AddTask ¶ added in v1.3.2
func (mr *MockPendingTaskTrackerMockRecorder) AddTask(arg0 any) *gomock.Call
AddTask indicates an expected call of AddTask.
func (*MockPendingTaskTrackerMockRecorder) GetMinimumTaskKey ¶ added in v1.3.2
func (mr *MockPendingTaskTrackerMockRecorder) GetMinimumTaskKey() *gomock.Call
GetMinimumTaskKey indicates an expected call of GetMinimumTaskKey.
func (*MockPendingTaskTrackerMockRecorder) GetTasks ¶ added in v1.3.2
func (mr *MockPendingTaskTrackerMockRecorder) GetTasks() *gomock.Call
GetTasks indicates an expected call of GetTasks.
func (*MockPendingTaskTrackerMockRecorder) PruneAckedTasks ¶ added in v1.3.2
func (mr *MockPendingTaskTrackerMockRecorder) PruneAckedTasks() *gomock.Call
PruneAckedTasks indicates an expected call of PruneAckedTasks.
type MockPredicate ¶
type MockPredicate struct {
// contains filtered or unexported fields
}
MockPredicate is a mock of Predicate interface.
func NewMockPredicate ¶
func NewMockPredicate(ctrl *gomock.Controller) *MockPredicate
NewMockPredicate creates a new mock instance.
func (*MockPredicate) Check ¶
func (m *MockPredicate) Check(task persistence.Task) bool
Check mocks base method.
func (*MockPredicate) EXPECT ¶
func (m *MockPredicate) EXPECT() *MockPredicateMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPredicate) Equals ¶ added in v1.3.2
func (m *MockPredicate) Equals(other Predicate) bool
Equals mocks base method.
type MockPredicateMockRecorder ¶
type MockPredicateMockRecorder struct {
// contains filtered or unexported fields
}
MockPredicateMockRecorder is the mock recorder for MockPredicate.
func (*MockPredicateMockRecorder) Check ¶
func (mr *MockPredicateMockRecorder) Check(task any) *gomock.Call
Check indicates an expected call of Check.
func (*MockPredicateMockRecorder) Equals ¶ added in v1.3.2
func (mr *MockPredicateMockRecorder) Equals(other any) *gomock.Call
Equals indicates an expected call of Equals.
func (*MockPredicateMockRecorder) IsEmpty ¶
func (mr *MockPredicateMockRecorder) IsEmpty() *gomock.Call
IsEmpty indicates an expected call of IsEmpty.
type MockQueueReader ¶ added in v1.3.2
type MockQueueReader struct {
// contains filtered or unexported fields
}
MockQueueReader is a mock of QueueReader interface.
func NewMockQueueReader ¶ added in v1.3.2
func NewMockQueueReader(ctrl *gomock.Controller) *MockQueueReader
NewMockQueueReader creates a new mock instance.
func (*MockQueueReader) EXPECT ¶ added in v1.3.2
func (m *MockQueueReader) EXPECT() *MockQueueReaderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockQueueReader) GetTask ¶ added in v1.3.2
func (m *MockQueueReader) GetTask(arg0 context.Context, arg1 *GetTaskRequest) (*GetTaskResponse, error)
GetTask mocks base method.
type MockQueueReaderMockRecorder ¶ added in v1.3.2
type MockQueueReaderMockRecorder struct {
// contains filtered or unexported fields
}
MockQueueReaderMockRecorder is the mock recorder for MockQueueReader.
type MockVirtualSlice ¶ added in v1.3.2
type MockVirtualSlice struct {
// contains filtered or unexported fields
}
MockVirtualSlice is a mock of VirtualSlice interface.
func NewMockVirtualSlice ¶ added in v1.3.2
func NewMockVirtualSlice(ctrl *gomock.Controller) *MockVirtualSlice
NewMockVirtualSlice creates a new mock instance.
func (*MockVirtualSlice) EXPECT ¶ added in v1.3.2
func (m *MockVirtualSlice) EXPECT() *MockVirtualSliceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockVirtualSlice) GetState ¶ added in v1.3.2
func (m *MockVirtualSlice) GetState() VirtualSliceState
GetState mocks base method.
func (*MockVirtualSlice) HasMoreTasks ¶ added in v1.3.2
func (m *MockVirtualSlice) HasMoreTasks() bool
HasMoreTasks mocks base method.
func (*MockVirtualSlice) TryMergeWithVirtualSlice ¶ added in v1.3.2
func (m *MockVirtualSlice) TryMergeWithVirtualSlice(arg0 VirtualSlice) ([]VirtualSlice, bool)
TryMergeWithVirtualSlice mocks base method.
func (*MockVirtualSlice) TrySplitByTaskKey ¶ added in v1.3.2
func (m *MockVirtualSlice) TrySplitByTaskKey(arg0 persistence.HistoryTaskKey) (VirtualSlice, VirtualSlice, bool)
TrySplitByTaskKey mocks base method.
func (*MockVirtualSlice) UpdateAndGetState ¶ added in v1.3.2
func (m *MockVirtualSlice) UpdateAndGetState() VirtualSliceState
UpdateAndGetState mocks base method.
type MockVirtualSliceMockRecorder ¶ added in v1.3.2
type MockVirtualSliceMockRecorder struct {
// contains filtered or unexported fields
}
MockVirtualSliceMockRecorder is the mock recorder for MockVirtualSlice.
func (*MockVirtualSliceMockRecorder) GetState ¶ added in v1.3.2
func (mr *MockVirtualSliceMockRecorder) GetState() *gomock.Call
GetState indicates an expected call of GetState.
func (*MockVirtualSliceMockRecorder) GetTasks ¶ added in v1.3.2
func (mr *MockVirtualSliceMockRecorder) GetTasks(arg0, arg1 any) *gomock.Call
GetTasks indicates an expected call of GetTasks.
func (*MockVirtualSliceMockRecorder) HasMoreTasks ¶ added in v1.3.2
func (mr *MockVirtualSliceMockRecorder) HasMoreTasks() *gomock.Call
HasMoreTasks indicates an expected call of HasMoreTasks.
func (*MockVirtualSliceMockRecorder) TryMergeWithVirtualSlice ¶ added in v1.3.2
func (mr *MockVirtualSliceMockRecorder) TryMergeWithVirtualSlice(arg0 any) *gomock.Call
TryMergeWithVirtualSlice indicates an expected call of TryMergeWithVirtualSlice.
func (*MockVirtualSliceMockRecorder) TrySplitByTaskKey ¶ added in v1.3.2
func (mr *MockVirtualSliceMockRecorder) TrySplitByTaskKey(arg0 any) *gomock.Call
TrySplitByTaskKey indicates an expected call of TrySplitByTaskKey.
func (*MockVirtualSliceMockRecorder) UpdateAndGetState ¶ added in v1.3.2
func (mr *MockVirtualSliceMockRecorder) UpdateAndGetState() *gomock.Call
UpdateAndGetState indicates an expected call of UpdateAndGetState.
type PendingTaskTracker ¶ added in v1.3.2
type PendingTaskTracker interface {
// AddTask adds a task to the pending task tracker.
AddTask(task.Task)
// PruneAckedTasks prunes the acked tasks from the pending task tracker.
PruneAckedTasks()
// GetMinimumTaskKey returns the minimum task key in the pending task tracker, if there are no pending tasks, it returns MaximumHistoryTaskKey.
GetMinimumTaskKey() (persistence.HistoryTaskKey, bool)
// GetTasks returns all the tasks in the pending task tracker, the result should be read-only.
GetTasks() map[persistence.HistoryTaskKey]task.Task
}
PendingTaskTracker tracks the pending tasks in a virtual slice.
func NewPendingTaskTracker ¶ added in v1.3.2
func NewPendingTaskTracker() PendingTaskTracker
type Predicate ¶
type Predicate interface {
// IsEmpty returns true if no task satisfies the predicate
IsEmpty() bool
// Check returns true if the task satisfies the predicate
Check(task persistence.Task) bool
// Equals returns true if the predicate is the same as the other predicate
Equals(other Predicate) bool
}
Predicate defines a predicate that can be used to filter tasks
func NewUniversalPredicate ¶
func NewUniversalPredicate() Predicate
type QueueReader ¶ added in v1.3.2
type QueueReader interface {
GetTask(context.Context, *GetTaskRequest) (*GetTaskResponse, error)
}
func NewQueueReader ¶ added in v1.3.2
func NewQueueReader( shard shard.Context, category persistence.HistoryTaskCategory, ) QueueReader
type QueueState ¶
type QueueState struct {
VirtualQueueStates map[int64][]VirtualSliceState
ExclusiveMaxReadLevel persistence.HistoryTaskKey
}
func FromPersistenceQueueState ¶
func FromPersistenceQueueState(state *types.QueueState) *QueueState
type Range ¶
type Range struct {
InclusiveMinTaskKey persistence.HistoryTaskKey
ExclusiveMaxTaskKey persistence.HistoryTaskKey
}
func (*Range) CanSplitByTaskKey ¶
func (r *Range) CanSplitByTaskKey(taskKey persistence.HistoryTaskKey) bool
func (*Range) Contains ¶
func (r *Range) Contains(taskKey persistence.HistoryTaskKey) bool
func (*Range) ContainsRange ¶
type VirtualQueue ¶ added in v1.3.2
type VirtualQueue interface {
common.Daemon
GetState() []VirtualSliceState
UpdateAndGetState() []VirtualSliceState
MergeSlices(...VirtualSlice)
}
func NewVirtualQueue ¶ added in v1.3.2
func NewVirtualQueue( processor task.Processor, redispatcher task.Redispatcher, logger log.Logger, metricsScope metrics.Scope, virtualSlices []VirtualSlice, options *VirtualQueueOptions, ) VirtualQueue
type VirtualQueueOptions ¶ added in v1.3.2
type VirtualQueueOptions struct {
PageSize dynamicproperties.IntPropertyFn
}
type VirtualSlice ¶ added in v1.3.2
type VirtualSlice interface {
GetState() VirtualSliceState
GetTasks(context.Context, int) ([]task.Task, error)
HasMoreTasks() bool
UpdateAndGetState() VirtualSliceState
TrySplitByTaskKey(persistence.HistoryTaskKey) (VirtualSlice, VirtualSlice, bool)
TryMergeWithVirtualSlice(VirtualSlice) ([]VirtualSlice, bool)
}
func NewVirtualSlice ¶ added in v1.3.2
func NewVirtualSlice( state VirtualSliceState, taskInitializer task.Initializer, queueReader QueueReader, pendingTaskTracker PendingTaskTracker, ) VirtualSlice
type VirtualSliceState ¶
func FromPersistenceVirtualQueueState ¶
func FromPersistenceVirtualQueueState(state *types.VirtualQueueState) []VirtualSliceState
func FromPersistenceVirtualSliceState ¶
func FromPersistenceVirtualSliceState(state *types.VirtualSliceState) VirtualSliceState
func (*VirtualSliceState) Contains ¶
func (s *VirtualSliceState) Contains(task persistence.Task) bool
func (*VirtualSliceState) IsEmpty ¶
func (s *VirtualSliceState) IsEmpty() bool
func (*VirtualSliceState) TrySplitByTaskKey ¶
func (s *VirtualSliceState) TrySplitByTaskKey(taskKey persistence.HistoryTaskKey) (VirtualSliceState, VirtualSliceState, bool)