fragment_table

package
v1.20.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FragmentTable

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

FragmentTable maintains a mapping between query fragments and their assigned querier addresses. Entries automatically expire after a configured duration to prevent stale mappings.

func NewFragmentTable

func NewFragmentTable(expiration time.Duration) *FragmentTable

NewFragmentTable creates a new FragmentTable with the specified expiration duration. It starts a background goroutine that periodically removes expired entries. The cleanup interval is set to half of the expiration duration.

func (*FragmentTable) AddAddressByID

func (f *FragmentTable) AddAddressByID(queryID uint64, fragmentID uint64, addr string)

AddAddressByID associates a querier address with a specific fragment of a query. The association will automatically expire after the configured duration.

func (*FragmentTable) GetAddrByID

func (f *FragmentTable) GetAddrByID(queryID uint64, fragmentID uint64) (string, bool)

GetAddrByID retrieves the querier address associated with a specific fragment.

Jump to

Keyboard shortcuts

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