Documentation ¶
Index ¶
- Variables
- func GetLashHashKey(vdiskID string) []byte
- type DecodedAggregation
- type Decoder
- type LimitBySequence
- func (lbt LimitBySequence) EndAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
- func (lbt LimitBySequence) EndBlock(block schema.TlogBlock) bool
- func (lbt LimitBySequence) StartAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
- func (lbt LimitBySequence) StartBlock(block schema.TlogBlock) bool
- type LimitByTimestamp
- func (lbt LimitByTimestamp) EndAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
- func (lbt LimitByTimestamp) EndBlock(block schema.TlogBlock) bool
- func (lbt LimitByTimestamp) StartAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
- func (lbt LimitByTimestamp) StartBlock(block schema.TlogBlock) bool
- type Limiter
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNilLastHash indicates that there is no last hash entry ErrNilLastHash = errors.New("nil last hash") )
Functions ¶
func GetLashHashKey ¶
GetLashHashKey returns last hash key of a given vdisk ID
Types ¶
type DecodedAggregation ¶
type DecodedAggregation struct { Agg *schema.TlogAggregation Err error }
DecodedAggregation defines a decoded tlog aggregation from decoder.
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder defines tlog data decoder
func (*Decoder) Decode ¶
func (d *Decoder) Decode(lmt Limiter) <-chan *DecodedAggregation
Decode decodes all tlog transaction started from startTs timestamp to endTs timestamp. If startTs == 0, it means from the beginning of transaction. If endTs == 0, it means until the end of transaction
func (*Decoder) GetLastHash ¶
GetLastHash returns valid last hash of a vdisk. It checks all data shards to get latest valid hash
type LimitBySequence ¶
type LimitBySequence struct {
// contains filtered or unexported fields
}
func NewLimitBySequence ¶
func NewLimitBySequence(startSeq, endSeq uint64) LimitBySequence
func (LimitBySequence) EndAgg ¶
func (lbt LimitBySequence) EndAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
EndAgg implements Limiter.EndAgg
func (LimitBySequence) EndBlock ¶
func (lbt LimitBySequence) EndBlock(block schema.TlogBlock) bool
EndBlock implementes Limiter.EndBlock
func (LimitBySequence) StartAgg ¶
func (lbt LimitBySequence) StartAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
StartAgg implements Limiter.StartAgg
func (LimitBySequence) StartBlock ¶
func (lbt LimitBySequence) StartBlock(block schema.TlogBlock) bool
StartBlock implements Limiter.StartBlock
type LimitByTimestamp ¶
type LimitByTimestamp struct {
// contains filtered or unexported fields
}
LimitByTimestamp implements limiter based on the timestamp
func NewLimitByTimestamp ¶
func NewLimitByTimestamp(startTs, endTs uint64) LimitByTimestamp
NewLimitByTimestamp creates new LimitByTimestamp limiter
func (LimitByTimestamp) EndAgg ¶
func (lbt LimitByTimestamp) EndAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
EndAgg implements Limiter.EndAgg
func (LimitByTimestamp) EndBlock ¶
func (lbt LimitByTimestamp) EndBlock(block schema.TlogBlock) bool
EndBlock implementes Limiter.EndBlock
func (LimitByTimestamp) StartAgg ¶
func (lbt LimitByTimestamp) StartAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
StartAgg implements Limiter.StartAgg
func (LimitByTimestamp) StartBlock ¶
func (lbt LimitByTimestamp) StartBlock(block schema.TlogBlock) bool
StartBlock implements Limiter.StartBlock
type Limiter ¶
type Limiter interface { // EndAgg returns true if it is the end of the // aggregation we want to decode EndAgg(*schema.TlogAggregation, schema.TlogBlock_List) bool // StartAgg returns true if it is the start of the // aggregation we want to decode StartAgg(*schema.TlogAggregation, schema.TlogBlock_List) bool StartBlock(schema.TlogBlock) bool EndBlock(schema.TlogBlock) bool }
Limiter is interface that needs to be implemented in order for the decoder to know which aggregations it needs to decode