org.springframework.data.hadoop.store.input
Class TextFileReader
java.lang.Object
org.springframework.data.hadoop.store.support.LifecycleObjectSupport
org.springframework.data.hadoop.store.support.StoreObjectSupport
org.springframework.data.hadoop.store.support.InputStoreObjectSupport
org.springframework.data.hadoop.store.input.AbstractDataStreamReader
org.springframework.data.hadoop.store.input.TextFileReader
- All Implemented Interfaces:
- java.io.Closeable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, DataReader<java.lang.String>, DataStoreReader<java.lang.String>
public class TextFileReader
- extends AbstractDataStreamReader
- implements DataStoreReader<java.lang.String>
A TextFileReader
is a DataStoreReader
implementation
able to read String
s from a raw hdfs files.
- Author:
- Janne Valkealahti
Constructor Summary |
TextFileReader(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec)
Instantiates a new text file reader. |
TextFileReader(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec,
Split split)
Instantiates a new text file reader. |
TextFileReader(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec,
Split split,
byte[] delimiter)
Instantiates a new text file reader. |
Method Summary |
void |
close()
|
java.lang.String |
read()
Read next entity from a reader. |
Methods inherited from class org.springframework.data.hadoop.store.support.LifecycleObjectSupport |
afterPropertiesSet, getBeanFactory, getPhase, getStoreEventPublisher, getTaskExecutor, getTaskScheduler, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setStoreEventPublisher, setTaskExecutor, setTaskScheduler, start, stop, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextFileReader
public TextFileReader(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec)
- Instantiates a new text file reader.
- Parameters:
configuration
- the hadoop configurationbasePath
- the hdfs pathcodec
- the compression codec info
TextFileReader
public TextFileReader(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec,
Split split)
- Instantiates a new text file reader.
- Parameters:
configuration
- the configurationbasePath
- the base pathcodec
- the codecsplit
- the input split
TextFileReader
public TextFileReader(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec,
Split split,
byte[] delimiter)
- Instantiates a new text file reader.
- Parameters:
configuration
- the configurationbasePath
- the base pathcodec
- the codecsplit
- the input splitdelimiter
- the delimiter
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Throws:
java.io.IOException
read
public java.lang.String read()
throws java.io.IOException
- Description copied from interface:
DataReader
- Read next entity from a reader.
- Specified by:
read
in interface DataReader<java.lang.String>
- Returns:
- the entity or
null
- Throws:
java.io.IOException
- if an I/O error occurs