clientprogress

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientProgress

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

ClientProgress tracks watermarks for all the clients.

func FromPb

func NewClientProgress

func NewClientProgress(logger logging.Logger) *ClientProgress

func (*ClientProgress) Add

func (cp *ClientProgress) Add(clID t.ClientID, reqNo t.ReqNo) bool

func (*ClientProgress) GarbageCollect

func (cp *ClientProgress) GarbageCollect() map[t.ClientID]t.ReqNo

func (*ClientProgress) LoadPb

func (cp *ClientProgress) LoadPb(pb *commonpb.ClientProgress)

func (*ClientProgress) Pb

type DeliveredReqs

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

DeliveredReqs tracks the watermarks of delivered transactions for a single client.

func DeliveredReqsFromPb

func DeliveredReqsFromPb(pb *commonpb.DeliveredReqs, logger logging.Logger) *DeliveredReqs

func EmptyDeliveredReqs

func EmptyDeliveredReqs(logger logging.Logger) *DeliveredReqs

EmptyDeliveredReqs allocates and returns a new DeliveredReqs.

func (*DeliveredReqs) Add

func (dr *DeliveredReqs) Add(reqNo t.ReqNo) bool

Add adds a request number that is considered delivered to the DeliveredReqs. Returns true if the request number has been added now (after not being previously present). Returns false if the request number has already been added before the call to Add.

func (*DeliveredReqs) GarbageCollect

func (dr *DeliveredReqs) GarbageCollect() t.ReqNo

GarbageCollect reduces the memory footprint of the DeliveredReqs by deleting a contiguous prefix of delivered request numbers and increasing the low watermark accordingly. Returns the new low watermark.

func (*DeliveredReqs) Pb

Jump to

Keyboard shortcuts

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