VenuReddy2103 commented on a change in pull request #4010:
URL: https://github.com/apache/carbondata/pull/4010#discussion_r526656764



##########
File path: 
core/src/main/java/org/apache/carbondata/core/datastore/filesystem/AbstractDFSCarbonFile.java
##########
@@ -541,7 +547,10 @@ public boolean createNewLockFile() throws IOException {
   @Override
   public String[] getLocations() throws IOException {
     BlockLocation[] blkLocations;
-    FileStatus fileStatus = fileSystem.getFileStatus(path);
+    FileStatus fileStatus = this.fileStatus;
+    if (fileStatus == null) {
+      fileStatus = fileSystem.getFileStatus(path);

Review comment:
       I think, as mentioned in PR #2465, we shouldn't get once and cache the 
filestatus in class field member. So have fixed to use the existing fileStatus 
from class field only if available (i.e., when Carbon file is instantiated with 
a `FileStatus` constructor `AbstractDFSCarbonFile(FileStatus fileStatus)`). 
This is particularly the case where we have obtained all the filestatuses in 
the segment and create carbonfiles with filestatus argument constructor. It 
happens only from implementation of `protected abstract CarbonFile[] 
getFiles(FileStatus[] listStatus);`




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