shahrs87 commented on a change in pull request #3504:
URL: https://github.com/apache/hbase/pull/3504#discussion_r673983493



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractFSWALProvider.java
##########
@@ -500,6 +499,39 @@ public static Path getArchivedLogPath(Path path, 
Configuration conf) throws IOEx
     }
   }
 
+  /**
+   * Get the archived WAL file path
+   * @param path - active WAL file path
+   * @param conf - configuration
+   * @return archived path if exists, path - otherwise
+   * @throws IOException exception
+   */
+  public static Path getArchivedLog(Path path, Configuration conf) throws 
IOException {

Review comment:
       > The above getArchivedLogPath is used when we want to move a file into 
the archived directory, we need to check the configuration to see if we want to 
put the log into the separate directory or not.
   
   In production code, these 3 places are where we are calling 
`getArchivedLogPath` util method.
   1. 
[AbstractFSWALProvider#openReader](https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractFSWALProvider.java#L524)
 
   2. 
[ReplicationSource#getFileSize](https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java#L399)
   3. 
[WALInputFormat.WALRecordReader#nextKeyValue](https://github.com/apache/hbase/blob/master/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/WALInputFormat.java#L220)
   @Apache9  All of the above calls  are trying to find the log in archive path 
after they couldn't locate the wal in walsDir and they are not used for moving 
a log file to archive directory. Correct me if I am wrong.
   
   
[AbstractFSWALProvider#getWALArchiveDirectoryName](https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractFSWALProvider.java#L334)
 is the mehod we use to locate the wal archive directory to move the wal.




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