Source:
public void getAssignments(SortedMap<TServerInstance,TabletServerStatus> current, Map<KeyExtent,TServerInstance> unassigned, Map<KeyExtent,TServerInstance> assignments) { Map<String,SortedMap<TServerInstance,TabletServerStatus>> pools = splitCurrentByRegex(current); Map<String,Map<KeyExtent,TServerInstance>> groupedUnassigned = new HashMap<String,Map<KeyExtent,TServerInstance>>(); for (Entry<KeyExtent,TServerInstance> e : unassigned.entrySet()) { Map<KeyExtent,TServerInstance> tableUnassigned = groupedUnassigned.get(e.getKey().getTableId()); if (tableUnassigned == null) { tableUnassigned = new HashMap<KeyExtent,TServerInstance>(); groupedUnassigned.put(e.getKey().getTableId(), tableUnassigned); } tableUnassigned.put(e.getKey(), e.getValue()); } for (Entry<String,Map<KeyExtent,TServerInstance>> e : groupedUnassigned.entrySet()) { Map<KeyExtent,TServerInstance> newAssignments = new HashMap<KeyExtent,TServerInstance>(); String tableName = tableIdToTableName.get(e.getKey()); String poolName = getPoolNameForTable(tableName); SortedMap<TServerInstance,TabletServerStatus> currentView = pools.get(poolName); if (null == currentView || currentView.size() == 0) { LOG.warn("No tablet servers online for table {}, assigning within default pool", tableName); currentView = pools.get(DEFAULT_POOL); if (null == currentView) { LOG.error("No tablet servers exist in the default pool, unable to assign tablets for table {}", tableName); } } LOG.debug("Sending tablets to balancer for table for assignment within tservers {}", e.getValue().size(), tableName, currentView.keySet()); getBalancerForTable(e.getKey()).getAssignments(currentView, e.getValue(), newAssignments); assignments.putAll(newAssignments); } }

Target:
public void getAssignments(SortedMap<TServerInstance,TabletServerStatus> current, Map<KeyExtent,TServerInstance> unassigned, Map<KeyExtent,TServerInstance> assignments) { Map<String,SortedMap<TServerInstance,TabletServerStatus>> pools = splitCurrentByRegex(current); Map<String,Map<KeyExtent,TServerInstance>> groupedUnassigned = new HashMap<String,Map<KeyExtent,TServerInstance>>(); for (Entry<KeyExtent,TServerInstance> e : unassigned.entrySet()) { Map<KeyExtent,TServerInstance> tableUnassigned = groupedUnassigned.get(e.getKey().getTableId()); if (tableUnassigned == null) { tableUnassigned = new HashMap<KeyExtent,TServerInstance>(); groupedUnassigned.put(e.getKey().getTableId(), tableUnassigned); } tableUnassigned.put(e.getKey(), e.getValue()); } for (Entry<String,Map<KeyExtent,TServerInstance>> e : groupedUnassigned.entrySet()) { Map<KeyExtent,TServerInstance> newAssignments = new HashMap<KeyExtent,TServerInstance>(); String tableName = tableIdToTableName.get(e.getKey()); String poolName = getPoolNameForTable(tableName); SortedMap<TServerInstance,TabletServerStatus> currentView = pools.get(poolName); if (null == currentView || currentView.size() == 0) { LOG.warn("No tablet servers online for table {}, assigning within default pool", tableName); currentView = pools.get(DEFAULT_POOL); if (null == currentView) { LOG.error("No tablet servers exist in the default pool, unable to assign tablets for table {}", tableName); continue; } } LOG.debug("Sending tablets to balancer for table for assignment within tservers {}", e.getValue().size(), tableName, currentView.keySet()); getBalancerForTable(e.getKey()).getAssignments(currentView, e.getValue(), newAssignments); assignments.putAll(newAssignments); } }