jackylk commented on a change in pull request #2465: [CARBONDATA-2863] 
Refactored CarbonFile interface
URL: https://github.com/apache/carbondata/pull/2465#discussion_r349921607
 
 

 ##########
 File path: 
core/src/main/java/org/apache/carbondata/core/datastore/filesystem/AbstractDFSCarbonFile.java
 ##########
 @@ -151,54 +149,47 @@ public String getPath() {
 
   @Override
   public long getSize() {
-    return fileStatus.getLen();
+    try {
+      return fileSystem.getFileStatus(path).getLen();
+    } catch (IOException e) {
+      throw new CarbonFileException("Unable to get file status: ", e);
+    }
   }
 
-  public boolean renameTo(String changeToName) {
-    FileSystem fs;
+  @Override
+  public boolean renameTo(String changetoName) {
     try {
-      if (null != fileStatus) {
-        fs = fileStatus.getPath().getFileSystem(hadoopConf);
-        return fs.rename(fileStatus.getPath(), new Path(changeToName));
-      }
+      return fileSystem.rename(path, new Path(changetoName));
 
 Review comment:
   please add log for all file operation in this file. This class is the base 
class for other implementation, and we can have all info log in this class. 
Many times, we do not have sufficient logs to debug related to files operation 
issues

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


With regards,
Apache Git Services

Reply via email to