decoder

package
v1.1.0-alpha-4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNilLastHash indicates that there is no last hash entry
	ErrNilLastHash = errors.New("nil last hash")
)

Functions

func GetLashHashKey

func GetLashHashKey(vdiskID string) []byte

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 New

func New(pool tlog.RedisPool, k, m int, vdiskID, privKey, hexNonce string) (*Decoder, error)

New creates a tlog decoder

func (*Decoder) Decode

func (d *Decoder) Decode(startTs, endTs uint64) <-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

func (d *Decoder) GetLastHash() ([]byte, error)

GetLastHash returns valid last hash of a vdisk. It checks all data shards to get latest valid hash

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL