Documentation
¶
Index ¶
- func AcquireAWSWebIdentityToken() (string, error)
- func AcquireGoogleIDToken(ctx context.Context, audience string) (string, error)
- type ClientConfig
- type ErrForwardRequired
- type SmartClient
- func (c *SmartClient) Close() error
- func (c *SmartClient) DoAction(ctx context.Context, action *flight.Action) (flight.FlightService_DoActionClient, error)
- func (c *SmartClient) DoGet(ctx context.Context, ticket []byte) (flight.FlightService_DoGetClient, error)
- func (c *SmartClient) DoPut(ctx context.Context, desc *flight.FlightDescriptor) (flight.FlightService_DoPutClient, error)
- func (c *SmartClient) ExchangeOIDCToken(ctx context.Context, oidcToken string, ttl time.Duration) (string, error)
- func (c *SmartClient) GetFlightInfo(ctx context.Context, desc *flight.FlightDescriptor) (*flight.FlightInfo, error)
- func (c *SmartClient) GetLastLoadHints() *loadbalancing.LoadHints
- func (c *SmartClient) NewStreamUploader(ctx context.Context, dataset string, schema *arrow.Schema) (*StreamUploader, error)
- func (c *SmartClient) SetAPIKey(token string)
- func (c *SmartClient) UploadTable(ctx context.Context, dataset string, tbl arrow.Table, chunkSize int64) error
- func (c *SmartClient) WithAuthContext(ctx context.Context) context.Context
- type StreamUploader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcquireAWSWebIdentityToken ¶
AcquireAWSWebIdentityToken reads an EKS/IRSA web identity JWT from AWS_WEB_IDENTITY_TOKEN_FILE.
Types ¶
type ClientConfig ¶
ClientConfig configures security and tenant headers for SmartClient.
type ErrForwardRequired ¶
ErrForwardRequired is returned when a request needs to be routed to another node
func IsForwardRequired ¶
func IsForwardRequired(err error) *ErrForwardRequired
IsForwardRequired checks if an error is a "FORWARD_REQUIRED" error If success, returns the parsed error struct, otherwise nil
func (*ErrForwardRequired) Error ¶
func (e *ErrForwardRequired) Error() string
type SmartClient ¶
type SmartClient struct {
// contains filtered or unexported fields
}
SmartClient is a wrapper around flight.Client that handles strict sharding redirects
func NewSmartClient ¶
func NewSmartClient(addr string) (*SmartClient, error)
NewSmartClient creates a new smart client connected to the initial address
func NewSmartClientWithConfig ¶
func NewSmartClientWithConfig(cfg ClientConfig) (*SmartClient, error)
NewSmartClientWithConfig creates a SmartClient with optional TLS/mTLS, API key, and tenant context.
func (*SmartClient) DoAction ¶
func (c *SmartClient) DoAction(ctx context.Context, action *flight.Action) (flight.FlightService_DoActionClient, error)
DoAction performs a Flight DoAction with automatic redirection handling
func (*SmartClient) DoGet ¶
func (c *SmartClient) DoGet(ctx context.Context, ticket []byte) (flight.FlightService_DoGetClient, error)
DoGet performs a Flight DoGet with automatic redirection handling
func (*SmartClient) DoPut ¶
func (c *SmartClient) DoPut(ctx context.Context, desc *flight.FlightDescriptor) (flight.FlightService_DoPutClient, error)
DoPut performs a Flight DoPut with automatic redirection handling (best-effort)
func (*SmartClient) ExchangeOIDCToken ¶
func (c *SmartClient) ExchangeOIDCToken(ctx context.Context, oidcToken string, ttl time.Duration) (string, error)
ExchangeOIDCToken exchanges a federated OIDC JWT for a short-lived Longbow session token via the ExchangeOIDCToken Flight action and updates SmartClient's active bearer credential.
func (*SmartClient) GetFlightInfo ¶
func (c *SmartClient) GetFlightInfo(ctx context.Context, desc *flight.FlightDescriptor) (*flight.FlightInfo, error)
GetFlightInfo gets flight info with redirect handling
func (*SmartClient) GetLastLoadHints ¶
func (c *SmartClient) GetLastLoadHints() *loadbalancing.LoadHints
GetLastLoadHints returns the latest load balancing hints received from the server.
func (*SmartClient) NewStreamUploader ¶
func (c *SmartClient) NewStreamUploader(ctx context.Context, dataset string, schema *arrow.Schema) (*StreamUploader, error)
NewStreamUploader creates a stream uploader for streaming Arrow record batches/chunks into Longbow.
func (*SmartClient) SetAPIKey ¶
func (c *SmartClient) SetAPIKey(token string)
SetAPIKey updates the bearer token / API key used by WithAuthContext.
func (*SmartClient) UploadTable ¶
func (c *SmartClient) UploadTable(ctx context.Context, dataset string, tbl arrow.Table, chunkSize int64) error
UploadTable streams an arrow.Table in chunks (default 10,000 rows per chunk) to Longbow.
func (*SmartClient) WithAuthContext ¶
func (c *SmartClient) WithAuthContext(ctx context.Context) context.Context
WithAuthContext attaches Bearer API key and optional tenant header to an outgoing RPC context.
type StreamUploader ¶
type StreamUploader struct {
// contains filtered or unexported fields
}
StreamUploader handles streaming chunk uploads over Flight DoPut. It sends chunks of Arrow RecordBatches sequentially across the stream, avoiding huge memory spikes on either client or server.
func (*StreamUploader) Close ¶
func (u *StreamUploader) Close() error
Close closes the stream writer and completes the Flight DoPut exchange.
func (*StreamUploader) Write ¶
func (u *StreamUploader) Write(record arrow.RecordBatch) error
Write writes a single Arrow record batch to the upload stream.
func (*StreamUploader) WriteChunked ¶
func (u *StreamUploader) WriteChunked(record arrow.RecordBatch, maxChunkSize int64) error
WriteChunked writes a record batch, automatically splitting it into smaller chunks if it exceeds maxChunkSize.