List of usage examples for org.apache.hadoop.mapred.lib CombineFileSplit getPath
public Path getPath(int i)
From source file:cascading.tap.hadoop.io.CombineFileRecordReaderWrapper.java
License:Open Source License
public CombineFileRecordReaderWrapper(CombineFileSplit split, Configuration conf, Reporter reporter, Integer idx) throws Exception { FileSplit fileSplit = new FileSplit(split.getPath(idx), split.getOffset(idx), split.getLength(idx), split.getLocations());/* w ww . ja va 2s .c om*/ Class<?> clz = conf.getClass(INDIVIDUAL_INPUT_FORMAT, null); FileInputFormat<K, V> inputFormat = (FileInputFormat<K, V>) clz.newInstance(); if (inputFormat instanceof Configurable) ((Configurable) inputFormat).setConf(conf); delegate = inputFormat.getRecordReader(fileSplit, (JobConf) conf, reporter); }
From source file:com.gemstone.gemfire.cache.hdfs.internal.hoplog.mapred.AbstractGFRecordReader.java
License:Apache License
/** * Initializes instance of record reader using file split and job * configuration/*www .ja v a2 s.c om*/ * * @param split * @param conf * @throws IOException */ public void initialize(CombineFileSplit split, JobConf conf) throws IOException { CombineFileSplit cSplit = (CombineFileSplit) split; Path[] path = cSplit.getPaths(); long[] start = cSplit.getStartOffsets(); long[] len = cSplit.getLengths(); FileSystem fs = cSplit.getPath(0).getFileSystem(conf); this.splitIterator = HDFSSplitIterator.newInstance(fs, path, start, len, 0l, 0l); }
From source file:com.ricemap.spateDB.mapred.SpatialRecordReader.java
License:Apache License
/** * Initialize from an input split//from w w w. ja v a2s. c o m * @param split * @param conf * @param reporter * @param index * @throws IOException */ public SpatialRecordReader(CombineFileSplit split, Configuration conf, Reporter reporter, Integer index) throws IOException { this(conf, split.getStartOffsets()[index], split.getLength(index), split.getPath(index)); }
From source file:org.icgc.dcc.release.core.hadoop.CombineFileRecordReaderWrapper.java
License:Open Source License
protected CombineFileRecordReaderWrapper(FileInputFormat<K, V> inputFormat, CombineFileSplit split, Configuration conf, Reporter reporter, Integer index) throws IOException { val fileSplit = new FileSplit(split.getPath(index), split.getOffset(index), split.getLength(index), split.getLocations());//from ww w. jav a 2s . c om delegate = inputFormat.getRecordReader(fileSplit, (JobConf) conf, reporter); }