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:
- Closeable, Aware, BeanFactoryAware, InitializingBean, Lifecycle, Phased, SmartLifecycle, DataReader<String>, DataStoreReader<String>
public class TextFileReader
- extends AbstractDataStreamReader
- implements DataStoreReader<String>
A TextFileReader is a DataStoreReader implementation
able to read Strings from a raw hdfs files.
- Author:
- Janne Valkealahti
| 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(Configuration configuration,
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(Configuration configuration,
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(Configuration configuration,
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 IOException
- Specified by:
close in interface Closeable
- Throws:
IOException
read
public String read()
throws IOException
- Description copied from interface:
DataReader
- Read next entity from a reader.
- Specified by:
read in interface DataReader<String>
- Returns:
- the entity or
null
- Throws:
IOException - if an I/O error occurs