public class FlightEndpointDataQueue extends Object implements AutoCloseable
FlightStream
.
The usage follows this routine:
FlightStreamQueue
;enqueue(FlightStream)
for all streams to be consumed;next()
to get a FlightStream that is ready to consumeenqueue(FlightStream)
next()
returns null.Modifier | Constructor and Description |
---|---|
protected |
FlightEndpointDataQueue(CompletionService<CloseableEndpointStreamPair> executorService)
Instantiate a new FlightStreamQueue.
|
Modifier and Type | Method and Description |
---|---|
void |
checkOpen()
Checks if this queue is open.
|
void |
close() |
static FlightEndpointDataQueue |
createNewQueue(ExecutorService service)
Creates a new
FlightEndpointDataQueue from the provided ExecutorService . |
void |
enqueue(CloseableEndpointStreamPair endpointRequest)
Adds given
FlightStream to the queue. |
void |
enqueue(Collection<CloseableEndpointStreamPair> endpointRequests)
Readily adds given
FlightStream s to the queue. |
boolean |
isClosed()
Gets whether this queue is closed.
|
CloseableEndpointStreamPair |
next()
Blocking request to get the next ready FlightStream in queue.
|
CloseableEndpointStreamPair |
next(long timeoutValue,
TimeUnit timeoutUnit)
Blocking request with timeout to get the next ready FlightStream in queue.
|
protected FlightEndpointDataQueue(CompletionService<CloseableEndpointStreamPair> executorService)
public static FlightEndpointDataQueue createNewQueue(ExecutorService service)
FlightEndpointDataQueue
from the provided ExecutorService
.service
- the service from which to create a new queue.public boolean isClosed()
public CloseableEndpointStreamPair next(long timeoutValue, TimeUnit timeoutUnit) throws SQLException
timeoutValue
- the amount of time to be waitedtimeoutUnit
- the timeoutValue time unitSQLException
public CloseableEndpointStreamPair next() throws SQLException
SQLException
public void checkOpen()
public void enqueue(Collection<CloseableEndpointStreamPair> endpointRequests)
FlightStream
s to the queue.public void enqueue(CloseableEndpointStreamPair endpointRequest)
FlightStream
to the queue.public void close() throws SQLException
close
in interface AutoCloseable
SQLException
Copyright © 2024 The Apache Software Foundation. All rights reserved.