prashantwason commented on a change in pull request #2494:
URL: https://github.com/apache/hudi/pull/2494#discussion_r578804219
##########
File path:
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java
##########
@@ -147,23 +184,21 @@ private void initIfNeeded() {
}
}
timings.add(timer.endTimer());
- LOG.info(String.format("Metadata read for key %s took [open,
baseFileRead, logMerge] %s ms", key, timings));
+ LOG.info(String.format("Metadata read for key %s took [baseFileRead,
logMerge] %s ms", key, timings));
return Option.ofNullable(hoodieRecord);
} catch (IOException ioe) {
throw new HoodieIOException("Error merging records from metadata table
for key :" + key, ioe);
- } finally {
- closeIfNeeded();
}
}
/**
- * Open readers to the base and log files.
+ * Returns the readers to the base and log files.
+ *
+ * If reuse is allowed then cached readers are returned. Otherwise new
readers are opened.
*/
- private synchronized void openFileSliceIfNeeded() throws IOException {
- if (metadataConfig.enableReuse() && baseFileReader != null) {
- // we will reuse what's open.
- return;
- }
+ private Pair<HoodieFileReader, HoodieMetadataMergedLogRecordScanner>
openReaders() throws IOException {
+ HoodieFileReader baseFileReader = null;
Review comment:
There was a review comment earlier due to which I changed from
cachedBaseFileReader.
What about using localBaseFileReader and logRecordScanner?
----------------------------------------------------------------
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:
[email protected]