hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [24/43] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd.
Date Tue, 01 Aug 2017 15:08:06 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/110df817/devapidocs/src-html/org/apache/hadoop/hbase/master/assignment/AssignmentManager.RegionInTransitionChore.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/assignment/AssignmentManager.RegionInTransitionChore.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/assignment/AssignmentManager.RegionInTransitionChore.html
index 596b800..681f621 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/assignment/AssignmentManager.RegionInTransitionChore.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/assignment/AssignmentManager.RegionInTransitionChore.html
@@ -1456,364 +1456,366 @@
 <span class="sourceLineNo">1448</span>    synchronized (regionNode) {<a name="line.1448"></a>
 <span class="sourceLineNo">1449</span>      State state = regionNode.transitionState(State.OPEN, RegionStates.STATES_EXPECTED_ON_OPEN);<a name="line.1449"></a>
 <span class="sourceLineNo">1450</span>      if (isMetaRegion(hri)) {<a name="line.1450"></a>
-<span class="sourceLineNo">1451</span>        setMetaInitialized(hri, true);<a name="line.1451"></a>
-<span class="sourceLineNo">1452</span>      }<a name="line.1452"></a>
-<span class="sourceLineNo">1453</span>      regionStates.addRegionToServer(regionNode.getRegionLocation(), regionNode);<a name="line.1453"></a>
-<span class="sourceLineNo">1454</span>      // TODO: OPENING Updates hbase:meta too... we need to do both here and there?<a name="line.1454"></a>
-<span class="sourceLineNo">1455</span>      // That is a lot of hbase:meta writing.<a name="line.1455"></a>
-<span class="sourceLineNo">1456</span>      regionStateStore.updateRegionLocation(regionNode.getRegionInfo(), state,<a name="line.1456"></a>
-<span class="sourceLineNo">1457</span>        regionNode.getRegionLocation(), regionNode.getLastHost(), regionNode.getOpenSeqNum(),<a name="line.1457"></a>
-<span class="sourceLineNo">1458</span>        regionNode.getProcedure().getProcId());<a name="line.1458"></a>
-<span class="sourceLineNo">1459</span>      sendRegionOpenedNotification(hri, regionNode.getRegionLocation());<a name="line.1459"></a>
-<span class="sourceLineNo">1460</span>    }<a name="line.1460"></a>
-<span class="sourceLineNo">1461</span>  }<a name="line.1461"></a>
-<span class="sourceLineNo">1462</span><a name="line.1462"></a>
-<span class="sourceLineNo">1463</span>  public void markRegionAsClosing(final RegionStateNode regionNode) throws IOException {<a name="line.1463"></a>
-<span class="sourceLineNo">1464</span>    final HRegionInfo hri = regionNode.getRegionInfo();<a name="line.1464"></a>
-<span class="sourceLineNo">1465</span>    synchronized (regionNode) {<a name="line.1465"></a>
-<span class="sourceLineNo">1466</span>      State state = regionNode.transitionState(State.CLOSING, RegionStates.STATES_EXPECTED_ON_CLOSE);<a name="line.1466"></a>
-<span class="sourceLineNo">1467</span>      // Set meta has not initialized early. so people trying to create/edit tables will wait<a name="line.1467"></a>
-<span class="sourceLineNo">1468</span>      if (isMetaRegion(hri)) {<a name="line.1468"></a>
-<span class="sourceLineNo">1469</span>        setMetaInitialized(hri, false);<a name="line.1469"></a>
-<span class="sourceLineNo">1470</span>      }<a name="line.1470"></a>
-<span class="sourceLineNo">1471</span>      regionStates.addRegionToServer(regionNode.getRegionLocation(), regionNode);<a name="line.1471"></a>
-<span class="sourceLineNo">1472</span>      regionStateStore.updateRegionLocation(regionNode.getRegionInfo(), state,<a name="line.1472"></a>
-<span class="sourceLineNo">1473</span>        regionNode.getRegionLocation(), regionNode.getLastHost(), HConstants.NO_SEQNUM,<a name="line.1473"></a>
-<span class="sourceLineNo">1474</span>        regionNode.getProcedure().getProcId());<a name="line.1474"></a>
-<span class="sourceLineNo">1475</span>    }<a name="line.1475"></a>
-<span class="sourceLineNo">1476</span><a name="line.1476"></a>
-<span class="sourceLineNo">1477</span>    // update the operation count metrics<a name="line.1477"></a>
-<span class="sourceLineNo">1478</span>    metrics.incrementOperationCounter();<a name="line.1478"></a>
-<span class="sourceLineNo">1479</span>  }<a name="line.1479"></a>
-<span class="sourceLineNo">1480</span><a name="line.1480"></a>
-<span class="sourceLineNo">1481</span>  public void undoRegionAsClosing(final RegionStateNode regionNode) {<a name="line.1481"></a>
-<span class="sourceLineNo">1482</span>    // TODO: Metrics. Do opposite of metrics.incrementOperationCounter();<a name="line.1482"></a>
-<span class="sourceLineNo">1483</span>    // There is nothing to undo?<a name="line.1483"></a>
-<span class="sourceLineNo">1484</span>  }<a name="line.1484"></a>
-<span class="sourceLineNo">1485</span><a name="line.1485"></a>
-<span class="sourceLineNo">1486</span>  public void markRegionAsClosed(final RegionStateNode regionNode) throws IOException {<a name="line.1486"></a>
-<span class="sourceLineNo">1487</span>    final HRegionInfo hri = regionNode.getRegionInfo();<a name="line.1487"></a>
-<span class="sourceLineNo">1488</span>    synchronized (regionNode) {<a name="line.1488"></a>
-<span class="sourceLineNo">1489</span>      State state = regionNode.transitionState(State.CLOSED, RegionStates.STATES_EXPECTED_ON_CLOSE);<a name="line.1489"></a>
-<span class="sourceLineNo">1490</span>      regionStates.removeRegionFromServer(regionNode.getRegionLocation(), regionNode);<a name="line.1490"></a>
-<span class="sourceLineNo">1491</span>      regionNode.setLastHost(regionNode.getRegionLocation());<a name="line.1491"></a>
-<span class="sourceLineNo">1492</span>      regionNode.setRegionLocation(null);<a name="line.1492"></a>
-<span class="sourceLineNo">1493</span>      regionStateStore.updateRegionLocation(regionNode.getRegionInfo(), state,<a name="line.1493"></a>
-<span class="sourceLineNo">1494</span>        regionNode.getRegionLocation()/*null*/, regionNode.getLastHost(),<a name="line.1494"></a>
-<span class="sourceLineNo">1495</span>        HConstants.NO_SEQNUM, regionNode.getProcedure().getProcId());<a name="line.1495"></a>
-<span class="sourceLineNo">1496</span>      sendRegionClosedNotification(hri);<a name="line.1496"></a>
-<span class="sourceLineNo">1497</span>    }<a name="line.1497"></a>
-<span class="sourceLineNo">1498</span>  }<a name="line.1498"></a>
-<span class="sourceLineNo">1499</span><a name="line.1499"></a>
-<span class="sourceLineNo">1500</span>  public void markRegionAsSplit(final HRegionInfo parent, final ServerName serverName,<a name="line.1500"></a>
-<span class="sourceLineNo">1501</span>      final HRegionInfo daughterA, final HRegionInfo daughterB)<a name="line.1501"></a>
-<span class="sourceLineNo">1502</span>  throws IOException {<a name="line.1502"></a>
-<span class="sourceLineNo">1503</span>    // Update hbase:meta. Parent will be marked offline and split up in hbase:meta.<a name="line.1503"></a>
-<span class="sourceLineNo">1504</span>    // The parent stays in regionStates until cleared when removed by CatalogJanitor.<a name="line.1504"></a>
-<span class="sourceLineNo">1505</span>    // Update its state in regionStates to it shows as offline and split when read<a name="line.1505"></a>
-<span class="sourceLineNo">1506</span>    // later figuring what regions are in a table and what are not: see<a name="line.1506"></a>
-<span class="sourceLineNo">1507</span>    // regionStates#getRegionsOfTable<a name="line.1507"></a>
-<span class="sourceLineNo">1508</span>    final RegionStateNode node = regionStates.getOrCreateRegionNode(parent);<a name="line.1508"></a>
-<span class="sourceLineNo">1509</span>    node.setState(State.SPLIT);<a name="line.1509"></a>
-<span class="sourceLineNo">1510</span>    regionStateStore.splitRegion(parent, daughterA, daughterB, serverName);<a name="line.1510"></a>
-<span class="sourceLineNo">1511</span>    if (shouldAssignFavoredNodes(parent)) {<a name="line.1511"></a>
-<span class="sourceLineNo">1512</span>      List&lt;ServerName&gt; onlineServers = this.master.getServerManager().getOnlineServersList();<a name="line.1512"></a>
-<span class="sourceLineNo">1513</span>      ((FavoredNodesPromoter)getBalancer()).<a name="line.1513"></a>
-<span class="sourceLineNo">1514</span>          generateFavoredNodesForDaughter(onlineServers, parent, daughterA, daughterB);<a name="line.1514"></a>
-<span class="sourceLineNo">1515</span>    }<a name="line.1515"></a>
-<span class="sourceLineNo">1516</span>  }<a name="line.1516"></a>
-<span class="sourceLineNo">1517</span><a name="line.1517"></a>
-<span class="sourceLineNo">1518</span>  /**<a name="line.1518"></a>
-<span class="sourceLineNo">1519</span>   * When called here, the merge has happened. The two merged regions have been<a name="line.1519"></a>
-<span class="sourceLineNo">1520</span>   * unassigned and the above markRegionClosed has been called on each so they have been<a name="line.1520"></a>
-<span class="sourceLineNo">1521</span>   * disassociated from a hosting Server. The merged region will be open after this call. The<a name="line.1521"></a>
-<span class="sourceLineNo">1522</span>   * merged regions are removed from hbase:meta below&gt; Later they are deleted from the filesystem<a name="line.1522"></a>
-<span class="sourceLineNo">1523</span>   * by the catalog janitor running against hbase:meta. It notices when the merged region no<a name="line.1523"></a>
-<span class="sourceLineNo">1524</span>   * longer holds references to the old regions.<a name="line.1524"></a>
-<span class="sourceLineNo">1525</span>   */<a name="line.1525"></a>
-<span class="sourceLineNo">1526</span>  public void markRegionAsMerged(final HRegionInfo child, final ServerName serverName,<a name="line.1526"></a>
-<span class="sourceLineNo">1527</span>      final HRegionInfo mother, final HRegionInfo father) throws IOException {<a name="line.1527"></a>
-<span class="sourceLineNo">1528</span>    final RegionStateNode node = regionStates.getOrCreateRegionNode(child);<a name="line.1528"></a>
-<span class="sourceLineNo">1529</span>    node.setState(State.MERGED);<a name="line.1529"></a>
-<span class="sourceLineNo">1530</span>    regionStates.deleteRegion(mother);<a name="line.1530"></a>
-<span class="sourceLineNo">1531</span>    regionStates.deleteRegion(father);<a name="line.1531"></a>
-<span class="sourceLineNo">1532</span>    regionStateStore.mergeRegions(child, mother, father, serverName);<a name="line.1532"></a>
-<span class="sourceLineNo">1533</span>    if (shouldAssignFavoredNodes(child)) {<a name="line.1533"></a>
-<span class="sourceLineNo">1534</span>      ((FavoredNodesPromoter)getBalancer()).<a name="line.1534"></a>
-<span class="sourceLineNo">1535</span>        generateFavoredNodesForMergedRegion(child, mother, father);<a name="line.1535"></a>
-<span class="sourceLineNo">1536</span>    }<a name="line.1536"></a>
-<span class="sourceLineNo">1537</span>  }<a name="line.1537"></a>
-<span class="sourceLineNo">1538</span><a name="line.1538"></a>
-<span class="sourceLineNo">1539</span>  /*<a name="line.1539"></a>
-<span class="sourceLineNo">1540</span>   * Favored nodes should be applied only when FavoredNodes balancer is configured and the region<a name="line.1540"></a>
-<span class="sourceLineNo">1541</span>   * belongs to a non-system table.<a name="line.1541"></a>
-<span class="sourceLineNo">1542</span>   */<a name="line.1542"></a>
-<span class="sourceLineNo">1543</span>  private boolean shouldAssignFavoredNodes(HRegionInfo region) {<a name="line.1543"></a>
-<span class="sourceLineNo">1544</span>    return this.shouldAssignRegionsWithFavoredNodes &amp;&amp;<a name="line.1544"></a>
-<span class="sourceLineNo">1545</span>        FavoredNodesManager.isFavoredNodeApplicable(region);<a name="line.1545"></a>
-<span class="sourceLineNo">1546</span>  }<a name="line.1546"></a>
-<span class="sourceLineNo">1547</span><a name="line.1547"></a>
-<span class="sourceLineNo">1548</span>  // ============================================================================================<a name="line.1548"></a>
-<span class="sourceLineNo">1549</span>  //  Assign Queue (Assign/Balance)<a name="line.1549"></a>
+<span class="sourceLineNo">1451</span>        master.getTableStateManager().setTableState(TableName.META_TABLE_NAME,<a name="line.1451"></a>
+<span class="sourceLineNo">1452</span>            TableState.State.ENABLED);<a name="line.1452"></a>
+<span class="sourceLineNo">1453</span>        setMetaInitialized(hri, true);<a name="line.1453"></a>
+<span class="sourceLineNo">1454</span>      }<a name="line.1454"></a>
+<span class="sourceLineNo">1455</span>      regionStates.addRegionToServer(regionNode.getRegionLocation(), regionNode);<a name="line.1455"></a>
+<span class="sourceLineNo">1456</span>      // TODO: OPENING Updates hbase:meta too... we need to do both here and there?<a name="line.1456"></a>
+<span class="sourceLineNo">1457</span>      // That is a lot of hbase:meta writing.<a name="line.1457"></a>
+<span class="sourceLineNo">1458</span>      regionStateStore.updateRegionLocation(regionNode.getRegionInfo(), state,<a name="line.1458"></a>
+<span class="sourceLineNo">1459</span>        regionNode.getRegionLocation(), regionNode.getLastHost(), regionNode.getOpenSeqNum(),<a name="line.1459"></a>
+<span class="sourceLineNo">1460</span>        regionNode.getProcedure().getProcId());<a name="line.1460"></a>
+<span class="sourceLineNo">1461</span>      sendRegionOpenedNotification(hri, regionNode.getRegionLocation());<a name="line.1461"></a>
+<span class="sourceLineNo">1462</span>    }<a name="line.1462"></a>
+<span class="sourceLineNo">1463</span>  }<a name="line.1463"></a>
+<span class="sourceLineNo">1464</span><a name="line.1464"></a>
+<span class="sourceLineNo">1465</span>  public void markRegionAsClosing(final RegionStateNode regionNode) throws IOException {<a name="line.1465"></a>
+<span class="sourceLineNo">1466</span>    final HRegionInfo hri = regionNode.getRegionInfo();<a name="line.1466"></a>
+<span class="sourceLineNo">1467</span>    synchronized (regionNode) {<a name="line.1467"></a>
+<span class="sourceLineNo">1468</span>      State state = regionNode.transitionState(State.CLOSING, RegionStates.STATES_EXPECTED_ON_CLOSE);<a name="line.1468"></a>
+<span class="sourceLineNo">1469</span>      // Set meta has not initialized early. so people trying to create/edit tables will wait<a name="line.1469"></a>
+<span class="sourceLineNo">1470</span>      if (isMetaRegion(hri)) {<a name="line.1470"></a>
+<span class="sourceLineNo">1471</span>        setMetaInitialized(hri, false);<a name="line.1471"></a>
+<span class="sourceLineNo">1472</span>      }<a name="line.1472"></a>
+<span class="sourceLineNo">1473</span>      regionStates.addRegionToServer(regionNode.getRegionLocation(), regionNode);<a name="line.1473"></a>
+<span class="sourceLineNo">1474</span>      regionStateStore.updateRegionLocation(regionNode.getRegionInfo(), state,<a name="line.1474"></a>
+<span class="sourceLineNo">1475</span>        regionNode.getRegionLocation(), regionNode.getLastHost(), HConstants.NO_SEQNUM,<a name="line.1475"></a>
+<span class="sourceLineNo">1476</span>        regionNode.getProcedure().getProcId());<a name="line.1476"></a>
+<span class="sourceLineNo">1477</span>    }<a name="line.1477"></a>
+<span class="sourceLineNo">1478</span><a name="line.1478"></a>
+<span class="sourceLineNo">1479</span>    // update the operation count metrics<a name="line.1479"></a>
+<span class="sourceLineNo">1480</span>    metrics.incrementOperationCounter();<a name="line.1480"></a>
+<span class="sourceLineNo">1481</span>  }<a name="line.1481"></a>
+<span class="sourceLineNo">1482</span><a name="line.1482"></a>
+<span class="sourceLineNo">1483</span>  public void undoRegionAsClosing(final RegionStateNode regionNode) {<a name="line.1483"></a>
+<span class="sourceLineNo">1484</span>    // TODO: Metrics. Do opposite of metrics.incrementOperationCounter();<a name="line.1484"></a>
+<span class="sourceLineNo">1485</span>    // There is nothing to undo?<a name="line.1485"></a>
+<span class="sourceLineNo">1486</span>  }<a name="line.1486"></a>
+<span class="sourceLineNo">1487</span><a name="line.1487"></a>
+<span class="sourceLineNo">1488</span>  public void markRegionAsClosed(final RegionStateNode regionNode) throws IOException {<a name="line.1488"></a>
+<span class="sourceLineNo">1489</span>    final HRegionInfo hri = regionNode.getRegionInfo();<a name="line.1489"></a>
+<span class="sourceLineNo">1490</span>    synchronized (regionNode) {<a name="line.1490"></a>
+<span class="sourceLineNo">1491</span>      State state = regionNode.transitionState(State.CLOSED, RegionStates.STATES_EXPECTED_ON_CLOSE);<a name="line.1491"></a>
+<span class="sourceLineNo">1492</span>      regionStates.removeRegionFromServer(regionNode.getRegionLocation(), regionNode);<a name="line.1492"></a>
+<span class="sourceLineNo">1493</span>      regionNode.setLastHost(regionNode.getRegionLocation());<a name="line.1493"></a>
+<span class="sourceLineNo">1494</span>      regionNode.setRegionLocation(null);<a name="line.1494"></a>
+<span class="sourceLineNo">1495</span>      regionStateStore.updateRegionLocation(regionNode.getRegionInfo(), state,<a name="line.1495"></a>
+<span class="sourceLineNo">1496</span>        regionNode.getRegionLocation()/*null*/, regionNode.getLastHost(),<a name="line.1496"></a>
+<span class="sourceLineNo">1497</span>        HConstants.NO_SEQNUM, regionNode.getProcedure().getProcId());<a name="line.1497"></a>
+<span class="sourceLineNo">1498</span>      sendRegionClosedNotification(hri);<a name="line.1498"></a>
+<span class="sourceLineNo">1499</span>    }<a name="line.1499"></a>
+<span class="sourceLineNo">1500</span>  }<a name="line.1500"></a>
+<span class="sourceLineNo">1501</span><a name="line.1501"></a>
+<span class="sourceLineNo">1502</span>  public void markRegionAsSplit(final HRegionInfo parent, final ServerName serverName,<a name="line.1502"></a>
+<span class="sourceLineNo">1503</span>      final HRegionInfo daughterA, final HRegionInfo daughterB)<a name="line.1503"></a>
+<span class="sourceLineNo">1504</span>  throws IOException {<a name="line.1504"></a>
+<span class="sourceLineNo">1505</span>    // Update hbase:meta. Parent will be marked offline and split up in hbase:meta.<a name="line.1505"></a>
+<span class="sourceLineNo">1506</span>    // The parent stays in regionStates until cleared when removed by CatalogJanitor.<a name="line.1506"></a>
+<span class="sourceLineNo">1507</span>    // Update its state in regionStates to it shows as offline and split when read<a name="line.1507"></a>
+<span class="sourceLineNo">1508</span>    // later figuring what regions are in a table and what are not: see<a name="line.1508"></a>
+<span class="sourceLineNo">1509</span>    // regionStates#getRegionsOfTable<a name="line.1509"></a>
+<span class="sourceLineNo">1510</span>    final RegionStateNode node = regionStates.getOrCreateRegionNode(parent);<a name="line.1510"></a>
+<span class="sourceLineNo">1511</span>    node.setState(State.SPLIT);<a name="line.1511"></a>
+<span class="sourceLineNo">1512</span>    regionStateStore.splitRegion(parent, daughterA, daughterB, serverName);<a name="line.1512"></a>
+<span class="sourceLineNo">1513</span>    if (shouldAssignFavoredNodes(parent)) {<a name="line.1513"></a>
+<span class="sourceLineNo">1514</span>      List&lt;ServerName&gt; onlineServers = this.master.getServerManager().getOnlineServersList();<a name="line.1514"></a>
+<span class="sourceLineNo">1515</span>      ((FavoredNodesPromoter)getBalancer()).<a name="line.1515"></a>
+<span class="sourceLineNo">1516</span>          generateFavoredNodesForDaughter(onlineServers, parent, daughterA, daughterB);<a name="line.1516"></a>
+<span class="sourceLineNo">1517</span>    }<a name="line.1517"></a>
+<span class="sourceLineNo">1518</span>  }<a name="line.1518"></a>
+<span class="sourceLineNo">1519</span><a name="line.1519"></a>
+<span class="sourceLineNo">1520</span>  /**<a name="line.1520"></a>
+<span class="sourceLineNo">1521</span>   * When called here, the merge has happened. The two merged regions have been<a name="line.1521"></a>
+<span class="sourceLineNo">1522</span>   * unassigned and the above markRegionClosed has been called on each so they have been<a name="line.1522"></a>
+<span class="sourceLineNo">1523</span>   * disassociated from a hosting Server. The merged region will be open after this call. The<a name="line.1523"></a>
+<span class="sourceLineNo">1524</span>   * merged regions are removed from hbase:meta below&gt; Later they are deleted from the filesystem<a name="line.1524"></a>
+<span class="sourceLineNo">1525</span>   * by the catalog janitor running against hbase:meta. It notices when the merged region no<a name="line.1525"></a>
+<span class="sourceLineNo">1526</span>   * longer holds references to the old regions.<a name="line.1526"></a>
+<span class="sourceLineNo">1527</span>   */<a name="line.1527"></a>
+<span class="sourceLineNo">1528</span>  public void markRegionAsMerged(final HRegionInfo child, final ServerName serverName,<a name="line.1528"></a>
+<span class="sourceLineNo">1529</span>      final HRegionInfo mother, final HRegionInfo father) throws IOException {<a name="line.1529"></a>
+<span class="sourceLineNo">1530</span>    final RegionStateNode node = regionStates.getOrCreateRegionNode(child);<a name="line.1530"></a>
+<span class="sourceLineNo">1531</span>    node.setState(State.MERGED);<a name="line.1531"></a>
+<span class="sourceLineNo">1532</span>    regionStates.deleteRegion(mother);<a name="line.1532"></a>
+<span class="sourceLineNo">1533</span>    regionStates.deleteRegion(father);<a name="line.1533"></a>
+<span class="sourceLineNo">1534</span>    regionStateStore.mergeRegions(child, mother, father, serverName);<a name="line.1534"></a>
+<span class="sourceLineNo">1535</span>    if (shouldAssignFavoredNodes(child)) {<a name="line.1535"></a>
+<span class="sourceLineNo">1536</span>      ((FavoredNodesPromoter)getBalancer()).<a name="line.1536"></a>
+<span class="sourceLineNo">1537</span>        generateFavoredNodesForMergedRegion(child, mother, father);<a name="line.1537"></a>
+<span class="sourceLineNo">1538</span>    }<a name="line.1538"></a>
+<span class="sourceLineNo">1539</span>  }<a name="line.1539"></a>
+<span class="sourceLineNo">1540</span><a name="line.1540"></a>
+<span class="sourceLineNo">1541</span>  /*<a name="line.1541"></a>
+<span class="sourceLineNo">1542</span>   * Favored nodes should be applied only when FavoredNodes balancer is configured and the region<a name="line.1542"></a>
+<span class="sourceLineNo">1543</span>   * belongs to a non-system table.<a name="line.1543"></a>
+<span class="sourceLineNo">1544</span>   */<a name="line.1544"></a>
+<span class="sourceLineNo">1545</span>  private boolean shouldAssignFavoredNodes(HRegionInfo region) {<a name="line.1545"></a>
+<span class="sourceLineNo">1546</span>    return this.shouldAssignRegionsWithFavoredNodes &amp;&amp;<a name="line.1546"></a>
+<span class="sourceLineNo">1547</span>        FavoredNodesManager.isFavoredNodeApplicable(region);<a name="line.1547"></a>
+<span class="sourceLineNo">1548</span>  }<a name="line.1548"></a>
+<span class="sourceLineNo">1549</span><a name="line.1549"></a>
 <span class="sourceLineNo">1550</span>  // ============================================================================================<a name="line.1550"></a>
-<span class="sourceLineNo">1551</span>  private final ArrayList&lt;RegionStateNode&gt; pendingAssignQueue = new ArrayList&lt;RegionStateNode&gt;();<a name="line.1551"></a>
-<span class="sourceLineNo">1552</span>  private final ReentrantLock assignQueueLock = new ReentrantLock();<a name="line.1552"></a>
-<span class="sourceLineNo">1553</span>  private final Condition assignQueueFullCond = assignQueueLock.newCondition();<a name="line.1553"></a>
-<span class="sourceLineNo">1554</span><a name="line.1554"></a>
-<span class="sourceLineNo">1555</span>  /**<a name="line.1555"></a>
-<span class="sourceLineNo">1556</span>   * Add the assign operation to the assignment queue.<a name="line.1556"></a>
-<span class="sourceLineNo">1557</span>   * The pending assignment operation will be processed,<a name="line.1557"></a>
-<span class="sourceLineNo">1558</span>   * and each region will be assigned by a server using the balancer.<a name="line.1558"></a>
-<span class="sourceLineNo">1559</span>   */<a name="line.1559"></a>
-<span class="sourceLineNo">1560</span>  protected void queueAssign(final RegionStateNode regionNode) {<a name="line.1560"></a>
-<span class="sourceLineNo">1561</span>    getProcedureScheduler().suspendEvent(regionNode.getProcedureEvent());<a name="line.1561"></a>
-<span class="sourceLineNo">1562</span><a name="line.1562"></a>
-<span class="sourceLineNo">1563</span>    // TODO: quick-start for meta and the other sys-tables?<a name="line.1563"></a>
-<span class="sourceLineNo">1564</span>    assignQueueLock.lock();<a name="line.1564"></a>
-<span class="sourceLineNo">1565</span>    try {<a name="line.1565"></a>
-<span class="sourceLineNo">1566</span>      pendingAssignQueue.add(regionNode);<a name="line.1566"></a>
-<span class="sourceLineNo">1567</span>      if (regionNode.isSystemTable() ||<a name="line.1567"></a>
-<span class="sourceLineNo">1568</span>          pendingAssignQueue.size() == 1 ||<a name="line.1568"></a>
-<span class="sourceLineNo">1569</span>          pendingAssignQueue.size() &gt;= assignDispatchWaitQueueMaxSize) {<a name="line.1569"></a>
-<span class="sourceLineNo">1570</span>        assignQueueFullCond.signal();<a name="line.1570"></a>
-<span class="sourceLineNo">1571</span>      }<a name="line.1571"></a>
-<span class="sourceLineNo">1572</span>    } finally {<a name="line.1572"></a>
-<span class="sourceLineNo">1573</span>      assignQueueLock.unlock();<a name="line.1573"></a>
-<span class="sourceLineNo">1574</span>    }<a name="line.1574"></a>
-<span class="sourceLineNo">1575</span>  }<a name="line.1575"></a>
-<span class="sourceLineNo">1576</span><a name="line.1576"></a>
-<span class="sourceLineNo">1577</span>  private void startAssignmentThread() {<a name="line.1577"></a>
-<span class="sourceLineNo">1578</span>    assignThread = new Thread("AssignmentThread") {<a name="line.1578"></a>
-<span class="sourceLineNo">1579</span>      @Override<a name="line.1579"></a>
-<span class="sourceLineNo">1580</span>      public void run() {<a name="line.1580"></a>
-<span class="sourceLineNo">1581</span>        while (isRunning()) {<a name="line.1581"></a>
-<span class="sourceLineNo">1582</span>          processAssignQueue();<a name="line.1582"></a>
-<span class="sourceLineNo">1583</span>        }<a name="line.1583"></a>
-<span class="sourceLineNo">1584</span>        pendingAssignQueue.clear();<a name="line.1584"></a>
-<span class="sourceLineNo">1585</span>      }<a name="line.1585"></a>
-<span class="sourceLineNo">1586</span>    };<a name="line.1586"></a>
-<span class="sourceLineNo">1587</span>    assignThread.start();<a name="line.1587"></a>
-<span class="sourceLineNo">1588</span>  }<a name="line.1588"></a>
-<span class="sourceLineNo">1589</span><a name="line.1589"></a>
-<span class="sourceLineNo">1590</span>  private void stopAssignmentThread() {<a name="line.1590"></a>
-<span class="sourceLineNo">1591</span>    assignQueueSignal();<a name="line.1591"></a>
-<span class="sourceLineNo">1592</span>    try {<a name="line.1592"></a>
-<span class="sourceLineNo">1593</span>      while (assignThread.isAlive()) {<a name="line.1593"></a>
-<span class="sourceLineNo">1594</span>        assignQueueSignal();<a name="line.1594"></a>
-<span class="sourceLineNo">1595</span>        assignThread.join(250);<a name="line.1595"></a>
-<span class="sourceLineNo">1596</span>      }<a name="line.1596"></a>
-<span class="sourceLineNo">1597</span>    } catch (InterruptedException e) {<a name="line.1597"></a>
-<span class="sourceLineNo">1598</span>      LOG.warn("join interrupted", e);<a name="line.1598"></a>
-<span class="sourceLineNo">1599</span>      Thread.currentThread().interrupt();<a name="line.1599"></a>
-<span class="sourceLineNo">1600</span>    }<a name="line.1600"></a>
-<span class="sourceLineNo">1601</span>  }<a name="line.1601"></a>
-<span class="sourceLineNo">1602</span><a name="line.1602"></a>
-<span class="sourceLineNo">1603</span>  private void assignQueueSignal() {<a name="line.1603"></a>
-<span class="sourceLineNo">1604</span>    assignQueueLock.lock();<a name="line.1604"></a>
-<span class="sourceLineNo">1605</span>    try {<a name="line.1605"></a>
-<span class="sourceLineNo">1606</span>      assignQueueFullCond.signal();<a name="line.1606"></a>
-<span class="sourceLineNo">1607</span>    } finally {<a name="line.1607"></a>
-<span class="sourceLineNo">1608</span>      assignQueueLock.unlock();<a name="line.1608"></a>
-<span class="sourceLineNo">1609</span>    }<a name="line.1609"></a>
-<span class="sourceLineNo">1610</span>  }<a name="line.1610"></a>
-<span class="sourceLineNo">1611</span><a name="line.1611"></a>
-<span class="sourceLineNo">1612</span>  @edu.umd.cs.findbugs.annotations.SuppressWarnings("WA_AWAIT_NOT_IN_LOOP")<a name="line.1612"></a>
-<span class="sourceLineNo">1613</span>  private HashMap&lt;HRegionInfo, RegionStateNode&gt; waitOnAssignQueue() {<a name="line.1613"></a>
-<span class="sourceLineNo">1614</span>    HashMap&lt;HRegionInfo, RegionStateNode&gt; regions = null;<a name="line.1614"></a>
-<span class="sourceLineNo">1615</span><a name="line.1615"></a>
-<span class="sourceLineNo">1616</span>    assignQueueLock.lock();<a name="line.1616"></a>
-<span class="sourceLineNo">1617</span>    try {<a name="line.1617"></a>
-<span class="sourceLineNo">1618</span>      if (pendingAssignQueue.isEmpty() &amp;&amp; isRunning()) {<a name="line.1618"></a>
-<span class="sourceLineNo">1619</span>        assignQueueFullCond.await();<a name="line.1619"></a>
-<span class="sourceLineNo">1620</span>      }<a name="line.1620"></a>
-<span class="sourceLineNo">1621</span><a name="line.1621"></a>
-<span class="sourceLineNo">1622</span>      if (!isRunning()) return null;<a name="line.1622"></a>
-<span class="sourceLineNo">1623</span>      assignQueueFullCond.await(assignDispatchWaitMillis, TimeUnit.MILLISECONDS);<a name="line.1623"></a>
-<span class="sourceLineNo">1624</span>      regions = new HashMap&lt;HRegionInfo, RegionStateNode&gt;(pendingAssignQueue.size());<a name="line.1624"></a>
-<span class="sourceLineNo">1625</span>      for (RegionStateNode regionNode: pendingAssignQueue) {<a name="line.1625"></a>
-<span class="sourceLineNo">1626</span>        regions.put(regionNode.getRegionInfo(), regionNode);<a name="line.1626"></a>
-<span class="sourceLineNo">1627</span>      }<a name="line.1627"></a>
-<span class="sourceLineNo">1628</span>      pendingAssignQueue.clear();<a name="line.1628"></a>
-<span class="sourceLineNo">1629</span>    } catch (InterruptedException e) {<a name="line.1629"></a>
-<span class="sourceLineNo">1630</span>      LOG.warn("got interrupted ", e);<a name="line.1630"></a>
-<span class="sourceLineNo">1631</span>      Thread.currentThread().interrupt();<a name="line.1631"></a>
-<span class="sourceLineNo">1632</span>    } finally {<a name="line.1632"></a>
-<span class="sourceLineNo">1633</span>      assignQueueLock.unlock();<a name="line.1633"></a>
-<span class="sourceLineNo">1634</span>    }<a name="line.1634"></a>
-<span class="sourceLineNo">1635</span>    return regions;<a name="line.1635"></a>
-<span class="sourceLineNo">1636</span>  }<a name="line.1636"></a>
-<span class="sourceLineNo">1637</span><a name="line.1637"></a>
-<span class="sourceLineNo">1638</span>  private void processAssignQueue() {<a name="line.1638"></a>
-<span class="sourceLineNo">1639</span>    final HashMap&lt;HRegionInfo, RegionStateNode&gt; regions = waitOnAssignQueue();<a name="line.1639"></a>
-<span class="sourceLineNo">1640</span>    if (regions == null || regions.size() == 0 || !isRunning()) {<a name="line.1640"></a>
-<span class="sourceLineNo">1641</span>      return;<a name="line.1641"></a>
-<span class="sourceLineNo">1642</span>    }<a name="line.1642"></a>
-<span class="sourceLineNo">1643</span><a name="line.1643"></a>
-<span class="sourceLineNo">1644</span>    if (LOG.isTraceEnabled()) {<a name="line.1644"></a>
-<span class="sourceLineNo">1645</span>      LOG.trace("PROCESS ASSIGN QUEUE regionCount=" + regions.size());<a name="line.1645"></a>
-<span class="sourceLineNo">1646</span>    }<a name="line.1646"></a>
-<span class="sourceLineNo">1647</span><a name="line.1647"></a>
-<span class="sourceLineNo">1648</span>    // TODO: Optimize balancer. pass a RegionPlan?<a name="line.1648"></a>
-<span class="sourceLineNo">1649</span>    final HashMap&lt;HRegionInfo, ServerName&gt; retainMap = new HashMap&lt;HRegionInfo, ServerName&gt;();<a name="line.1649"></a>
-<span class="sourceLineNo">1650</span>    final List&lt;HRegionInfo&gt; rrList = new ArrayList&lt;HRegionInfo&gt;();<a name="line.1650"></a>
-<span class="sourceLineNo">1651</span>    for (RegionStateNode regionNode: regions.values()) {<a name="line.1651"></a>
-<span class="sourceLineNo">1652</span>      if (regionNode.getRegionLocation() != null) {<a name="line.1652"></a>
-<span class="sourceLineNo">1653</span>        retainMap.put(regionNode.getRegionInfo(), regionNode.getRegionLocation());<a name="line.1653"></a>
-<span class="sourceLineNo">1654</span>      } else {<a name="line.1654"></a>
-<span class="sourceLineNo">1655</span>        rrList.add(regionNode.getRegionInfo());<a name="line.1655"></a>
-<span class="sourceLineNo">1656</span>      }<a name="line.1656"></a>
-<span class="sourceLineNo">1657</span>    }<a name="line.1657"></a>
-<span class="sourceLineNo">1658</span><a name="line.1658"></a>
-<span class="sourceLineNo">1659</span>    // TODO: connect with the listener to invalidate the cache<a name="line.1659"></a>
-<span class="sourceLineNo">1660</span>    final LoadBalancer balancer = getBalancer();<a name="line.1660"></a>
-<span class="sourceLineNo">1661</span><a name="line.1661"></a>
-<span class="sourceLineNo">1662</span>    // TODO use events<a name="line.1662"></a>
-<span class="sourceLineNo">1663</span>    List&lt;ServerName&gt; servers = master.getServerManager().createDestinationServersList();<a name="line.1663"></a>
-<span class="sourceLineNo">1664</span>    for (int i = 0; servers.size() &lt; 1; ++i) {<a name="line.1664"></a>
-<span class="sourceLineNo">1665</span>      if (i % 4 == 0) {<a name="line.1665"></a>
-<span class="sourceLineNo">1666</span>        LOG.warn("no server available, unable to find a location for " + regions.size() +<a name="line.1666"></a>
-<span class="sourceLineNo">1667</span>            " unassigned regions. waiting");<a name="line.1667"></a>
-<span class="sourceLineNo">1668</span>      }<a name="line.1668"></a>
-<span class="sourceLineNo">1669</span><a name="line.1669"></a>
-<span class="sourceLineNo">1670</span>      // the was AM killed<a name="line.1670"></a>
-<span class="sourceLineNo">1671</span>      if (!isRunning()) {<a name="line.1671"></a>
-<span class="sourceLineNo">1672</span>        LOG.debug("aborting assignment-queue with " + regions.size() + " not assigned");<a name="line.1672"></a>
-<span class="sourceLineNo">1673</span>        return;<a name="line.1673"></a>
-<span class="sourceLineNo">1674</span>      }<a name="line.1674"></a>
-<span class="sourceLineNo">1675</span><a name="line.1675"></a>
-<span class="sourceLineNo">1676</span>      Threads.sleep(250);<a name="line.1676"></a>
-<span class="sourceLineNo">1677</span>      servers = master.getServerManager().createDestinationServersList();<a name="line.1677"></a>
-<span class="sourceLineNo">1678</span>    }<a name="line.1678"></a>
-<span class="sourceLineNo">1679</span><a name="line.1679"></a>
-<span class="sourceLineNo">1680</span>    final boolean isTraceEnabled = LOG.isTraceEnabled();<a name="line.1680"></a>
-<span class="sourceLineNo">1681</span>    if (isTraceEnabled) {<a name="line.1681"></a>
-<span class="sourceLineNo">1682</span>      LOG.trace("available servers count=" + servers.size() + ": " + servers);<a name="line.1682"></a>
-<span class="sourceLineNo">1683</span>    }<a name="line.1683"></a>
-<span class="sourceLineNo">1684</span><a name="line.1684"></a>
-<span class="sourceLineNo">1685</span>    // ask the balancer where to place regions<a name="line.1685"></a>
-<span class="sourceLineNo">1686</span>    if (!retainMap.isEmpty()) {<a name="line.1686"></a>
-<span class="sourceLineNo">1687</span>      if (isTraceEnabled) {<a name="line.1687"></a>
-<span class="sourceLineNo">1688</span>        LOG.trace("retain assign regions=" + retainMap);<a name="line.1688"></a>
-<span class="sourceLineNo">1689</span>      }<a name="line.1689"></a>
-<span class="sourceLineNo">1690</span>      try {<a name="line.1690"></a>
-<span class="sourceLineNo">1691</span>        acceptPlan(regions, balancer.retainAssignment(retainMap, servers));<a name="line.1691"></a>
-<span class="sourceLineNo">1692</span>      } catch (HBaseIOException e) {<a name="line.1692"></a>
-<span class="sourceLineNo">1693</span>        LOG.warn("unable to retain assignment", e);<a name="line.1693"></a>
-<span class="sourceLineNo">1694</span>        addToPendingAssignment(regions, retainMap.keySet());<a name="line.1694"></a>
-<span class="sourceLineNo">1695</span>      }<a name="line.1695"></a>
-<span class="sourceLineNo">1696</span>    }<a name="line.1696"></a>
-<span class="sourceLineNo">1697</span><a name="line.1697"></a>
-<span class="sourceLineNo">1698</span>    // TODO: Do we need to split retain and round-robin?<a name="line.1698"></a>
-<span class="sourceLineNo">1699</span>    // the retain seems to fallback to round-robin/random if the region is not in the map.<a name="line.1699"></a>
-<span class="sourceLineNo">1700</span>    if (!rrList.isEmpty()) {<a name="line.1700"></a>
-<span class="sourceLineNo">1701</span>      Collections.sort(rrList);<a name="line.1701"></a>
-<span class="sourceLineNo">1702</span>      if (isTraceEnabled) {<a name="line.1702"></a>
-<span class="sourceLineNo">1703</span>        LOG.trace("round robin regions=" + rrList);<a name="line.1703"></a>
-<span class="sourceLineNo">1704</span>      }<a name="line.1704"></a>
-<span class="sourceLineNo">1705</span>      try {<a name="line.1705"></a>
-<span class="sourceLineNo">1706</span>        acceptPlan(regions, balancer.roundRobinAssignment(rrList, servers));<a name="line.1706"></a>
-<span class="sourceLineNo">1707</span>      } catch (HBaseIOException e) {<a name="line.1707"></a>
-<span class="sourceLineNo">1708</span>        LOG.warn("unable to round-robin assignment", e);<a name="line.1708"></a>
-<span class="sourceLineNo">1709</span>        addToPendingAssignment(regions, rrList);<a name="line.1709"></a>
-<span class="sourceLineNo">1710</span>      }<a name="line.1710"></a>
-<span class="sourceLineNo">1711</span>    }<a name="line.1711"></a>
-<span class="sourceLineNo">1712</span>  }<a name="line.1712"></a>
-<span class="sourceLineNo">1713</span><a name="line.1713"></a>
-<span class="sourceLineNo">1714</span>  private void acceptPlan(final HashMap&lt;HRegionInfo, RegionStateNode&gt; regions,<a name="line.1714"></a>
-<span class="sourceLineNo">1715</span>      final Map&lt;ServerName, List&lt;HRegionInfo&gt;&gt; plan) throws HBaseIOException {<a name="line.1715"></a>
-<span class="sourceLineNo">1716</span>    final ProcedureEvent[] events = new ProcedureEvent[regions.size()];<a name="line.1716"></a>
-<span class="sourceLineNo">1717</span>    final long st = System.currentTimeMillis();<a name="line.1717"></a>
-<span class="sourceLineNo">1718</span><a name="line.1718"></a>
-<span class="sourceLineNo">1719</span>    if (plan == null) {<a name="line.1719"></a>
-<span class="sourceLineNo">1720</span>      throw new HBaseIOException("unable to compute plans for regions=" + regions.size());<a name="line.1720"></a>
-<span class="sourceLineNo">1721</span>    }<a name="line.1721"></a>
-<span class="sourceLineNo">1722</span><a name="line.1722"></a>
-<span class="sourceLineNo">1723</span>    if (plan.isEmpty()) return;<a name="line.1723"></a>
+<span class="sourceLineNo">1551</span>  //  Assign Queue (Assign/Balance)<a name="line.1551"></a>
+<span class="sourceLineNo">1552</span>  // ============================================================================================<a name="line.1552"></a>
+<span class="sourceLineNo">1553</span>  private final ArrayList&lt;RegionStateNode&gt; pendingAssignQueue = new ArrayList&lt;RegionStateNode&gt;();<a name="line.1553"></a>
+<span class="sourceLineNo">1554</span>  private final ReentrantLock assignQueueLock = new ReentrantLock();<a name="line.1554"></a>
+<span class="sourceLineNo">1555</span>  private final Condition assignQueueFullCond = assignQueueLock.newCondition();<a name="line.1555"></a>
+<span class="sourceLineNo">1556</span><a name="line.1556"></a>
+<span class="sourceLineNo">1557</span>  /**<a name="line.1557"></a>
+<span class="sourceLineNo">1558</span>   * Add the assign operation to the assignment queue.<a name="line.1558"></a>
+<span class="sourceLineNo">1559</span>   * The pending assignment operation will be processed,<a name="line.1559"></a>
+<span class="sourceLineNo">1560</span>   * and each region will be assigned by a server using the balancer.<a name="line.1560"></a>
+<span class="sourceLineNo">1561</span>   */<a name="line.1561"></a>
+<span class="sourceLineNo">1562</span>  protected void queueAssign(final RegionStateNode regionNode) {<a name="line.1562"></a>
+<span class="sourceLineNo">1563</span>    getProcedureScheduler().suspendEvent(regionNode.getProcedureEvent());<a name="line.1563"></a>
+<span class="sourceLineNo">1564</span><a name="line.1564"></a>
+<span class="sourceLineNo">1565</span>    // TODO: quick-start for meta and the other sys-tables?<a name="line.1565"></a>
+<span class="sourceLineNo">1566</span>    assignQueueLock.lock();<a name="line.1566"></a>
+<span class="sourceLineNo">1567</span>    try {<a name="line.1567"></a>
+<span class="sourceLineNo">1568</span>      pendingAssignQueue.add(regionNode);<a name="line.1568"></a>
+<span class="sourceLineNo">1569</span>      if (regionNode.isSystemTable() ||<a name="line.1569"></a>
+<span class="sourceLineNo">1570</span>          pendingAssignQueue.size() == 1 ||<a name="line.1570"></a>
+<span class="sourceLineNo">1571</span>          pendingAssignQueue.size() &gt;= assignDispatchWaitQueueMaxSize) {<a name="line.1571"></a>
+<span class="sourceLineNo">1572</span>        assignQueueFullCond.signal();<a name="line.1572"></a>
+<span class="sourceLineNo">1573</span>      }<a name="line.1573"></a>
+<span class="sourceLineNo">1574</span>    } finally {<a name="line.1574"></a>
+<span class="sourceLineNo">1575</span>      assignQueueLock.unlock();<a name="line.1575"></a>
+<span class="sourceLineNo">1576</span>    }<a name="line.1576"></a>
+<span class="sourceLineNo">1577</span>  }<a name="line.1577"></a>
+<span class="sourceLineNo">1578</span><a name="line.1578"></a>
+<span class="sourceLineNo">1579</span>  private void startAssignmentThread() {<a name="line.1579"></a>
+<span class="sourceLineNo">1580</span>    assignThread = new Thread("AssignmentThread") {<a name="line.1580"></a>
+<span class="sourceLineNo">1581</span>      @Override<a name="line.1581"></a>
+<span class="sourceLineNo">1582</span>      public void run() {<a name="line.1582"></a>
+<span class="sourceLineNo">1583</span>        while (isRunning()) {<a name="line.1583"></a>
+<span class="sourceLineNo">1584</span>          processAssignQueue();<a name="line.1584"></a>
+<span class="sourceLineNo">1585</span>        }<a name="line.1585"></a>
+<span class="sourceLineNo">1586</span>        pendingAssignQueue.clear();<a name="line.1586"></a>
+<span class="sourceLineNo">1587</span>      }<a name="line.1587"></a>
+<span class="sourceLineNo">1588</span>    };<a name="line.1588"></a>
+<span class="sourceLineNo">1589</span>    assignThread.start();<a name="line.1589"></a>
+<span class="sourceLineNo">1590</span>  }<a name="line.1590"></a>
+<span class="sourceLineNo">1591</span><a name="line.1591"></a>
+<span class="sourceLineNo">1592</span>  private void stopAssignmentThread() {<a name="line.1592"></a>
+<span class="sourceLineNo">1593</span>    assignQueueSignal();<a name="line.1593"></a>
+<span class="sourceLineNo">1594</span>    try {<a name="line.1594"></a>
+<span class="sourceLineNo">1595</span>      while (assignThread.isAlive()) {<a name="line.1595"></a>
+<span class="sourceLineNo">1596</span>        assignQueueSignal();<a name="line.1596"></a>
+<span class="sourceLineNo">1597</span>        assignThread.join(250);<a name="line.1597"></a>
+<span class="sourceLineNo">1598</span>      }<a name="line.1598"></a>
+<span class="sourceLineNo">1599</span>    } catch (InterruptedException e) {<a name="line.1599"></a>
+<span class="sourceLineNo">1600</span>      LOG.warn("join interrupted", e);<a name="line.1600"></a>
+<span class="sourceLineNo">1601</span>      Thread.currentThread().interrupt();<a name="line.1601"></a>
+<span class="sourceLineNo">1602</span>    }<a name="line.1602"></a>
+<span class="sourceLineNo">1603</span>  }<a name="line.1603"></a>
+<span class="sourceLineNo">1604</span><a name="line.1604"></a>
+<span class="sourceLineNo">1605</span>  private void assignQueueSignal() {<a name="line.1605"></a>
+<span class="sourceLineNo">1606</span>    assignQueueLock.lock();<a name="line.1606"></a>
+<span class="sourceLineNo">1607</span>    try {<a name="line.1607"></a>
+<span class="sourceLineNo">1608</span>      assignQueueFullCond.signal();<a name="line.1608"></a>
+<span class="sourceLineNo">1609</span>    } finally {<a name="line.1609"></a>
+<span class="sourceLineNo">1610</span>      assignQueueLock.unlock();<a name="line.1610"></a>
+<span class="sourceLineNo">1611</span>    }<a name="line.1611"></a>
+<span class="sourceLineNo">1612</span>  }<a name="line.1612"></a>
+<span class="sourceLineNo">1613</span><a name="line.1613"></a>
+<span class="sourceLineNo">1614</span>  @edu.umd.cs.findbugs.annotations.SuppressWarnings("WA_AWAIT_NOT_IN_LOOP")<a name="line.1614"></a>
+<span class="sourceLineNo">1615</span>  private HashMap&lt;HRegionInfo, RegionStateNode&gt; waitOnAssignQueue() {<a name="line.1615"></a>
+<span class="sourceLineNo">1616</span>    HashMap&lt;HRegionInfo, RegionStateNode&gt; regions = null;<a name="line.1616"></a>
+<span class="sourceLineNo">1617</span><a name="line.1617"></a>
+<span class="sourceLineNo">1618</span>    assignQueueLock.lock();<a name="line.1618"></a>
+<span class="sourceLineNo">1619</span>    try {<a name="line.1619"></a>
+<span class="sourceLineNo">1620</span>      if (pendingAssignQueue.isEmpty() &amp;&amp; isRunning()) {<a name="line.1620"></a>
+<span class="sourceLineNo">1621</span>        assignQueueFullCond.await();<a name="line.1621"></a>
+<span class="sourceLineNo">1622</span>      }<a name="line.1622"></a>
+<span class="sourceLineNo">1623</span><a name="line.1623"></a>
+<span class="sourceLineNo">1624</span>      if (!isRunning()) return null;<a name="line.1624"></a>
+<span class="sourceLineNo">1625</span>      assignQueueFullCond.await(assignDispatchWaitMillis, TimeUnit.MILLISECONDS);<a name="line.1625"></a>
+<span class="sourceLineNo">1626</span>      regions = new HashMap&lt;HRegionInfo, RegionStateNode&gt;(pendingAssignQueue.size());<a name="line.1626"></a>
+<span class="sourceLineNo">1627</span>      for (RegionStateNode regionNode: pendingAssignQueue) {<a name="line.1627"></a>
+<span class="sourceLineNo">1628</span>        regions.put(regionNode.getRegionInfo(), regionNode);<a name="line.1628"></a>
+<span class="sourceLineNo">1629</span>      }<a name="line.1629"></a>
+<span class="sourceLineNo">1630</span>      pendingAssignQueue.clear();<a name="line.1630"></a>
+<span class="sourceLineNo">1631</span>    } catch (InterruptedException e) {<a name="line.1631"></a>
+<span class="sourceLineNo">1632</span>      LOG.warn("got interrupted ", e);<a name="line.1632"></a>
+<span class="sourceLineNo">1633</span>      Thread.currentThread().interrupt();<a name="line.1633"></a>
+<span class="sourceLineNo">1634</span>    } finally {<a name="line.1634"></a>
+<span class="sourceLineNo">1635</span>      assignQueueLock.unlock();<a name="line.1635"></a>
+<span class="sourceLineNo">1636</span>    }<a name="line.1636"></a>
+<span class="sourceLineNo">1637</span>    return regions;<a name="line.1637"></a>
+<span class="sourceLineNo">1638</span>  }<a name="line.1638"></a>
+<span class="sourceLineNo">1639</span><a name="line.1639"></a>
+<span class="sourceLineNo">1640</span>  private void processAssignQueue() {<a name="line.1640"></a>
+<span class="sourceLineNo">1641</span>    final HashMap&lt;HRegionInfo, RegionStateNode&gt; regions = waitOnAssignQueue();<a name="line.1641"></a>
+<span class="sourceLineNo">1642</span>    if (regions == null || regions.size() == 0 || !isRunning()) {<a name="line.1642"></a>
+<span class="sourceLineNo">1643</span>      return;<a name="line.1643"></a>
+<span class="sourceLineNo">1644</span>    }<a name="line.1644"></a>
+<span class="sourceLineNo">1645</span><a name="line.1645"></a>
+<span class="sourceLineNo">1646</span>    if (LOG.isTraceEnabled()) {<a name="line.1646"></a>
+<span class="sourceLineNo">1647</span>      LOG.trace("PROCESS ASSIGN QUEUE regionCount=" + regions.size());<a name="line.1647"></a>
+<span class="sourceLineNo">1648</span>    }<a name="line.1648"></a>
+<span class="sourceLineNo">1649</span><a name="line.1649"></a>
+<span class="sourceLineNo">1650</span>    // TODO: Optimize balancer. pass a RegionPlan?<a name="line.1650"></a>
+<span class="sourceLineNo">1651</span>    final HashMap&lt;HRegionInfo, ServerName&gt; retainMap = new HashMap&lt;HRegionInfo, ServerName&gt;();<a name="line.1651"></a>
+<span class="sourceLineNo">1652</span>    final List&lt;HRegionInfo&gt; rrList = new ArrayList&lt;HRegionInfo&gt;();<a name="line.1652"></a>
+<span class="sourceLineNo">1653</span>    for (RegionStateNode regionNode: regions.values()) {<a name="line.1653"></a>
+<span class="sourceLineNo">1654</span>      if (regionNode.getRegionLocation() != null) {<a name="line.1654"></a>
+<span class="sourceLineNo">1655</span>        retainMap.put(regionNode.getRegionInfo(), regionNode.getRegionLocation());<a name="line.1655"></a>
+<span class="sourceLineNo">1656</span>      } else {<a name="line.1656"></a>
+<span class="sourceLineNo">1657</span>        rrList.add(regionNode.getRegionInfo());<a name="line.1657"></a>
+<span class="sourceLineNo">1658</span>      }<a name="line.1658"></a>
+<span class="sourceLineNo">1659</span>    }<a name="line.1659"></a>
+<span class="sourceLineNo">1660</span><a name="line.1660"></a>
+<span class="sourceLineNo">1661</span>    // TODO: connect with the listener to invalidate the cache<a name="line.1661"></a>
+<span class="sourceLineNo">1662</span>    final LoadBalancer balancer = getBalancer();<a name="line.1662"></a>
+<span class="sourceLineNo">1663</span><a name="line.1663"></a>
+<span class="sourceLineNo">1664</span>    // TODO use events<a name="line.1664"></a>
+<span class="sourceLineNo">1665</span>    List&lt;ServerName&gt; servers = master.getServerManager().createDestinationServersList();<a name="line.1665"></a>
+<span class="sourceLineNo">1666</span>    for (int i = 0; servers.size() &lt; 1; ++i) {<a name="line.1666"></a>
+<span class="sourceLineNo">1667</span>      if (i % 4 == 0) {<a name="line.1667"></a>
+<span class="sourceLineNo">1668</span>        LOG.warn("no server available, unable to find a location for " + regions.size() +<a name="line.1668"></a>
+<span class="sourceLineNo">1669</span>            " unassigned regions. waiting");<a name="line.1669"></a>
+<span class="sourceLineNo">1670</span>      }<a name="line.1670"></a>
+<span class="sourceLineNo">1671</span><a name="line.1671"></a>
+<span class="sourceLineNo">1672</span>      // the was AM killed<a name="line.1672"></a>
+<span class="sourceLineNo">1673</span>      if (!isRunning()) {<a name="line.1673"></a>
+<span class="sourceLineNo">1674</span>        LOG.debug("aborting assignment-queue with " + regions.size() + " not assigned");<a name="line.1674"></a>
+<span class="sourceLineNo">1675</span>        return;<a name="line.1675"></a>
+<span class="sourceLineNo">1676</span>      }<a name="line.1676"></a>
+<span class="sourceLineNo">1677</span><a name="line.1677"></a>
+<span class="sourceLineNo">1678</span>      Threads.sleep(250);<a name="line.1678"></a>
+<span class="sourceLineNo">1679</span>      servers = master.getServerManager().createDestinationServersList();<a name="line.1679"></a>
+<span class="sourceLineNo">1680</span>    }<a name="line.1680"></a>
+<span class="sourceLineNo">1681</span><a name="line.1681"></a>
+<span class="sourceLineNo">1682</span>    final boolean isTraceEnabled = LOG.isTraceEnabled();<a name="line.1682"></a>
+<span class="sourceLineNo">1683</span>    if (isTraceEnabled) {<a name="line.1683"></a>
+<span class="sourceLineNo">1684</span>      LOG.trace("available servers count=" + servers.size() + ": " + servers);<a name="line.1684"></a>
+<span class="sourceLineNo">1685</span>    }<a name="line.1685"></a>
+<span class="sourceLineNo">1686</span><a name="line.1686"></a>
+<span class="sourceLineNo">1687</span>    // ask the balancer where to place regions<a name="line.1687"></a>
+<span class="sourceLineNo">1688</span>    if (!retainMap.isEmpty()) {<a name="line.1688"></a>
+<span class="sourceLineNo">1689</span>      if (isTraceEnabled) {<a name="line.1689"></a>
+<span class="sourceLineNo">1690</span>        LOG.trace("retain assign regions=" + retainMap);<a name="line.1690"></a>
+<span class="sourceLineNo">1691</span>      }<a name="line.1691"></a>
+<span class="sourceLineNo">1692</span>      try {<a name="line.1692"></a>
+<span class="sourceLineNo">1693</span>        acceptPlan(regions, balancer.retainAssignment(retainMap, servers));<a name="line.1693"></a>
+<span class="sourceLineNo">1694</span>      } catch (HBaseIOException e) {<a name="line.1694"></a>
+<span class="sourceLineNo">1695</span>        LOG.warn("unable to retain assignment", e);<a name="line.1695"></a>
+<span class="sourceLineNo">1696</span>        addToPendingAssignment(regions, retainMap.keySet());<a name="line.1696"></a>
+<span class="sourceLineNo">1697</span>      }<a name="line.1697"></a>
+<span class="sourceLineNo">1698</span>    }<a name="line.1698"></a>
+<span class="sourceLineNo">1699</span><a name="line.1699"></a>
+<span class="sourceLineNo">1700</span>    // TODO: Do we need to split retain and round-robin?<a name="line.1700"></a>
+<span class="sourceLineNo">1701</span>    // the retain seems to fallback to round-robin/random if the region is not in the map.<a name="line.1701"></a>
+<span class="sourceLineNo">1702</span>    if (!rrList.isEmpty()) {<a name="line.1702"></a>
+<span class="sourceLineNo">1703</span>      Collections.sort(rrList);<a name="line.1703"></a>
+<span class="sourceLineNo">1704</span>      if (isTraceEnabled) {<a name="line.1704"></a>
+<span class="sourceLineNo">1705</span>        LOG.trace("round robin regions=" + rrList);<a name="line.1705"></a>
+<span class="sourceLineNo">1706</span>      }<a name="line.1706"></a>
+<span class="sourceLineNo">1707</span>      try {<a name="line.1707"></a>
+<span class="sourceLineNo">1708</span>        acceptPlan(regions, balancer.roundRobinAssignment(rrList, servers));<a name="line.1708"></a>
+<span class="sourceLineNo">1709</span>      } catch (HBaseIOException e) {<a name="line.1709"></a>
+<span class="sourceLineNo">1710</span>        LOG.warn("unable to round-robin assignment", e);<a name="line.1710"></a>
+<span class="sourceLineNo">1711</span>        addToPendingAssignment(regions, rrList);<a name="line.1711"></a>
+<span class="sourceLineNo">1712</span>      }<a name="line.1712"></a>
+<span class="sourceLineNo">1713</span>    }<a name="line.1713"></a>
+<span class="sourceLineNo">1714</span>  }<a name="line.1714"></a>
+<span class="sourceLineNo">1715</span><a name="line.1715"></a>
+<span class="sourceLineNo">1716</span>  private void acceptPlan(final HashMap&lt;HRegionInfo, RegionStateNode&gt; regions,<a name="line.1716"></a>
+<span class="sourceLineNo">1717</span>      final Map&lt;ServerName, List&lt;HRegionInfo&gt;&gt; plan) throws HBaseIOException {<a name="line.1717"></a>
+<span class="sourceLineNo">1718</span>    final ProcedureEvent[] events = new ProcedureEvent[regions.size()];<a name="line.1718"></a>
+<span class="sourceLineNo">1719</span>    final long st = System.currentTimeMillis();<a name="line.1719"></a>
+<span class="sourceLineNo">1720</span><a name="line.1720"></a>
+<span class="sourceLineNo">1721</span>    if (plan == null) {<a name="line.1721"></a>
+<span class="sourceLineNo">1722</span>      throw new HBaseIOException("unable to compute plans for regions=" + regions.size());<a name="line.1722"></a>
+<span class="sourceLineNo">1723</span>    }<a name="line.1723"></a>
 <span class="sourceLineNo">1724</span><a name="line.1724"></a>
-<span class="sourceLineNo">1725</span>    int evcount = 0;<a name="line.1725"></a>
-<span class="sourceLineNo">1726</span>    for (Map.Entry&lt;ServerName, List&lt;HRegionInfo&gt;&gt; entry: plan.entrySet()) {<a name="line.1726"></a>
-<span class="sourceLineNo">1727</span>      final ServerName server = entry.getKey();<a name="line.1727"></a>
-<span class="sourceLineNo">1728</span>      for (HRegionInfo hri: entry.getValue()) {<a name="line.1728"></a>
-<span class="sourceLineNo">1729</span>        final RegionStateNode regionNode = regions.get(hri);<a name="line.1729"></a>
-<span class="sourceLineNo">1730</span>        regionNode.setRegionLocation(server);<a name="line.1730"></a>
-<span class="sourceLineNo">1731</span>        events[evcount++] = regionNode.getProcedureEvent();<a name="line.1731"></a>
-<span class="sourceLineNo">1732</span>      }<a name="line.1732"></a>
-<span class="sourceLineNo">1733</span>    }<a name="line.1733"></a>
-<span class="sourceLineNo">1734</span>    getProcedureScheduler().wakeEvents(evcount, events);<a name="line.1734"></a>
-<span class="sourceLineNo">1735</span><a name="line.1735"></a>
-<span class="sourceLineNo">1736</span>    final long et = System.currentTimeMillis();<a name="line.1736"></a>
-<span class="sourceLineNo">1737</span>    if (LOG.isTraceEnabled()) {<a name="line.1737"></a>
-<span class="sourceLineNo">1738</span>      LOG.trace("ASSIGN ACCEPT " + events.length + " -&gt; " +<a name="line.1738"></a>
-<span class="sourceLineNo">1739</span>          StringUtils.humanTimeDiff(et - st));<a name="line.1739"></a>
-<span class="sourceLineNo">1740</span>    }<a name="line.1740"></a>
-<span class="sourceLineNo">1741</span>  }<a name="line.1741"></a>
-<span class="sourceLineNo">1742</span><a name="line.1742"></a>
-<span class="sourceLineNo">1743</span>  private void addToPendingAssignment(final HashMap&lt;HRegionInfo, RegionStateNode&gt; regions,<a name="line.1743"></a>
-<span class="sourceLineNo">1744</span>      final Collection&lt;HRegionInfo&gt; pendingRegions) {<a name="line.1744"></a>
-<span class="sourceLineNo">1745</span>    assignQueueLock.lock();<a name="line.1745"></a>
-<span class="sourceLineNo">1746</span>    try {<a name="line.1746"></a>
-<span class="sourceLineNo">1747</span>      for (HRegionInfo hri: pendingRegions) {<a name="line.1747"></a>
-<span class="sourceLineNo">1748</span>        pendingAssignQueue.add(regions.get(hri));<a name="line.1748"></a>
-<span class="sourceLineNo">1749</span>      }<a name="line.1749"></a>
-<span class="sourceLineNo">1750</span>    } finally {<a name="line.1750"></a>
-<span class="sourceLineNo">1751</span>      assignQueueLock.unlock();<a name="line.1751"></a>
-<span class="sourceLineNo">1752</span>    }<a name="line.1752"></a>
-<span class="sourceLineNo">1753</span>  }<a name="line.1753"></a>
-<span class="sourceLineNo">1754</span><a name="line.1754"></a>
-<span class="sourceLineNo">1755</span>  /**<a name="line.1755"></a>
-<span class="sourceLineNo">1756</span>   * Get a list of servers that this region can not assign to.<a name="line.1756"></a>
-<span class="sourceLineNo">1757</span>   * For system table, we must assign them to a server with highest version.<a name="line.1757"></a>
-<span class="sourceLineNo">1758</span>   */<a name="line.1758"></a>
-<span class="sourceLineNo">1759</span>  public List&lt;ServerName&gt; getExcludedServersForSystemTable() {<a name="line.1759"></a>
-<span class="sourceLineNo">1760</span>    List&lt;Pair&lt;ServerName, String&gt;&gt; serverList = master.getServerManager().getOnlineServersList()<a name="line.1760"></a>
-<span class="sourceLineNo">1761</span>        .stream()<a name="line.1761"></a>
-<span class="sourceLineNo">1762</span>        .map((s)-&gt;new Pair&lt;&gt;(s, master.getRegionServerVersion(s)))<a name="line.1762"></a>
-<span class="sourceLineNo">1763</span>        .collect(Collectors.toList());<a name="line.1763"></a>
-<span class="sourceLineNo">1764</span>    if (serverList.isEmpty()) {<a name="line.1764"></a>
-<span class="sourceLineNo">1765</span>      return new ArrayList&lt;&gt;();<a name="line.1765"></a>
-<span class="sourceLineNo">1766</span>    }<a name="line.1766"></a>
-<span class="sourceLineNo">1767</span>    String highestVersion = Collections.max(serverList,<a name="line.1767"></a>
-<span class="sourceLineNo">1768</span>        (o1, o2) -&gt; VersionInfo.compareVersion(o1.getSecond(), o2.getSecond())).getSecond();<a name="line.1768"></a>
-<span class="sourceLineNo">1769</span>    return serverList.stream()<a name="line.1769"></a>
-<span class="sourceLineNo">1770</span>        .filter((p)-&gt;!p.getSecond().equals(highestVersion))<a name="line.1770"></a>
-<span class="sourceLineNo">1771</span>        .map(Pair::getFirst)<a name="line.1771"></a>
-<span class="sourceLineNo">1772</span>        .collect(Collectors.toList());<a name="line.1772"></a>
-<span class="sourceLineNo">1773</span>  }<a name="line.1773"></a>
-<span class="sourceLineNo">1774</span><a name="line.1774"></a>
-<span class="sourceLineNo">1775</span>  // ============================================================================================<a name="line.1775"></a>
-<span class="sourceLineNo">1776</span>  //  Server Helpers<a name="line.1776"></a>
+<span class="sourceLineNo">1725</span>    if (plan.isEmpty()) return;<a name="line.1725"></a>
+<span class="sourceLineNo">1726</span><a name="line.1726"></a>
+<span class="sourceLineNo">1727</span>    int evcount = 0;<a name="line.1727"></a>
+<span class="sourceLineNo">1728</span>    for (Map.Entry&lt;ServerName, List&lt;HRegionInfo&gt;&gt; entry: plan.entrySet()) {<a name="line.1728"></a>
+<span class="sourceLineNo">1729</span>      final ServerName server = entry.getKey();<a name="line.1729"></a>
+<span class="sourceLineNo">1730</span>      for (HRegionInfo hri: entry.getValue()) {<a name="line.1730"></a>
+<span class="sourceLineNo">1731</span>        final RegionStateNode regionNode = regions.get(hri);<a name="line.1731"></a>
+<span class="sourceLineNo">1732</span>        regionNode.setRegionLocation(server);<a name="line.1732"></a>
+<span class="sourceLineNo">1733</span>        events[evcount++] = regionNode.getProcedureEvent();<a name="line.1733"></a>
+<span class="sourceLineNo">1734</span>      }<a name="line.1734"></a>
+<span class="sourceLineNo">1735</span>    }<a name="line.1735"></a>
+<span class="sourceLineNo">1736</span>    getProcedureScheduler().wakeEvents(evcount, events);<a name="line.1736"></a>
+<span class="sourceLineNo">1737</span><a name="line.1737"></a>
+<span class="sourceLineNo">1738</span>    final long et = System.currentTimeMillis();<a name="line.1738"></a>
+<span class="sourceLineNo">1739</span>    if (LOG.isTraceEnabled()) {<a name="line.1739"></a>
+<span class="sourceLineNo">1740</span>      LOG.trace("ASSIGN ACCEPT " + events.length + " -&gt; " +<a name="line.1740"></a>
+<span class="sourceLineNo">1741</span>          StringUtils.humanTimeDiff(et - st));<a name="line.1741"></a>
+<span class="sourceLineNo">1742</span>    }<a name="line.1742"></a>
+<span class="sourceLineNo">1743</span>  }<a name="line.1743"></a>
+<span class="sourceLineNo">1744</span><a name="line.1744"></a>
+<span class="sourceLineNo">1745</span>  private void addToPendingAssignment(final HashMap&lt;HRegionInfo, RegionStateNode&gt; regions,<a name="line.1745"></a>
+<span class="sourceLineNo">1746</span>      final Collection&lt;HRegionInfo&gt; pendingRegions) {<a name="line.1746"></a>
+<span class="sourceLineNo">1747</span>    assignQueueLock.lock();<a name="line.1747"></a>
+<span class="sourceLineNo">1748</span>    try {<a name="line.1748"></a>
+<span class="sourceLineNo">1749</span>      for (HRegionInfo hri: pendingRegions) {<a name="line.1749"></a>
+<span class="sourceLineNo">1750</span>        pendingAssignQueue.add(regions.get(hri));<a name="line.1750"></a>
+<span class="sourceLineNo">1751</span>      }<a name="line.1751"></a>
+<span class="sourceLineNo">1752</span>    } finally {<a name="line.1752"></a>
+<span class="sourceLineNo">1753</span>      assignQueueLock.unlock();<a name="line.1753"></a>
+<span class="sourceLineNo">1754</span>    }<a name="line.1754"></a>
+<span class="sourceLineNo">1755</span>  }<a name="line.1755"></a>
+<span class="sourceLineNo">1756</span><a name="line.1756"></a>
+<span class="sourceLineNo">1757</span>  /**<a name="line.1757"></a>
+<span class="sourceLineNo">1758</span>   * Get a list of servers that this region can not assign to.<a name="line.1758"></a>
+<span class="sourceLineNo">1759</span>   * For system table, we must assign them to a server with highest version.<a name="line.1759"></a>
+<span class="sourceLineNo">1760</span>   */<a name="line.1760"></a>
+<span class="sourceLineNo">1761</span>  public List&lt;ServerName&gt; getExcludedServersForSystemTable() {<a name="line.1761"></a>
+<span class="sourceLineNo">1762</span>    List&lt;Pair&lt;ServerName, String&gt;&gt; serverList = master.getServerManager().getOnlineServersList()<a name="line.1762"></a>
+<span class="sourceLineNo">1763</span>        .stream()<a name="line.1763"></a>
+<span class="sourceLineNo">1764</span>        .map((s)-&gt;new Pair&lt;&gt;(s, master.getRegionServerVersion(s)))<a name="line.1764"></a>
+<span class="sourceLineNo">1765</span>        .collect(Collectors.toList());<a name="line.1765"></a>
+<span class="sourceLineNo">1766</span>    if (serverList.isEmpty()) {<a name="line.1766"></a>
+<span class="sourceLineNo">1767</span>      return new ArrayList&lt;&gt;();<a name="line.1767"></a>
+<span class="sourceLineNo">1768</span>    }<a name="line.1768"></a>
+<span class="sourceLineNo">1769</span>    String highestVersion = Collections.max(serverList,<a name="line.1769"></a>
+<span class="sourceLineNo">1770</span>        (o1, o2) -&gt; VersionInfo.compareVersion(o1.getSecond(), o2.getSecond())).getSecond();<a name="line.1770"></a>
+<span class="sourceLineNo">1771</span>    return serverList.stream()<a name="line.1771"></a>
+<span class="sourceLineNo">1772</span>        .filter((p)-&gt;!p.getSecond().equals(highestVersion))<a name="line.1772"></a>
+<span class="sourceLineNo">1773</span>        .map(Pair::getFirst)<a name="line.1773"></a>
+<span class="sourceLineNo">1774</span>        .collect(Collectors.toList());<a name="line.1774"></a>
+<span class="sourceLineNo">1775</span>  }<a name="line.1775"></a>
+<span class="sourceLineNo">1776</span><a name="line.1776"></a>
 <span class="sourceLineNo">1777</span>  // ============================================================================================<a name="line.1777"></a>
-<span class="sourceLineNo">1778</span>  @Override<a name="line.1778"></a>
-<span class="sourceLineNo">1779</span>  public void serverAdded(final ServerName serverName) {<a name="line.1779"></a>
-<span class="sourceLineNo">1780</span>  }<a name="line.1780"></a>
-<span class="sourceLineNo">1781</span><a name="line.1781"></a>
-<span class="sourceLineNo">1782</span>  @Override<a name="line.1782"></a>
-<span class="sourceLineNo">1783</span>  public void serverRemoved(final ServerName serverName) {<a name="line.1783"></a>
-<span class="sourceLineNo">1784</span>    final ServerStateNode serverNode = regionStates.getServerNode(serverName);<a name="line.1784"></a>
-<span class="sourceLineNo">1785</span>    if (serverNode == null) return;<a name="line.1785"></a>
-<span class="sourceLineNo">1786</span><a name="line.1786"></a>
-<span class="sourceLineNo">1787</span>    // just in case, wake procedures waiting for this server report<a name="line.1787"></a>
-<span class="sourceLineNo">1788</span>    wakeServerReportEvent(serverNode);<a name="line.1788"></a>
-<span class="sourceLineNo">1789</span>  }<a name="line.1789"></a>
-<span class="sourceLineNo">1790</span><a name="line.1790"></a>
-<span class="sourceLineNo">1791</span>  public int getServerVersion(final ServerName serverName) {<a name="line.1791"></a>
-<span class="sourceLineNo">1792</span>    final ServerStateNode node = regionStates.getServerNode(serverName);<a name="line.1792"></a>
-<span class="sourceLineNo">1793</span>    return node != null ? node.getVersionNumber() : 0;<a name="line.1793"></a>
-<span class="sourceLineNo">1794</span>  }<a name="line.1794"></a>
-<span class="sourceLineNo">1795</span><a name="line.1795"></a>
-<span class="sourceLineNo">1796</span>  public void killRegionServer(final ServerName serverName) {<a name="line.1796"></a>
-<span class="sourceLineNo">1797</span>    final ServerStateNode serverNode = regionStates.getServerNode(serverName);<a name="line.1797"></a>
-<span class="sourceLineNo">1798</span>    killRegionServer(serverNode);<a name="line.1798"></a>
-<span class="sourceLineNo">1799</span>  }<a name="line.1799"></a>
-<span class="sourceLineNo">1800</span><a name="line.1800"></a>
-<span class="sourceLineNo">1801</span>  public void killRegionServer(final ServerStateNode serverNode) {<a name="line.1801"></a>
-<span class="sourceLineNo">1802</span>    /** Don't do this. Messes up accounting. Let ServerCrashProcedure do this.<a name="line.1802"></a>
-<span class="sourceLineNo">1803</span>    for (RegionStateNode regionNode: serverNode.getRegions()) {<a name="line.1803"></a>
-<span class="sourceLineNo">1804</span>      regionNode.offline();<a name="line.1804"></a>
-<span class="sourceLineNo">1805</span>    }*/<a name="line.1805"></a>
-<span class="sourceLineNo">1806</span>    master.getServerManager().expireServer(serverNode.getServerName());<a name="line.1806"></a>
-<span class="sourceLineNo">1807</span>  }<a name="line.1807"></a>
-<span class="sourceLineNo">1808</span>}<a name="line.1808"></a>
+<span class="sourceLineNo">1778</span>  //  Server Helpers<a name="line.1778"></a>
+<span class="sourceLineNo">1779</span>  // ============================================================================================<a name="line.1779"></a>
+<span class="sourceLineNo">1780</span>  @Override<a name="line.1780"></a>
+<span class="sourceLineNo">1781</span>  public void serverAdded(final ServerName serverName) {<a name="line.1781"></a>
+<span class="sourceLineNo">1782</span>  }<a name="line.1782"></a>
+<span class="sourceLineNo">1783</span><a name="line.1783"></a>
+<span class="sourceLineNo">1784</span>  @Override<a name="line.1784"></a>
+<span class="sourceLineNo">1785</span>  public void serverRemoved(final ServerName serverName) {<a name="line.1785"></a>
+<span class="sourceLineNo">1786</span>    final ServerStateNode serverNode = regionStates.getServerNode(serverName);<a name="line.1786"></a>
+<span class="sourceLineNo">1787</span>    if (serverNode == null) return;<a name="line.1787"></a>
+<span class="sourceLineNo">1788</span><a name="line.1788"></a>
+<span class="sourceLineNo">1789</span>    // just in case, wake procedures waiting for this server report<a name="line.1789"></a>
+<span class="sourceLineNo">1790</span>    wakeServerReportEvent(serverNode);<a name="line.1790"></a>
+<span class="sourceLineNo">1791</span>  }<a name="line.1791"></a>
+<span class="sourceLineNo">1792</span><a name="line.1792"></a>
+<span class="sourceLineNo">1793</span>  public int getServerVersion(final ServerName serverName) {<a name="line.1793"></a>
+<span class="sourceLineNo">1794</span>    final ServerStateNode node = regionStates.getServerNode(serverName);<a name="line.1794"></a>
+<span class="sourceLineNo">1795</span>    return node != null ? node.getVersionNumber() : 0;<a name="line.1795"></a>
+<span class="sourceLineNo">1796</span>  }<a name="line.1796"></a>
+<span class="sourceLineNo">1797</span><a name="line.1797"></a>
+<span class="sourceLineNo">1798</span>  public void killRegionServer(final ServerName serverName) {<a name="line.1798"></a>
+<span class="sourceLineNo">1799</span>    final ServerStateNode serverNode = regionStates.getServerNode(serverName);<a name="line.1799"></a>
+<span class="sourceLineNo">1800</span>    killRegionServer(serverNode);<a name="line.1800"></a>
+<span class="sourceLineNo">1801</span>  }<a name="line.1801"></a>
+<span class="sourceLineNo">1802</span><a name="line.1802"></a>
+<span class="sourceLineNo">1803</span>  public void killRegionServer(final ServerStateNode serverNode) {<a name="line.1803"></a>
+<span class="sourceLineNo">1804</span>    /** Don't do this. Messes up accounting. Let ServerCrashProcedure do this.<a name="line.1804"></a>
+<span class="sourceLineNo">1805</span>    for (RegionStateNode regionNode: serverNode.getRegions()) {<a name="line.1805"></a>
+<span class="sourceLineNo">1806</span>      regionNode.offline();<a name="line.1806"></a>
+<span class="sourceLineNo">1807</span>    }*/<a name="line.1807"></a>
+<span class="sourceLineNo">1808</span>    master.getServerManager().expireServer(serverNode.getServerName());<a name="line.1808"></a>
+<span class="sourceLineNo">1809</span>  }<a name="line.1809"></a>
+<span class="sourceLineNo">1810</span>}<a name="line.1810"></a>
 
 
 


Mime
View raw message