flight

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Unlicense Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTensorSchema

func GetTensorSchema(dtype arrow.DataType, shape []int64) *arrow.Schema

GetTensorSchema returns the schema for a tensor transfer

func IsStreamEOF

func IsStreamEOF(err error) bool

IsStreamEOF returns true when err signals a normal stream termination. It handles three cases:

  1. The canonical Go sentinel: io.EOF
  2. Wrapped errors where io.EOF appears anywhere in the chain (e.g. fmt.Errorf("context: %w", io.EOF))
  3. Legacy string-only "EOF" errors produced by some Arrow/gRPC client libraries that do not wrap the sentinel properly.

func NormaliseStreamError

func NormaliseStreamError(err error, direction, protocol string) error

NormaliseStreamError converts a stream-terminal error to nil so that callers can treat it as a clean end-of-stream. Non-terminal errors are returned unchanged.

direction should be "client" or "server". protocol should be "arrow" or "grpc".

Types

type AdaptiveChunkStrategy

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

AdaptiveChunkStrategy manages dynamic chunk sizing for DoGet operations. It starts with small chunks for low latency and grows to larger chunks for high throughput.

func NewAdaptiveChunkStrategy

func NewAdaptiveChunkStrategy(minSize, maxSize int, growthFactor float64) *AdaptiveChunkStrategy

NewAdaptiveChunkStrategy creates a new adaptive chunking strategy. minSize: initial chunk size (e.g., 4096 rows) maxSize: maximum chunk size (e.g., 65536 rows) growthFactor: multiplier for exponential growth (e.g., 2.0 for doubling)

func (*AdaptiveChunkStrategy) CurrentSize

func (s *AdaptiveChunkStrategy) CurrentSize() int

CurrentSize returns the current chunk size without advancing.

func (*AdaptiveChunkStrategy) NextChunkSize

func (s *AdaptiveChunkStrategy) NextChunkSize() int

NextChunkSize returns the next chunk size and advances the strategy.

func (*AdaptiveChunkStrategy) Reset

func (s *AdaptiveChunkStrategy) Reset()

Reset resets the strategy back to minimum chunk size.

type LinearChunkStrategy

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

LinearChunkStrategy implements linear growth instead of exponential.

func NewLinearChunkStrategy

func NewLinearChunkStrategy(minSize, maxSize, increment int) *LinearChunkStrategy

NewLinearChunkStrategy creates a linear growth strategy.

func (*LinearChunkStrategy) CurrentSize

func (s *LinearChunkStrategy) CurrentSize() int

CurrentSize returns the current chunk size.

func (*LinearChunkStrategy) NextChunkSize

func (s *LinearChunkStrategy) NextChunkSize() int

NextChunkSize returns the next chunk size with linear growth.

func (*LinearChunkStrategy) Reset

func (s *LinearChunkStrategy) Reset()

Reset resets to minimum size.

type RDMAServer

type RDMAServer struct {
	flight.BaseFlightServer
	// contains filtered or unexported fields
}

RDMAServer handles zero-copy Arrow Flight transfers over RoCEv2.

func NewRDMAServer

func NewRDMAServer(enabled bool) *RDMAServer

func (*RDMAServer) DoGet

DoGet implements the RDMA-accelerated path for data retrieval (e.g., tensors).

func (*RDMAServer) DoPut

DoPut implements the RDMA-accelerated path for data ingestion.

func (*RDMAServer) StartRDMAListener

func (s *RDMAServer) StartRDMAListener(addr string) error

StartRDMAListener starts the RDMA listener on the specified port.

func (*RDMAServer) Stop

func (s *RDMAServer) Stop()

Stop gracefully stops the RDMA server.

type TensorStreamHandler

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

TensorStreamHandler handles direct GPU-to-GPU transfers for tensors

func NewTensorStreamHandler

func NewTensorStreamHandler(server *RDMAServer) *TensorStreamHandler

func (*TensorStreamHandler) StreamTensorRDMA

func (h *TensorStreamHandler) StreamTensorRDMA(ctx context.Context, stream flight.FlightService_DoGetServer, ptr uintptr, size uint64) error

StreamTensorRDMA initiates a zero-copy RDMA transfer of a GPU-backed tensor

Jump to

Keyboard shortcuts

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