From 8195b3409edfa11c73487254fca85a2b34053f3c Mon Sep 17 00:00:00 2001 From: Benoit Sigoure Date: Thu, 3 Oct 2013 22:33:42 -0700 Subject: [PATCH] Log the region name instead of the encoded region name. This makes the log more useful when debugging, because it's not possible to tell right away what a region is just by looking at its encoded name. --- .../org/apache/hadoop/hbase/regionserver/HRegionServer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 307cfa1..e33fb40 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -2549,10 +2549,10 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa protected HRegion getRegion(final byte[] regionName) throws NotServingRegionException { String encodedRegionName = HRegionInfo.encodeRegionName(regionName); - return getRegionByEncodedName(encodedRegionName); + return getRegionByEncodedName(regionName, encodedRegionName); } - protected HRegion getRegionByEncodedName(String encodedRegionName) + protected HRegion getRegionByEncodedName(byte[] regionName, String encodedRegionName) throws NotServingRegionException { HRegion region = this.onlineRegions.get(encodedRegionName); if (region == null) { @@ -2562,9 +2562,9 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa } Boolean isOpening = this.regionsInTransitionInRS.get(Bytes.toBytes(encodedRegionName)); if (isOpening != null && isOpening.booleanValue()) { - throw new RegionOpeningException("Region is being opened: " + encodedRegionName); + throw new RegionOpeningException("Region is being opened: " + new String(regionName)); } - throw new NotServingRegionException("Region is not online: " + encodedRegionName); + throw new NotServingRegionException("Region is not online: " + new String(regionName)); } return region; } @@ -3938,7 +3938,7 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa */ protected HRegion getRegion( final RegionSpecifier regionSpecifier) throws IOException { - return getRegionByEncodedName( + return getRegionByEncodedName(regionSpecifier.getValue().toByteArray(), ProtobufUtil.getRegionEncodedName(regionSpecifier)); } -- 1.8.4.475.gd10da9c