public abstract class AbstractChannelReader extends Object implements Runnable
| Modifier and Type | Field and Description |
|---|---|
private BufferPool |
bufferPool |
private StreamConsumer |
consumer |
private AtomicReference<ScheduledFuture<?>> |
future |
private AtomicBoolean |
isClosed |
private SelectionKey |
key |
private static org.slf4j.Logger |
LOGGER |
private String |
uniqueId |
| Constructor and Description |
|---|
AbstractChannelReader(String id,
SelectionKey key,
BufferPool empties,
StreamConsumerFactory consumerFactory) |
| Modifier and Type | Method and Description |
|---|---|
private void |
closeStream() |
boolean |
equals(Object obj) |
protected abstract int |
fillBuffer(SelectionKey key,
ByteBuffer buffer)
Allows a subclass to specifically handle how it reads from the given
key's channel into the given buffer.
|
protected ScheduledFuture<?> |
getScheduledFuture() |
protected SelectionKey |
getSelectionKey() |
int |
hashCode() |
boolean |
isClosed() |
void |
run() |
protected void |
setScheduledFuture(ScheduledFuture<?> future) |
String |
toString() |
private static final org.slf4j.Logger LOGGER
private final String uniqueId
private final SelectionKey key
private final BufferPool bufferPool
private final StreamConsumer consumer
private final AtomicBoolean isClosed
private final AtomicReference<ScheduledFuture<?>> future
public AbstractChannelReader(String id, SelectionKey key, BufferPool empties, StreamConsumerFactory consumerFactory)
protected void setScheduledFuture(ScheduledFuture<?> future)
protected ScheduledFuture<?> getScheduledFuture()
protected SelectionKey getSelectionKey()
public boolean isClosed()
private void closeStream()
protected abstract int fillBuffer(SelectionKey key, ByteBuffer buffer) throws IOException
key - of channel to read frombuffer - to fillIOException - if reading from channel causes failureCopyright © 2023 Apache NiFi Project. All rights reserved.