public class InMemoryStore extends Object implements FlightProducer, AutoCloseable
FlightProducer.CallContext, FlightProducer.ServerStreamListener, FlightProducer.StreamListener<T>
Constructor and Description |
---|
InMemoryStore(BufferAllocator allocator,
Location location)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
Runnable |
acceptPut(FlightProducer.CallContext context,
FlightStream flightStream,
FlightProducer.StreamListener<PutResult> ackStream)
Accept uploaded data for a particular stream.
|
void |
close() |
void |
doAction(FlightProducer.CallContext context,
Action action,
FlightProducer.StreamListener<Result> listener)
Generic handler for application-defined RPCs.
|
FlightInfo |
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.
|
Stream |
getStream(Ticket t)
Returns the appropriate stream given the ticket (streams are indexed by path and an ordinal).
|
void |
listActions(FlightProducer.CallContext context,
FlightProducer.StreamListener<ActionType> listener)
List available application-defined RPCs.
|
void |
listFlights(FlightProducer.CallContext context,
Criteria criteria,
FlightProducer.StreamListener<FlightInfo> listener)
List available data streams on this service.
|
void |
setLocation(Location location)
Update the location after server start.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doExchange, getSchema
public InMemoryStore(BufferAllocator allocator, Location location)
allocator
- The allocator for creating new Arrow buffers.location
- The location of the storage.public void setLocation(Location location)
Useful for binding to port 0 to get a free port.
public void getStream(FlightProducer.CallContext context, Ticket ticket, FlightProducer.ServerStreamListener listener)
FlightProducer
getStream
in interface FlightProducer
context
- Per-call context.ticket
- The application-defined ticket identifying this stream.listener
- An interface for sending data back to the client.public Stream getStream(Ticket t)
public void listFlights(FlightProducer.CallContext context, Criteria criteria, FlightProducer.StreamListener<FlightInfo> listener)
FlightProducer
listFlights
in interface FlightProducer
context
- Per-call context.criteria
- Application-defined criteria for filtering streams.listener
- An interface for sending data back to the client.public FlightInfo getFlightInfo(FlightProducer.CallContext context, FlightDescriptor descriptor)
FlightProducer
getFlightInfo
in interface FlightProducer
context
- Per-call context.descriptor
- The descriptor identifying the data stream.public Runnable acceptPut(FlightProducer.CallContext context, FlightStream flightStream, FlightProducer.StreamListener<PutResult> ackStream)
FlightProducer
acceptPut
in interface FlightProducer
context
- Per-call context.flightStream
- The data stream being uploaded.public void doAction(FlightProducer.CallContext context, Action action, FlightProducer.StreamListener<Result> listener)
FlightProducer
doAction
in interface FlightProducer
context
- Per-call context.action
- Client-supplied parameters.listener
- A stream of responses.public void listActions(FlightProducer.CallContext context, FlightProducer.StreamListener<ActionType> listener)
FlightProducer
listActions
in interface FlightProducer
context
- Per-call context.listener
- An interface for sending data back to the client.public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2022 The Apache Software Foundation. All rights reserved.