timemap

package
v0.0.0-...-8d187f3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INIT_OUTPUT_LEN = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry interface {
	Timestamp() uint32
	SetTimestamp(timestamp uint32)
	// Hash和Eq与timestamp没关系
	// 换句话说,调用了SetTimestamp或Merge之后,Hash不应该改变
	Hash() uint64
	Eq(other Entry) bool
	Merge(other Entry)
	Clone() Entry
	Release()
	fmt.Stringer
}

type TimeMap

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

func New

func New(id, capacity, hashSlots int, timeInterval uint32, timeSlots int) *TimeMap

func (*TimeMap) AddOrMerge

func (m *TimeMap) AddOrMerge(entry Entry) error

AddOrMerge does not consume entry

func (*TimeMap) AdvanceTime

func (m *TimeMap) AdvanceTime(timestamp uint32)

func (*TimeMap) ClearOutput

func (m *TimeMap) ClearOutput()

func (*TimeMap) GetOutput

func (m *TimeMap) GetOutput() []Entry

Jump to

Keyboard shortcuts

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