HBASE-7682 Replace HRegion custom File-System debug, with FSUtils.logFileSystemState()

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1438974 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
mbertozzi 2013-01-26 22:03:02 +00:00
parent 48a565a739
commit a3f0aea354
1 changed files with 4 additions and 30 deletions

View File

@ -4212,12 +4212,12 @@ public class HRegion implements HeapSize { // , Writable{
a.compactStores(true);
if (LOG.isDebugEnabled()) {
LOG.debug("Files for region: " + a);
listPaths(fs, a.getRegionDir());
FSUtils.logFileSystemState(fs, a.getRegionDir(), LOG);
}
b.compactStores(true);
if (LOG.isDebugEnabled()) {
LOG.debug("Files for region: " + b);
listPaths(fs, b.getRegionDir());
FSUtils.logFileSystemState(fs, b.getRegionDir(), LOG);
}
Configuration conf = a.baseConf;
@ -4294,7 +4294,7 @@ public class HRegion implements HeapSize { // , Writable{
}
if (LOG.isDebugEnabled()) {
LOG.debug("Files for new region");
listPaths(fs, newRegionDir);
FSUtils.logFileSystemState(fs, newRegionDir, LOG);
}
HRegion dstRegion = HRegion.newHRegion(tableDir, log, fs, conf,
newRegionInfo, a.getTableDesc(), null);
@ -4308,7 +4308,7 @@ public class HRegion implements HeapSize { // , Writable{
dstRegion.compactStores();
if (LOG.isDebugEnabled()) {
LOG.debug("Files for new region");
listPaths(fs, dstRegion.getRegionDir());
FSUtils.logFileSystemState(fs, dstRegion.getRegionDir(), LOG);
}
// delete out the 'A' region
@ -4357,32 +4357,6 @@ public class HRegion implements HeapSize { // , Writable{
return false;
}
/*
* List the files under the specified directory
*
* @param fs
* @param dir
* @throws IOException
*/
private static void listPaths(FileSystem fs, Path dir) throws IOException {
if (LOG.isDebugEnabled()) {
FileStatus[] stats = FSUtils.listStatus(fs, dir, null);
if (stats == null || stats.length == 0) {
return;
}
for (int i = 0; i < stats.length; i++) {
String path = stats[i].getPath().toString();
if (stats[i].isDir()) {
LOG.debug("d " + path);
listPaths(fs, stats[i].getPath());
} else {
LOG.debug("f " + path + " size=" + stats[i].getLen());
}
}
}
}
//
// HBASE-880
//