import "github.com/apache/beam/sdks/go/pkg/beam/runners/vet"
Package vet is a Beam runner that "runs" a pipeline by producing generated code to avoid symbol table lookups and reflection in pipeline execution.
This runner isn't necessarily intended to be run by itself. Other runners can use this as a sanity check on whether a given pipeline avoids known performance bottlenecks.
TODO(BEAM-7374): Add usage documentation.
Execute evaluates the pipeline on whether it can run without reflection.
NameType turns a reflect.Type into a string based on its name. It prefixes Emit or Iter if the function satisfies the constraints of those types.
type Eval struct {
// contains filtered or unexported fields
}
Eval contains and uniquifies the cache of types and things that need to be generated.
Evaluate returns an object that can generate necessary shims and inits.
AllExported returns whether all values in the pipeline are exported, and thus it may be possible to patch the pipeline's package with generated shims. Using exported vs unexported identifiers does not affect pipeline performance but does matter on if the pipeline package can do anything about it.
Bytes returns the Eval buffer's bytes for file writing.
Generate produces a go file under the given package.
Performant returns whether this pipeline needs additional registrations to avoid reflection, or symbol lookups at runtime.
Print invokes fmt.Fprint on the Eval buffer.
Printf invokes fmt.Fprintf on the Eval buffer.
RequiresRegistrations returns if there are any types or functions that require registrations.
UsesDefaultReflectionShims returns whether the default reflection shims are going to be used by the pipeline.
Path | Synopsis |
---|---|
testpipeline | Package testpipeline exports small test pipelines for testing the vet runner. |
Package vet imports 16 packages (graph) and is imported by 2 packages. Updated 2021-01-24. Refresh now. Tools for package owners.