Documentation ¶
Overview ¶
Package postings is a generated GoMock package.
Index ¶
- Variables
- type AtomicID
- type ID
- type Iterator
- type List
- type MockIterator
- type MockIteratorMockRecorder
- type MockList
- func (m *MockList) Clone() MutableList
- func (m *MockList) Contains(id ID) bool
- func (m *MockList) EXPECT() *MockListMockRecorder
- func (m *MockList) Equal(other List) bool
- func (m *MockList) IsEmpty() bool
- func (m *MockList) Iterator() Iterator
- func (m *MockList) Len() int
- func (m *MockList) Max() (ID, error)
- type MockListMockRecorder
- func (mr *MockListMockRecorder) Clone() *gomock.Call
- func (mr *MockListMockRecorder) Contains(id interface{}) *gomock.Call
- func (mr *MockListMockRecorder) Equal(other interface{}) *gomock.Call
- func (mr *MockListMockRecorder) IsEmpty() *gomock.Call
- func (mr *MockListMockRecorder) Iterator() *gomock.Call
- func (mr *MockListMockRecorder) Len() *gomock.Call
- func (mr *MockListMockRecorder) Max() *gomock.Call
- type MockMutableList
- func (m *MockMutableList) AddIterator(iter Iterator) error
- func (m *MockMutableList) AddRange(min, max ID) error
- func (m *MockMutableList) Clone() MutableList
- func (m *MockMutableList) Contains(id ID) bool
- func (m *MockMutableList) Difference(other List) error
- func (m *MockMutableList) EXPECT() *MockMutableListMockRecorder
- func (m *MockMutableList) Equal(other List) bool
- func (m *MockMutableList) Insert(i ID) error
- func (m *MockMutableList) Intersect(other List) error
- func (m *MockMutableList) IsEmpty() bool
- func (m *MockMutableList) Iterator() Iterator
- func (m *MockMutableList) Len() int
- func (m *MockMutableList) Max() (ID, error)
- func (m *MockMutableList) RemoveRange(min, max ID) error
- func (m *MockMutableList) Reset()
- func (m *MockMutableList) Union(other List) error
- func (m *MockMutableList) UnionMany(others []List) error
- type MockMutableListMockRecorder
- func (mr *MockMutableListMockRecorder) AddIterator(iter interface{}) *gomock.Call
- func (mr *MockMutableListMockRecorder) AddRange(min, max interface{}) *gomock.Call
- func (mr *MockMutableListMockRecorder) Clone() *gomock.Call
- func (mr *MockMutableListMockRecorder) Contains(id interface{}) *gomock.Call
- func (mr *MockMutableListMockRecorder) Difference(other interface{}) *gomock.Call
- func (mr *MockMutableListMockRecorder) Equal(other interface{}) *gomock.Call
- func (mr *MockMutableListMockRecorder) Insert(i interface{}) *gomock.Call
- func (mr *MockMutableListMockRecorder) Intersect(other interface{}) *gomock.Call
- func (mr *MockMutableListMockRecorder) IsEmpty() *gomock.Call
- func (mr *MockMutableListMockRecorder) Iterator() *gomock.Call
- func (mr *MockMutableListMockRecorder) Len() *gomock.Call
- func (mr *MockMutableListMockRecorder) Max() *gomock.Call
- func (mr *MockMutableListMockRecorder) RemoveRange(min, max interface{}) *gomock.Call
- func (mr *MockMutableListMockRecorder) Reset() *gomock.Call
- func (mr *MockMutableListMockRecorder) Union(other interface{}) *gomock.Call
- func (mr *MockMutableListMockRecorder) UnionMany(others interface{}) *gomock.Call
- type MockPool
- type MockPoolMockRecorder
- type MutableList
- type Pool
- type PoolAllocateFn
Constants ¶
This section is empty.
Variables ¶
var ( // ErrEmptyList is the error returned when a postings list is unexpectedly empty. ErrEmptyList = errors.New("postings list is empty") )
Functions ¶
This section is empty.
Types ¶
type AtomicID ¶
type AtomicID struct {
// contains filtered or unexported fields
}
AtomicID is an atomic ID.
type ID ¶
type ID uint32
ID is the unique identifier of an element in the postings list. TODO: Use a uint64, currently we only use uint32 because we use Roaring Bitmaps for the implementation of the postings list. Pilosa has an implementation of Roaring Bitmaps using uint64s.
type Iterator ¶
type Iterator interface { // Next returns whether the iterator has another postings ID. Next() bool // Current returns the current postings ID. It is only safe to call Current immediately // after a call to Next confirms there are more IDs remaining. Current() ID // Err returns any errors encountered during iteration. Err() error // Close closes the iterator. Close() error }
Iterator is an iterator over a postings list. The iterator is guaranteed to return IDs in increasing order. It is not safe for concurrent access.
func NewRangeIterator ¶
NewRangeIterator returns a new Iterator over the specified range.
type List ¶
type List interface { // Contains returns whether the specified ID is contained in this postings list. Contains(id ID) bool // IsEmpty returns whether the postings list is empty. Some posting lists have an // optimized implementation to determine if they are empty which is faster than // calculating the size of the postings list. IsEmpty() bool // Max returns the maximum ID in the postings list or an error if it is empty. Max() (ID, error) // Len returns the numbers of IDs in the postings list. Len() int // Iterator returns an iterator over the IDs in the postings list. Iterator() Iterator // Clone returns a copy of the postings list. Clone() MutableList // Equal returns whether this postings list contains the same posting IDs as other. Equal(other List) bool }
List is a collection of docIDs. The interface only supports immutable methods.
type MockIterator ¶
type MockIterator struct {
// contains filtered or unexported fields
}
MockIterator is a mock of Iterator interface
func NewMockIterator ¶
func NewMockIterator(ctrl *gomock.Controller) *MockIterator
NewMockIterator creates a new mock instance
func (*MockIterator) EXPECT ¶
func (m *MockIterator) EXPECT() *MockIteratorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockIteratorMockRecorder ¶
type MockIteratorMockRecorder struct {
// contains filtered or unexported fields
}
MockIteratorMockRecorder is the mock recorder for MockIterator
func (*MockIteratorMockRecorder) Close ¶
func (mr *MockIteratorMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockIteratorMockRecorder) Current ¶
func (mr *MockIteratorMockRecorder) Current() *gomock.Call
Current indicates an expected call of Current
func (*MockIteratorMockRecorder) Err ¶
func (mr *MockIteratorMockRecorder) Err() *gomock.Call
Err indicates an expected call of Err
func (*MockIteratorMockRecorder) Next ¶
func (mr *MockIteratorMockRecorder) Next() *gomock.Call
Next indicates an expected call of Next
type MockList ¶
type MockList struct {
// contains filtered or unexported fields
}
MockList is a mock of List interface
func NewMockList ¶
func NewMockList(ctrl *gomock.Controller) *MockList
NewMockList creates a new mock instance
func (*MockList) EXPECT ¶
func (m *MockList) EXPECT() *MockListMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockListMockRecorder ¶
type MockListMockRecorder struct {
// contains filtered or unexported fields
}
MockListMockRecorder is the mock recorder for MockList
func (*MockListMockRecorder) Clone ¶
func (mr *MockListMockRecorder) Clone() *gomock.Call
Clone indicates an expected call of Clone
func (*MockListMockRecorder) Contains ¶
func (mr *MockListMockRecorder) Contains(id interface{}) *gomock.Call
Contains indicates an expected call of Contains
func (*MockListMockRecorder) Equal ¶
func (mr *MockListMockRecorder) Equal(other interface{}) *gomock.Call
Equal indicates an expected call of Equal
func (*MockListMockRecorder) IsEmpty ¶
func (mr *MockListMockRecorder) IsEmpty() *gomock.Call
IsEmpty indicates an expected call of IsEmpty
func (*MockListMockRecorder) Iterator ¶
func (mr *MockListMockRecorder) Iterator() *gomock.Call
Iterator indicates an expected call of Iterator
func (*MockListMockRecorder) Len ¶
func (mr *MockListMockRecorder) Len() *gomock.Call
Len indicates an expected call of Len
func (*MockListMockRecorder) Max ¶
func (mr *MockListMockRecorder) Max() *gomock.Call
Max indicates an expected call of Max
type MockMutableList ¶
type MockMutableList struct {
// contains filtered or unexported fields
}
MockMutableList is a mock of MutableList interface
func NewMockMutableList ¶
func NewMockMutableList(ctrl *gomock.Controller) *MockMutableList
NewMockMutableList creates a new mock instance
func (*MockMutableList) AddIterator ¶
func (m *MockMutableList) AddIterator(iter Iterator) error
AddIterator mocks base method
func (*MockMutableList) AddRange ¶
func (m *MockMutableList) AddRange(min, max ID) error
AddRange mocks base method
func (*MockMutableList) Clone ¶
func (m *MockMutableList) Clone() MutableList
Clone mocks base method
func (*MockMutableList) Contains ¶
func (m *MockMutableList) Contains(id ID) bool
Contains mocks base method
func (*MockMutableList) Difference ¶
func (m *MockMutableList) Difference(other List) error
Difference mocks base method
func (*MockMutableList) EXPECT ¶
func (m *MockMutableList) EXPECT() *MockMutableListMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockMutableList) Equal ¶
func (m *MockMutableList) Equal(other List) bool
Equal mocks base method
func (*MockMutableList) Insert ¶
func (m *MockMutableList) Insert(i ID) error
Insert mocks base method
func (*MockMutableList) Intersect ¶
func (m *MockMutableList) Intersect(other List) error
Intersect mocks base method
func (*MockMutableList) IsEmpty ¶
func (m *MockMutableList) IsEmpty() bool
IsEmpty mocks base method
func (*MockMutableList) Iterator ¶
func (m *MockMutableList) Iterator() Iterator
Iterator mocks base method
func (*MockMutableList) RemoveRange ¶
func (m *MockMutableList) RemoveRange(min, max ID) error
RemoveRange mocks base method
func (*MockMutableList) Union ¶
func (m *MockMutableList) Union(other List) error
Union mocks base method
func (*MockMutableList) UnionMany ¶ added in v0.15.0
func (m *MockMutableList) UnionMany(others []List) error
UnionMany mocks base method
type MockMutableListMockRecorder ¶
type MockMutableListMockRecorder struct {
// contains filtered or unexported fields
}
MockMutableListMockRecorder is the mock recorder for MockMutableList
func (*MockMutableListMockRecorder) AddIterator ¶
func (mr *MockMutableListMockRecorder) AddIterator(iter interface{}) *gomock.Call
AddIterator indicates an expected call of AddIterator
func (*MockMutableListMockRecorder) AddRange ¶
func (mr *MockMutableListMockRecorder) AddRange(min, max interface{}) *gomock.Call
AddRange indicates an expected call of AddRange
func (*MockMutableListMockRecorder) Clone ¶
func (mr *MockMutableListMockRecorder) Clone() *gomock.Call
Clone indicates an expected call of Clone
func (*MockMutableListMockRecorder) Contains ¶
func (mr *MockMutableListMockRecorder) Contains(id interface{}) *gomock.Call
Contains indicates an expected call of Contains
func (*MockMutableListMockRecorder) Difference ¶
func (mr *MockMutableListMockRecorder) Difference(other interface{}) *gomock.Call
Difference indicates an expected call of Difference
func (*MockMutableListMockRecorder) Equal ¶
func (mr *MockMutableListMockRecorder) Equal(other interface{}) *gomock.Call
Equal indicates an expected call of Equal
func (*MockMutableListMockRecorder) Insert ¶
func (mr *MockMutableListMockRecorder) Insert(i interface{}) *gomock.Call
Insert indicates an expected call of Insert
func (*MockMutableListMockRecorder) Intersect ¶
func (mr *MockMutableListMockRecorder) Intersect(other interface{}) *gomock.Call
Intersect indicates an expected call of Intersect
func (*MockMutableListMockRecorder) IsEmpty ¶
func (mr *MockMutableListMockRecorder) IsEmpty() *gomock.Call
IsEmpty indicates an expected call of IsEmpty
func (*MockMutableListMockRecorder) Iterator ¶
func (mr *MockMutableListMockRecorder) Iterator() *gomock.Call
Iterator indicates an expected call of Iterator
func (*MockMutableListMockRecorder) Len ¶
func (mr *MockMutableListMockRecorder) Len() *gomock.Call
Len indicates an expected call of Len
func (*MockMutableListMockRecorder) Max ¶
func (mr *MockMutableListMockRecorder) Max() *gomock.Call
Max indicates an expected call of Max
func (*MockMutableListMockRecorder) RemoveRange ¶
func (mr *MockMutableListMockRecorder) RemoveRange(min, max interface{}) *gomock.Call
RemoveRange indicates an expected call of RemoveRange
func (*MockMutableListMockRecorder) Reset ¶
func (mr *MockMutableListMockRecorder) Reset() *gomock.Call
Reset indicates an expected call of Reset
func (*MockMutableListMockRecorder) Union ¶
func (mr *MockMutableListMockRecorder) Union(other interface{}) *gomock.Call
Union indicates an expected call of Union
func (*MockMutableListMockRecorder) UnionMany ¶ added in v0.15.0
func (mr *MockMutableListMockRecorder) UnionMany(others interface{}) *gomock.Call
UnionMany indicates an expected call of UnionMany
type MockPool ¶
type MockPool struct {
// contains filtered or unexported fields
}
MockPool is a mock of Pool interface
func NewMockPool ¶
func NewMockPool(ctrl *gomock.Controller) *MockPool
NewMockPool creates a new mock instance
func (*MockPool) EXPECT ¶
func (m *MockPool) EXPECT() *MockPoolMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockPoolMockRecorder ¶
type MockPoolMockRecorder struct {
// contains filtered or unexported fields
}
MockPoolMockRecorder is the mock recorder for MockPool
func (*MockPoolMockRecorder) Get ¶
func (mr *MockPoolMockRecorder) Get() *gomock.Call
Get indicates an expected call of Get
func (*MockPoolMockRecorder) Put ¶
func (mr *MockPoolMockRecorder) Put(pl interface{}) *gomock.Call
Put indicates an expected call of Put
type MutableList ¶
type MutableList interface { List // Insert inserts the given ID into the postings list. Insert(i ID) error // Intersect updates this postings list in place to contain only those DocIDs which are // in both this postings list and other. Intersect(other List) error // Difference updates this postings list in place to contain only those DocIDs which are // in this postings list but not other. Difference(other List) error // Union updates this postings list in place to contain those DocIDs which are in either // this postings list or other. Union(other List) error // UnionMany updates this postings list in place to contain those DocIDs which are in // either this postings list or multiple others. UnionMany(others []List) error // AddIterator adds all IDs contained in the iterator. AddIterator(iter Iterator) error // AddRange adds all IDs between [min, max) to this postings list. AddRange(min, max ID) error // RemoveRange removes all IDs between [min, max) from this postings list. RemoveRange(min, max ID) error // Reset resets the internal state of the postings list. Reset() }
MutableList is a postings list implementation which also supports mutable operations.
type Pool ¶
type Pool interface { // Get retrieves a MutableList. Get() MutableList // Put releases the provided MutableList back to the pool. Put(pl MutableList) }
Pool provides a pool for MutableLists.
func NewPool ¶
func NewPool( opts xpool.ObjectPoolOptions, allocator PoolAllocateFn, ) Pool
NewPool returns a new Pool.
type PoolAllocateFn ¶
type PoolAllocateFn func() MutableList
PoolAllocateFn returns a new MutableList.