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) CloneAsMutable() MutableList
- func (m *MockList) Contains(id ID) bool
- func (m *MockList) Difference(other List) (List, error)
- func (m *MockList) EXPECT() *MockListMockRecorder
- func (m *MockList) Equal(other List) bool
- func (m *MockList) Intersect(other List) (List, error)
- 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) CloneAsMutable() *gomock.Call
- func (mr *MockListMockRecorder) Contains(id interface{}) *gomock.Call
- func (mr *MockListMockRecorder) Difference(other interface{}) *gomock.Call
- func (mr *MockListMockRecorder) Equal(other interface{}) *gomock.Call
- func (mr *MockListMockRecorder) Intersect(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) CloneAsMutable() MutableList
- func (m *MockMutableList) Contains(id ID) bool
- func (m *MockMutableList) Difference(other List) (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) (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) UnionInPlace(other List) error
- func (m *MockMutableList) UnionManyInPlace(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) CloneAsMutable() *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) UnionInPlace(other interface{}) *gomock.Call
- func (mr *MockMutableListMockRecorder) UnionManyInPlace(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 // CloneAsMutable returns a mutable deep copy of the postings list. CloneAsMutable() MutableList // Equal returns whether this postings list contains the same posting IDs as other. Equal(other List) bool // Intersect returns a new postings list containing only those DocIDs which are // in both this postings list and other. Intersect(other List) (List, error) // Difference returns a new postings list containing only those DocIDs which are // in this postings list but not other. Difference(other List) (List, error) }
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) CloneAsMutable ¶ added in v1.4.2
func (m *MockList) CloneAsMutable() MutableList
CloneAsMutable mocks base method.
func (*MockList) Difference ¶ added in v1.4.2
Difference mocks base method.
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) CloneAsMutable ¶ added in v1.4.2
func (mr *MockListMockRecorder) CloneAsMutable() *gomock.Call
CloneAsMutable indicates an expected call of CloneAsMutable.
func (*MockListMockRecorder) Contains ¶
func (mr *MockListMockRecorder) Contains(id interface{}) *gomock.Call
Contains indicates an expected call of Contains.
func (*MockListMockRecorder) Difference ¶ added in v1.4.2
func (mr *MockListMockRecorder) Difference(other interface{}) *gomock.Call
Difference indicates an expected call of Difference.
func (*MockListMockRecorder) Equal ¶
func (mr *MockListMockRecorder) Equal(other interface{}) *gomock.Call
Equal indicates an expected call of Equal.
func (*MockListMockRecorder) Intersect ¶ added in v1.4.2
func (mr *MockListMockRecorder) Intersect(other interface{}) *gomock.Call
Intersect indicates an expected call of Intersect.
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) CloneAsMutable ¶ added in v1.4.2
func (m *MockMutableList) CloneAsMutable() MutableList
CloneAsMutable 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) (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) (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) UnionInPlace ¶ added in v1.4.2
func (m *MockMutableList) UnionInPlace(other List) error
UnionInPlace mocks base method.
func (*MockMutableList) UnionManyInPlace ¶ added in v1.4.2
func (m *MockMutableList) UnionManyInPlace(others []List) error
UnionManyInPlace 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) CloneAsMutable ¶ added in v1.4.2
func (mr *MockMutableListMockRecorder) CloneAsMutable() *gomock.Call
CloneAsMutable indicates an expected call of CloneAsMutable.
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) UnionInPlace ¶ added in v1.4.2
func (mr *MockMutableListMockRecorder) UnionInPlace(other interface{}) *gomock.Call
UnionInPlace indicates an expected call of UnionInPlace.
func (*MockMutableListMockRecorder) UnionManyInPlace ¶ added in v1.4.2
func (mr *MockMutableListMockRecorder) UnionManyInPlace(others interface{}) *gomock.Call
UnionManyInPlace indicates an expected call of UnionManyInPlace.
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 // UnionInPlace updates this postings list in place to contain those DocIDs which are in either // this postings list or other. UnionInPlace(other List) error // UnionManyInPlace updates this postings list in place to contain those DocIDs which are in // either this postings list or multiple others. UnionManyInPlace(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.