@Override public List<InputSplit> getSplits(JobContext job) throws IOException { return getSplits(super.getSplits(job), job.getConfiguration()); }
@Override public List<InputSplit> getSplits(JobContext job) throws IOException { return getSplits(super.getSplits(job), job.getConfiguration()); }
@Override public List<InputSplit> getSplits(JobContext job) throws IOException { return getSplits(super.getSplits(job), job.getConfiguration()); }
newSplits.addAll(cramIF.getSplits(cramOrigSplits, job.getConfiguration())); return newSplits;
newSplits.addAll(cramIF.getSplits(cramOrigSplits, job.getConfiguration())); return newSplits;
newSplits.addAll(cramIF.getSplits(cramOrigSplits, job.getConfiguration())); return newSplits;
@Test public void testReader() throws Exception { int expectedCount = 0; SamReader samReader = SamReaderFactory.makeDefault() .referenceSequence(new File(URI.create(reference))).open(new File(input)); for (SAMRecord r : samReader) { expectedCount++; } CRAMInputFormat inputFormat = new CRAMInputFormat(); List<InputSplit> splits = inputFormat.getSplits(jobContext); assertEquals(1, splits.size()); RecordReader<LongWritable, SAMRecordWritable> reader = inputFormat .createRecordReader(splits.get(0), taskAttemptContext); reader.initialize(splits.get(0), taskAttemptContext); int actualCount = 0; while (reader.nextKeyValue()) { actualCount++; } assertEquals(expectedCount, actualCount); }
private void checkSplits(int splitMaxSize) throws IOException { // test.cram has containers at positions 1069 and 3403. The file length is 3433. // expected splits = 1069+2334, 3403+30 jobContext.getConfiguration().setInt(FileInputFormat.SPLIT_MAXSIZE, splitMaxSize); CRAMInputFormat inputFormat = new CRAMInputFormat(); List<InputSplit> splits = inputFormat.getSplits(jobContext); assertEquals(2, splits.size()); FileSplit split0 = (FileSplit) splits.get(0); FileSplit split1 = (FileSplit) splits.get(1); assertEquals(1069, split0.getStart()); assertEquals(2334, split0.getLength()); assertEquals(3403, split1.getStart()); assertEquals(30, split1.getLength()); }