diff --git a/CHANGES.txt b/CHANGES.txt index 0a2c1792efb..cee8aa1c77e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -113,6 +113,8 @@ Release 0.20.0 - Unreleased HBASE-1374 NPE out of ZooKeeperWrapper.loadZooKeeperConfig HBASE-1336 Splitting up the compare of family+column into 2 different compare HBASE-1377 RS address is null in master web UI + HBASE-1344 WARN IllegalStateException: Cannot set a region as open if it has + not been pending IMPROVEMENTS HBASE-1089 Add count of regions on filesystem to master UI; add percentage diff --git a/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java b/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java index cde9f295fd7..9553c6e7988 100644 --- a/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java +++ b/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java @@ -556,10 +556,16 @@ public class HColumnDescriptor implements ISerializable, WritableComparable e: values.entrySet()) { + String key = Bytes.toString(e.getKey().get()); + String value = Bytes.toString(e.getValue().get()); + if (key != null && key.toUpperCase().equals(BLOOMFILTER)) { + // Don't emit bloomfilter. Its not working. + continue; + } s.append(", "); - s.append(Bytes.toString(e.getKey().get())); + s.append(key); s.append(" => '"); - s.append(Bytes.toString(e.getValue().get())); + s.append(value); s.append("'"); } s.append('}'); diff --git a/src/java/org/apache/hadoop/hbase/HTableDescriptor.java b/src/java/org/apache/hadoop/hbase/HTableDescriptor.java index 594ae0d940b..bec2bb17e75 100644 --- a/src/java/org/apache/hadoop/hbase/HTableDescriptor.java +++ b/src/java/org/apache/hadoop/hbase/HTableDescriptor.java @@ -483,6 +483,18 @@ public class HTableDescriptor implements WritableComparable, I s.append("'"); for (Map.Entry e: values.entrySet()) { + String key = Bytes.toString(e.getKey().get()); + String value = Bytes.toString(e.getValue().get()); + if (key == null) { + continue; + } + String upperCase = key.toUpperCase(); + if (upperCase.equals(IS_ROOT) || upperCase.equals(IS_META)) { + // Skip. Don't bother printing out read-only values if false. + if (value.toLowerCase().equals(Boolean.FALSE.toString())) { + continue; + } + } s.append(", "); s.append(Bytes.toString(e.getKey().get())); s.append(" => '"); @@ -493,11 +505,13 @@ public class HTableDescriptor implements WritableComparable, I s.append(FAMILIES); s.append(" => "); s.append(families.values()); - - s.append(", "); - s.append("INDEXES"); - s.append(" => "); - s.append(indexes.values()); + if (!indexes.isEmpty()) { + // Don't emit if empty. Has to do w/ transactional hbase. + s.append(", "); + s.append("INDEXES"); + s.append(" => "); + s.append(indexes.values()); + } s.append('}'); return s.toString(); } diff --git a/src/java/org/apache/hadoop/hbase/master/BaseScanner.java b/src/java/org/apache/hadoop/hbase/master/BaseScanner.java index a7a32c7313b..9e2db9a0528 100644 --- a/src/java/org/apache/hadoop/hbase/master/BaseScanner.java +++ b/src/java/org/apache/hadoop/hbase/master/BaseScanner.java @@ -328,9 +328,8 @@ abstract class BaseScanner extends Chore implements HConstants { } protected void checkAssigned(final HRegionInfo info, - final String serverAddress, final long startCode) + final String serverAddress, final long startCode) throws IOException { - String serverName = null; if (serverAddress != null && serverAddress.length() > 0) { serverName = HServerInfo.getServerName(serverAddress, startCode); @@ -347,7 +346,6 @@ abstract class BaseScanner extends Chore implements HConstants { this.master.regionManager.regionIsInTransition( info.getRegionNameAsString()) || this.master.serverManager.isDead(serverName)) { - return; } storedInfo = this.master.serverManager.getServerInfo(serverName); diff --git a/src/java/org/apache/hadoop/hbase/master/RegionManager.java b/src/java/org/apache/hadoop/hbase/master/RegionManager.java index 11cc8c9b8c6..2ce154e3bbf 100644 --- a/src/java/org/apache/hadoop/hbase/master/RegionManager.java +++ b/src/java/org/apache/hadoop/hbase/master/RegionManager.java @@ -281,20 +281,49 @@ class RegionManager implements HConstants { } for (RegionState s: regionsToAssign) { - LOG.info("assigning region " + Bytes.toString(s.getRegionName())+ - " to server " + info.getServerName()); - s.setPendingOpen(info.getServerName()); - this.historian.addRegionAssignment(s.getRegionInfo(), - info.getServerName()); - returnMsgs.add( - new HMsg(HMsg.Type.MSG_REGION_OPEN, s.getRegionInfo())); + doRegionAssignment(s, info, returnMsgs); if (--nregions <= 0) { break; } } } } - + + /* + * Assign all to the only server. An unlikely case but still possible. + * + * Note that no synchronization is needed on regionsInTransition while + * iterating on it because the only caller is assignRegions whose caller owns + * the monitor for RegionManager + * + * @param regionsToAssign + * @param serverName + * @param returnMsgs + */ + private void assignRegionsToOneServer(final Set regionsToAssign, + final HServerInfo info, final ArrayList returnMsgs) { + for (RegionState s: regionsToAssign) { + doRegionAssignment(s, info, returnMsgs); + } + } + + /* + * Do single region assignment. + * @param rs + * @param sinfo + * @param returnMsgs + */ + private void doRegionAssignment(final RegionState rs, + final HServerInfo sinfo, final ArrayList returnMsgs) { + String regionName = rs.getRegionInfo().getRegionNameAsString(); + LOG.info("Assigning region " + regionName + " to " + sinfo.getServerName()); + rs.setPendingOpen(sinfo.getServerName()); + this.regionsInTransition.put(regionName, rs); + this.historian.addRegionAssignment(rs.getRegionInfo(), + sinfo.getServerName()); + returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_OPEN, rs.getRegionInfo())); + } + /* * @param nRegionsToAssign * @param thisServersLoad @@ -394,31 +423,7 @@ class RegionManager implements HConstants { } return nservers; } - - - /* - * Assign all to the only server. An unlikely case but still possible. - * - * Note that no synchronization is needed on regionsInTransition while - * iterating on it because the only caller is assignRegions whose caller owns - * the monitor for RegionManager - * - * @param regionsToAssign - * @param serverName - * @param returnMsgs - */ - private void assignRegionsToOneServer(final Set regionsToAssign, - final HServerInfo info, final ArrayList returnMsgs) { - for (RegionState s: regionsToAssign) { - LOG.info("assigning region " + Bytes.toString(s.getRegionName()) + - " to the only server " + info.getServerName()); - s.setPendingOpen(info.getServerName()); - this.historian.addRegionAssignment(s.getRegionInfo(), info.getServerName()); - returnMsgs.add( - new HMsg(HMsg.Type.MSG_REGION_OPEN, s.getRegionInfo())); - } - } - + /* * The server checking in right now is overloaded. We will tell it to close * some or all of its most loaded regions, allowing it to reduce its load. @@ -719,7 +724,7 @@ class RegionManager implements HConstants { * @param info */ public void removeRegion(HRegionInfo info) { - regionsInTransition.remove(info.getRegionNameAsString()); + this.regionsInTransition.remove(info.getRegionNameAsString()); } /**