Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTensorSchema ¶
GetTensorSchema returns the schema for a tensor transfer
func IsStreamEOF ¶
IsStreamEOF returns true when err signals a normal stream termination. It handles three cases:
- The canonical Go sentinel: io.EOF
- Wrapped errors where io.EOF appears anywhere in the chain (e.g. fmt.Errorf("context: %w", io.EOF))
- Legacy string-only "EOF" errors produced by some Arrow/gRPC client libraries that do not wrap the sentinel properly.
func NormaliseStreamError ¶
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 ¶
func (s *RDMAServer) DoGet(tkt *flight.Ticket, stream flight.FlightService_DoGetServer) error
DoGet implements the RDMA-accelerated path for data retrieval (e.g., tensors).
func (*RDMAServer) DoPut ¶
func (s *RDMAServer) DoPut(stream flight.FlightService_DoPutServer) error
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.
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