Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <[email protected]>
  • Loading branch information
sachinpkale committed Oct 4, 2024
1 parent f62a960 commit a84b06a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,8 @@ private static Set<String> getPinnedTimestampLockedFiles(
Set<Long> newPinnedTimestamps = new TreeSet<>(Collections.reverseOrder());
for (Long pinnedTimestamp : pinnedTimestampSet) {
String cachedFile = metadataFilePinnedTimestampMap.get(pinnedTimestamp);
if (cachedFile != null && metadataFiles.contains(cachedFile)) {
if (cachedFile != null) {
assert metadataFiles.contains(cachedFile) : "Metadata files should contain [" + cachedFile + "]";
implicitLockedFiles.add(cachedFile);
} else {
newPinnedTimestamps.add(pinnedTimestamp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,15 @@ public void testGetPinnedTimestampLockedFilesWithCache() {
assertEquals(0, implicitLockedFiles.size());
assertEquals(3, metadataFilePinnedTimestampCache.size());

assertThrows(
AssertionError.class,
() -> testGetPinnedTimestampLockedFilesWithPinnedTimestamps(
List.of(2000L, 2200L, 3001L, 4200L, 4600L, 5010L),
Set.of(3000L, 4000L, 5000L, 6000L),
metadataFilePinnedTimestampCache
)
);

metadataAndLocks = testGetPinnedTimestampLockedFilesWithPinnedTimestamps(
List.of(2000L, 2200L, 2500L, 3001L, 4200L, 4600L, 5010L),
Set.of(),
Expand Down

0 comments on commit a84b06a

Please sign in to comment.