pub struct PollInfo {
pub info: Option<FlightInfo>,
pub flight_descriptor: Option<FlightDescriptor>,
pub progress: Option<f64>,
pub expiration_time: Option<Timestamp>,
}
Expand description
The information to process a long-running query.
Fields§
§info: Option<FlightInfo>
The currently available results.
If “flight_descriptor” is not specified, the query is complete and “info” specifies all results. Otherwise, “info” contains partial query results.
Note that each PollInfo response contains a complete FlightInfo (not just the delta between the previous and current FlightInfo).
Subsequent PollInfo responses may only append new endpoints to info.
Clients can begin fetching results via DoGet(Ticket) with the ticket in the info before the query is completed. FlightInfo.ordered is also valid.
flight_descriptor: Option<FlightDescriptor>
The descriptor the client should use on the next try. If unset, the query is complete.
progress: Option<f64>
Query progress. If known, must be in [0.0, 1.0] but need not be monotonic or nondecreasing. If unknown, do not set.
expiration_time: Option<Timestamp>
Expiration time for this request. After this passes, the server might not accept the retry descriptor anymore (and the query may be cancelled). This may be updated on a call to PollFlightInfo.
Implementations§
Source§impl PollInfo
impl PollInfo
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new, empty PollInfo
, providing information for a long-running query
§Example:
// Create a new PollInfo
let poll_info = PollInfo::new()
.with_info(FlightInfo::new())
.with_descriptor(FlightDescriptor::new_cmd("RUN QUERY"))
.try_with_progress(0.5)
.expect("progress should've been valid")
.with_expiration_time(
"1970-01-01".parse().expect("invalid timestamp")
);
Sourcepub fn with_info(self, info: FlightInfo) -> Self
pub fn with_info(self, info: FlightInfo) -> Self
Add the current available results for the poll call as a FlightInfo
Sourcepub fn with_descriptor(self, flight_descriptor: FlightDescriptor) -> Self
pub fn with_descriptor(self, flight_descriptor: FlightDescriptor) -> Self
Add a FlightDescriptor
that the client should use for the next poll call,
if the query is not yet complete
Sourcepub fn try_with_progress(self, progress: f64) -> Result<Self, ArrowError>
pub fn try_with_progress(self, progress: f64) -> Result<Self, ArrowError>
Set the query progress if known. Must be in the range [0.0, 1.0] else this will return an error
Sourcepub fn with_expiration_time(self, expiration_time: Timestamp) -> Self
pub fn with_expiration_time(self, expiration_time: Timestamp) -> Self
Specify expiration time for this request
Trait Implementations§
Source§impl Message for PollInfo
impl Message for PollInfo
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.impl StructuralPartialEq for PollInfo
Auto Trait Implementations§
impl !Freeze for PollInfo
impl RefUnwindSafe for PollInfo
impl Send for PollInfo
impl Sync for PollInfo
impl Unpin for PollInfo
impl UnwindSafe for PollInfo
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