HBASE-6916 HBA logs at info level errors that won't show in the shell

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1394274 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2012-10-04 21:18:04 +00:00
parent fc2d32793c
commit e898f6de21
2 changed files with 9 additions and 24 deletions

View File

@ -1105,16 +1105,16 @@ public class HBaseAdmin implements Abortable, Closeable {
if (serverName != null) {
Pair<HRegionInfo, ServerName> pair = MetaReader.getRegion(ct, regionname);
if (pair == null || pair.getFirst() == null) {
LOG.info("No region in .META. for " +
Bytes.toStringBinary(regionname) + "; pair=" + pair);
throw new UnknownRegionException(Bytes.toStringBinary(regionname));
} else {
closeRegion(new ServerName(serverName), pair.getFirst());
}
} else {
Pair<HRegionInfo, ServerName> pair = MetaReader.getRegion(ct, regionname);
if (pair == null || pair.getSecond() == null) {
LOG.info("No server in .META. for " +
Bytes.toStringBinary(regionname) + "; pair=" + pair);
if (pair == null) {
throw new UnknownRegionException(Bytes.toStringBinary(regionname));
} else if (pair.getSecond() == null) {
throw new NoServerForRegionException(Bytes.toStringBinary(regionname));
} else {
closeRegion(pair.getSecond(), pair.getFirst());
}
@ -1223,8 +1223,7 @@ public class HBaseAdmin implements Abortable, Closeable {
= getRegion(tableNameOrRegionName, ct);
if (regionServerPair != null) {
if (regionServerPair.getSecond() == null) {
LOG.info("No server in .META. for " +
Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + regionServerPair);
throw new NoServerForRegionException(Bytes.toStringBinary(tableNameOrRegionName));
} else {
flush(regionServerPair.getSecond(), regionServerPair.getFirst());
}
@ -1333,8 +1332,7 @@ public class HBaseAdmin implements Abortable, Closeable {
= getRegion(tableNameOrRegionName, ct);
if (regionServerPair != null) {
if (regionServerPair.getSecond() == null) {
LOG.info("No server in .META. for " +
Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + regionServerPair);
throw new NoServerForRegionException(Bytes.toStringBinary(tableNameOrRegionName));
} else {
compact(regionServerPair.getSecond(), regionServerPair.getFirst(), major);
}
@ -1615,8 +1613,7 @@ public class HBaseAdmin implements Abortable, Closeable {
= getRegion(tableNameOrRegionName, ct);
if (regionServerPair != null) {
if (regionServerPair.getSecond() == null) {
LOG.info("No server in .META. for " +
Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + regionServerPair);
throw new NoServerForRegionException(Bytes.toStringBinary(tableNameOrRegionName));
} else {
split(regionServerPair.getSecond(), regionServerPair.getFirst(), splitPoint);
}
@ -1976,8 +1973,7 @@ public class HBaseAdmin implements Abortable, Closeable {
= getRegion(tableNameOrRegionName, ct);
if (regionServerPair != null) {
if (regionServerPair.getSecond() == null) {
LOG.info("No server in .META. for " +
Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + regionServerPair);
throw new NoServerForRegionException(Bytes.toStringBinary(tableNameOrRegionName));
} else {
ServerName sn = regionServerPair.getSecond();
AdminProtocol admin =

View File

@ -163,17 +163,6 @@ module Hbase
#-------------------------------------------------------------------------------
define_test "close should work without region server name" do
if admin.exists?(@create_test_name)
admin.disable(@create_test_name)
admin.drop(@create_test_name)
end
admin.create(@create_test_name, 'foo')
admin.close_region(@create_test_name + ',,0', nil)
end
#-------------------------------------------------------------------------------
define_test "describe should fail for non-existent tables" do
assert_raise(ArgumentError) do
admin.describe('.NOT.EXISTS.')