Class IntegrationProducer
java.lang.Object
org.apache.arrow.flight.NoOpFlightProducer
org.apache.arrow.flight.integration.tests.IntegrationProducer
- All Implemented Interfaces:
AutoCloseable
,FlightProducer
A FlightProducer that hosts an in memory store of Arrow buffers. Used for integration testing.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.arrow.flight.FlightProducer
FlightProducer.CallContext, FlightProducer.ServerStreamListener, FlightProducer.StreamListener<T>
-
Constructor Summary
ConstructorDescriptionIntegrationProducer
(BufferAllocator allocator, Location location) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionacceptPut
(FlightProducer.CallContext context, FlightStream flightStream, FlightProducer.StreamListener<PutResult> ackStream) Accept uploaded data for a particular stream.void
close()
getFlightInfo
(FlightProducer.CallContext context, FlightDescriptor descriptor) Get information about a particular data stream.void
getStream
(FlightProducer.CallContext context, Ticket ticket, FlightProducer.ServerStreamListener listener) Return data for a stream.void
setLocation
(Location location) Update the location after server start.Methods inherited from class org.apache.arrow.flight.NoOpFlightProducer
doAction, listActions, listFlights
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.arrow.flight.FlightProducer
doExchange, getSchema, pollFlightInfo
-
Constructor Details
-
IntegrationProducer
Constructs a new instance.- Parameters:
allocator
- The allocator for creating new Arrow buffers.location
- The location of the storage.
-
-
Method Details
-
setLocation
Update the location after server start.Useful for binding to port 0 to get a free port.
-
getStream
public void getStream(FlightProducer.CallContext context, Ticket ticket, FlightProducer.ServerStreamListener listener) Description copied from interface:FlightProducer
Return data for a stream.- Specified by:
getStream
in interfaceFlightProducer
- Overrides:
getStream
in classNoOpFlightProducer
- Parameters:
context
- Per-call context.ticket
- The application-defined ticket identifying this stream.listener
- An interface for sending data back to the client.
-
getFlightInfo
Description copied from interface:FlightProducer
Get information about a particular data stream.- Specified by:
getFlightInfo
in interfaceFlightProducer
- Overrides:
getFlightInfo
in classNoOpFlightProducer
- Parameters:
context
- Per-call context.descriptor
- The descriptor identifying the data stream.- Returns:
- Metadata about the stream.
-
acceptPut
public Runnable acceptPut(FlightProducer.CallContext context, FlightStream flightStream, FlightProducer.StreamListener<PutResult> ackStream) Description copied from interface:FlightProducer
Accept uploaded data for a particular stream.- Specified by:
acceptPut
in interfaceFlightProducer
- Overrides:
acceptPut
in classNoOpFlightProducer
- Parameters:
context
- Per-call context.flightStream
- The data stream being uploaded.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-