public abstract class PrefetchableTextFilesFirehoseFactory<ObjectType> extends AbstractTextFilesFirehoseFactory<ObjectType>
connect(StringInputRowParser, File), it caches objects in a local disk
up to maxCacheCapacityBytes. These caches are NOT deleted until the process terminates,
and thus can be used for future reads.
prefetchTriggerBytes, a background prefetch thread automatically starts to
fetch remaining objects.
maxFetchRetry.
maxFetchCapacityBytes. Depending on prefetching is enabled or
disabled, the behavior of the firehose is different like below.
LineIterator reading that file.
LineIterator only when the
download operation is successfully finished.
LineIterator which directly reads the stream opened by
AbstractTextFilesFirehoseFactory.openObjectStream(ObjectType). If there is an IOException, it will throw it and the read will fail.
| Constructor and Description |
|---|
PrefetchableTextFilesFirehoseFactory(Long maxCacheCapacityBytes,
Long maxFetchCapacityBytes,
Long prefetchTriggerBytes,
Long fetchTimeout,
Integer maxFetchRetry) |
| Modifier and Type | Method and Description |
|---|---|
Firehose |
connect(StringInputRowParser firehoseParser,
File temporaryDirectory)
Initialization method that connects up the fire hose.
|
initObjects, openObjectStream, wrapObjectStreamclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnectpublic Firehose connect(StringInputRowParser firehoseParser, File temporaryDirectory) throws IOException
FirehoseFactoryPrefetchableTextFilesFirehoseFactory may use a temporary
directory to cache data in it.connect in interface FirehoseFactory<StringInputRowParser>connect in class AbstractTextFilesFirehoseFactory<ObjectType>firehoseParser - an input row parsertemporaryDirectory - a directory where temporary files are storedIOExceptionCopyright © 2011–2017. All rights reserved.