flightserver

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 33 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

Overview

Package flightserver serves the plugin Arrow Flight contract (internal/ plugin/contract) in-process, backed by a real source.Source or sink.Sink. It lets a Go .so plugin speak the SAME contract a subprocess plugin speaks: RegisterSource/RegisterSink stay unchanged for the plugin author, and driver.LoadPlugin wraps the registered driver with this server, dialing it back through the existing internal/plugin/client code over a unix socket. There is exactly one normative plugin contract — Arrow Flight — regardless of transport (in-process or subprocess).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server hosts one in-process Flight service (source and/or sink side) on a unix socket. Addr()+Token() are what driver.LoadPlugin hands to client.Connect — the same call a subprocess plugin's caller makes.

func Start

func Start(dir, token string, svc flight.FlightServer) (*Server, error)

Start listens on a fresh unix socket in dir and serves svc (a flight.FlightServiceServer, normally *sourceServer or *sinkServer from this package) with bearer-token auth matching the client's handshake/ bearer-metadata contract. Returns once the listener is up; Serve runs in a background goroutine until Stop.

func (*Server) Addr

func (s *Server) Addr() string

Addr is the unix socket path — the address client.Connect dials.

func (*Server) Stop

func (s *Server) Stop()

Stop gracefully stops the server and removes its socket file. Idempotent: an adapter may stop it on Close after an earlier error path already did.

type SinkServer

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

SinkServer serves the plugin contract's sink RPC (DoPut) over a real sink.Sink, so the existing internal/plugin/client + internal/plugin. SinkAdapter can connect to it exactly as they would a subprocess plugin. It expects the plugin sink record shape internal/plugin/sink.go's recordsFromReader produces: op + stringified data columns + offset + ts_source, all in the DESCRIPTOR's table.

func NewSinkServer

func NewSinkServer(snk sink.Sink) *SinkServer

NewSinkServer wraps snk for in-process Flight serving.

func (*SinkServer) DoAction

func (s *SinkServer) DoAction(action *flight.Action, stream flight.FlightService_DoActionServer) error

func (*SinkServer) DoPut

DoPut receives one plugin-shaped record stream (contract §10: op + stringified columns + offset + ts_source) and re-projects it into a dataplane.Batch committed through the wrapped sink.Sink's TableWriter.

func (*SinkServer) Handshake

func (*SinkServer) ListActions

type SourceServer

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

SourceServer serves the plugin contract's source RPCs (GetFlightInfo + DoGet) over a real source.Source, so the existing internal/plugin/client + internal/plugin.SourceAdapter can connect to it exactly as they would a subprocess plugin.

func NewSourceServer

func NewSourceServer(src source.Source, sp *spec.Spec, rt source.Runtime) *SourceServer

NewSourceServer wraps src for in-process Flight serving.

func (*SourceServer) DoAction

func (s *SourceServer) DoAction(action *flight.Action, stream flight.FlightService_DoActionServer) error

func (*SourceServer) DoGet

DoGet streams the table's rows in the shape GetFlightInfo announced for the ticket's mode: flat rows for snapshot, CDC before/after records for changes. It opens the wrapped source.Source's Reader once and re-projects every dataplane.Batch (flat wire schema) accordingly.

func (*SourceServer) GetFlightInfo

func (s *SourceServer) GetFlightInfo(ctx context.Context, desc *flight.FlightDescriptor) (*flight.FlightInfo, error)

GetFlightInfo resolves the schema for one table via source.Source's Introspect. Per contract §6/§7/§8: snapshot mode announces the flat table schema; changes mode announces the CDC change-record schema (§8.1, before/after struct-shaped).

func (*SourceServer) Handshake

func (*SourceServer) ListActions

Jump to

Keyboard shortcuts

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