Documentation
¶
Overview ¶
Package ingestpolicy assigns an ingestion priority to destination tables.
A Policy is immutable after construction and safe for concurrent use. Lookups do not allocate so they can be used on the write and upload hot paths.
Index ¶
Constants ¶
const NumPriorities = int(PriorityRealtime) + 1
NumPriorities is the number of defined priorities. It can be used to size per-priority arrays.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Policy ¶
type Policy struct {
// contains filtered or unexported fields
}
Policy maps destination tables to priorities. The zero value and a nil *Policy assign PriorityQueued to every table.
func New ¶
New returns a Policy where the given tables are realtime and all other tables are queued. Database and table names are normalized the same way as WAL segment keys. Names that are empty after normalization and duplicate tables are rejected.
func (*Policy) HasRealtime ¶
HasRealtime returns true if any table is realtime.
func (*Policy) Priority ¶
Priority returns the priority for the normalized database and table. For WAL segments, obtain the database and table with wal.ParseFilename.
func (*Policy) PriorityBytes ¶
PriorityBytes is like Priority but accepts byte slices without allocating.
func (*Policy) RealtimeDatabases ¶
RealtimeDatabases returns the distinct normalized databases that contain realtime tables, sorted.
func (*Policy) RealtimeTables ¶
RealtimeTables returns the normalized realtime tables sorted by database then table. The returned slice must not be modified.