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.

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
 void afterPropertiesSet()
          After properties set.
 void setLocation(String location)
          Sets the location.
 
Methods inherited from class org.springframework.batch.item.file.FlatFileItemReader
doClose, doOpen, 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

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
After properties set.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class FlatFileItemReader<T>
Throws:
Exception - the exception

setLocation

public void setLocation(String location)
Sets the location.

Parameters:
location - the new location