HBASE-21688 Address WAL filesystem issues
Signed-off-by: Josh Elser <elserj@apache.org>
This commit is contained in:
parent
cd2374a7f0
commit
a3110afcda
|
@ -189,8 +189,7 @@ public class MasterWalManager {
|
||||||
*/
|
*/
|
||||||
public FileStatus[] getWALDirPaths(final PathFilter filter) throws IOException {
|
public FileStatus[] getWALDirPaths(final PathFilter filter) throws IOException {
|
||||||
Path walDirPath = new Path(CommonFSUtils.getWALRootDir(conf), HConstants.HREGION_LOGDIR_NAME);
|
Path walDirPath = new Path(CommonFSUtils.getWALRootDir(conf), HConstants.HREGION_LOGDIR_NAME);
|
||||||
FileStatus[] walDirForServerNames = FSUtils.listStatus(
|
FileStatus[] walDirForServerNames = FSUtils.listStatus(fs, walDirPath, filter);
|
||||||
CommonFSUtils.getWALFileSystem(conf), walDirPath, filter);
|
|
||||||
return walDirForServerNames == null? new FileStatus[0]: walDirForServerNames;
|
return walDirForServerNames == null? new FileStatus[0]: walDirForServerNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -432,7 +432,7 @@ public abstract class AbstractFSWALProvider<T extends AbstractFSWAL<?>> implemen
|
||||||
* @throws IOException exception
|
* @throws IOException exception
|
||||||
*/
|
*/
|
||||||
public static Path getArchivedLogPath(Path path, Configuration conf) throws IOException {
|
public static Path getArchivedLogPath(Path path, Configuration conf) throws IOException {
|
||||||
Path rootDir = FSUtils.getRootDir(conf);
|
Path rootDir = FSUtils.getWALRootDir(conf);
|
||||||
Path oldLogDir = new Path(rootDir, HConstants.HREGION_OLDLOGDIR_NAME);
|
Path oldLogDir = new Path(rootDir, HConstants.HREGION_OLDLOGDIR_NAME);
|
||||||
if (conf.getBoolean(SEPARATE_OLDLOGDIR, DEFAULT_SEPARATE_OLDLOGDIR)) {
|
if (conf.getBoolean(SEPARATE_OLDLOGDIR, DEFAULT_SEPARATE_OLDLOGDIR)) {
|
||||||
ServerName serverName = getServerNameFromWALDirectoryName(path);
|
ServerName serverName = getServerNameFromWALDirectoryName(path);
|
||||||
|
@ -443,7 +443,7 @@ public abstract class AbstractFSWALProvider<T extends AbstractFSWAL<?>> implemen
|
||||||
oldLogDir = new Path(oldLogDir, serverName.getServerName());
|
oldLogDir = new Path(oldLogDir, serverName.getServerName());
|
||||||
}
|
}
|
||||||
Path archivedLogLocation = new Path(oldLogDir, path.getName());
|
Path archivedLogLocation = new Path(oldLogDir, path.getName());
|
||||||
final FileSystem fs = FSUtils.getCurrentFileSystem(conf);
|
final FileSystem fs = FSUtils.getWALFileSystem(conf);
|
||||||
|
|
||||||
if (fs.exists(archivedLogLocation)) {
|
if (fs.exists(archivedLogLocation)) {
|
||||||
LOG.info("Log " + path + " was moved to " + archivedLogLocation);
|
LOG.info("Log " + path + " was moved to " + archivedLogLocation);
|
||||||
|
|
Loading…
Reference in New Issue