joshelser commented on a change in pull request #740: HBASE-23197
'IllegalArgumentException: Wrong FS' on edits replay when…
URL: https://github.com/apache/hbase/pull/740#discussion_r348822168
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java
##########
@@ -295,8 +297,49 @@ public static void archiveFamilyByFamilyDir(FileSystem
fs, Configuration conf,
*/
public static void archiveStoreFiles(Configuration conf, FileSystem fs,
RegionInfo regionInfo,
Path tableDir, byte[] family, Collection<HStoreFile> compactedFiles)
- throws IOException, FailedArchiveException {
+ throws IOException {
+ Path storeArchiveDir = HFileArchiveUtil.getStoreArchivePath(conf,
regionInfo, tableDir, family);
+ archive(fs, regionInfo, family, compactedFiles, storeArchiveDir);
+ }
+
+ /**
+ * Archive recovered edits using existing logic for archiving store files.
This is currently only
+ * relevant when <b>hbase.region.archive.recovered.edits</b> is true, as
recovered edits shouldn't
+ * be kept after replay. In theory, we could use very same method available
for archiving
+ * store files, but supporting WAL dir and store files on different
FileSystems added the need for
+ * extra validation of the passed FileSystem instance and the path where the
archiving edits
+ * should be placed.
+ * @param conf {@link Configuration} to determine the archive directory.
+ * @param fs the filesystem used for storing WAL files.
+ * @param regionInfo {@link RegionInfo} a pseudo region representation for
the archiving logic.
+ * @param family a pseudo familiy representation for the archiving logic.
+ * @param replayedEdits the recovered edits to be archived.
+ * @throws IOException if files can't be achived due to some internal error.
+ */
+ public static void archiveRecoveredEdits(Configuration conf, FileSystem fs,
RegionInfo regionInfo,
+ byte[] family, Collection<HStoreFile> replayedEdits)
+ throws IOException {
+ String workingDir = conf.get(CommonFSUtils.HBASE_WAL_DIR);
Review comment:
Could consolidate to `conf.get(CommonFSUtils.HBASE_WAL_DIR,
conf.get(HConstants.HBASE_DIR))`.
----------------------------------------------------------------
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