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

Add support for downloading flights from alternate endpoints #4

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,6 @@ cpp/Brewfile.lock.json
java-dist/
java-native-c/
java-native-cpp/

# files altered by build
java/flight/flight-jdbc-driver/src/main/resources/properties/flight.properties
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
/**
* The in-memory representation of FlightData used to manage a stream of Arrow messages.
*/
class ArrowMessage implements AutoCloseable {
public class ArrowMessage implements AutoCloseable {

// If true, deserialize Arrow data by giving Arrow a reference to the underlying gRPC buffer
// instead of copying the data. Defaults to true.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public SchemaResult getSchema(FlightDescriptor descriptor, CallOption... options
public FlightStream getStream(Ticket ticket, CallOption... options) {
final io.grpc.CallOptions callOptions = CallOptions.wrapStub(asyncStub, options).getCallOptions();
ClientCall<Flight.Ticket, ArrowMessage> call = interceptedChannel.newCall(doGetDescriptor, callOptions);
FlightStream stream = new FlightStream(
FlightStream stream = new FlightStreamImpl(
allocator,
PENDING_REQUESTS,
(String message, Throwable cause) -> call.cancel(message, cause),
Expand Down Expand Up @@ -352,14 +352,14 @@ public ExchangeReaderWriter doExchange(FlightDescriptor descriptor, CallOption..

try {
final ClientCall<ArrowMessage, ArrowMessage> call = interceptedChannel.newCall(doExchangeDescriptor, callOptions);
final FlightStream stream = new FlightStream(allocator, PENDING_REQUESTS, call::cancel, call::request);
final FlightStream stream = new FlightStreamImpl(allocator, PENDING_REQUESTS, call::cancel, call::request);
final ClientCallStreamObserver<ArrowMessage> observer = (ClientCallStreamObserver<ArrowMessage>)
ClientCalls.asyncBidiStreamingCall(call, stream.asObserver());
final ClientStreamListener writer = new PutObserver(
descriptor, observer, stream.cancelled::isDone,
descriptor, observer, stream.cancelled()::isDone,
() -> {
try {
stream.completed.get();
stream.completed().get();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw CallStatus.INTERNAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public StreamObserver<ArrowMessage> doPutCustom(final StreamObserver<Flight.PutR

final StreamPipe<PutResult, Flight.PutResult> ackStream = StreamPipe
.wrap(responseObserver, PutResult::toProtocol, this::handleExceptionWithMiddleware);
final FlightStream fs = new FlightStream(
final FlightStream fs = new FlightStreamImpl(
allocator,
PENDING_REQUESTS,
/* server-upload streams are not cancellable */null,
Expand Down Expand Up @@ -351,7 +351,7 @@ public StreamObserver<ArrowMessage> doExchangeCustom(StreamObserver<ArrowMessage
final ExchangeListener listener = new ExchangeListener(
responseObserver,
this::handleExceptionWithMiddleware);
final FlightStream fs = new FlightStream(
final FlightStream fs = new FlightStreamImpl(
allocator,
PENDING_REQUESTS,
/* server-upload streams are not cancellable */null,
Expand Down
Loading