Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhumanmod committed Dec 14, 2024
1 parent 4198e5b commit b181a07
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public interface ConversionTarget {
*
* @param sourceIdentifier the unique identifier of the source table commit
* @return an {@link Optional} containing the target commit identifier if a corresponding commit
* exists, or an empty {@link Optional} if no match is found
* exists, or an empty {@link Optional} if no match is found
*/
Optional<String> getTargetCommitIdentifier(String sourceIdentifier);
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,16 @@ public void testCreateSnapshotControlFlow() throws Exception {

TableFormatSync.getInstance()
.syncSnapshot(Collections.singletonList(conversionTarget), snapshot1);
Optional<String> targetIdentifier1 = conversionTarget.getTargetCommitIdentifier(snapshot1.getSourceIdentifier());
Optional<String> targetIdentifier1 =
conversionTarget.getTargetCommitIdentifier(snapshot1.getSourceIdentifier());
validateDeltaTable(basePath, new HashSet<>(Arrays.asList(dataFile1, dataFile2)), null);
assertTrue(targetIdentifier1.isPresent());
assertEquals("0", targetIdentifier1.get());

TableFormatSync.getInstance()
.syncSnapshot(Collections.singletonList(conversionTarget), snapshot2);
Optional<String> targetIdentifier2 = conversionTarget.getTargetCommitIdentifier(snapshot2.getSourceIdentifier());
Optional<String> targetIdentifier2 =
conversionTarget.getTargetCommitIdentifier(snapshot2.getSourceIdentifier());
validateDeltaTable(basePath, new HashSet<>(Arrays.asList(dataFile2, dataFile3)), null);
assertTrue(targetIdentifier2.isPresent());
assertEquals("1", targetIdentifier2.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ CONTEXT, getHoodieWriteConfig(metaClient).getMetadataConfig(), tableBasePath, tr
assertTrue(targetIdentifier5.isPresent());

// Case that return empty target identifier
Optional<String> emptyTargetIdentifier = targetClient.getTargetCommitIdentifier("5", metaClient);
Optional<String> emptyTargetIdentifier =
targetClient.getTargetCommitIdentifier("5", metaClient);
assertFalse(emptyTargetIdentifier.isPresent());

// the first commit to the timeline should be archived
Expand Down

0 comments on commit b181a07

Please sign in to comment.