vdiravka commented on a change in pull request #1723: DRILL-7063: Seperate metadata cache file into summary, file metadata URL: https://github.com/apache/drill/pull/1723#discussion_r270738499
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatPlugin.java ########## @@ -301,8 +301,25 @@ private Path getMetadataPath(FileStatus dir) { return new Path(dir.getPath(), Metadata.METADATA_FILENAME); } + /** + * Check if the metadata version 4 files exist + * @param dir the path of the directory + * @param fs + * @return true if both file metadata and summary cache file exist + * @throws IOException in case of problems during accessing files + */ + private boolean currentMetadataFileExists(FileStatus dir, FileSystem fs) throws IOException { + for (String metaFileName : Metadata.CURRENT_METADATA_FILENAMES) { Review comment: It's a pity that functional style can't be used here, since `FileSystem.exists()` throws checked exception. ``` return Arrays.stream(Metadata.OLD_METADATA_FILENAMES) .allMatch(metaFileName -> fs.exists(new Path(dir.getPath(), metaFileName))); ``` Possibly we will introduce `FunctionWithException` in Drill in future. All are fine here now. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services