Details
Description
getOnlineTabletsForTable can return null for a couple of different reasons. The try/catch prevents the NPE from filtering up, but it is a confusing situation that can be re-written to be more clear.
DefaultLoadBalancer.java
Map<KeyExtent,TabletStats> onlineTabletsForTable = onlineTablets.get(table); try { if (onlineTabletsForTable == null) { onlineTabletsForTable = new HashMap<KeyExtent,TabletStats>(); for (TabletStats stat : getOnlineTabletsForTable(tooMuch.server, table)) onlineTabletsForTable.put(new KeyExtent(stat.extent), stat); onlineTablets.put(table, onlineTabletsForTable); } } catch (Exception ex) { log.error("Unable to select a tablet to move", ex); return result; }