org.springframework.data.hadoop.batch
Class HdfsItemReader<T>

java.lang.Object
  extended by org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader<T>
      extended by org.springframework.batch.item.file.FlatFileItemReader<T>
          extended by org.springframework.data.hadoop.batch.HdfsItemReader<T>
Type Parameters:
T - the generic type
All Implemented Interfaces:
ResourceAwareItemReaderItemStream<T>, ItemReader<T>, ItemStream, ItemStreamReader<T>, InitializingBean

public class HdfsItemReader<T>
extends FlatFileItemReader<T>

Spring Batch ItemReader implementation for Hadoop FileSystem. This class exists as it has to do the conversion manually since there's no pluggable way to add another resource loader.

Author:
Costin Leau

Field Summary
 
Fields inherited from class org.springframework.batch.item.file.FlatFileItemReader
DEFAULT_CHARSET
 
Constructor Summary
HdfsItemReader(Configuration configuration)
          Instantiates a new hdfs item reader.
HdfsItemReader(FileSystem fs)
          Instantiates a new hdfs item reader.
HdfsItemReader(HdfsResourceLoader hdfsLoader)
          Instantiates a new hdfs item reader.
 
Method Summary
protected  void doOpen()
           
 void setLocation(String location)
          Sets the location.
 
Methods inherited from class org.springframework.batch.item.file.FlatFileItemReader
afterPropertiesSet, doClose, doRead, jumpToItem, setBufferedReaderFactory, setComments, setEncoding, setLineMapper, setLinesToSkip, setRecordSeparatorPolicy, setResource, setSkippedLinesCallback, setStrict
 
Methods inherited from class org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader
close, getCurrentItemCount, getExecutionContextUserSupport, isSaveState, open, read, setCurrentItemCount, setMaxItemCount, setName, setSaveState, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.batch.item.ItemStream
close, open, update
 
Methods inherited from interface org.springframework.batch.item.ItemReader
read
 

Constructor Detail

HdfsItemReader

public HdfsItemReader(Configuration configuration)
Instantiates a new hdfs item reader.

Parameters:
configuration - the configuration

HdfsItemReader

public HdfsItemReader(FileSystem fs)
Instantiates a new hdfs item reader.

Parameters:
fs - the fs

HdfsItemReader

public HdfsItemReader(HdfsResourceLoader hdfsLoader)
Instantiates a new hdfs item reader.

Parameters:
hdfsLoader - the hdfs loader
Method Detail

doOpen

protected void doOpen()
               throws Exception
Overrides:
doOpen in class FlatFileItemReader<T>
Throws:
Exception

setLocation

public void setLocation(String location)
Sets the location.

Parameters:
location - the new location