T
- object type representing input datapublic abstract class AbstractTextFilesFirehoseFactory<T> extends Object implements FirehoseFactory<StringInputRowParser>
connect(StringInputRowParser, File)
implementation for its subclasses.Constructor and Description |
---|
AbstractTextFilesFirehoseFactory() |
Modifier and Type | Method and Description |
---|---|
Firehose |
connect(StringInputRowParser firehoseParser,
File temporaryDirectory)
Initialization method that connects up the fire hose.
|
protected abstract Collection<T> |
initObjects()
Initialize objects to be read by this firehose.
|
protected abstract InputStream |
openObjectStream(T object)
Open an input stream from the given object.
|
protected abstract InputStream |
wrapObjectStream(T object,
InputStream stream)
Wrap the given input stream if needed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connect
public Firehose connect(StringInputRowParser firehoseParser, File temporaryDirectory) throws IOException
FirehoseFactory
PrefetchableTextFilesFirehoseFactory
may use a temporary
directory to cache data in it.connect
in interface FirehoseFactory<StringInputRowParser>
firehoseParser
- an input row parsertemporaryDirectory
- a directory where temporary files are storedIOException
protected abstract Collection<T> initObjects() throws IOException
connect(StringInputRowParser, File)
is called.IOException
protected abstract InputStream openObjectStream(T object) throws IOException
wrapObjectStream(Object, InputStream)
.object
- an object to be readIOException
protected abstract InputStream wrapObjectStream(T object, InputStream stream) throws IOException
object
- an input objectstream
- a stream for the objectIOException
Copyright © 2011–2018. All rights reserved.