Documentation ¶
Overview ¶
Package resource supports Beam resource hints to specify scoped hints or annotations to pipelines.
See https://beam.apache.org/documentation/runtime/resource-hints/ for more information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUCountHint ¶
type CPUCountHint struct {
// contains filtered or unexported fields
}
func (CPUCountHint) MergeWithOuter ¶
func (h CPUCountHint) MergeWithOuter(outer Hint) Hint
MergeWithOuter by keeping the maximum of the two cpu counts.
func (CPUCountHint) Payload ¶
func (h CPUCountHint) Payload() []byte
func (CPUCountHint) String ¶
func (h CPUCountHint) String() string
func (CPUCountHint) URN ¶
func (CPUCountHint) URN() string
type Hint ¶
type Hint interface { // URN returns the name for this hint. URN() string // Payload returns the serialized version of this payload. Payload() []byte // MergeWithOuter an outer scope hint. MergeWithOuter(outer Hint) Hint }
Hint contains all the information about a given resource hint.
func Accelerator ¶
Accelerator hints that this scope should be put in a machine with a given accelerator.
Hints for accelerators will have formats that are runner specific. For example, the following is valid accelerator syntax for the Dataflow runner:
accelerator="type:<type>;count:<n>;<options>"
Hints are advisory only and runners may not respect them.
See https://beam.apache.org/documentation/runtime/resource-hints/ for more information about resource hints.
func CPUCount ¶
CPUCount hints that this scope should be put in a machine with at least this many CPUs or vCPUs.
Hints are advisory only and runners may not respect them.
See https://beam.apache.org/documentation/runtime/resource-hints/ for more information about resource hints.
func MinRAMBytes ¶
MinRAMBytes hints that this scope should be put in a machine with at least this many bytes of memory.
Hints are advisory only and runners may not respect them.
See https://beam.apache.org/documentation/runtime/resource-hints/ for more information about resource hints.
func ParseMinRAM ¶
ParseMinRAM converts various byte units, including MB, GB, MiB, and GiB into a hint. An invalid byte size format will cause ParseMinRAM to panic.
Hints are advisory only and runners may not respect them.
See https://beam.apache.org/documentation/runtime/resource-hints/ for more information about resource hints.
type Hints ¶
type Hints struct {
// contains filtered or unexported fields
}
Hints contains a list of hints for a given scope.
func NewHints ¶
NewHints produces a hints map from a list of hints. If there are multiple hints with the same URN, the last one in the list is used.
func (Hints) Equal ¶
Equal checks if two sets of hints are identical. A hint is identical to another if their payloads are the same for a given URN.
func (Hints) MergeWithOuter ¶
MergeWithOuter produces a new list of Hints from this Hints, and the Hints from the outer scope. Semantics are defined per hint urn, but by default the "inner" hint will be prefered over the outer hint if both scopes have the same urn.