nsivabalan opened a new pull request #3757:
URL: https://github.com/apache/hudi/pull/3757


   ## What is the purpose of the pull request
   
   - Fixing couple of direct fs calls. 
   - a. HoodieLogFileReader was using fs.getFileStatus on log file path. Fixed 
to avoid direct fs call
   - b. AbstractTableFileSystemView was calling createNewPath for partition 
which inturn uses fs.exists(). Fixed this to avoid direct fs.exists() call
   
   ## Brief change log
   
   - when reverse reading is enabled in HoodieLogFileReader, we do 
fs.getFileStatus().getLen to know the file length. but if we triage the call, 
one of the callers actually fetches the log paths from fileSlice and sets it in 
RealTimeSplit as List<String> for deltaLogPaths. Have added a new methods in 
RealTimeSplit called deltaLogFileStatus() and this particular caller will 
leverage the same to re-use the fileStatus and fetch the length as well. 
   - Within AbstractTableFileSystemView.ensurePartitionLoadedCorrectly(), we 
create partition path if it does not exists. and so a direct fs.exists() call 
is made here. Still trying to get a sense of if we need to fix this. In the 
sense, if ensurePartitionLoadedCorrectly() will only be called for those 
partitions which exists, is there a need to fix this? Because, actual fix 
involves adding a new api to TableFileSystemView as below 
   ```
   Stream<String> getAllPartitions();
   ```
   and we need to implement the same in all concrete implementations. and 
expose a new endpoint in timeline server as well. Wondering if there is a real 
benefit in here. And this is the only place where we need getAllPartitions(). 
   - There are few other places documented 
[here](https://issues.apache.org/jira/browse/HUDI-2005), but most of them does 
not quality to be removed. most cases happens for uncommitted data and so we 
can't route them to TableFileSystemView. 
   
   ## Verify this pull request
   
   *(Please pick either of the following options)*
   
   This pull request is a trivial rework / code cleanup without any test 
coverage.
   
   *(or)*
   
   This pull request is already covered by existing tests, such as *(please 
describe tests)*.
   
   (or)
   
   This change added tests and can be verified as follows:
   
   *(example:)*
   
     - *Added integration tests for end-to-end.*
     - *Added HoodieClientWriteTest to verify the change.*
     - *Manually verified the change by running a job locally.*
   
   ## Committer checklist
   
    - [ ] Has a corresponding JIRA in PR title & commit
    
    - [ ] Commit message is descriptive of the change
    
    - [ ] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] For large changes, please consider breaking it into sub-tasks under 
an umbrella JIRA.
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to