HBASE-7204 Make hbck ErrorReporter pluggable, ADDENDUM
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1415897 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
51dc20638e
commit
5a408cf256
|
@ -2789,7 +2789,7 @@ public class HBaseFsck extends Configured implements Tool {
|
||||||
public boolean tableHasErrors(TableInfo table);
|
public boolean tableHasErrors(TableInfo table);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class PrintingErrorReporter implements ErrorReporter {
|
static class PrintingErrorReporter implements ErrorReporter {
|
||||||
public int errorCount = 0;
|
public int errorCount = 0;
|
||||||
private int showProgress;
|
private int showProgress;
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
|
||||||
import org.apache.hadoop.hbase.regionserver.HRegion;
|
import org.apache.hadoop.hbase.regionserver.HRegion;
|
||||||
import org.apache.hadoop.hbase.regionserver.HRegionServer;
|
import org.apache.hadoop.hbase.regionserver.HRegionServer;
|
||||||
import org.apache.hadoop.hbase.util.HBaseFsck.ErrorReporter;
|
import org.apache.hadoop.hbase.util.HBaseFsck.ErrorReporter;
|
||||||
|
import org.apache.hadoop.hbase.util.HBaseFsck.PrintingErrorReporter;
|
||||||
import org.apache.hadoop.hbase.util.HBaseFsck.TableInfo;
|
import org.apache.hadoop.hbase.util.HBaseFsck.TableInfo;
|
||||||
import org.apache.hadoop.hbase.util.HBaseFsck.ErrorReporter.ERROR_CODE;
|
import org.apache.hadoop.hbase.util.HBaseFsck.ErrorReporter.ERROR_CODE;
|
||||||
import org.apache.hadoop.hbase.util.HBaseFsck.HbckInfo;
|
import org.apache.hadoop.hbase.util.HBaseFsck.HbckInfo;
|
||||||
|
@ -1677,7 +1678,8 @@ public class TestHBaseFsck {
|
||||||
doFsck(conf, false);
|
doFsck(conf, false);
|
||||||
assertTrue(MockErrorReporter.calledCount > 20);
|
assertTrue(MockErrorReporter.calledCount > 20);
|
||||||
} finally {
|
} finally {
|
||||||
conf.set("hbasefsck.errorreporter", "");
|
conf.set("hbasefsck.errorreporter",
|
||||||
|
PrintingErrorReporter.class.getName());
|
||||||
MockErrorReporter.calledCount = 0;
|
MockErrorReporter.calledCount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue