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.