public class FlightStreamQueue 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 |
FlightStreamQueue(CompletionService<FlightStream> executorService)
Instantiate a new FlightStreamQueue.
|
Modifier and Type | Method and Description |
---|---|
void |
checkOpen()
Checks if this queue is open.
|
void |
close() |
static FlightStreamQueue |
createNewQueue(ExecutorService service)
Creates a new
FlightStreamQueue from the provided ExecutorService . |
void |
enqueue(Collection<FlightStream> flightStreams)
Readily adds given
FlightStream s to the queue. |
void |
enqueue(FlightStream flightStream)
Adds given
FlightStream to the queue. |
boolean |
isClosed()
Gets whether this queue is closed.
|
FlightStream |
next()
Blocking request to get the next ready FlightStream in queue.
|
FlightStream |
next(long timeoutValue,
TimeUnit timeoutUnit)
Blocking request with timeout to get the next ready FlightStream in queue.
|
protected FlightStreamQueue(CompletionService<FlightStream> executorService)
public static FlightStreamQueue createNewQueue(ExecutorService service)
FlightStreamQueue
from the provided ExecutorService
.service
- the service from which to create a new queue.public boolean isClosed()
public FlightStream next(long timeoutValue, TimeUnit timeoutUnit) throws SQLException
timeoutValue
- the amount of time to be waitedtimeoutUnit
- the timeoutValue time unitSQLException
public FlightStream next() throws SQLException
SQLException
public void checkOpen()
public void enqueue(Collection<FlightStream> flightStreams)
FlightStream
s to the queue.public void enqueue(FlightStream flightStream)
FlightStream
to the queue.public void close() throws SQLException
close
in interface AutoCloseable
SQLException
Copyright © 2023 The Apache Software Foundation. All rights reserved.