From a3f0aea354e001e9a2b35b2d4b45a02c1e738f6e Mon Sep 17 00:00:00 2001 From: mbertozzi Date: Sat, 26 Jan 2013 22:03:02 +0000 Subject: [PATCH] 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 --- .../hadoop/hbase/regionserver/HRegion.java | 34 +++---------------- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index e49ef997d80..dd3a77d625a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -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 //