public class WebHdfsPersistReader extends Object implements StreamsPersistReader, DatumStatusCountable
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.fs.FileSystem |
client |
protected DatumStatusCounter |
countersCurrent |
protected DatumStatusCounter |
countersTotal |
protected static char |
DELIMITER |
protected HdfsReaderConfiguration |
hdfsConfiguration |
protected LineReadWriteUtil |
lineReaderUtil |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
protected org.apache.hadoop.fs.Path |
path |
protected Queue<StreamsDatum> |
persistQueue |
protected org.apache.hadoop.fs.FileStatus[] |
status |
static String |
STREAMS_ID |
protected StreamsConfiguration |
streamsConfiguration |
| Constructor and Description |
|---|
WebHdfsPersistReader()
WebHdfsPersistReader constructor - resolves HdfsReaderConfiguration from JVM 'hdfs'.
|
WebHdfsPersistReader(HdfsReaderConfiguration hdfsConfiguration)
WebHdfsPersistReader constructor - uses supplied HdfsReaderConfiguration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp() |
DatumStatusCounter |
getDatumStatusCounter() |
org.apache.hadoop.fs.FileSystem |
getFileSystem()
getFileSystem.
|
String |
getId() |
URI |
getURI()
getURI from hdfsConfiguration.
|
boolean |
isConnected()
isConnected.
|
boolean |
isRunning() |
void |
prepare(Object configurationObject) |
StreamsResultSet |
readAll() |
StreamsResultSet |
readCurrent() |
StreamsResultSet |
readNew(BigInteger sequence) |
StreamsResultSet |
readRange(org.joda.time.DateTime start,
org.joda.time.DateTime end) |
void |
startStream() |
protected void |
write(StreamsDatum entry) |
public static final String STREAMS_ID
protected static final char DELIMITER
protected org.apache.hadoop.fs.FileSystem client
protected org.apache.hadoop.fs.Path path
protected org.apache.hadoop.fs.FileStatus[] status
protected volatile Queue<StreamsDatum> persistQueue
protected com.fasterxml.jackson.databind.ObjectMapper mapper
protected LineReadWriteUtil lineReaderUtil
protected HdfsReaderConfiguration hdfsConfiguration
protected StreamsConfiguration streamsConfiguration
protected DatumStatusCounter countersTotal
protected DatumStatusCounter countersCurrent
public WebHdfsPersistReader()
public WebHdfsPersistReader(HdfsReaderConfiguration hdfsConfiguration)
hdfsConfiguration - hdfsConfigurationpublic URI getURI() throws URISyntaxException
URISyntaxException - URISyntaxExceptionpublic boolean isConnected()
public final org.apache.hadoop.fs.FileSystem getFileSystem()
public String getId()
getId in interface StreamsOperationpublic void prepare(Object configurationObject)
prepare in interface StreamsOperationpublic void cleanUp()
cleanUp in interface StreamsOperationpublic StreamsResultSet readAll()
readAll in interface StreamsPersistReaderpublic void startStream()
startStream in interface StreamsProviderpublic StreamsResultSet readCurrent()
readCurrent in interface StreamsProviderprotected void write(StreamsDatum entry)
public StreamsResultSet readNew(BigInteger sequence)
readNew in interface StreamsPersistReaderreadNew in interface StreamsProviderpublic StreamsResultSet readRange(org.joda.time.DateTime start, org.joda.time.DateTime end)
readRange in interface StreamsPersistReaderreadRange in interface StreamsProviderpublic boolean isRunning()
isRunning in interface StreamsProviderpublic DatumStatusCounter getDatumStatusCounter()
getDatumStatusCounter in interface DatumStatusCountableCopyright © 2018 The Apache Software Foundation. All rights reserved.