timeline

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OffsetTimeline

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

OffsetTimeline is to store the event time to the offset records. Our list is sorted by event time from highest to lowest.

func NewOffsetTimeline

func NewOffsetTimeline(ctx context.Context, c int) *OffsetTimeline

NewOffsetTimeline returns OffsetTimeline.

func (*OffsetTimeline) Capacity

func (t *OffsetTimeline) Capacity() int

Capacity returns the capacity of the OffsetTimeline list.

func (*OffsetTimeline) Dump

func (t *OffsetTimeline) Dump() string

Dump dumps the in-memory representation of the OffsetTimeline. Could get very ugly if the list is large, like > 100 elements. I am assuming we will have it in 10K+ (86400 seconds are there in a day).

func (*OffsetTimeline) GetEventTime

func (t *OffsetTimeline) GetEventTime(inputOffset isb.Offset) int64

GetEventTime will return the event-time for the given offset. TODO(jyu6): will make Watermark an interface make it easy to get a Watermark and return an Offset?

func (*OffsetTimeline) GetEventTimeFromInt64

func (t *OffsetTimeline) GetEventTimeFromInt64(inputOffsetInt64 int64) int64

func (*OffsetTimeline) GetHeadOffset

func (t *OffsetTimeline) GetHeadOffset() int64

GetHeadOffset returns the head offset, that is the most recent offset which will have the highest Watermark.

func (*OffsetTimeline) GetHeadWMB

func (t *OffsetTimeline) GetHeadWMB() wmb.WMB

GetHeadWMB returns the largest offset with the largest watermark.

func (*OffsetTimeline) GetHeadWatermark

func (t *OffsetTimeline) GetHeadWatermark() int64

GetHeadWatermark returns the head watermark, which is the highest one.

func (*OffsetTimeline) GetOffset

func (t *OffsetTimeline) GetOffset(eventTime int64) int64

GetOffset will return the offset for the given event-time. TODO(jyu6): will make Watermark an interface make it easy to pass an Offset and return a Watermark?

func (*OffsetTimeline) Put

func (t *OffsetTimeline) Put(node wmb.WMB)

Put inserts the WMB into list. It ensures that the list will remain sorted after the insert.

func (*OffsetTimeline) PutIdle

func (t *OffsetTimeline) PutIdle(node wmb.WMB)

PutIdle inserts the idle WMB into list or update the current idle WMB.

Jump to

Keyboard shortcuts

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