@Test public void testPendingCompactionWithActiveCommits() throws IOException { List<HoodieInstant> instants = new ArrayList<>(); HoodieInstant t1 = new HoodieInstant(HoodieInstant.State.COMPLETED, HoodieTimeline.COMMIT_ACTION, "1"); HoodieInstant t2 = new HoodieInstant(HoodieInstant.State.INFLIGHT, HoodieTimeline.DELTA_COMMIT_ACTION, "2"); HoodieInstant t3 = new HoodieInstant(HoodieInstant.State.REQUESTED, HoodieTimeline.COMPACTION_ACTION, "3"); HoodieInstant t4 = new HoodieInstant(HoodieInstant.State.COMPLETED, HoodieTimeline.DELTA_COMMIT_ACTION, "4"); HoodieInstant t5 = new HoodieInstant(HoodieInstant.State.REQUESTED, HoodieTimeline.COMPACTION_ACTION, "5"); HoodieInstant t6 = new HoodieInstant(HoodieInstant.State.COMPLETED, HoodieTimeline.DELTA_COMMIT_ACTION, "6"); instants.add(t1); instants.add(t2); instants.add(t3); instants.add(t4); instants.add(t5); instants.add(t6); HoodieTableMetaClient metaClient = HoodieTestUtils.init(basePath.toString(), HoodieFileFormat.HFILE); HoodieActiveTimeline timeline = new HoodieActiveTimeline(metaClient); timeline.setInstants(instants); HoodieTimeline filteredTimeline = inputFormat.filterInstantsTimeline(timeline); assertTrue(filteredTimeline.containsInstant(t1)); assertTrue(filteredTimeline.containsInstant(t2)); assertFalse(filteredTimeline.containsInstant(t3)); assertFalse(filteredTimeline.containsInstant(t4)); assertFalse(filteredTimeline.containsInstant(t5)); assertFalse(filteredTimeline.containsInstant(t6)); instants.remove(t3); timeline = new HoodieActiveTimeline(metaClient); timeline.setInstants(instants); filteredTimeline = inputFormat.filterInstantsTimeline(timeline); assertTrue(filteredTimeline.containsInstant(t1)); assertTrue(filteredTimeline.containsInstant(t2)); assertFalse(filteredTimeline.containsInstant(t3)); assertTrue(filteredTimeline.containsInstant(t4)); assertFalse(filteredTimeline.containsInstant(t5)); assertFalse(filteredTimeline.containsInstant(t6)); instants.remove(t5); timeline = new HoodieActiveTimeline(metaClient); timeline.setInstants(instants); filteredTimeline = inputFormat.filterInstantsTimeline(timeline); assertTrue(filteredTimeline.containsInstant(t1)); assertTrue(filteredTimeline.containsInstant(t2)); assertFalse(filteredTimeline.containsInstant(t3)); assertTrue(filteredTimeline.containsInstant(t4)); assertFalse(filteredTimeline.containsInstant(t5)); assertTrue(filteredTimeline.containsInstant(t6)); }
protected HoodieDefaultTimeline filterInstantsTimeline(HoodieDefaultTimeline timeline) { return HoodieInputFormatUtils.filterInstantsTimeline(timeline); }
HoodieHFileInputFormat extends FileInputFormat<NullWritable, ArrayWritable> implements Configurable { protected HoodieDefaultTimeline filterInstantsTimeline(HoodieDefaultTimeline timeline) { return HoodieInputFormatUtils.filterInstantsTimeline(timeline); } }
HoodieHFileInputFormat extends FileInputFormat<NullWritable, ArrayWritable> implements Configurable { protected HoodieDefaultTimeline filterInstantsTimeline(HoodieDefaultTimeline timeline) { return HoodieInputFormatUtils.filterInstantsTimeline(timeline); }  }
HoodieHFileInputFormat extends FileInputFormat<NullWritable, ArrayWritable> implements Configurable { protected HoodieDefaultTimeline filterInstantsTimeline(HoodieDefaultTimeline timeline) { return HoodieInputFormatUtils.filterInstantsTimeline(timeline); }  @Override FileStatus[] listStatus(JobConf job); @Override RecordReader<NullWritable, ArrayWritable> getRecordReader(final InputSplit split, final JobConf job,
      final Reporter reporter); void setConf(Configuration conf); @Override Configuration getConf(); }
HoodieHFileInputFormat extends FileInputFormat<NullWritable, ArrayWritable> implements Configurable { protected HoodieDefaultTimeline filterInstantsTimeline(HoodieDefaultTimeline timeline) { return HoodieInputFormatUtils.filterInstantsTimeline(timeline); }  @Override FileStatus[] listStatus(JobConf job); @Override RecordReader<NullWritable, ArrayWritable> getRecordReader(final InputSplit split, final JobConf job,
      final Reporter reporter); void setConf(Configuration conf); @Override Configuration getConf();  }