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) { if (serverName != null) {
Pair<HRegionInfo, ServerName> pair = MetaReader.getRegion(ct, regionname); Pair<HRegionInfo, ServerName> pair = MetaReader.getRegion(ct, regionname);
if (pair == null || pair.getFirst() == null) { if (pair == null || pair.getFirst() == null) {
LOG.info("No region in .META. for " + throw new UnknownRegionException(Bytes.toStringBinary(regionname));
Bytes.toStringBinary(regionname) + "; pair=" + pair);
} else { } else {
closeRegion(new ServerName(serverName), pair.getFirst()); closeRegion(new ServerName(serverName), pair.getFirst());
} }
} else { } else {
Pair<HRegionInfo, ServerName> pair = MetaReader.getRegion(ct, regionname); Pair<HRegionInfo, ServerName> pair = MetaReader.getRegion(ct, regionname);
if (pair == null || pair.getSecond() == null) { if (pair == null) {
LOG.info("No server in .META. for " + throw new UnknownRegionException(Bytes.toStringBinary(regionname));
Bytes.toStringBinary(regionname) + "; pair=" + pair); } else if (pair.getSecond() == null) {
throw new NoServerForRegionException(Bytes.toStringBinary(regionname));
} else { } else {
closeRegion(pair.getSecond(), pair.getFirst()); closeRegion(pair.getSecond(), pair.getFirst());
} }
@ -1223,8 +1223,7 @@ public class HBaseAdmin implements Abortable, Closeable {
= getRegion(tableNameOrRegionName, ct); = getRegion(tableNameOrRegionName, ct);
if (regionServerPair != null) { if (regionServerPair != null) {
if (regionServerPair.getSecond() == null) { if (regionServerPair.getSecond() == null) {
LOG.info("No server in .META. for " + throw new NoServerForRegionException(Bytes.toStringBinary(tableNameOrRegionName));
Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + regionServerPair);
} else { } else {
flush(regionServerPair.getSecond(), regionServerPair.getFirst()); flush(regionServerPair.getSecond(), regionServerPair.getFirst());
} }
@ -1333,8 +1332,7 @@ public class HBaseAdmin implements Abortable, Closeable {
= getRegion(tableNameOrRegionName, ct); = getRegion(tableNameOrRegionName, ct);
if (regionServerPair != null) { if (regionServerPair != null) {
if (regionServerPair.getSecond() == null) { if (regionServerPair.getSecond() == null) {
LOG.info("No server in .META. for " + throw new NoServerForRegionException(Bytes.toStringBinary(tableNameOrRegionName));
Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + regionServerPair);
} else { } else {
compact(regionServerPair.getSecond(), regionServerPair.getFirst(), major); compact(regionServerPair.getSecond(), regionServerPair.getFirst(), major);
} }
@ -1615,8 +1613,7 @@ public class HBaseAdmin implements Abortable, Closeable {
= getRegion(tableNameOrRegionName, ct); = getRegion(tableNameOrRegionName, ct);
if (regionServerPair != null) { if (regionServerPair != null) {
if (regionServerPair.getSecond() == null) { if (regionServerPair.getSecond() == null) {
LOG.info("No server in .META. for " + throw new NoServerForRegionException(Bytes.toStringBinary(tableNameOrRegionName));
Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + regionServerPair);
} else { } else {
split(regionServerPair.getSecond(), regionServerPair.getFirst(), splitPoint); split(regionServerPair.getSecond(), regionServerPair.getFirst(), splitPoint);
} }
@ -1976,8 +1973,7 @@ public class HBaseAdmin implements Abortable, Closeable {
= getRegion(tableNameOrRegionName, ct); = getRegion(tableNameOrRegionName, ct);
if (regionServerPair != null) { if (regionServerPair != null) {
if (regionServerPair.getSecond() == null) { if (regionServerPair.getSecond() == null) {
LOG.info("No server in .META. for " + throw new NoServerForRegionException(Bytes.toStringBinary(tableNameOrRegionName));
Bytes.toStringBinary(tableNameOrRegionName) + "; pair=" + regionServerPair);
} else { } else {
ServerName sn = regionServerPair.getSecond(); ServerName sn = regionServerPair.getSecond();
AdminProtocol admin = 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 define_test "describe should fail for non-existent tables" do
assert_raise(ArgumentError) do assert_raise(ArgumentError) do
admin.describe('.NOT.EXISTS.') admin.describe('.NOT.EXISTS.')