prashantwason commented on pull request #2494:
URL: https://github.com/apache/hudi/pull/2494#issuecomment-768576158


   With enableReuse=false, the caching of readers needs special handling 
because:
   1. Multiple threads may call into 
HoodieBackedTableMetadata.getRecordByKeyFromMetadata() to read their respective 
keys
   2. If enableReuse=false, then each of these threads will try to close the 
readers after reading the key
   
   Hence, we essentially have two codepaths:
   1. enableReuse=false then  readers cannot be cached
   2. enableReuse=true then the readers can be cached.
   
   
   I have updated the patch to handle both these cases by modifying the 
openFileSliceIfNeeded function (renamed to getReader) which returns either:
   1. cached readers when enableReuse=true
   2. newly opened readers when enableReuse=false


----------------------------------------------------------------
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]


Reply via email to