public class FlightClient extends Object implements AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
FlightClient.Builder
A builder for Flight clients.
|
static interface |
FlightClient.ClientStreamListener
Interface for writers to an Arrow data stream.
|
static class |
FlightClient.ExchangeReaderWriter
A pair of a reader and a writer for a DoExchange call.
|
static interface |
FlightClient.PutListener
A handler for server-sent application metadata messages during a Flight DoPut operation.
|
Modifier and Type | Method and Description |
---|---|
void |
authenticate(ClientAuthHandler handler,
CallOption... options)
Authenticates against the Flight service.
|
void |
authenticateBasic(String username,
String password)
Authenticates with a username and password.
|
Optional<CredentialCallOption> |
authenticateBasicToken(String username,
String password)
Authenticates with a username and password.
|
static FlightClient.Builder |
builder()
Create a builder for a Flight client.
|
static FlightClient.Builder |
builder(BufferAllocator allocator,
Location location)
Create a builder for a Flight client.
|
CancelFlightInfoResult |
cancelFlightInfo(CancelFlightInfoRequest request,
CallOption... options)
Cancel execution of a distributed query.
|
void |
close()
Shut down this client.
|
Iterator<Result> |
doAction(Action action,
CallOption... options)
Performs an action on the Flight service.
|
FlightClient.ExchangeReaderWriter |
doExchange(FlightDescriptor descriptor,
CallOption... options)
Initiate a bidirectional data exchange with the server.
|
FlightInfo |
getInfo(FlightDescriptor descriptor,
CallOption... options)
Get info on a stream.
|
SchemaResult |
getSchema(FlightDescriptor descriptor,
CallOption... options)
Get schema for a stream.
|
FlightStream |
getStream(Ticket ticket,
CallOption... options)
Retrieve a stream from the server.
|
void |
handshake(CallOption... options)
Executes the handshake against the Flight service.
|
Iterable<ActionType> |
listActions(CallOption... options)
Lists actions available on the Flight service.
|
Iterable<FlightInfo> |
listFlights(Criteria criteria,
CallOption... options)
Get a list of available flights.
|
PollInfo |
pollInfo(FlightDescriptor descriptor,
CallOption... options)
Start or get info on execution of a long-running query.
|
FlightEndpoint |
renewFlightEndpoint(RenewFlightEndpointRequest request,
CallOption... options)
Request the server to extend the lifetime of a query result set.
|
FlightClient.ClientStreamListener |
startPut(FlightDescriptor descriptor,
FlightClient.PutListener metadataListener,
CallOption... options)
Create or append a descriptor with another stream.
|
FlightClient.ClientStreamListener |
startPut(FlightDescriptor descriptor,
VectorSchemaRoot root,
DictionaryProvider provider,
FlightClient.PutListener metadataListener,
CallOption... options)
Create or append a descriptor with another stream.
|
FlightClient.ClientStreamListener |
startPut(FlightDescriptor descriptor,
VectorSchemaRoot root,
FlightClient.PutListener metadataListener,
CallOption... options)
Create or append a descriptor with another stream.
|
public Iterable<FlightInfo> listFlights(Criteria criteria, CallOption... options)
criteria
- Criteria for selecting flightsoptions
- RPC-layer hints for the call.public Iterable<ActionType> listActions(CallOption... options)
options
- RPC-layer hints for the call.public Iterator<Result> doAction(Action action, CallOption... options)
action
- The action to perform.options
- RPC-layer hints for this call.public void authenticateBasic(String username, String password)
public void authenticate(ClientAuthHandler handler, CallOption... options)
options
- RPC-layer hints for this call.handler
- The auth mechanism to use.public Optional<CredentialCallOption> authenticateBasicToken(String username, String password)
username
- the username.password
- the password.public void handshake(CallOption... options)
options
- RPC-layer hints for this call.public FlightClient.ClientStreamListener startPut(FlightDescriptor descriptor, VectorSchemaRoot root, FlightClient.PutListener metadataListener, CallOption... options)
descriptor
- FlightDescriptor the descriptor for the dataroot
- VectorSchemaRoot the root containing datametadataListener
- A handler for metadata messages from the server. This will be passed buffers that will be
freed after FlightProducer.StreamListener.onNext(Object)
is called!options
- RPC-layer hints for this call.public FlightClient.ClientStreamListener startPut(FlightDescriptor descriptor, VectorSchemaRoot root, DictionaryProvider provider, FlightClient.PutListener metadataListener, CallOption... options)
descriptor
- FlightDescriptor the descriptor for the dataroot
- VectorSchemaRoot the root containing datametadataListener
- A handler for metadata messages from the server.options
- RPC-layer hints for this call.OutboundStreamListener.start(VectorSchemaRoot, DictionaryProvider)
will already have been called.public FlightClient.ClientStreamListener startPut(FlightDescriptor descriptor, FlightClient.PutListener metadataListener, CallOption... options)
descriptor
- FlightDescriptor the descriptor for the datametadataListener
- A handler for metadata messages from the server.options
- RPC-layer hints for this call.OutboundStreamListener.start(VectorSchemaRoot, DictionaryProvider)
will NOT already have been called.public FlightInfo getInfo(FlightDescriptor descriptor, CallOption... options)
descriptor
- The descriptor for the stream.options
- RPC-layer hints for this call.public PollInfo pollInfo(FlightDescriptor descriptor, CallOption... options)
descriptor
- The descriptor for the stream.options
- RPC-layer hints for this call.public SchemaResult getSchema(FlightDescriptor descriptor, CallOption... options)
descriptor
- The descriptor for the stream.options
- RPC-layer hints for this call.public FlightStream getStream(Ticket ticket, CallOption... options)
ticket
- The ticket granting access to the data stream.options
- RPC-layer hints for this call.public FlightClient.ExchangeReaderWriter doExchange(FlightDescriptor descriptor, CallOption... options)
descriptor
- A descriptor for the data stream.options
- RPC call options.public CancelFlightInfoResult cancelFlightInfo(CancelFlightInfoRequest request, CallOption... options)
request
- The query to cancel.options
- Call options.public FlightEndpoint renewFlightEndpoint(RenewFlightEndpointRequest request, CallOption... options)
request
- The result set partition.options
- Call options.public void close() throws InterruptedException
close
in interface AutoCloseable
InterruptedException
public static FlightClient.Builder builder()
public static FlightClient.Builder builder(BufferAllocator allocator, Location location)
allocator
- The allocator to use for the client.location
- The location to connect to.Copyright © 2023 The Apache Software Foundation. All rights reserved.