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 487fb08..4888b0a 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 @@ -2578,10 +2578,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) { @@ -2590,10 +2590,11 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa throw new RegionMovedException(moveInfo.getServerName(), moveInfo.getSeqNum()); } Boolean isOpening = this.regionsInTransitionInRS.get(Bytes.toBytes(encodedRegionName)); + String regionNameStr = Bytes.toStringBinary(regionName); if (isOpening != null && isOpening.booleanValue()) { - throw new RegionOpeningException("Region is being opened: " + encodedRegionName); + throw new RegionOpeningException("Region " + regionNameStr + " is opening"); } - throw new NotServingRegionException("Region is not online: " + encodedRegionName); + throw new NotServingRegionException("Region " + regionNameStr + " is not online"); } return region; } @@ -3881,16 +3882,16 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa // empty input return ReplicateWALEntryResponse.newBuilder().build(); } - + HRegion region = this.getRegionByEncodedName( entries.get(0).getKey().getEncodedRegionName().toStringUtf8()); RegionCoprocessorHost coprocessorHost = region.getCoprocessorHost(); List> walEntries = new ArrayList>(); List> mutations = new ArrayList>(); for (WALEntry entry : entries) { - Pair walEntry = (coprocessorHost == null) ? null : + Pair walEntry = (coprocessorHost == null) ? null : new Pair(); - List> edits = HLogSplitter.getMutationsFromWALEntry(entry, + List> edits = HLogSplitter.getMutationsFromWALEntry(entry, cells, walEntry); if (coprocessorHost != null) { // Start coprocessor replay here. The coprocessor is for each WALEdit instead of a @@ -3996,7 +3997,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)); }