@Test public void testGetLatestBaseFilesWithPartitionPath() { Stream<HoodieBaseFile> actual; Stream<HoodieBaseFile> expected = testBaseFileStream; String partitionPath = "/table2"; when(primary.getLatestBaseFiles(partitionPath)).thenReturn(testBaseFileStream); actual = fsView.getLatestBaseFiles(partitionPath); assertEquals(expected, actual); resetMocks(); when(primary.getLatestBaseFiles(partitionPath)).thenThrow(new RuntimeException()); when(secondary.getLatestBaseFiles(partitionPath)).thenReturn(testBaseFileStream); actual = fsView.getLatestBaseFiles(partitionPath); assertEquals(expected, actual); resetMocks(); when(secondary.getLatestBaseFiles(partitionPath)).thenReturn(testBaseFileStream); actual = fsView.getLatestBaseFiles(partitionPath); assertEquals(expected, actual); resetMocks(); when(secondary.getLatestBaseFiles(partitionPath)).thenThrow(new RuntimeException()); assertThrows(RuntimeException.class, () -> { fsView.getLatestBaseFiles(partitionPath); }); }
@Override public Stream<HoodieBaseFile> getLatestBaseFiles(String partitionPath) { return execute(partitionPath, preferredView::getLatestBaseFiles, secondaryView::getLatestBaseFiles); }
PriorityBasedFileSystemView implements SyncableFileSystemView, Serializable { @Override public Stream<HoodieBaseFile> getLatestBaseFiles(String partitionPath) { return execute(partitionPath, preferredView::getLatestBaseFiles, secondaryView::getLatestBaseFiles); } }
PriorityBasedFileSystemView implements SyncableFileSystemView, Serializable { @Override public Stream<HoodieBaseFile> getLatestBaseFiles(String partitionPath) { return execute(partitionPath, preferredView::getLatestBaseFiles, secondaryView::getLatestBaseFiles); } PriorityBasedFileSystemView(SyncableFileSystemView preferredView, SyncableFileSystemView secondaryView); }
PriorityBasedFileSystemView implements SyncableFileSystemView, Serializable { @Override public Stream<HoodieBaseFile> getLatestBaseFiles(String partitionPath) { return execute(partitionPath, preferredView::getLatestBaseFiles, secondaryView::getLatestBaseFiles); } PriorityBasedFileSystemView(SyncableFileSystemView preferredView, SyncableFileSystemView secondaryView); @Override Stream<HoodieBaseFile> getLatestBaseFiles(String partitionPath); @Override Stream<HoodieBaseFile> getLatestBaseFiles(); @Override Stream<HoodieBaseFile> getLatestBaseFilesBeforeOrOn(String partitionPath, String maxCommitTime); @Override Option<HoodieBaseFile> getLatestBaseFile(String partitionPath, String fileId); @Override Option<HoodieBaseFile> getBaseFileOn(String partitionPath, String instantTime, String fileId); @Override Stream<HoodieBaseFile> getLatestBaseFilesInRange(List<String> commitsToReturn); @Override Stream<HoodieBaseFile> getAllBaseFiles(String partitionPath); @Override Stream<FileSlice> getLatestFileSlices(String partitionPath); @Override Stream<FileSlice> getLatestUnCompactedFileSlices(String partitionPath); @Override Stream<FileSlice> getLatestFileSlicesBeforeOrOn(String partitionPath, String maxCommitTime,
      boolean includeFileSlicesInPendingCompaction); @Override Stream<FileSlice> getLatestMergedFileSlicesBeforeOrOn(String partitionPath, String maxInstantTime); @Override Stream<FileSlice> getLatestFileSliceInRange(List<String> commitsToReturn); @Override Stream<FileSlice> getAllFileSlices(String partitionPath); @Override Stream<HoodieFileGroup> getAllFileGroups(String partitionPath); @Override Stream<HoodieFileGroup> getReplacedFileGroupsBeforeOrOn(String maxCommitTime, String partitionPath); @Override Stream<Pair<String, CompactionOperation>> getPendingCompactionOperations(); @Override void close(); @Override void reset(); @Override Option<HoodieInstant> getLastInstant(); @Override HoodieTimeline getTimeline(); @Override void sync(); @Override Option<FileSlice> getLatestFileSlice(String partitionPath, String fileId); SyncableFileSystemView getPreferredView(); SyncableFileSystemView getSecondaryView(); }
PriorityBasedFileSystemView implements SyncableFileSystemView, Serializable { @Override public Stream<HoodieBaseFile> getLatestBaseFiles(String partitionPath) { return execute(partitionPath, preferredView::getLatestBaseFiles, secondaryView::getLatestBaseFiles); } PriorityBasedFileSystemView(SyncableFileSystemView preferredView, SyncableFileSystemView secondaryView); @Override Stream<HoodieBaseFile> getLatestBaseFiles(String partitionPath); @Override Stream<HoodieBaseFile> getLatestBaseFiles(); @Override Stream<HoodieBaseFile> getLatestBaseFilesBeforeOrOn(String partitionPath, String maxCommitTime); @Override Option<HoodieBaseFile> getLatestBaseFile(String partitionPath, String fileId); @Override Option<HoodieBaseFile> getBaseFileOn(String partitionPath, String instantTime, String fileId); @Override Stream<HoodieBaseFile> getLatestBaseFilesInRange(List<String> commitsToReturn); @Override Stream<HoodieBaseFile> getAllBaseFiles(String partitionPath); @Override Stream<FileSlice> getLatestFileSlices(String partitionPath); @Override Stream<FileSlice> getLatestUnCompactedFileSlices(String partitionPath); @Override Stream<FileSlice> getLatestFileSlicesBeforeOrOn(String partitionPath, String maxCommitTime,
      boolean includeFileSlicesInPendingCompaction); @Override Stream<FileSlice> getLatestMergedFileSlicesBeforeOrOn(String partitionPath, String maxInstantTime); @Override Stream<FileSlice> getLatestFileSliceInRange(List<String> commitsToReturn); @Override Stream<FileSlice> getAllFileSlices(String partitionPath); @Override Stream<HoodieFileGroup> getAllFileGroups(String partitionPath); @Override Stream<HoodieFileGroup> getReplacedFileGroupsBeforeOrOn(String maxCommitTime, String partitionPath); @Override Stream<Pair<String, CompactionOperation>> getPendingCompactionOperations(); @Override void close(); @Override void reset(); @Override Option<HoodieInstant> getLastInstant(); @Override HoodieTimeline getTimeline(); @Override void sync(); @Override Option<FileSlice> getLatestFileSlice(String partitionPath, String fileId); SyncableFileSystemView getPreferredView(); SyncableFileSystemView getSecondaryView();  }