Source:
<code>public void getAssignments(SortedMap<TServerInstance,TabletServerStatus> current, Map<KeyExtent,TServerInstance> unassigned, Map<KeyExtent,TServerInstance> assignments) { <START> Map<String,SortedMap<TServerInstance,TabletServerStatus>> pools = splitCurrentByRegex(current); <END> 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); } }</code><technical_language>This problematic. I wait a default of 5minutes for tablets migrated a new server in a pool (because pools recomputed). I miss something</technical_language>

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); } }