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 StreamsOperation
public void prepare(Object configurationObject)
prepare
in interface StreamsOperation
public void cleanUp()
cleanUp
in interface StreamsOperation
public StreamsResultSet readAll()
readAll
in interface StreamsPersistReader
public void startStream()
startStream
in interface StreamsProvider
public StreamsResultSet readCurrent()
readCurrent
in interface StreamsProvider
protected void write(StreamsDatum entry)
public StreamsResultSet readNew(BigInteger sequence)
readNew
in interface StreamsPersistReader
readNew
in interface StreamsProvider
public StreamsResultSet readRange(org.joda.time.DateTime start, org.joda.time.DateTime end)
readRange
in interface StreamsPersistReader
readRange
in interface StreamsProvider
public boolean isRunning()
isRunning
in interface StreamsProvider
public DatumStatusCounter getDatumStatusCounter()
getDatumStatusCounter
in interface DatumStatusCountable
Copyright © 2018 The Apache Software Foundation. All rights reserved.