Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTxnPutEndID = coderr.NewCodeError(coderr.Internal, "put end id in txn") ErrAllocID = coderr.NewCodeError(coderr.Internal, "alloc id") ErrCollectID = coderr.NewCodeError(coderr.Internal, "collect invalid id") ErrCollectNotSupported = coderr.NewCodeError(coderr.Internal, "collect is not supported") )
Functions ¶
This section is empty.
Types ¶
type Allocator ¶
type Allocator interface { // Alloc allocs a unique id. Alloc(ctx context.Context) (uint64, error) // Collect collect unused id to reused in alloc Collect(ctx context.Context, id uint64) error }
Allocator defines the id allocator on the ceresdb cluster meta info.
func NewAllocatorImpl ¶
func NewReusableAllocatorImpl ¶ added in v0.4.0
type AllocatorImpl ¶
type AllocatorImpl struct {
// contains filtered or unexported fields
}
type OrderedList ¶ added in v0.4.0
type OrderedList struct {
// contains filtered or unexported fields
}
func (*OrderedList) FindMinHoleValueAndIndex ¶ added in v0.4.0
func (l *OrderedList) FindMinHoleValueAndIndex(min uint64) (uint64, int)
FindMinHoleValueAndIndex Find the minimum hole value and its index. If the list is empty, then return min value and 0 as index; If no hole is found, then return the `last_value + 1` in the list and l.Len() as the index;
func (*OrderedList) Insert ¶ added in v0.4.0
func (l *OrderedList) Insert(v uint64, i int)
Insert the value at the idx whose correctness should be ensured by the caller.
func (*OrderedList) Remove ¶ added in v0.4.0
func (l *OrderedList) Remove(v uint64) int
type ReusableAllocatorImpl ¶ added in v0.4.0
type ReusableAllocatorImpl struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.