Example #1
0
 @Override
 public List<InputSplit> getSplits(JobContext jobContext)
     throws IOException, InterruptedException {
   perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.ORC_GET_SPLITS);
   Configuration conf = ShimLoader.getHadoopShims().getConfiguration(jobContext);
   List<OrcSplit> splits =
       OrcInputFormat.generateSplitsInfo(ShimLoader.getHadoopShims().getConfiguration(jobContext));
   List<InputSplit> result = new ArrayList<InputSplit>();
   for (OrcSplit split : OrcInputFormat.generateSplitsInfo(conf)) {
     result.add(new OrcNewSplit(split));
   }
   perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.ORC_GET_SPLITS);
   return result;
 }
Example #2
0
 OrcRecordReader(Reader file, Configuration conf, long offset, long length) throws IOException {
   List<OrcProto.Type> types = file.getTypes();
   numColumns = (types.size() == 0) ? 0 : types.get(0).getSubtypesCount();
   value = new OrcStruct(numColumns);
   this.reader = OrcInputFormat.createReaderFromFile(file, conf, offset, length);
 }