Documentation
¶
Index ¶
- type Range
- func (r *Range) Contains(blockNum uint64) bool
- func (r *Range) Equals(other *Range) bool
- func (r *Range) IsOutOfBounds(blockNum uint64) bool
- func (r *Range) Len() uint64
- func (r *Range) MarshalLogObject(enc zapcore.ObjectEncoder) error
- func (r *Range) Size() uint64
- func (r *Range) Split(chunkSize uint64) []*Range
- func (r *Range) String() string
- type Ranges
- type Segmenter
- func (s *Segmenter) Count() int
- func (s *Segmenter) EndsOnInterval(segmentIndex int) bool
- func (s *Segmenter) ExclusiveEndBlock() uint64
- func (s *Segmenter) FirstIndex() int
- func (s *Segmenter) IndexForEndBlock(blockNum uint64) int
- func (s *Segmenter) IndexForStartBlock(blockNum uint64) int
- func (s *Segmenter) InitialBlock() uint64
- func (s *Segmenter) Interval() uint64
- func (s *Segmenter) LastIndex() int
- func (s *Segmenter) Range(idx int) *Range
- func (s *Segmenter) WithExclusiveEndBlock(newExclusiveEndBlock uint64) *Segmenter
- func (s *Segmenter) WithInitialBlock(newInitialBlock uint64) *Segmenter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Range ¶
type Range struct {
StartBlock uint64 `json:"start_block"`
ExclusiveEndBlock uint64 `json:"exclusive_end_block"`
}
func MustParseRange ¶ added in v1.10.1
func ParseRange ¶ added in v0.0.14
func (*Range) IsOutOfBounds ¶ added in v0.1.0
func (*Range) MarshalLogObject ¶
func (r *Range) MarshalLogObject(enc zapcore.ObjectEncoder) error
type Ranges ¶
type Ranges []*Range
func MustParseRanges ¶ added in v1.10.1
func (Ranges) MergedBuckets ¶ added in v0.0.14
type Segmenter ¶ added in v1.1.9
type Segmenter struct {
// contains filtered or unexported fields
}
TODO(abourget): The Segmenter is a new SegmentedRange system, that takes an index so the caller can always keep track of just one number, and we can obtain the corresponding Range for the segment. We can obtain info on the Segment too (if it's Partial, Complete, etc..) The segmenter can be 'empty' if initialBlock == exclusiveEndBlock, for example if we depend on a store that starts in the future, but still want the segmenter to exist.
func NewSegmenter ¶ added in v1.1.9
func (*Segmenter) Count ¶ added in v1.1.9
Count returns the number of valid segments for the internal range. Use LastIndex to know about the highest index.
func (*Segmenter) EndsOnInterval ¶ added in v1.1.9
func (*Segmenter) ExclusiveEndBlock ¶ added in v1.1.9
func (*Segmenter) FirstIndex ¶ added in v1.1.9
func (*Segmenter) IndexForEndBlock ¶ added in v1.1.9
func (*Segmenter) IndexForStartBlock ¶ added in v1.1.9
func (*Segmenter) InitialBlock ¶ added in v1.1.9
func (*Segmenter) LastIndex ¶ added in v1.1.9
if LastIndex returns -1, it means the segment is effectively empty
func (*Segmenter) WithExclusiveEndBlock ¶ added in v1.1.9
func (*Segmenter) WithInitialBlock ¶ added in v1.1.9
The given initialBlock will be clamped to exclusiveEndBlock