pub struct FlightServiceClient<T> {
inner: Grpc<T>,
}
Expand description
A flight service is an endpoint for retrieving or storing Arrow data. A flight service can expose one or more predefined endpoints that can be accessed using the Arrow Flight Protocol. Additionally, a flight service can expose a set of actions that are available.
Fields§
§inner: Grpc<T>
Implementations§
Source§impl<T> FlightServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> FlightServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> FlightServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn handshake(
&mut self,
request: impl IntoStreamingRequest<Message = HandshakeRequest>,
) -> Result<Response<Streaming<HandshakeResponse>>, Status>
pub async fn handshake( &mut self, request: impl IntoStreamingRequest<Message = HandshakeRequest>, ) -> Result<Response<Streaming<HandshakeResponse>>, Status>
Handshake between client and server. Depending on the server, the handshake may be required to determine the token that should be used for future operations. Both request and response are streams to allow multiple round-trips depending on auth mechanism.
Sourcepub async fn list_flights(
&mut self,
request: impl IntoRequest<Criteria>,
) -> Result<Response<Streaming<FlightInfo>>, Status>
pub async fn list_flights( &mut self, request: impl IntoRequest<Criteria>, ) -> Result<Response<Streaming<FlightInfo>>, Status>
Get a list of available streams given a particular criteria. Most flight services will expose one or more streams that are readily available for retrieval. This api allows listing the streams available for consumption. A user can also provide a criteria. The criteria can limit the subset of streams that can be listed via this interface. Each flight service allows its own definition of how to consume criteria.
Sourcepub async fn get_flight_info(
&mut self,
request: impl IntoRequest<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status>
pub async fn get_flight_info( &mut self, request: impl IntoRequest<FlightDescriptor>, ) -> Result<Response<FlightInfo>, Status>
For a given FlightDescriptor, get information about how the flight can be consumed. This is a useful interface if the consumer of the interface already can identify the specific flight to consume. This interface can also allow a consumer to generate a flight stream through a specified descriptor. For example, a flight descriptor might be something that includes a SQL statement or a Pickled Python operation that will be executed. In those cases, the descriptor will not be previously available within the list of available streams provided by ListFlights but will be available for consumption for the duration defined by the specific flight service.
Sourcepub async fn poll_flight_info(
&mut self,
request: impl IntoRequest<FlightDescriptor>,
) -> Result<Response<PollInfo>, Status>
pub async fn poll_flight_info( &mut self, request: impl IntoRequest<FlightDescriptor>, ) -> Result<Response<PollInfo>, Status>
For a given FlightDescriptor, start a query and get information to poll its execution status. This is a useful interface if the query may be a long-running query. The first PollFlightInfo call should return as quickly as possible. (GetFlightInfo doesn’t return until the query is complete.)
A client can consume any available results before the query is completed. See PollInfo.info for details.
A client can poll the updated query status by calling PollFlightInfo() with PollInfo.flight_descriptor. A server should not respond until the result would be different from last time. That way, the client can “long poll” for updates without constantly making requests. Clients can set a short timeout to avoid blocking calls if desired.
A client can’t use PollInfo.flight_descriptor after PollInfo.expiration_time passes. A server might not accept the retry descriptor anymore and the query may be cancelled.
A client may use the CancelFlightInfo action with PollInfo.info to cancel the running query.
Sourcepub async fn get_schema(
&mut self,
request: impl IntoRequest<FlightDescriptor>,
) -> Result<Response<SchemaResult>, Status>
pub async fn get_schema( &mut self, request: impl IntoRequest<FlightDescriptor>, ) -> Result<Response<SchemaResult>, Status>
For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema This is used when a consumer needs the Schema of flight stream. Similar to GetFlightInfo this interface may generate a new flight that was not previously available in ListFlights.
Sourcepub async fn do_get(
&mut self,
request: impl IntoRequest<Ticket>,
) -> Result<Response<Streaming<FlightData>>, Status>
pub async fn do_get( &mut self, request: impl IntoRequest<Ticket>, ) -> Result<Response<Streaming<FlightData>>, Status>
Retrieve a single stream associated with a particular descriptor associated with the referenced ticket. A Flight can be composed of one or more streams where each stream can be retrieved using a separate opaque ticket that the flight service uses for managing a collection of streams.
Sourcepub async fn do_put(
&mut self,
request: impl IntoStreamingRequest<Message = FlightData>,
) -> Result<Response<Streaming<PutResult>>, Status>
pub async fn do_put( &mut self, request: impl IntoStreamingRequest<Message = FlightData>, ) -> Result<Response<Streaming<PutResult>>, Status>
Push a stream to the flight service associated with a particular flight stream. This allows a client of a flight service to upload a stream of data. Depending on the particular flight service, a client consumer could be allowed to upload a single stream per descriptor or an unlimited number. In the latter, the service might implement a ‘seal’ action that can be applied to a descriptor once all streams are uploaded.
Sourcepub async fn do_exchange(
&mut self,
request: impl IntoStreamingRequest<Message = FlightData>,
) -> Result<Response<Streaming<FlightData>>, Status>
pub async fn do_exchange( &mut self, request: impl IntoStreamingRequest<Message = FlightData>, ) -> Result<Response<Streaming<FlightData>>, Status>
Open a bidirectional data channel for a given descriptor. This allows clients to send and receive arbitrary Arrow data and application-specific metadata in a single logical stream. In contrast to DoGet/DoPut, this is more suited for clients offloading computation (rather than storage) to a Flight service.
Sourcepub async fn do_action(
&mut self,
request: impl IntoRequest<Action>,
) -> Result<Response<Streaming<Result>>, Status>
pub async fn do_action( &mut self, request: impl IntoRequest<Action>, ) -> Result<Response<Streaming<Result>>, Status>
Flight services can support an arbitrary number of simple actions in addition to the possible ListFlights, GetFlightInfo, DoGet, DoPut operations that are potentially available. DoAction allows a flight client to do a specific action against a flight service. An action includes opaque request and response objects that are specific to the type action being undertaken.
Sourcepub async fn list_actions(
&mut self,
request: impl IntoRequest<Empty>,
) -> Result<Response<Streaming<ActionType>>, Status>
pub async fn list_actions( &mut self, request: impl IntoRequest<Empty>, ) -> Result<Response<Streaming<ActionType>>, Status>
A flight service exposes all of the available action types that it has along with descriptions. This allows different flight consumers to understand the capabilities of the flight service.
Trait Implementations§
Source§impl<T: Clone> Clone for FlightServiceClient<T>
impl<T: Clone> Clone for FlightServiceClient<T>
Source§fn clone(&self) -> FlightServiceClient<T>
fn clone(&self) -> FlightServiceClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> !Freeze for FlightServiceClient<T>
impl<T> RefUnwindSafe for FlightServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for FlightServiceClient<T>where
T: Send,
impl<T> Sync for FlightServiceClient<T>where
T: Sync,
impl<T> Unpin for FlightServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for FlightServiceClient<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request