Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update prost and tonic related crates #2268

Merged
merged 11 commits into from Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/rust.yml
Expand Up @@ -44,6 +44,10 @@ jobs:
run: |
rustup toolchain install ${{ matrix.rust }} --no-self-update
rustup default ${{ matrix.rust }}
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
shell: bash
run: |
Expand Down Expand Up @@ -83,6 +87,10 @@ jobs:
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Cargo
uses: actions/cache@v3
with:
Expand Down
10 changes: 5 additions & 5 deletions arrow-flight/Cargo.toml
Expand Up @@ -29,11 +29,11 @@ license = "Apache-2.0"
[dependencies]
arrow = { path = "../arrow", version = "19.0.0", default-features = false, features = ["ipc"] }
base64 = { version = "0.13", default-features = false }
tonic = { version = "0.7", default-features = false, features = ["transport", "codegen", "prost"] }
tonic = { version = "0.8", default-features = false, features = ["transport", "codegen", "prost"] }
bytes = { version = "1", default-features = false }
prost = { version = "0.10", default-features = false }
prost-types = { version = "0.10.0", default-features = false, optional = true }
prost-derive = { version = "0.10", default-features = false }
prost = { version = "0.11", default-features = false }
prost-types = { version = "0.11.0", default-features = false, optional = true }
prost-derive = { version = "0.11", default-features = false }
tokio = { version = "1.0", default-features = false, features = ["macros", "rt", "rt-multi-thread"] }
futures = { version = "0.3", default-features = false, features = ["alloc"]}

Expand All @@ -44,7 +44,7 @@ flight-sql-experimental = ["prost-types"]
[dev-dependencies]

[build-dependencies]
tonic-build = { version = "0.7", default-features = false, features = ["transport", "prost"] }
tonic-build = { version = "0.8", default-features = false, features = ["transport", "prost"] }
# Pin specific version of the tonic-build dependencies to avoid auto-generated
# (and checked in) arrow.flight.protocol.rs from changing
proc-macro2 = { version = ">1.0.30", default-features = false }
Expand Down
154 changes: 92 additions & 62 deletions arrow-flight/src/arrow.flight.protocol.rs
@@ -1,31 +1,31 @@
// This file was automatically generated through the build.rs script, and should not be edited.

///
/// The request that a client provides to a server on handshake.
/// The request that a client provides to a server on handshake.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HandshakeRequest {
///
/// A defined protocol version
/// A defined protocol version
#[prost(uint64, tag="1")]
pub protocol_version: u64,
///
/// Arbitrary auth/handshake info.
/// Arbitrary auth/handshake info.
#[prost(bytes="vec", tag="2")]
pub payload: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HandshakeResponse {
///
/// A defined protocol version
/// A defined protocol version
#[prost(uint64, tag="1")]
pub protocol_version: u64,
///
/// Arbitrary auth/handshake info.
/// Arbitrary auth/handshake info.
#[prost(bytes="vec", tag="2")]
pub payload: ::prost::alloc::vec::Vec<u8>,
}
///
/// A message for doing simple auth.
/// A message for doing simple auth.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BasicAuth {
#[prost(string, tag="2")]
Expand All @@ -37,8 +37,8 @@ pub struct BasicAuth {
pub struct Empty {
}
///
/// Describes an available action, including both the name used for execution
/// along with a short description of the purpose of the action.
/// Describes an available action, including both the name used for execution
/// along with a short description of the purpose of the action.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActionType {
#[prost(string, tag="1")]
Expand All @@ -47,15 +47,15 @@ pub struct ActionType {
pub description: ::prost::alloc::string::String,
}
///
/// A service specific expression that can be used to return a limited set
/// of available Arrow Flight streams.
/// A service specific expression that can be used to return a limited set
/// of available Arrow Flight streams.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Criteria {
#[prost(bytes="vec", tag="1")]
pub expression: ::prost::alloc::vec::Vec<u8>,
}
///
/// An opaque action specific for the service.
/// An opaque action specific for the service.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Action {
#[prost(string, tag="1")]
Expand All @@ -64,138 +64,151 @@ pub struct Action {
pub body: ::prost::alloc::vec::Vec<u8>,
}
///
/// An opaque result returned after executing an action.
/// An opaque result returned after executing an action.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Result {
#[prost(bytes="vec", tag="1")]
pub body: ::prost::alloc::vec::Vec<u8>,
}
///
/// Wrap the result of a getSchema call
/// Wrap the result of a getSchema call
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SchemaResult {
/// schema of the dataset as described in Schema.fbs::Schema.
/// schema of the dataset as described in Schema.fbs::Schema.
#[prost(bytes="vec", tag="1")]
pub schema: ::prost::alloc::vec::Vec<u8>,
}
///
/// The name or tag for a Flight. May be used as a way to retrieve or generate
/// a flight or be used to expose a set of previously defined flights.
/// The name or tag for a Flight. May be used as a way to retrieve or generate
/// a flight or be used to expose a set of previously defined flights.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlightDescriptor {
#[prost(enumeration="flight_descriptor::DescriptorType", tag="1")]
pub r#type: i32,
///
/// Opaque value used to express a command. Should only be defined when
/// type = CMD.
/// Opaque value used to express a command. Should only be defined when
/// type = CMD.
#[prost(bytes="vec", tag="2")]
pub cmd: ::prost::alloc::vec::Vec<u8>,
///
/// List of strings identifying a particular dataset. Should only be defined
/// when type = PATH.
/// List of strings identifying a particular dataset. Should only be defined
/// when type = PATH.
#[prost(string, repeated, tag="3")]
pub path: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Nested message and enum types in `FlightDescriptor`.
pub mod flight_descriptor {
///
/// Describes what type of descriptor is defined.
/// Describes what type of descriptor is defined.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DescriptorType {
/// Protobuf pattern, not used.
/// Protobuf pattern, not used.
Unknown = 0,
///
/// A named path that identifies a dataset. A path is composed of a string
/// or list of strings describing a particular dataset. This is conceptually
/// similar to a path inside a filesystem.
/// A named path that identifies a dataset. A path is composed of a string
/// or list of strings describing a particular dataset. This is conceptually
/// similar to a path inside a filesystem.
Path = 1,
///
/// An opaque command to generate a dataset.
/// An opaque command to generate a dataset.
Cmd = 2,
}
impl DescriptorType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
DescriptorType::Unknown => "UNKNOWN",
DescriptorType::Path => "PATH",
DescriptorType::Cmd => "CMD",
}
}
}
}
///
/// The access coordinates for retrieval of a dataset. With a FlightInfo, a
/// consumer is able to determine how to retrieve a dataset.
/// The access coordinates for retrieval of a dataset. With a FlightInfo, a
/// consumer is able to determine how to retrieve a dataset.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlightInfo {
/// schema of the dataset as described in Schema.fbs::Schema.
/// schema of the dataset as described in Schema.fbs::Schema.
#[prost(bytes="vec", tag="1")]
pub schema: ::prost::alloc::vec::Vec<u8>,
///
/// The descriptor associated with this info.
/// The descriptor associated with this info.
#[prost(message, optional, tag="2")]
pub flight_descriptor: ::core::option::Option<FlightDescriptor>,
///
/// A list of endpoints associated with the flight. To consume the whole
/// flight, all endpoints must be consumed.
/// A list of endpoints associated with the flight. To consume the whole
/// flight, all endpoints must be consumed.
#[prost(message, repeated, tag="3")]
pub endpoint: ::prost::alloc::vec::Vec<FlightEndpoint>,
/// Set these to -1 if unknown.
/// Set these to -1 if unknown.
#[prost(int64, tag="4")]
pub total_records: i64,
#[prost(int64, tag="5")]
pub total_bytes: i64,
}
///
/// A particular stream or split associated with a flight.
/// A particular stream or split associated with a flight.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlightEndpoint {
///
/// Token used to retrieve this stream.
/// Token used to retrieve this stream.
#[prost(message, optional, tag="1")]
pub ticket: ::core::option::Option<Ticket>,
///
/// A list of URIs where this ticket can be redeemed. If the list is
/// empty, the expectation is that the ticket can only be redeemed on the
/// current service where the ticket was generated.
/// A list of URIs where this ticket can be redeemed. If the list is
/// empty, the expectation is that the ticket can only be redeemed on the
/// current service where the ticket was generated.
#[prost(message, repeated, tag="2")]
pub location: ::prost::alloc::vec::Vec<Location>,
}
///
/// A location where a Flight service will accept retrieval of a particular
/// stream given a ticket.
/// A location where a Flight service will accept retrieval of a particular
/// stream given a ticket.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Location {
#[prost(string, tag="1")]
pub uri: ::prost::alloc::string::String,
}
///
/// An opaque identifier that the service can use to retrieve a particular
/// portion of a stream.
/// An opaque identifier that the service can use to retrieve a particular
/// portion of a stream.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Ticket {
#[prost(bytes="vec", tag="1")]
pub ticket: ::prost::alloc::vec::Vec<u8>,
}
///
/// A batch of Arrow data as part of a stream of batches.
/// A batch of Arrow data as part of a stream of batches.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlightData {
///
/// The descriptor of the data. This is only relevant when a client is
/// starting a new DoPut stream.
/// The descriptor of the data. This is only relevant when a client is
/// starting a new DoPut stream.
#[prost(message, optional, tag="1")]
pub flight_descriptor: ::core::option::Option<FlightDescriptor>,
///
/// Header for message data as described in Message.fbs::Message.
/// Header for message data as described in Message.fbs::Message.
#[prost(bytes="vec", tag="2")]
pub data_header: ::prost::alloc::vec::Vec<u8>,
///
/// Application-defined metadata.
/// Application-defined metadata.
#[prost(bytes="vec", tag="3")]
pub app_metadata: ::prost::alloc::vec::Vec<u8>,
///
/// The actual batch of Arrow data. Preferably handled with minimal-copies
/// coming last in the definition to help with sidecar patterns (it is
/// expected that some implementations will fetch this field off the wire
/// with specialized code to avoid extra memory copies).
/// The actual batch of Arrow data. Preferably handled with minimal-copies
/// coming last in the definition to help with sidecar patterns (it is
/// expected that some implementations will fetch this field off the wire
/// with specialized code to avoid extra memory copies).
#[prost(bytes="vec", tag="1000")]
pub data_body: ::prost::alloc::vec::Vec<u8>,
}
///*
/// The response message associated with the submission of a DoPut.
/// *
/// The response message associated with the submission of a DoPut.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PutResult {
#[prost(bytes="vec", tag="1")]
Expand All @@ -205,6 +218,7 @@ pub struct PutResult {
pub mod flight_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
///
/// 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
Expand Down Expand Up @@ -236,6 +250,10 @@ pub mod flight_service_client {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
Expand All @@ -255,19 +273,19 @@ pub mod flight_service_client {
{
FlightServiceClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with `gzip`.
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses with `gzip`.
/// Enable decompressing responses.
#[must_use]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
///
Expand Down Expand Up @@ -672,8 +690,8 @@ pub mod flight_service_server {
#[derive(Debug)]
pub struct FlightServiceServer<T: FlightService> {
inner: _Inner<T>,
accept_compression_encodings: (),
send_compression_encodings: (),
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: FlightService> FlightServiceServer<T> {
Expand All @@ -697,6 +715,18 @@ pub mod flight_service_server {
{
InterceptedService::new(Self::new(inner), interceptor)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for FlightServiceServer<T>
where
Expand Down Expand Up @@ -1108,7 +1138,7 @@ pub mod flight_service_server {
write!(f, "{:?}", self.0)
}
}
impl<T: FlightService> tonic::transport::NamedService for FlightServiceServer<T> {
impl<T: FlightService> tonic::server::NamedService for FlightServiceServer<T> {
const NAME: &'static str = "arrow.flight.protocol.FlightService";
}
}