blockbuffer

package
v1.1.0-alpha-5 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2017 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRetryExceeded = errors.New("retry exceeded")
)

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

Buffer defines buffer of tlog blocks that already sent but still waiting for: - to be succesfully received by the server - to be flushed

func NewBuffer

func NewBuffer(timeout time.Duration) *Buffer

NewBuffer creates a new tlog blocks buffer

func (*Buffer) Add

func (b *Buffer) Add(block *schema.TlogBlock)

Add adds a block to this buffer. It only update the states if already exist.

func (*Buffer) LenWaitFlush

func (b *Buffer) LenWaitFlush()

func (*Buffer) MinSequence

func (b *Buffer) MinSequence() uint64

MinSequence returns min sequence that this buffer will/currently has.

func (*Buffer) NeedResend

func (b *Buffer) NeedResend(seq uint64) bool

Returns true this seq need to be re-send

func (*Buffer) SetFlushed

func (b *Buffer) SetFlushed(seqs []uint64)

SetFlushed set this sequence as succesfully flushed

func (*Buffer) SetResendAll

func (b *Buffer) SetResendAll()

SetResendAll resets this buffer, make all blocks need to be resend right now

func (*Buffer) SetSent

func (b *Buffer) SetSent(seq uint64)

SetSent set this sequence as succesfully sent

func (*Buffer) TimedOut

func (b *Buffer) TimedOut(ctx context.Context) <-chan *schema.TlogBlock

TimedOut returns channel of timed out block

type Uint64Slice

type Uint64Slice []uint64

implement sort interface for buffer.seqToTimeout

func (Uint64Slice) Len

func (us Uint64Slice) Len() int

func (Uint64Slice) Less

func (us Uint64Slice) Less(i, j int) bool

func (Uint64Slice) Swap

func (us Uint64Slice) Swap(i, j int)

Jump to

Keyboard shortcuts

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