T - the generic typepublic class Fetcher<T extends FetchingElement> extends Object implements Runnable, Closeable
| Modifier and Type | Field and Description |
|---|---|
protected FetchingBuffer<T> |
buffer |
protected boolean |
complete |
protected org.apache.log4j.Logger |
logger |
protected int |
MAX_CONSECUTIVE_ATTEMPTS_ON_NULL |
protected CloseableIterator<T> |
source |
| Constructor and Description |
|---|
Fetcher(CloseableIterator<T> source,
FetchingBuffer<T> buffer)
Instantiates a new fetcher.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CloseableIterator<T> |
getSource()
Gets the source.
|
boolean |
isComplete()
Checks if is complete.
|
void |
run() |
void |
setSource(CloseableIterator<T> source)
Sets the source.
|
protected void |
silentClose()
Silent close.
|
protected org.apache.log4j.Logger logger
protected final int MAX_CONSECUTIVE_ATTEMPTS_ON_NULL
protected FetchingBuffer<T extends FetchingElement> buffer
protected CloseableIterator<T extends FetchingElement> source
protected boolean complete
public Fetcher(CloseableIterator<T> source, FetchingBuffer<T> buffer)
source - the sourcebuffer - the bufferpublic CloseableIterator<T> getSource()
public void setSource(CloseableIterator<T> source)
source - the source to setprotected void silentClose()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic boolean isComplete()
Copyright © 2020. All Rights Reserved.