arrow

package
v0.106.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStreamRestarting = status.Error(codes.Aborted, "stream is restarting")

Functions

This section is empty.

Types

type AnyStreamClient

type AnyStreamClient interface {
	Send(*arrowpb.BatchArrowRecords) error
	Recv() (*arrowpb.BatchStatus, error)
	grpc.ClientStream
}

AnyStreamClient is the interface supported by all Arrow streams.

type Exporter

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

Exporter is 1:1 with exporter, isolates arrow-specific functionality.

func NewExporter added in v0.101.0

func NewExporter(
	maxStreamLifetime time.Duration,
	numStreams int,
	prioritizerName PrioritizerName,
	disableDowngrade bool,
	telemetry component.TelemetrySettings,
	grpcOptions []grpc.CallOption,
	newProducer func() arrowRecord.ProducerAPI,
	streamClient StreamClientFunc,
	perRPCCredentials credentials.PerRPCCredentials,
	netReporter netstats.Interface,
) *Exporter

NewExporter configures a new Exporter.

func (*Exporter) SendAndWait added in v0.101.0

func (e *Exporter) SendAndWait(ctx context.Context, data any) (bool, error)

SendAndWait tries to send using an Arrow stream. The results are:

(true, nil): Arrow send: success at consumer (false, nil): Arrow is not supported by the server, caller expected to fallback. (true, non-nil): Arrow send: server response may be permanent or allow retry. (false, non-nil): Context timeout prevents retry.

consumer should fall back to standard OTLP, (true, nil)

func (*Exporter) Shutdown added in v0.101.0

func (e *Exporter) Shutdown(_ context.Context) error

Shutdown returns when all Arrow-associated goroutines have returned.

func (*Exporter) Start added in v0.101.0

func (e *Exporter) Start(ctx context.Context) error

Start creates the background context used by all streams and starts a stream controller, which initializes the initial set of streams.

type PrioritizerName added in v0.101.0

type PrioritizerName string
const (
	DefaultPrioritizer         PrioritizerName = LeastLoadedPrioritizer
	LeastLoadedPrioritizer     PrioritizerName = llPrefix
	LeastLoadedTwoPrioritizer  PrioritizerName = llPrefix + "2"
	LeastLoadedFourPrioritizer PrioritizerName = llPrefix + "4"
)

func (PrioritizerName) Validate added in v0.101.0

func (p PrioritizerName) Validate() error

Validate implements component.ConfigValidator

type Stream added in v0.101.0

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

Stream is 1:1 with gRPC stream.

type StreamClientFunc

type StreamClientFunc func(context.Context, ...grpc.CallOption) (AnyStreamClient, string, error)

streamClientFunc is a constructor for AnyStreamClients. These return the method name to assist with instrumentation, since the gRPC stats handler isn't able to see the correct uncompressed size.

func MakeAnyStreamClient

func MakeAnyStreamClient[T AnyStreamClient](method string, clientFunc func(ctx context.Context, opts ...grpc.CallOption) (T, error)) StreamClientFunc

MakeAnyStreamClient accepts any Arrow-like stream and turns it into an AnyStreamClient. The method name is carried through because once constructed, gRPC clients will not reveal their service and method names.

Directories

Path Synopsis
Package grpcmock is a generated GoMock package.
Package grpcmock is a generated GoMock package.

Jump to

Keyboard shortcuts

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