carols10cents commented on a change in pull request #8641: URL: https://github.com/apache/arrow/pull/8641#discussion_r521618644
########## File path: rust/integration-testing/src/bin/flight-test-integration-server.rs ########## @@ -0,0 +1,634 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use std::collections::HashMap; +use std::convert::TryFrom; +use std::net::SocketAddr; +use std::pin::Pin; +use std::sync::Arc; + +use clap::{App, Arg}; +use futures::{channel::mpsc, sink::SinkExt, Stream, StreamExt}; +use prost::Message; +use tokio::net::TcpListener; +use tokio::sync::Mutex; +use tonic::transport::Server; +use tonic::{metadata::MetadataMap, Request, Response, Status, Streaming}; + +use arrow::{datatypes::Schema, record_batch::RecordBatch}; +use arrow_flight::{ + flight_descriptor::DescriptorType, flight_service_server::FlightService, + flight_service_server::FlightServiceServer, utils::flight_data_to_arrow_batch, + Action, ActionType, BasicAuth, Criteria, Empty, FlightData, FlightDescriptor, + FlightEndpoint, FlightInfo, HandshakeRequest, HandshakeResponse, Location, PutResult, + SchemaResult, Ticket, +}; + +use arrow_integration_testing::{AUTH_PASSWORD, AUTH_USERNAME}; + +type TonicStream<T> = Pin<Box<dyn Stream<Item = T> + Send + Sync + 'static>>; + +#[derive(Debug, Clone)] +struct IntegrationDataset { + schema: Schema, + chunks: Vec<RecordBatch>, +} + +#[derive(Clone, Default)] +pub struct FlightServiceImpl { + server_location: String, + uploaded_chunks: Arc<Mutex<HashMap<String, IntegrationDataset>>>, +} + +#[tonic::async_trait] +impl FlightService for FlightServiceImpl { + type HandshakeStream = TonicStream<Result<HandshakeResponse, Status>>; + type ListFlightsStream = TonicStream<Result<FlightInfo, Status>>; + type DoGetStream = TonicStream<Result<FlightData, Status>>; + type DoPutStream = TonicStream<Result<PutResult, Status>>; + type DoActionStream = TonicStream<Result<arrow_flight::Result, Status>>; + type ListActionsStream = TonicStream<Result<ActionType, Status>>; + type DoExchangeStream = TonicStream<Result<FlightData, Status>>; + + async fn get_schema( + &self, + _request: Request<FlightDescriptor>, + ) -> Result<Response<SchemaResult>, Status> { + Err(Status::unimplemented("Not yet implemented")) Review comment: Yes, there's nothing I can see that calls these methods in the integration tests. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
