@Test
public void testComputeWorkUnitsWithNoPrexistentCheckpointsMultiplePartitions() throws IOException {
this.fileSystem.mkdirs(new Path(this.dataPath, PARTITION_2));
this.fileSystem.mkdirs(new Path(this.dataPath, PARTITION_3));
this.partitionManager = new HDFSPartitionManager(JOB_NAME,
this.metadataPath,
this.dataPath,
this.fileSystem);
this.metadataManager = new HDFSMetadataManager(this.fileSystem,
new Path(this.metadataPath, JOB_NAME).toString(),
new AtomicBoolean(true));
Assert.assertFalse(this.partitionManager.isSinglePartition());
final Optional<StringValue> latestCheckpoint = getLatestCheckpoint(this.metadataManager);
Assert.assertFalse(latestCheckpoint.isPresent());
virtuallyProcessPartition(this.partitionManager, this.metadataManager, Optional.absent(), PARTITION_2);
final HDFSPartitionManager partitionManager2 = new HDFSPartitionManager(JOB_NAME,
this.metadataPath,
this.dataPath,
this.fileSystem);
final HDFSMetadataManager metadataManager2 = new HDFSMetadataManager(this.fileSystem,
new Path(this.metadataPath, JOB_NAME).toString(),
new AtomicBoolean(true));
final Optional<StringValue> latestCheckpoint2 = getLatestCheckpoint(metadataManager2);
Assert.assertTrue(latestCheckpoint2.isPresent());
virtuallyProcessPartition(partitionManager2, metadataManager2, Optional.of(new StringValue(PARTITION_2)), PARTITION_3);
}