hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject [10/51] [partial] hbase-site git commit: Published site at 88f775996b3b52d784ad13ab07515134619316ba.
Date Mon, 29 Feb 2016 19:08:19 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bdd1f3f0/devapidocs/src-html/org/apache/hadoop/hbase/client/ConnectionImplementation.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/client/ConnectionImplementation.html b/devapidocs/src-html/org/apache/hadoop/hbase/client/ConnectionImplementation.html
index 00013eb..a0f4a2d 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/client/ConnectionImplementation.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/client/ConnectionImplementation.html
@@ -1750,401 +1750,401 @@
 <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>      @Override<a name="line.1744"></a>
-<span class="sourceLineNo">1745</span>      public IsNormalizerEnabledResponse isNormalizerEnabled(RpcController controller,<a name="line.1745"></a>
-<span class="sourceLineNo">1746</span>          IsNormalizerEnabledRequest request) throws ServiceException {<a name="line.1746"></a>
-<span class="sourceLineNo">1747</span>        return stub.isNormalizerEnabled(controller, request);<a name="line.1747"></a>
-<span class="sourceLineNo">1748</span>      }<a name="line.1748"></a>
-<span class="sourceLineNo">1749</span><a name="line.1749"></a>
-<span class="sourceLineNo">1750</span>      @Override<a name="line.1750"></a>
-<span class="sourceLineNo">1751</span>      public SecurityCapabilitiesResponse getSecurityCapabilities(RpcController controller,<a name="line.1751"></a>
-<span class="sourceLineNo">1752</span>          SecurityCapabilitiesRequest request) throws ServiceException {<a name="line.1752"></a>
-<span class="sourceLineNo">1753</span>        return stub.getSecurityCapabilities(controller, request);<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">1745</span>      public MasterProtos.SetSplitOrMergeEnabledResponse setSplitOrMergeEnabled(<a name="line.1745"></a>
+<span class="sourceLineNo">1746</span>        RpcController controller, MasterProtos.SetSplitOrMergeEnabledRequest request)<a name="line.1746"></a>
+<span class="sourceLineNo">1747</span>        throws ServiceException {<a name="line.1747"></a>
+<span class="sourceLineNo">1748</span>        return stub.setSplitOrMergeEnabled(controller, request);<a name="line.1748"></a>
+<span class="sourceLineNo">1749</span>      }<a name="line.1749"></a>
+<span class="sourceLineNo">1750</span><a name="line.1750"></a>
+<span class="sourceLineNo">1751</span>      @Override<a name="line.1751"></a>
+<span class="sourceLineNo">1752</span>      public MasterProtos.IsSplitOrMergeEnabledResponse isSplitOrMergeEnabled(<a name="line.1752"></a>
+<span class="sourceLineNo">1753</span>        RpcController controller, MasterProtos.IsSplitOrMergeEnabledRequest request)<a name="line.1753"></a>
+<span class="sourceLineNo">1754</span>              throws ServiceException {<a name="line.1754"></a>
+<span class="sourceLineNo">1755</span>        return stub.isSplitOrMergeEnabled(controller, request);<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>  private static void release(MasterServiceState mss) {<a name="line.1758"></a>
-<span class="sourceLineNo">1759</span>    if (mss != null &amp;&amp; mss.connection != null) {<a name="line.1759"></a>
-<span class="sourceLineNo">1760</span>      ((ConnectionImplementation)mss.connection).releaseMaster(mss);<a name="line.1760"></a>
-<span class="sourceLineNo">1761</span>    }<a name="line.1761"></a>
-<span class="sourceLineNo">1762</span>  }<a name="line.1762"></a>
+<span class="sourceLineNo">1758</span>      @Override<a name="line.1758"></a>
+<span class="sourceLineNo">1759</span>      public IsNormalizerEnabledResponse isNormalizerEnabled(RpcController controller,<a name="line.1759"></a>
+<span class="sourceLineNo">1760</span>          IsNormalizerEnabledRequest request) throws ServiceException {<a name="line.1760"></a>
+<span class="sourceLineNo">1761</span>        return stub.isNormalizerEnabled(controller, request);<a name="line.1761"></a>
+<span class="sourceLineNo">1762</span>      }<a name="line.1762"></a>
 <span class="sourceLineNo">1763</span><a name="line.1763"></a>
-<span class="sourceLineNo">1764</span>  private boolean isKeepAliveMasterConnectedAndRunning(MasterServiceState mss) {<a name="line.1764"></a>
-<span class="sourceLineNo">1765</span>    if (mss.getStub() == null){<a name="line.1765"></a>
-<span class="sourceLineNo">1766</span>      return false;<a name="line.1766"></a>
-<span class="sourceLineNo">1767</span>    }<a name="line.1767"></a>
-<span class="sourceLineNo">1768</span>    try {<a name="line.1768"></a>
-<span class="sourceLineNo">1769</span>      return mss.isMasterRunning();<a name="line.1769"></a>
-<span class="sourceLineNo">1770</span>    } catch (UndeclaredThrowableException e) {<a name="line.1770"></a>
-<span class="sourceLineNo">1771</span>      // It's somehow messy, but we can receive exceptions such as<a name="line.1771"></a>
-<span class="sourceLineNo">1772</span>      //  java.net.ConnectException but they're not declared. So we catch it...<a name="line.1772"></a>
-<span class="sourceLineNo">1773</span>      LOG.info("Master connection is not running anymore", e.getUndeclaredThrowable());<a name="line.1773"></a>
-<span class="sourceLineNo">1774</span>      return false;<a name="line.1774"></a>
-<span class="sourceLineNo">1775</span>    } catch (ServiceException se) {<a name="line.1775"></a>
-<span class="sourceLineNo">1776</span>      LOG.warn("Checking master connection", se);<a name="line.1776"></a>
-<span class="sourceLineNo">1777</span>      return false;<a name="line.1777"></a>
-<span class="sourceLineNo">1778</span>    }<a name="line.1778"></a>
-<span class="sourceLineNo">1779</span>  }<a name="line.1779"></a>
-<span class="sourceLineNo">1780</span><a name="line.1780"></a>
-<span class="sourceLineNo">1781</span>  void releaseMaster(MasterServiceState mss) {<a name="line.1781"></a>
-<span class="sourceLineNo">1782</span>    if (mss.getStub() == null) return;<a name="line.1782"></a>
-<span class="sourceLineNo">1783</span>    synchronized (masterAndZKLock) {<a name="line.1783"></a>
-<span class="sourceLineNo">1784</span>      --mss.userCount;<a name="line.1784"></a>
-<span class="sourceLineNo">1785</span>    }<a name="line.1785"></a>
-<span class="sourceLineNo">1786</span>  }<a name="line.1786"></a>
-<span class="sourceLineNo">1787</span><a name="line.1787"></a>
-<span class="sourceLineNo">1788</span>  private void closeMasterService(MasterServiceState mss) {<a name="line.1788"></a>
-<span class="sourceLineNo">1789</span>    if (mss.getStub() != null) {<a name="line.1789"></a>
-<span class="sourceLineNo">1790</span>      LOG.info("Closing master protocol: " + mss);<a name="line.1790"></a>
-<span class="sourceLineNo">1791</span>      mss.clearStub();<a name="line.1791"></a>
+<span class="sourceLineNo">1764</span>      @Override<a name="line.1764"></a>
+<span class="sourceLineNo">1765</span>      public SecurityCapabilitiesResponse getSecurityCapabilities(RpcController controller,<a name="line.1765"></a>
+<span class="sourceLineNo">1766</span>          SecurityCapabilitiesRequest request) throws ServiceException {<a name="line.1766"></a>
+<span class="sourceLineNo">1767</span>        return stub.getSecurityCapabilities(controller, request);<a name="line.1767"></a>
+<span class="sourceLineNo">1768</span>      }<a name="line.1768"></a>
+<span class="sourceLineNo">1769</span>    };<a name="line.1769"></a>
+<span class="sourceLineNo">1770</span>  }<a name="line.1770"></a>
+<span class="sourceLineNo">1771</span><a name="line.1771"></a>
+<span class="sourceLineNo">1772</span>  private static void release(MasterServiceState mss) {<a name="line.1772"></a>
+<span class="sourceLineNo">1773</span>    if (mss != null &amp;&amp; mss.connection != null) {<a name="line.1773"></a>
+<span class="sourceLineNo">1774</span>      ((ConnectionImplementation)mss.connection).releaseMaster(mss);<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>  private boolean isKeepAliveMasterConnectedAndRunning(MasterServiceState mss) {<a name="line.1778"></a>
+<span class="sourceLineNo">1779</span>    if (mss.getStub() == null){<a name="line.1779"></a>
+<span class="sourceLineNo">1780</span>      return false;<a name="line.1780"></a>
+<span class="sourceLineNo">1781</span>    }<a name="line.1781"></a>
+<span class="sourceLineNo">1782</span>    try {<a name="line.1782"></a>
+<span class="sourceLineNo">1783</span>      return mss.isMasterRunning();<a name="line.1783"></a>
+<span class="sourceLineNo">1784</span>    } catch (UndeclaredThrowableException e) {<a name="line.1784"></a>
+<span class="sourceLineNo">1785</span>      // It's somehow messy, but we can receive exceptions such as<a name="line.1785"></a>
+<span class="sourceLineNo">1786</span>      //  java.net.ConnectException but they're not declared. So we catch it...<a name="line.1786"></a>
+<span class="sourceLineNo">1787</span>      LOG.info("Master connection is not running anymore", e.getUndeclaredThrowable());<a name="line.1787"></a>
+<span class="sourceLineNo">1788</span>      return false;<a name="line.1788"></a>
+<span class="sourceLineNo">1789</span>    } catch (ServiceException se) {<a name="line.1789"></a>
+<span class="sourceLineNo">1790</span>      LOG.warn("Checking master connection", se);<a name="line.1790"></a>
+<span class="sourceLineNo">1791</span>      return false;<a name="line.1791"></a>
 <span class="sourceLineNo">1792</span>    }<a name="line.1792"></a>
-<span class="sourceLineNo">1793</span>    mss.userCount = 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>  /**<a name="line.1796"></a>
-<span class="sourceLineNo">1797</span>   * Immediate close of the shared master. Can be by the delayed close or when closing the<a name="line.1797"></a>
-<span class="sourceLineNo">1798</span>   * connection itself.<a name="line.1798"></a>
-<span class="sourceLineNo">1799</span>   */<a name="line.1799"></a>
-<span class="sourceLineNo">1800</span>  private void closeMaster() {<a name="line.1800"></a>
-<span class="sourceLineNo">1801</span>    synchronized (masterAndZKLock) {<a name="line.1801"></a>
-<span class="sourceLineNo">1802</span>      closeMasterService(masterServiceState);<a name="line.1802"></a>
-<span class="sourceLineNo">1803</span>    }<a name="line.1803"></a>
-<span class="sourceLineNo">1804</span>  }<a name="line.1804"></a>
-<span class="sourceLineNo">1805</span><a name="line.1805"></a>
-<span class="sourceLineNo">1806</span>  void updateCachedLocation(HRegionInfo hri, ServerName source,<a name="line.1806"></a>
-<span class="sourceLineNo">1807</span>                            ServerName serverName, long seqNum) {<a name="line.1807"></a>
-<span class="sourceLineNo">1808</span>    HRegionLocation newHrl = new HRegionLocation(hri, serverName, seqNum);<a name="line.1808"></a>
-<span class="sourceLineNo">1809</span>    cacheLocation(hri.getTable(), source, newHrl);<a name="line.1809"></a>
-<span class="sourceLineNo">1810</span>  }<a name="line.1810"></a>
-<span class="sourceLineNo">1811</span><a name="line.1811"></a>
-<span class="sourceLineNo">1812</span>  @Override<a name="line.1812"></a>
-<span class="sourceLineNo">1813</span>  public void deleteCachedRegionLocation(final HRegionLocation location) {<a name="line.1813"></a>
-<span class="sourceLineNo">1814</span>    metaCache.clearCache(location);<a name="line.1814"></a>
-<span class="sourceLineNo">1815</span>  }<a name="line.1815"></a>
-<span class="sourceLineNo">1816</span><a name="line.1816"></a>
-<span class="sourceLineNo">1817</span>  @Override<a name="line.1817"></a>
-<span class="sourceLineNo">1818</span>  public void updateCachedLocations(final TableName tableName, byte[] rowkey,<a name="line.1818"></a>
-<span class="sourceLineNo">1819</span>      final Object exception, final HRegionLocation source) {<a name="line.1819"></a>
-<span class="sourceLineNo">1820</span>    assert source != null;<a name="line.1820"></a>
-<span class="sourceLineNo">1821</span>    updateCachedLocations(tableName, source.getRegionInfo().getRegionName()<a name="line.1821"></a>
-<span class="sourceLineNo">1822</span>        , rowkey, exception, source.getServerName());<a name="line.1822"></a>
-<span class="sourceLineNo">1823</span>  }<a name="line.1823"></a>
-<span class="sourceLineNo">1824</span><a name="line.1824"></a>
-<span class="sourceLineNo">1825</span>  /**<a name="line.1825"></a>
-<span class="sourceLineNo">1826</span>   * Update the location with the new value (if the exception is a RegionMovedException)<a name="line.1826"></a>
-<span class="sourceLineNo">1827</span>   * or delete it from the cache. Does nothing if we can be sure from the exception that<a name="line.1827"></a>
-<span class="sourceLineNo">1828</span>   * the location is still accurate, or if the cache has already been updated.<a name="line.1828"></a>
-<span class="sourceLineNo">1829</span>   * @param exception an object (to simplify user code) on which we will try to find a nested<a name="line.1829"></a>
-<span class="sourceLineNo">1830</span>   *  or wrapped or both RegionMovedException<a name="line.1830"></a>
-<span class="sourceLineNo">1831</span>   * @param source server that is the source of the location update.<a name="line.1831"></a>
-<span class="sourceLineNo">1832</span>   */<a name="line.1832"></a>
-<span class="sourceLineNo">1833</span>  @Override<a name="line.1833"></a>
-<span class="sourceLineNo">1834</span>  public void updateCachedLocations(final TableName tableName, byte[] regionName, byte[] rowkey,<a name="line.1834"></a>
-<span class="sourceLineNo">1835</span>    final Object exception, final ServerName source) {<a name="line.1835"></a>
-<span class="sourceLineNo">1836</span>    if (rowkey == null || tableName == null) {<a name="line.1836"></a>
-<span class="sourceLineNo">1837</span>      LOG.warn("Coding error, see method javadoc. row=" + (rowkey == null ? "null" : rowkey) +<a name="line.1837"></a>
-<span class="sourceLineNo">1838</span>          ", tableName=" + (tableName == null ? "null" : tableName));<a name="line.1838"></a>
-<span class="sourceLineNo">1839</span>      return;<a name="line.1839"></a>
-<span class="sourceLineNo">1840</span>    }<a name="line.1840"></a>
-<span class="sourceLineNo">1841</span><a name="line.1841"></a>
-<span class="sourceLineNo">1842</span>    if (source == null) {<a name="line.1842"></a>
-<span class="sourceLineNo">1843</span>      // This should not happen, but let's secure ourselves.<a name="line.1843"></a>
-<span class="sourceLineNo">1844</span>      return;<a name="line.1844"></a>
-<span class="sourceLineNo">1845</span>    }<a name="line.1845"></a>
-<span class="sourceLineNo">1846</span><a name="line.1846"></a>
-<span class="sourceLineNo">1847</span>    if (regionName == null) {<a name="line.1847"></a>
-<span class="sourceLineNo">1848</span>      // we do not know which region, so just remove the cache entry for the row and server<a name="line.1848"></a>
-<span class="sourceLineNo">1849</span>      metaCache.clearCache(tableName, rowkey, source);<a name="line.1849"></a>
-<span class="sourceLineNo">1850</span>      return;<a name="line.1850"></a>
-<span class="sourceLineNo">1851</span>    }<a name="line.1851"></a>
-<span class="sourceLineNo">1852</span><a name="line.1852"></a>
-<span class="sourceLineNo">1853</span>    // Is it something we have already updated?<a name="line.1853"></a>
-<span class="sourceLineNo">1854</span>    final RegionLocations oldLocations = getCachedLocation(tableName, rowkey);<a name="line.1854"></a>
-<span class="sourceLineNo">1855</span>    HRegionLocation oldLocation = null;<a name="line.1855"></a>
-<span class="sourceLineNo">1856</span>    if (oldLocations != null) {<a name="line.1856"></a>
-<span class="sourceLineNo">1857</span>      oldLocation = oldLocations.getRegionLocationByRegionName(regionName);<a name="line.1857"></a>
-<span class="sourceLineNo">1858</span>    }<a name="line.1858"></a>
-<span class="sourceLineNo">1859</span>    if (oldLocation == null || !source.equals(oldLocation.getServerName())) {<a name="line.1859"></a>
-<span class="sourceLineNo">1860</span>      // There is no such location in the cache (it's been removed already) or<a name="line.1860"></a>
-<span class="sourceLineNo">1861</span>      // the cache has already been refreshed with a different location.  =&gt; nothing to do<a name="line.1861"></a>
-<span class="sourceLineNo">1862</span>      return;<a name="line.1862"></a>
-<span class="sourceLineNo">1863</span>    }<a name="line.1863"></a>
-<span class="sourceLineNo">1864</span><a name="line.1864"></a>
-<span class="sourceLineNo">1865</span>    HRegionInfo regionInfo = oldLocation.getRegionInfo();<a name="line.1865"></a>
-<span class="sourceLineNo">1866</span>    Throwable cause = ClientExceptionsUtil.findException(exception);<a name="line.1866"></a>
-<span class="sourceLineNo">1867</span>    if (cause != null) {<a name="line.1867"></a>
-<span class="sourceLineNo">1868</span>      if (!ClientExceptionsUtil.isMetaClearingException(cause)) {<a name="line.1868"></a>
-<span class="sourceLineNo">1869</span>        // We know that the region is still on this region server<a name="line.1869"></a>
-<span class="sourceLineNo">1870</span>        return;<a name="line.1870"></a>
-<span class="sourceLineNo">1871</span>      }<a name="line.1871"></a>
-<span class="sourceLineNo">1872</span><a name="line.1872"></a>
-<span class="sourceLineNo">1873</span>      if (cause instanceof RegionMovedException) {<a name="line.1873"></a>
-<span class="sourceLineNo">1874</span>        RegionMovedException rme = (RegionMovedException) cause;<a name="line.1874"></a>
-<span class="sourceLineNo">1875</span>        if (LOG.isTraceEnabled()) {<a name="line.1875"></a>
-<span class="sourceLineNo">1876</span>          LOG.trace("Region " + regionInfo.getRegionNameAsString() + " moved to " +<a name="line.1876"></a>
-<span class="sourceLineNo">1877</span>              rme.getHostname() + ":" + rme.getPort() +<a name="line.1877"></a>
-<span class="sourceLineNo">1878</span>              " according to " + source.getHostAndPort());<a name="line.1878"></a>
-<span class="sourceLineNo">1879</span>        }<a name="line.1879"></a>
-<span class="sourceLineNo">1880</span>        // We know that the region is not anymore on this region server, but we know<a name="line.1880"></a>
-<span class="sourceLineNo">1881</span>        //  the new location.<a name="line.1881"></a>
-<span class="sourceLineNo">1882</span>        updateCachedLocation(<a name="line.1882"></a>
-<span class="sourceLineNo">1883</span>            regionInfo, source, rme.getServerName(), rme.getLocationSeqNum());<a name="line.1883"></a>
+<span class="sourceLineNo">1793</span>  }<a name="line.1793"></a>
+<span class="sourceLineNo">1794</span><a name="line.1794"></a>
+<span class="sourceLineNo">1795</span>  void releaseMaster(MasterServiceState mss) {<a name="line.1795"></a>
+<span class="sourceLineNo">1796</span>    if (mss.getStub() == null) return;<a name="line.1796"></a>
+<span class="sourceLineNo">1797</span>    synchronized (masterAndZKLock) {<a name="line.1797"></a>
+<span class="sourceLineNo">1798</span>      --mss.userCount;<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><a name="line.1801"></a>
+<span class="sourceLineNo">1802</span>  private void closeMasterService(MasterServiceState mss) {<a name="line.1802"></a>
+<span class="sourceLineNo">1803</span>    if (mss.getStub() != null) {<a name="line.1803"></a>
+<span class="sourceLineNo">1804</span>      LOG.info("Closing master protocol: " + mss);<a name="line.1804"></a>
+<span class="sourceLineNo">1805</span>      mss.clearStub();<a name="line.1805"></a>
+<span class="sourceLineNo">1806</span>    }<a name="line.1806"></a>
+<span class="sourceLineNo">1807</span>    mss.userCount = 0;<a name="line.1807"></a>
+<span class="sourceLineNo">1808</span>  }<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>
+<span class="sourceLineNo">1811</span>   * Immediate close of the shared master. Can be by the delayed close or when closing the<a name="line.1811"></a>
+<span class="sourceLineNo">1812</span>   * connection itself.<a name="line.1812"></a>
+<span class="sourceLineNo">1813</span>   */<a name="line.1813"></a>
+<span class="sourceLineNo">1814</span>  private void closeMaster() {<a name="line.1814"></a>
+<span class="sourceLineNo">1815</span>    synchronized (masterAndZKLock) {<a name="line.1815"></a>
+<span class="sourceLineNo">1816</span>      closeMasterService(masterServiceState);<a name="line.1816"></a>
+<span class="sourceLineNo">1817</span>    }<a name="line.1817"></a>
+<span class="sourceLineNo">1818</span>  }<a name="line.1818"></a>
+<span class="sourceLineNo">1819</span><a name="line.1819"></a>
+<span class="sourceLineNo">1820</span>  void updateCachedLocation(HRegionInfo hri, ServerName source,<a name="line.1820"></a>
+<span class="sourceLineNo">1821</span>                            ServerName serverName, long seqNum) {<a name="line.1821"></a>
+<span class="sourceLineNo">1822</span>    HRegionLocation newHrl = new HRegionLocation(hri, serverName, seqNum);<a name="line.1822"></a>
+<span class="sourceLineNo">1823</span>    cacheLocation(hri.getTable(), source, newHrl);<a name="line.1823"></a>
+<span class="sourceLineNo">1824</span>  }<a name="line.1824"></a>
+<span class="sourceLineNo">1825</span><a name="line.1825"></a>
+<span class="sourceLineNo">1826</span>  @Override<a name="line.1826"></a>
+<span class="sourceLineNo">1827</span>  public void deleteCachedRegionLocation(final HRegionLocation location) {<a name="line.1827"></a>
+<span class="sourceLineNo">1828</span>    metaCache.clearCache(location);<a name="line.1828"></a>
+<span class="sourceLineNo">1829</span>  }<a name="line.1829"></a>
+<span class="sourceLineNo">1830</span><a name="line.1830"></a>
+<span class="sourceLineNo">1831</span>  @Override<a name="line.1831"></a>
+<span class="sourceLineNo">1832</span>  public void updateCachedLocations(final TableName tableName, byte[] rowkey,<a name="line.1832"></a>
+<span class="sourceLineNo">1833</span>      final Object exception, final HRegionLocation source) {<a name="line.1833"></a>
+<span class="sourceLineNo">1834</span>    assert source != null;<a name="line.1834"></a>
+<span class="sourceLineNo">1835</span>    updateCachedLocations(tableName, source.getRegionInfo().getRegionName()<a name="line.1835"></a>
+<span class="sourceLineNo">1836</span>        , rowkey, exception, source.getServerName());<a name="line.1836"></a>
+<span class="sourceLineNo">1837</span>  }<a name="line.1837"></a>
+<span class="sourceLineNo">1838</span><a name="line.1838"></a>
+<span class="sourceLineNo">1839</span>  /**<a name="line.1839"></a>
+<span class="sourceLineNo">1840</span>   * Update the location with the new value (if the exception is a RegionMovedException)<a name="line.1840"></a>
+<span class="sourceLineNo">1841</span>   * or delete it from the cache. Does nothing if we can be sure from the exception that<a name="line.1841"></a>
+<span class="sourceLineNo">1842</span>   * the location is still accurate, or if the cache has already been updated.<a name="line.1842"></a>
+<span class="sourceLineNo">1843</span>   * @param exception an object (to simplify user code) on which we will try to find a nested<a name="line.1843"></a>
+<span class="sourceLineNo">1844</span>   *  or wrapped or both RegionMovedException<a name="line.1844"></a>
+<span class="sourceLineNo">1845</span>   * @param source server that is the source of the location update.<a name="line.1845"></a>
+<span class="sourceLineNo">1846</span>   */<a name="line.1846"></a>
+<span class="sourceLineNo">1847</span>  @Override<a name="line.1847"></a>
+<span class="sourceLineNo">1848</span>  public void updateCachedLocations(final TableName tableName, byte[] regionName, byte[] rowkey,<a name="line.1848"></a>
+<span class="sourceLineNo">1849</span>    final Object exception, final ServerName source) {<a name="line.1849"></a>
+<span class="sourceLineNo">1850</span>    if (rowkey == null || tableName == null) {<a name="line.1850"></a>
+<span class="sourceLineNo">1851</span>      LOG.warn("Coding error, see method javadoc. row=" + (rowkey == null ? "null" : rowkey) +<a name="line.1851"></a>
+<span class="sourceLineNo">1852</span>          ", tableName=" + (tableName == null ? "null" : tableName));<a name="line.1852"></a>
+<span class="sourceLineNo">1853</span>      return;<a name="line.1853"></a>
+<span class="sourceLineNo">1854</span>    }<a name="line.1854"></a>
+<span class="sourceLineNo">1855</span><a name="line.1855"></a>
+<span class="sourceLineNo">1856</span>    if (source == null) {<a name="line.1856"></a>
+<span class="sourceLineNo">1857</span>      // This should not happen, but let's secure ourselves.<a name="line.1857"></a>
+<span class="sourceLineNo">1858</span>      return;<a name="line.1858"></a>
+<span class="sourceLineNo">1859</span>    }<a name="line.1859"></a>
+<span class="sourceLineNo">1860</span><a name="line.1860"></a>
+<span class="sourceLineNo">1861</span>    if (regionName == null) {<a name="line.1861"></a>
+<span class="sourceLineNo">1862</span>      // we do not know which region, so just remove the cache entry for the row and server<a name="line.1862"></a>
+<span class="sourceLineNo">1863</span>      metaCache.clearCache(tableName, rowkey, source);<a name="line.1863"></a>
+<span class="sourceLineNo">1864</span>      return;<a name="line.1864"></a>
+<span class="sourceLineNo">1865</span>    }<a name="line.1865"></a>
+<span class="sourceLineNo">1866</span><a name="line.1866"></a>
+<span class="sourceLineNo">1867</span>    // Is it something we have already updated?<a name="line.1867"></a>
+<span class="sourceLineNo">1868</span>    final RegionLocations oldLocations = getCachedLocation(tableName, rowkey);<a name="line.1868"></a>
+<span class="sourceLineNo">1869</span>    HRegionLocation oldLocation = null;<a name="line.1869"></a>
+<span class="sourceLineNo">1870</span>    if (oldLocations != null) {<a name="line.1870"></a>
+<span class="sourceLineNo">1871</span>      oldLocation = oldLocations.getRegionLocationByRegionName(regionName);<a name="line.1871"></a>
+<span class="sourceLineNo">1872</span>    }<a name="line.1872"></a>
+<span class="sourceLineNo">1873</span>    if (oldLocation == null || !source.equals(oldLocation.getServerName())) {<a name="line.1873"></a>
+<span class="sourceLineNo">1874</span>      // There is no such location in the cache (it's been removed already) or<a name="line.1874"></a>
+<span class="sourceLineNo">1875</span>      // the cache has already been refreshed with a different location.  =&gt; nothing to do<a name="line.1875"></a>
+<span class="sourceLineNo">1876</span>      return;<a name="line.1876"></a>
+<span class="sourceLineNo">1877</span>    }<a name="line.1877"></a>
+<span class="sourceLineNo">1878</span><a name="line.1878"></a>
+<span class="sourceLineNo">1879</span>    HRegionInfo regionInfo = oldLocation.getRegionInfo();<a name="line.1879"></a>
+<span class="sourceLineNo">1880</span>    Throwable cause = ClientExceptionsUtil.findException(exception);<a name="line.1880"></a>
+<span class="sourceLineNo">1881</span>    if (cause != null) {<a name="line.1881"></a>
+<span class="sourceLineNo">1882</span>      if (!ClientExceptionsUtil.isMetaClearingException(cause)) {<a name="line.1882"></a>
+<span class="sourceLineNo">1883</span>        // We know that the region is still on this region server<a name="line.1883"></a>
 <span class="sourceLineNo">1884</span>        return;<a name="line.1884"></a>
 <span class="sourceLineNo">1885</span>      }<a name="line.1885"></a>
-<span class="sourceLineNo">1886</span>    }<a name="line.1886"></a>
-<span class="sourceLineNo">1887</span><a name="line.1887"></a>
-<span class="sourceLineNo">1888</span>    // If we're here, it means that can cannot be sure about the location, so we remove it from<a name="line.1888"></a>
-<span class="sourceLineNo">1889</span>    // the cache. Do not send the source because source can be a new server in the same host:port<a name="line.1889"></a>
-<span class="sourceLineNo">1890</span>    metaCache.clearCache(regionInfo);<a name="line.1890"></a>
-<span class="sourceLineNo">1891</span>  }<a name="line.1891"></a>
-<span class="sourceLineNo">1892</span><a name="line.1892"></a>
-<span class="sourceLineNo">1893</span>  @Override<a name="line.1893"></a>
-<span class="sourceLineNo">1894</span>  public void updateCachedLocations(final byte[] tableName, byte[] rowkey,<a name="line.1894"></a>
-<span class="sourceLineNo">1895</span>    final Object exception, final HRegionLocation source) {<a name="line.1895"></a>
-<span class="sourceLineNo">1896</span>    updateCachedLocations(TableName.valueOf(tableName), rowkey, exception, source);<a name="line.1896"></a>
-<span class="sourceLineNo">1897</span>  }<a name="line.1897"></a>
-<span class="sourceLineNo">1898</span><a name="line.1898"></a>
-<span class="sourceLineNo">1899</span>  /**<a name="line.1899"></a>
-<span class="sourceLineNo">1900</span>   * @deprecated since 0.96 Use {@link org.apache.hadoop.hbase.client.HTableInterface#batch} instead<a name="line.1900"></a>
-<span class="sourceLineNo">1901</span>   */<a name="line.1901"></a>
-<span class="sourceLineNo">1902</span>  @Override<a name="line.1902"></a>
-<span class="sourceLineNo">1903</span>  @Deprecated<a name="line.1903"></a>
-<span class="sourceLineNo">1904</span>  public void processBatch(List&lt;? extends Row&gt; list,<a name="line.1904"></a>
-<span class="sourceLineNo">1905</span>      final TableName tableName,<a name="line.1905"></a>
-<span class="sourceLineNo">1906</span>      ExecutorService pool,<a name="line.1906"></a>
-<span class="sourceLineNo">1907</span>      Object[] results) throws IOException, InterruptedException {<a name="line.1907"></a>
-<span class="sourceLineNo">1908</span>    // This belongs in HTable!!! Not in here.  St.Ack<a name="line.1908"></a>
-<span class="sourceLineNo">1909</span><a name="line.1909"></a>
-<span class="sourceLineNo">1910</span>    // results must be the same size as list<a name="line.1910"></a>
-<span class="sourceLineNo">1911</span>    if (results.length != list.size()) {<a name="line.1911"></a>
-<span class="sourceLineNo">1912</span>      throw new IllegalArgumentException(<a name="line.1912"></a>
-<span class="sourceLineNo">1913</span>        "argument results must be the same size as argument list");<a name="line.1913"></a>
-<span class="sourceLineNo">1914</span>    }<a name="line.1914"></a>
-<span class="sourceLineNo">1915</span>    processBatchCallback(list, tableName, pool, results, null);<a name="line.1915"></a>
-<span class="sourceLineNo">1916</span>  }<a name="line.1916"></a>
-<span class="sourceLineNo">1917</span><a name="line.1917"></a>
-<span class="sourceLineNo">1918</span>  /**<a name="line.1918"></a>
-<span class="sourceLineNo">1919</span>   * @deprecated Unsupported API<a name="line.1919"></a>
-<span class="sourceLineNo">1920</span>   */<a name="line.1920"></a>
-<span class="sourceLineNo">1921</span>  @Override<a name="line.1921"></a>
-<span class="sourceLineNo">1922</span>  @Deprecated<a name="line.1922"></a>
-<span class="sourceLineNo">1923</span>  public void processBatch(List&lt;? extends Row&gt; list,<a name="line.1923"></a>
-<span class="sourceLineNo">1924</span>      final byte[] tableName,<a name="line.1924"></a>
-<span class="sourceLineNo">1925</span>      ExecutorService pool,<a name="line.1925"></a>
-<span class="sourceLineNo">1926</span>      Object[] results) throws IOException, InterruptedException {<a name="line.1926"></a>
-<span class="sourceLineNo">1927</span>    processBatch(list, TableName.valueOf(tableName), pool, results);<a name="line.1927"></a>
-<span class="sourceLineNo">1928</span>  }<a name="line.1928"></a>
-<span class="sourceLineNo">1929</span><a name="line.1929"></a>
-<span class="sourceLineNo">1930</span>  /**<a name="line.1930"></a>
-<span class="sourceLineNo">1931</span>   * Send the queries in parallel on the different region servers. Retries on failures.<a name="line.1931"></a>
-<span class="sourceLineNo">1932</span>   * If the method returns it means that there is no error, and the 'results' array will<a name="line.1932"></a>
-<span class="sourceLineNo">1933</span>   * contain no exception. On error, an exception is thrown, and the 'results' array will<a name="line.1933"></a>
-<span class="sourceLineNo">1934</span>   * contain results and exceptions.<a name="line.1934"></a>
-<span class="sourceLineNo">1935</span>   * @deprecated since 0.96<a name="line.1935"></a>
-<span class="sourceLineNo">1936</span>   *  Use {@link org.apache.hadoop.hbase.client.HTable#processBatchCallback} instead<a name="line.1936"></a>
-<span class="sourceLineNo">1937</span>   */<a name="line.1937"></a>
-<span class="sourceLineNo">1938</span>  @Override<a name="line.1938"></a>
-<span class="sourceLineNo">1939</span>  @Deprecated<a name="line.1939"></a>
-<span class="sourceLineNo">1940</span>  public &lt;R&gt; void processBatchCallback(<a name="line.1940"></a>
-<span class="sourceLineNo">1941</span>    List&lt;? extends Row&gt; list,<a name="line.1941"></a>
-<span class="sourceLineNo">1942</span>    TableName tableName,<a name="line.1942"></a>
-<span class="sourceLineNo">1943</span>    ExecutorService pool,<a name="line.1943"></a>
-<span class="sourceLineNo">1944</span>    Object[] results,<a name="line.1944"></a>
-<span class="sourceLineNo">1945</span>    Batch.Callback&lt;R&gt; callback)<a name="line.1945"></a>
-<span class="sourceLineNo">1946</span>    throws IOException, InterruptedException {<a name="line.1946"></a>
-<span class="sourceLineNo">1947</span><a name="line.1947"></a>
-<span class="sourceLineNo">1948</span>    AsyncProcess.AsyncRequestFuture ars = this.asyncProcess.submitAll(<a name="line.1948"></a>
-<span class="sourceLineNo">1949</span>        pool, tableName, list, callback, results);<a name="line.1949"></a>
-<span class="sourceLineNo">1950</span>    ars.waitUntilDone();<a name="line.1950"></a>
-<span class="sourceLineNo">1951</span>    if (ars.hasError()) {<a name="line.1951"></a>
-<span class="sourceLineNo">1952</span>      throw ars.getErrors();<a name="line.1952"></a>
-<span class="sourceLineNo">1953</span>    }<a name="line.1953"></a>
-<span class="sourceLineNo">1954</span>  }<a name="line.1954"></a>
-<span class="sourceLineNo">1955</span><a name="line.1955"></a>
-<span class="sourceLineNo">1956</span>  /**<a name="line.1956"></a>
-<span class="sourceLineNo">1957</span>   * @deprecated Unsupported API<a name="line.1957"></a>
-<span class="sourceLineNo">1958</span>   */<a name="line.1958"></a>
-<span class="sourceLineNo">1959</span>  @Override<a name="line.1959"></a>
-<span class="sourceLineNo">1960</span>  @Deprecated<a name="line.1960"></a>
-<span class="sourceLineNo">1961</span>  public &lt;R&gt; void processBatchCallback(<a name="line.1961"></a>
-<span class="sourceLineNo">1962</span>    List&lt;? extends Row&gt; list,<a name="line.1962"></a>
-<span class="sourceLineNo">1963</span>    byte[] tableName,<a name="line.1963"></a>
-<span class="sourceLineNo">1964</span>    ExecutorService pool,<a name="line.1964"></a>
-<span class="sourceLineNo">1965</span>    Object[] results,<a name="line.1965"></a>
-<span class="sourceLineNo">1966</span>    Batch.Callback&lt;R&gt; callback)<a name="line.1966"></a>
-<span class="sourceLineNo">1967</span>    throws IOException, InterruptedException {<a name="line.1967"></a>
-<span class="sourceLineNo">1968</span>    processBatchCallback(list, TableName.valueOf(tableName), pool, results, callback);<a name="line.1968"></a>
-<span class="sourceLineNo">1969</span>  }<a name="line.1969"></a>
-<span class="sourceLineNo">1970</span><a name="line.1970"></a>
-<span class="sourceLineNo">1971</span>  // For tests to override.<a name="line.1971"></a>
-<span class="sourceLineNo">1972</span>  protected AsyncProcess createAsyncProcess(Configuration conf) {<a name="line.1972"></a>
-<span class="sourceLineNo">1973</span>    // No default pool available.<a name="line.1973"></a>
-<span class="sourceLineNo">1974</span>    return new AsyncProcess(this, conf, batchPool, rpcCallerFactory, false, rpcControllerFactory);<a name="line.1974"></a>
-<span class="sourceLineNo">1975</span>  }<a name="line.1975"></a>
-<span class="sourceLineNo">1976</span><a name="line.1976"></a>
-<span class="sourceLineNo">1977</span>  @Override<a name="line.1977"></a>
-<span class="sourceLineNo">1978</span>  public AsyncProcess getAsyncProcess() {<a name="line.1978"></a>
-<span class="sourceLineNo">1979</span>    return asyncProcess;<a name="line.1979"></a>
-<span class="sourceLineNo">1980</span>  }<a name="line.1980"></a>
-<span class="sourceLineNo">1981</span><a name="line.1981"></a>
-<span class="sourceLineNo">1982</span>  @Override<a name="line.1982"></a>
-<span class="sourceLineNo">1983</span>  public ServerStatisticTracker getStatisticsTracker() {<a name="line.1983"></a>
-<span class="sourceLineNo">1984</span>    return this.stats;<a name="line.1984"></a>
-<span class="sourceLineNo">1985</span>  }<a name="line.1985"></a>
-<span class="sourceLineNo">1986</span><a name="line.1986"></a>
-<span class="sourceLineNo">1987</span>  @Override<a name="line.1987"></a>
-<span class="sourceLineNo">1988</span>  public ClientBackoffPolicy getBackoffPolicy() {<a name="line.1988"></a>
-<span class="sourceLineNo">1989</span>    return this.backoffPolicy;<a name="line.1989"></a>
-<span class="sourceLineNo">1990</span>  }<a name="line.1990"></a>
-<span class="sourceLineNo">1991</span><a name="line.1991"></a>
-<span class="sourceLineNo">1992</span>  /*<a name="line.1992"></a>
-<span class="sourceLineNo">1993</span>   * Return the number of cached region for a table. It will only be called<a name="line.1993"></a>
-<span class="sourceLineNo">1994</span>   * from a unit test.<a name="line.1994"></a>
-<span class="sourceLineNo">1995</span>   */<a name="line.1995"></a>
-<span class="sourceLineNo">1996</span>  @VisibleForTesting<a name="line.1996"></a>
-<span class="sourceLineNo">1997</span>  int getNumberOfCachedRegionLocations(final TableName tableName) {<a name="line.1997"></a>
-<span class="sourceLineNo">1998</span>    return metaCache.getNumberOfCachedRegionLocations(tableName);<a name="line.1998"></a>
+<span class="sourceLineNo">1886</span><a name="line.1886"></a>
+<span class="sourceLineNo">1887</span>      if (cause instanceof RegionMovedException) {<a name="line.1887"></a>
+<span class="sourceLineNo">1888</span>        RegionMovedException rme = (RegionMovedException) cause;<a name="line.1888"></a>
+<span class="sourceLineNo">1889</span>        if (LOG.isTraceEnabled()) {<a name="line.1889"></a>
+<span class="sourceLineNo">1890</span>          LOG.trace("Region " + regionInfo.getRegionNameAsString() + " moved to " +<a name="line.1890"></a>
+<span class="sourceLineNo">1891</span>              rme.getHostname() + ":" + rme.getPort() +<a name="line.1891"></a>
+<span class="sourceLineNo">1892</span>              " according to " + source.getHostAndPort());<a name="line.1892"></a>
+<span class="sourceLineNo">1893</span>        }<a name="line.1893"></a>
+<span class="sourceLineNo">1894</span>        // We know that the region is not anymore on this region server, but we know<a name="line.1894"></a>
+<span class="sourceLineNo">1895</span>        //  the new location.<a name="line.1895"></a>
+<span class="sourceLineNo">1896</span>        updateCachedLocation(<a name="line.1896"></a>
+<span class="sourceLineNo">1897</span>            regionInfo, source, rme.getServerName(), rme.getLocationSeqNum());<a name="line.1897"></a>
+<span class="sourceLineNo">1898</span>        return;<a name="line.1898"></a>
+<span class="sourceLineNo">1899</span>      }<a name="line.1899"></a>
+<span class="sourceLineNo">1900</span>    }<a name="line.1900"></a>
+<span class="sourceLineNo">1901</span><a name="line.1901"></a>
+<span class="sourceLineNo">1902</span>    // If we're here, it means that can cannot be sure about the location, so we remove it from<a name="line.1902"></a>
+<span class="sourceLineNo">1903</span>    // the cache. Do not send the source because source can be a new server in the same host:port<a name="line.1903"></a>
+<span class="sourceLineNo">1904</span>    metaCache.clearCache(regionInfo);<a name="line.1904"></a>
+<span class="sourceLineNo">1905</span>  }<a name="line.1905"></a>
+<span class="sourceLineNo">1906</span><a name="line.1906"></a>
+<span class="sourceLineNo">1907</span>  @Override<a name="line.1907"></a>
+<span class="sourceLineNo">1908</span>  public void updateCachedLocations(final byte[] tableName, byte[] rowkey,<a name="line.1908"></a>
+<span class="sourceLineNo">1909</span>    final Object exception, final HRegionLocation source) {<a name="line.1909"></a>
+<span class="sourceLineNo">1910</span>    updateCachedLocations(TableName.valueOf(tableName), rowkey, exception, source);<a name="line.1910"></a>
+<span class="sourceLineNo">1911</span>  }<a name="line.1911"></a>
+<span class="sourceLineNo">1912</span><a name="line.1912"></a>
+<span class="sourceLineNo">1913</span>  /**<a name="line.1913"></a>
+<span class="sourceLineNo">1914</span>   * @deprecated since 0.96 Use {@link org.apache.hadoop.hbase.client.HTableInterface#batch} instead<a name="line.1914"></a>
+<span class="sourceLineNo">1915</span>   */<a name="line.1915"></a>
+<span class="sourceLineNo">1916</span>  @Override<a name="line.1916"></a>
+<span class="sourceLineNo">1917</span>  @Deprecated<a name="line.1917"></a>
+<span class="sourceLineNo">1918</span>  public void processBatch(List&lt;? extends Row&gt; list,<a name="line.1918"></a>
+<span class="sourceLineNo">1919</span>      final TableName tableName,<a name="line.1919"></a>
+<span class="sourceLineNo">1920</span>      ExecutorService pool,<a name="line.1920"></a>
+<span class="sourceLineNo">1921</span>      Object[] results) throws IOException, InterruptedException {<a name="line.1921"></a>
+<span class="sourceLineNo">1922</span>    // This belongs in HTable!!! Not in here.  St.Ack<a name="line.1922"></a>
+<span class="sourceLineNo">1923</span><a name="line.1923"></a>
+<span class="sourceLineNo">1924</span>    // results must be the same size as list<a name="line.1924"></a>
+<span class="sourceLineNo">1925</span>    if (results.length != list.size()) {<a name="line.1925"></a>
+<span class="sourceLineNo">1926</span>      throw new IllegalArgumentException(<a name="line.1926"></a>
+<span class="sourceLineNo">1927</span>        "argument results must be the same size as argument list");<a name="line.1927"></a>
+<span class="sourceLineNo">1928</span>    }<a name="line.1928"></a>
+<span class="sourceLineNo">1929</span>    processBatchCallback(list, tableName, pool, results, null);<a name="line.1929"></a>
+<span class="sourceLineNo">1930</span>  }<a name="line.1930"></a>
+<span class="sourceLineNo">1931</span><a name="line.1931"></a>
+<span class="sourceLineNo">1932</span>  /**<a name="line.1932"></a>
+<span class="sourceLineNo">1933</span>   * @deprecated Unsupported API<a name="line.1933"></a>
+<span class="sourceLineNo">1934</span>   */<a name="line.1934"></a>
+<span class="sourceLineNo">1935</span>  @Override<a name="line.1935"></a>
+<span class="sourceLineNo">1936</span>  @Deprecated<a name="line.1936"></a>
+<span class="sourceLineNo">1937</span>  public void processBatch(List&lt;? extends Row&gt; list,<a name="line.1937"></a>
+<span class="sourceLineNo">1938</span>      final byte[] tableName,<a name="line.1938"></a>
+<span class="sourceLineNo">1939</span>      ExecutorService pool,<a name="line.1939"></a>
+<span class="sourceLineNo">1940</span>      Object[] results) throws IOException, InterruptedException {<a name="line.1940"></a>
+<span class="sourceLineNo">1941</span>    processBatch(list, TableName.valueOf(tableName), pool, results);<a name="line.1941"></a>
+<span class="sourceLineNo">1942</span>  }<a name="line.1942"></a>
+<span class="sourceLineNo">1943</span><a name="line.1943"></a>
+<span class="sourceLineNo">1944</span>  /**<a name="line.1944"></a>
+<span class="sourceLineNo">1945</span>   * Send the queries in parallel on the different region servers. Retries on failures.<a name="line.1945"></a>
+<span class="sourceLineNo">1946</span>   * If the method returns it means that there is no error, and the 'results' array will<a name="line.1946"></a>
+<span class="sourceLineNo">1947</span>   * contain no exception. On error, an exception is thrown, and the 'results' array will<a name="line.1947"></a>
+<span class="sourceLineNo">1948</span>   * contain results and exceptions.<a name="line.1948"></a>
+<span class="sourceLineNo">1949</span>   * @deprecated since 0.96<a name="line.1949"></a>
+<span class="sourceLineNo">1950</span>   *  Use {@link org.apache.hadoop.hbase.client.HTable#processBatchCallback} instead<a name="line.1950"></a>
+<span class="sourceLineNo">1951</span>   */<a name="line.1951"></a>
+<span class="sourceLineNo">1952</span>  @Override<a name="line.1952"></a>
+<span class="sourceLineNo">1953</span>  @Deprecated<a name="line.1953"></a>
+<span class="sourceLineNo">1954</span>  public &lt;R&gt; void processBatchCallback(<a name="line.1954"></a>
+<span class="sourceLineNo">1955</span>    List&lt;? extends Row&gt; list,<a name="line.1955"></a>
+<span class="sourceLineNo">1956</span>    TableName tableName,<a name="line.1956"></a>
+<span class="sourceLineNo">1957</span>    ExecutorService pool,<a name="line.1957"></a>
+<span class="sourceLineNo">1958</span>    Object[] results,<a name="line.1958"></a>
+<span class="sourceLineNo">1959</span>    Batch.Callback&lt;R&gt; callback)<a name="line.1959"></a>
+<span class="sourceLineNo">1960</span>    throws IOException, InterruptedException {<a name="line.1960"></a>
+<span class="sourceLineNo">1961</span><a name="line.1961"></a>
+<span class="sourceLineNo">1962</span>    AsyncProcess.AsyncRequestFuture ars = this.asyncProcess.submitAll(<a name="line.1962"></a>
+<span class="sourceLineNo">1963</span>        pool, tableName, list, callback, results);<a name="line.1963"></a>
+<span class="sourceLineNo">1964</span>    ars.waitUntilDone();<a name="line.1964"></a>
+<span class="sourceLineNo">1965</span>    if (ars.hasError()) {<a name="line.1965"></a>
+<span class="sourceLineNo">1966</span>      throw ars.getErrors();<a name="line.1966"></a>
+<span class="sourceLineNo">1967</span>    }<a name="line.1967"></a>
+<span class="sourceLineNo">1968</span>  }<a name="line.1968"></a>
+<span class="sourceLineNo">1969</span><a name="line.1969"></a>
+<span class="sourceLineNo">1970</span>  /**<a name="line.1970"></a>
+<span class="sourceLineNo">1971</span>   * @deprecated Unsupported API<a name="line.1971"></a>
+<span class="sourceLineNo">1972</span>   */<a name="line.1972"></a>
+<span class="sourceLineNo">1973</span>  @Override<a name="line.1973"></a>
+<span class="sourceLineNo">1974</span>  @Deprecated<a name="line.1974"></a>
+<span class="sourceLineNo">1975</span>  public &lt;R&gt; void processBatchCallback(<a name="line.1975"></a>
+<span class="sourceLineNo">1976</span>    List&lt;? extends Row&gt; list,<a name="line.1976"></a>
+<span class="sourceLineNo">1977</span>    byte[] tableName,<a name="line.1977"></a>
+<span class="sourceLineNo">1978</span>    ExecutorService pool,<a name="line.1978"></a>
+<span class="sourceLineNo">1979</span>    Object[] results,<a name="line.1979"></a>
+<span class="sourceLineNo">1980</span>    Batch.Callback&lt;R&gt; callback)<a name="line.1980"></a>
+<span class="sourceLineNo">1981</span>    throws IOException, InterruptedException {<a name="line.1981"></a>
+<span class="sourceLineNo">1982</span>    processBatchCallback(list, TableName.valueOf(tableName), pool, results, callback);<a name="line.1982"></a>
+<span class="sourceLineNo">1983</span>  }<a name="line.1983"></a>
+<span class="sourceLineNo">1984</span><a name="line.1984"></a>
+<span class="sourceLineNo">1985</span>  // For tests to override.<a name="line.1985"></a>
+<span class="sourceLineNo">1986</span>  protected AsyncProcess createAsyncProcess(Configuration conf) {<a name="line.1986"></a>
+<span class="sourceLineNo">1987</span>    // No default pool available.<a name="line.1987"></a>
+<span class="sourceLineNo">1988</span>    return new AsyncProcess(this, conf, batchPool, rpcCallerFactory, false, rpcControllerFactory);<a name="line.1988"></a>
+<span class="sourceLineNo">1989</span>  }<a name="line.1989"></a>
+<span class="sourceLineNo">1990</span><a name="line.1990"></a>
+<span class="sourceLineNo">1991</span>  @Override<a name="line.1991"></a>
+<span class="sourceLineNo">1992</span>  public AsyncProcess getAsyncProcess() {<a name="line.1992"></a>
+<span class="sourceLineNo">1993</span>    return asyncProcess;<a name="line.1993"></a>
+<span class="sourceLineNo">1994</span>  }<a name="line.1994"></a>
+<span class="sourceLineNo">1995</span><a name="line.1995"></a>
+<span class="sourceLineNo">1996</span>  @Override<a name="line.1996"></a>
+<span class="sourceLineNo">1997</span>  public ServerStatisticTracker getStatisticsTracker() {<a name="line.1997"></a>
+<span class="sourceLineNo">1998</span>    return this.stats;<a name="line.1998"></a>
 <span class="sourceLineNo">1999</span>  }<a name="line.1999"></a>
 <span class="sourceLineNo">2000</span><a name="line.2000"></a>
-<span class="sourceLineNo">2001</span>  /**<a name="line.2001"></a>
-<span class="sourceLineNo">2002</span>   * @deprecated always return false since 0.99<a name="line.2002"></a>
-<span class="sourceLineNo">2003</span>   */<a name="line.2003"></a>
-<span class="sourceLineNo">2004</span>  @Override<a name="line.2004"></a>
-<span class="sourceLineNo">2005</span>  @Deprecated<a name="line.2005"></a>
-<span class="sourceLineNo">2006</span>  public void setRegionCachePrefetch(final TableName tableName, final boolean enable) {<a name="line.2006"></a>
-<span class="sourceLineNo">2007</span>  }<a name="line.2007"></a>
-<span class="sourceLineNo">2008</span><a name="line.2008"></a>
-<span class="sourceLineNo">2009</span>  /**<a name="line.2009"></a>
-<span class="sourceLineNo">2010</span>   * @deprecated always return false since 0.99<a name="line.2010"></a>
-<span class="sourceLineNo">2011</span>   */<a name="line.2011"></a>
-<span class="sourceLineNo">2012</span>  @Override<a name="line.2012"></a>
-<span class="sourceLineNo">2013</span>  @Deprecated<a name="line.2013"></a>
-<span class="sourceLineNo">2014</span>  public void setRegionCachePrefetch(final byte[] tableName,<a name="line.2014"></a>
-<span class="sourceLineNo">2015</span>      final boolean enable) {<a name="line.2015"></a>
-<span class="sourceLineNo">2016</span>  }<a name="line.2016"></a>
-<span class="sourceLineNo">2017</span><a name="line.2017"></a>
-<span class="sourceLineNo">2018</span>  /**<a name="line.2018"></a>
-<span class="sourceLineNo">2019</span>   * @deprecated always return false since 0.99<a name="line.2019"></a>
-<span class="sourceLineNo">2020</span>   */<a name="line.2020"></a>
-<span class="sourceLineNo">2021</span>  @Override<a name="line.2021"></a>
-<span class="sourceLineNo">2022</span>  @Deprecated<a name="line.2022"></a>
-<span class="sourceLineNo">2023</span>  public boolean getRegionCachePrefetch(TableName tableName) {<a name="line.2023"></a>
-<span class="sourceLineNo">2024</span>    return false;<a name="line.2024"></a>
-<span class="sourceLineNo">2025</span>  }<a name="line.2025"></a>
-<span class="sourceLineNo">2026</span><a name="line.2026"></a>
-<span class="sourceLineNo">2027</span>  /**<a name="line.2027"></a>
-<span class="sourceLineNo">2028</span>   * @deprecated always return false since 0.99<a name="line.2028"></a>
-<span class="sourceLineNo">2029</span>   */<a name="line.2029"></a>
-<span class="sourceLineNo">2030</span>  @Override<a name="line.2030"></a>
-<span class="sourceLineNo">2031</span>  @Deprecated<a name="line.2031"></a>
-<span class="sourceLineNo">2032</span>  public boolean getRegionCachePrefetch(byte[] tableName) {<a name="line.2032"></a>
-<span class="sourceLineNo">2033</span>    return false;<a name="line.2033"></a>
-<span class="sourceLineNo">2034</span>  }<a name="line.2034"></a>
-<span class="sourceLineNo">2035</span><a name="line.2035"></a>
-<span class="sourceLineNo">2036</span>  @Override<a name="line.2036"></a>
-<span class="sourceLineNo">2037</span>  public void abort(final String msg, Throwable t) {<a name="line.2037"></a>
-<span class="sourceLineNo">2038</span>    if (t instanceof KeeperException.SessionExpiredException<a name="line.2038"></a>
-<span class="sourceLineNo">2039</span>      &amp;&amp; keepAliveZookeeper != null) {<a name="line.2039"></a>
-<span class="sourceLineNo">2040</span>      synchronized (masterAndZKLock) {<a name="line.2040"></a>
-<span class="sourceLineNo">2041</span>        if (keepAliveZookeeper != null) {<a name="line.2041"></a>
-<span class="sourceLineNo">2042</span>          LOG.warn("This client just lost it's session with ZooKeeper," +<a name="line.2042"></a>
-<span class="sourceLineNo">2043</span>            " closing it." +<a name="line.2043"></a>
-<span class="sourceLineNo">2044</span>            " It will be recreated next time someone needs it", t);<a name="line.2044"></a>
-<span class="sourceLineNo">2045</span>          closeZooKeeperWatcher();<a name="line.2045"></a>
-<span class="sourceLineNo">2046</span>        }<a name="line.2046"></a>
-<span class="sourceLineNo">2047</span>      }<a name="line.2047"></a>
-<span class="sourceLineNo">2048</span>    } else {<a name="line.2048"></a>
-<span class="sourceLineNo">2049</span>      if (t != null) {<a name="line.2049"></a>
-<span class="sourceLineNo">2050</span>        LOG.fatal(msg, t);<a name="line.2050"></a>
-<span class="sourceLineNo">2051</span>      } else {<a name="line.2051"></a>
-<span class="sourceLineNo">2052</span>        LOG.fatal(msg);<a name="line.2052"></a>
-<span class="sourceLineNo">2053</span>      }<a name="line.2053"></a>
-<span class="sourceLineNo">2054</span>      this.aborted = true;<a name="line.2054"></a>
-<span class="sourceLineNo">2055</span>      close();<a name="line.2055"></a>
-<span class="sourceLineNo">2056</span>      this.closed = true;<a name="line.2056"></a>
-<span class="sourceLineNo">2057</span>    }<a name="line.2057"></a>
-<span class="sourceLineNo">2058</span>  }<a name="line.2058"></a>
-<span class="sourceLineNo">2059</span><a name="line.2059"></a>
-<span class="sourceLineNo">2060</span>  @Override<a name="line.2060"></a>
-<span class="sourceLineNo">2061</span>  public boolean isClosed() {<a name="line.2061"></a>
-<span class="sourceLineNo">2062</span>    return this.closed;<a name="line.2062"></a>
-<span class="sourceLineNo">2063</span>  }<a name="line.2063"></a>
-<span class="sourceLineNo">2064</span><a name="line.2064"></a>
-<span class="sourceLineNo">2065</span>  @Override<a name="line.2065"></a>
-<span class="sourceLineNo">2066</span>  public boolean isAborted(){<a name="line.2066"></a>
-<span class="sourceLineNo">2067</span>    return this.aborted;<a name="line.2067"></a>
-<span class="sourceLineNo">2068</span>  }<a name="line.2068"></a>
-<span class="sourceLineNo">2069</span><a name="line.2069"></a>
-<span class="sourceLineNo">2070</span>  @Override<a name="line.2070"></a>
-<span class="sourceLineNo">2071</span>  public int getCurrentNrHRS() throws IOException {<a name="line.2071"></a>
-<span class="sourceLineNo">2072</span>    return this.registry.getCurrentNrHRS();<a name="line.2072"></a>
-<span class="sourceLineNo">2073</span>  }<a name="line.2073"></a>
-<span class="sourceLineNo">2074</span><a name="line.2074"></a>
-<span class="sourceLineNo">2075</span>  @Override<a name="line.2075"></a>
-<span class="sourceLineNo">2076</span>  public void close() {<a name="line.2076"></a>
-<span class="sourceLineNo">2077</span>    if (this.closed) {<a name="line.2077"></a>
-<span class="sourceLineNo">2078</span>      return;<a name="line.2078"></a>
-<span class="sourceLineNo">2079</span>    }<a name="line.2079"></a>
-<span class="sourceLineNo">2080</span>    closeMaster();<a name="line.2080"></a>
-<span class="sourceLineNo">2081</span>    shutdownPools();<a name="line.2081"></a>
-<span class="sourceLineNo">2082</span>    if (this.metrics != null) {<a name="line.2082"></a>
-<span class="sourceLineNo">2083</span>      this.metrics.shutdown();<a name="line.2083"></a>
-<span class="sourceLineNo">2084</span>    }<a name="line.2084"></a>
-<span class="sourceLineNo">2085</span>    this.closed = true;<a name="line.2085"></a>
-<span class="sourceLineNo">2086</span>    closeZooKeeperWatcher();<a name="line.2086"></a>
-<span class="sourceLineNo">2087</span>    this.stubs.clear();<a name="line.2087"></a>
-<span class="sourceLineNo">2088</span>    if (clusterStatusListener != null) {<a name="line.2088"></a>
-<span class="sourceLineNo">2089</span>      clusterStatusListener.close();<a name="line.2089"></a>
-<span class="sourceLineNo">2090</span>    }<a name="line.2090"></a>
-<span class="sourceLineNo">2091</span>    if (rpcClient != null) {<a name="line.2091"></a>
-<span class="sourceLineNo">2092</span>      rpcClient.close();<a name="line.2092"></a>
+<span class="sourceLineNo">2001</span>  @Override<a name="line.2001"></a>
+<span class="sourceLineNo">2002</span>  public ClientBackoffPolicy getBackoffPolicy() {<a name="line.2002"></a>
+<span class="sourceLineNo">2003</span>    return this.backoffPolicy;<a name="line.2003"></a>
+<span class="sourceLineNo">2004</span>  }<a name="line.2004"></a>
+<span class="sourceLineNo">2005</span><a name="line.2005"></a>
+<span class="sourceLineNo">2006</span>  /*<a name="line.2006"></a>
+<span class="sourceLineNo">2007</span>   * Return the number of cached region for a table. It will only be called<a name="line.2007"></a>
+<span class="sourceLineNo">2008</span>   * from a unit test.<a name="line.2008"></a>
+<span class="sourceLineNo">2009</span>   */<a name="line.2009"></a>
+<span class="sourceLineNo">2010</span>  @VisibleForTesting<a name="line.2010"></a>
+<span class="sourceLineNo">2011</span>  int getNumberOfCachedRegionLocations(final TableName tableName) {<a name="line.2011"></a>
+<span class="sourceLineNo">2012</span>    return metaCache.getNumberOfCachedRegionLocations(tableName);<a name="line.2012"></a>
+<span class="sourceLineNo">2013</span>  }<a name="line.2013"></a>
+<span class="sourceLineNo">2014</span><a name="line.2014"></a>
+<span class="sourceLineNo">2015</span>  /**<a name="line.2015"></a>
+<span class="sourceLineNo">2016</span>   * @deprecated always return false since 0.99<a name="line.2016"></a>
+<span class="sourceLineNo">2017</span>   */<a name="line.2017"></a>
+<span class="sourceLineNo">2018</span>  @Override<a name="line.2018"></a>
+<span class="sourceLineNo">2019</span>  @Deprecated<a name="line.2019"></a>
+<span class="sourceLineNo">2020</span>  public void setRegionCachePrefetch(final TableName tableName, final boolean enable) {<a name="line.2020"></a>
+<span class="sourceLineNo">2021</span>  }<a name="line.2021"></a>
+<span class="sourceLineNo">2022</span><a name="line.2022"></a>
+<span class="sourceLineNo">2023</span>  /**<a name="line.2023"></a>
+<span class="sourceLineNo">2024</span>   * @deprecated always return false since 0.99<a name="line.2024"></a>
+<span class="sourceLineNo">2025</span>   */<a name="line.2025"></a>
+<span class="sourceLineNo">2026</span>  @Override<a name="line.2026"></a>
+<span class="sourceLineNo">2027</span>  @Deprecated<a name="line.2027"></a>
+<span class="sourceLineNo">2028</span>  public void setRegionCachePrefetch(final byte[] tableName,<a name="line.2028"></a>
+<span class="sourceLineNo">2029</span>      final boolean enable) {<a name="line.2029"></a>
+<span class="sourceLineNo">2030</span>  }<a name="line.2030"></a>
+<span class="sourceLineNo">2031</span><a name="line.2031"></a>
+<span class="sourceLineNo">2032</span>  /**<a name="line.2032"></a>
+<span class="sourceLineNo">2033</span>   * @deprecated always return false since 0.99<a name="line.2033"></a>
+<span class="sourceLineNo">2034</span>   */<a name="line.2034"></a>
+<span class="sourceLineNo">2035</span>  @Override<a name="line.2035"></a>
+<span class="sourceLineNo">2036</span>  @Deprecated<a name="line.2036"></a>
+<span class="sourceLineNo">2037</span>  public boolean getRegionCachePrefetch(TableName tableName) {<a name="line.2037"></a>
+<span class="sourceLineNo">2038</span>    return false;<a name="line.2038"></a>
+<span class="sourceLineNo">2039</span>  }<a name="line.2039"></a>
+<span class="sourceLineNo">2040</span><a name="line.2040"></a>
+<span class="sourceLineNo">2041</span>  /**<a name="line.2041"></a>
+<span class="sourceLineNo">2042</span>   * @deprecated always return false since 0.99<a name="line.2042"></a>
+<span class="sourceLineNo">2043</span>   */<a name="line.2043"></a>
+<span class="sourceLineNo">2044</span>  @Override<a name="line.2044"></a>
+<span class="sourceLineNo">2045</span>  @Deprecated<a name="line.2045"></a>
+<span class="sourceLineNo">2046</span>  public boolean getRegionCachePrefetch(byte[] tableName) {<a name="line.2046"></a>
+<span class="sourceLineNo">2047</span>    return false;<a name="line.2047"></a>
+<span class="sourceLineNo">2048</span>  }<a name="line.2048"></a>
+<span class="sourceLineNo">2049</span><a name="line.2049"></a>
+<span class="sourceLineNo">2050</span>  @Override<a name="line.2050"></a>
+<span class="sourceLineNo">2051</span>  public void abort(final String msg, Throwable t) {<a name="line.2051"></a>
+<span class="sourceLineNo">2052</span>    if (t instanceof KeeperException.SessionExpiredException<a name="line.2052"></a>
+<span class="sourceLineNo">2053</span>      &amp;&amp; keepAliveZookeeper != null) {<a name="line.2053"></a>
+<span class="sourceLineNo">2054</span>      synchronized (masterAndZKLock) {<a name="line.2054"></a>
+<span class="sourceLineNo">2055</span>        if (keepAliveZookeeper != null) {<a name="line.2055"></a>
+<span class="sourceLineNo">2056</span>          LOG.warn("This client just lost it's session with ZooKeeper," +<a name="line.2056"></a>
+<span class="sourceLineNo">2057</span>            " closing it." +<a name="line.2057"></a>
+<span class="sourceLineNo">2058</span>            " It will be recreated next time someone needs it", t);<a name="line.2058"></a>
+<span class="sourceLineNo">2059</span>          closeZooKeeperWatcher();<a name="line.2059"></a>
+<span class="sourceLineNo">2060</span>        }<a name="line.2060"></a>
+<span class="sourceLineNo">2061</span>      }<a name="line.2061"></a>
+<span class="sourceLineNo">2062</span>    } else {<a name="line.2062"></a>
+<span class="sourceLineNo">2063</span>      if (t != null) {<a name="line.2063"></a>
+<span class="sourceLineNo">2064</span>        LOG.fatal(msg, t);<a name="line.2064"></a>
+<span class="sourceLineNo">2065</span>      } else {<a name="line.2065"></a>
+<span class="sourceLineNo">2066</span>        LOG.fatal(msg);<a name="line.2066"></a>
+<span class="sourceLineNo">2067</span>      }<a name="line.2067"></a>
+<span class="sourceLineNo">2068</span>      this.aborted = true;<a name="line.2068"></a>
+<span class="sourceLineNo">2069</span>      close();<a name="line.2069"></a>
+<span class="sourceLineNo">2070</span>      this.closed = true;<a name="line.2070"></a>
+<span class="sourceLineNo">2071</span>    }<a name="line.2071"></a>
+<span class="sourceLineNo">2072</span>  }<a name="line.2072"></a>
+<span class="sourceLineNo">2073</span><a name="line.2073"></a>
+<span class="sourceLineNo">2074</span>  @Override<a name="line.2074"></a>
+<span class="sourceLineNo">2075</span>  public boolean isClosed() {<a name="line.2075"></a>
+<span class="sourceLineNo">2076</span>    return this.closed;<a name="line.2076"></a>
+<span class="sourceLineNo">2077</span>  }<a name="line.2077"></a>
+<span class="sourceLineNo">2078</span><a name="line.2078"></a>
+<span class="sourceLineNo">2079</span>  @Override<a name="line.2079"></a>
+<span class="sourceLineNo">2080</span>  public boolean isAborted(){<a name="line.2080"></a>
+<span class="sourceLineNo">2081</span>    return this.aborted;<a name="line.2081"></a>
+<span class="sourceLineNo">2082</span>  }<a name="line.2082"></a>
+<span class="sourceLineNo">2083</span><a name="line.2083"></a>
+<span class="sourceLineNo">2084</span>  @Override<a name="line.2084"></a>
+<span class="sourceLineNo">2085</span>  public int getCurrentNrHRS() throws IOException {<a name="line.2085"></a>
+<span class="sourceLineNo">2086</span>    return this.registry.getCurrentNrHRS();<a name="line.2086"></a>
+<span class="sourceLineNo">2087</span>  }<a name="line.2087"></a>
+<span class="sourceLineNo">2088</span><a name="line.2088"></a>
+<span class="sourceLineNo">2089</span>  @Override<a name="line.2089"></a>
+<span class="sourceLineNo">2090</span>  public void close() {<a name="line.2090"></a>
+<span class="sourceLineNo">2091</span>    if (this.closed) {<a name="line.2091"></a>
+<span class="sourceLineNo">2092</span>      return;<a name="line.2092"></a>
 <span class="sourceLineNo">2093</span>    }<a name="line.2093"></a>
-<span class="sourceLineNo">2094</span>  }<a name="line.2094"></a>
-<span class="sourceLineNo">2095</span><a name="line.2095"></a>
-<span class="sourceLineNo">2096</span>  /**<a name="line.2096"></a>
-<span class="sourceLineNo">2097</span>   * Close the connection for good. On the off chance that someone is unable to close<a name="line.2097"></a>
-<span class="sourceLineNo">2098</span>   * the connection, perhaps because it bailed out prematurely, the method<a name="line.2098"></a>
-<span class="sourceLineNo">2099</span>   * below will ensure that this instance is cleaned up.<a name="line.2099"></a>
-<span class="sourceLineNo">2100</span>   * Caveat: The JVM may take an unknown amount of time to call finalize on an<a name="line.2100"></a>
-<span class="sourceLineNo">2101</span>   * unreachable object, so our hope is that every consumer cleans up after<a name="line.2101"></a>
-<span class="sourceLineNo">2102</span>   * itself, like any good citizen.<a name="line.2102"></a>
-<span class="sourceLineNo">2103</span>   */<a name="line.2103"></a>
-<span class="sourceLineNo">2104</span>  @Override<a name="line.2104"></a>
-<span class="sourceLineNo">2105</span>  protected void finalize() throws Throwable {<a name="line.2105"></a>
-<span class="sourceLineNo">2106</span>    super.finalize();<a name="line.2106"></a>
-<span class="sourceLineNo">2107</span>    close();<a name="line.2107"></a>
+<span class="sourceLineNo">2094</span>    closeMaster();<a name="line.2094"></a>
+<span class="sourceLineNo">2095</span>    shutdownPools();<a name="line.2095"></a>
+<span class="sourceLineNo">2096</span>    if (this.metrics != null) {<a name="line.2096"></a>
+<span class="sourceLineNo">2097</span>      this.metrics.shutdown();<a name="line.2097"></a>
+<span class="sourceLineNo">2098</span>    }<a name="line.2098"></a>
+<span class="sourceLineNo">2099</span>    this.closed = true;<a name="line.2099"></a>
+<span class="sourceLineNo">2100</span>    closeZooKeeperWatcher();<a name="line.2100"></a>
+<span class="sourceLineNo">2101</span>    this.stubs.clear();<a name="line.2101"></a>
+<span class="sourceLineNo">2102</span>    if (clusterStatusListener != null) {<a name="line.2102"></a>
+<span class="sourceLineNo">2103</span>      clusterStatusListener.close();<a name="line.2103"></a>
+<span class="sourceLineNo">2104</span>    }<a name="line.2104"></a>
+<span class="sourceLineNo">2105</span>    if (rpcClient != null) {<a name="line.2105"></a>
+<span class="sourceLineNo">2106</span>      rpcClient.close();<a name="line.2106"></a>
+<span class="sourceLineNo">2107</span>    }<a name="line.2107"></a>
 <span class="sourceLineNo">2108</span>  }<a name="line.2108"></a>
 <span class="sourceLineNo">2109</span><a name="line.2109"></a>
 <span class="sourceLineNo">2110</span>  /**<a name="line.2110"></a>
-<span class="sourceLineNo">2111</span>   * @deprecated Use {@link org.apache.hadoop.hbase.client.Admin#listTables()} instead<a name="line.2111"></a>
-<span class="sourceLineNo">2112</span>   */<a name="line.2112"></a>
-<span class="sourceLineNo">2113</span>  @Deprecated<a name="line.2113"></a>
-<span class="sourceLineNo">2114</span>  @Override<a name="line.2114"></a>
-<span class="sourceLineNo">2115</span>  public HTableDescriptor[] listTables() throws IOException {<a name="line.2115"></a>
-<span class="sourceLineNo">2116</span>    MasterKeepAliveConnection master = getKeepAliveMasterService();<a name="line.2116"></a>
-<span class="sourceLineNo">2117</span>    try {<a name="line.2117"></a>
-<span class="sourceLineNo">2118</span>      MasterProtos.GetTableDescriptorsRequest req =<a name="line.2118"></a>
-<span class="sourceLineNo">2119</span>        RequestConverter.buildGetTableDescriptorsRequest((List&lt;TableName&gt;)null);<a name="line.2119"></a>
-<span class="sourceLineNo">2120</span>      return ProtobufUtil.getHTableDescriptorArray(master.getTableDescriptors(null, req));<a name="line.2120"></a>
-<span class="sourceLineNo">2121</span>    } catch (ServiceException se) {<a name="line.2121"></a>
-<span class="sourceLineNo">2122</span>      throw ProtobufUtil.getRemoteException(se);<a name="line.2122"></a>
-<span class="sourceLineNo">2123</span>    } finally {<a name="line.2123"></a>
-<span class="sourceLineNo">2124</span>      master.close();<a name="line.2124"></a>
-<span class="sourceLineNo">2125</span>    }<a name="line.2125"></a>
-<span class="sourceLineNo">2126</span>  }<a name="line.2126"></a>
-<span class="sourceLineNo">2127</span><a name="line.2127"></a>
-<span class="sourceLineNo">2128</span>  /**<a name="line.2128"></a>
-<span class="sourceLineNo">2129</span>   * @deprecated Use {@link org.apache.hadoop.hbase.client.Admin#listTableNames()} instead<a name="line.2129"></a>
-<span class="sourceLineNo">2130</span>   */<a name="line.2130"></a>
-<span class="sourceLineNo">2131</span>  @Deprecated<a name="line.2131"></a>
-<span class="sourceLineNo">2132</span>  @Override<a name="line.2132"></a>
-<span class="sourceLineNo">2133</span>  public String[] getTableNames() throws IOException {<a name="line.2133"></a>
-<span class="sourceLineNo">2134</span>    TableName[] tableNames = listTableNames();<a name="line.2134"></a>
-<span class="sourceLineNo">2135</span>    String[] result = new String[tableNames.length];<a name="line.2135"></a>
-<span class="sourceLineNo">2136</span>    for (int i = 0; i &lt; tableNames.length; i++) {<a name="line.2136"></a>
-<span class="sourceLineNo">2137</span>      result[i] = tableNames[i].getNameAsString();<a name="line.2137"></a>
-<span class="sourceLineNo">2138</span>    }<a name="line.2138"></a>
-<span class="sourceLineNo">2139</span>    return result;<a name="line.2139"></a>
+<span class="sourceLineNo">2111</span>   * Close the connection for good. On the off chance that someone is unable to close<a name="line.2111"></a>
+<span class="sourceLineNo">2112</span>   * the connection, perhaps because it bailed out prematurely, the method<a name="line.2112"></a>
+<span class="sourceLineNo">2113</span>   * below will ensure that this instance is cleaned up.<a name="line.2113"></a>
+<span class="sourceLineNo">2114</span>   * Caveat: The JVM may take an unknown amount of time to call finalize on an<a name="line.2114"></a>
+<span class="sourceLineNo">2115</span>   * unreachable object, so our hope is that every consumer cleans up after<a name="line.2115"></a>
+<span class="sourceLineNo">2116</span>   * itself, like any good citizen.<a name="line.2116"></a>
+<span class="sourceLineNo">2117</span>   */<a name="line.2117"></a>
+<span class="sourceLineNo">2118</span>  @Override<a name="line.2118"></a>
+<span class="sourceLineNo">2119</span>  protected void finalize() throws Throwable {<a name="line.2119"></a>
+<span class="sourceLineNo">2120</span>    super.finalize();<a name="line.2120"></a>
+<span class="sourceLineNo">2121</span>    close();<a name="line.2121"></a>
+<span class="sourceLineNo">2122</span>  }<a name="line.2122"></a>
+<span class="sourceLineNo">2123</span><a name="line.2123"></a>
+<span class="sourceLineNo">2124</span>  /**<a name="line.2124"></a>
+<span class="sourceLineNo">2125</span>   * @deprecated Use {@link org.apache.hadoop.hbase.client.Admin#listTables()} instead<a name="line.2125"></a>
+<span class="sourceLineNo">2126</span>   */<a name="line.2126"></a>
+<span class="sourceLineNo">2127</span>  @Deprecated<a name="line.2127"></a>
+<span class="sourceLineNo">2128</span>  @Override<a name="line.2128"></a>
+<span class="sourceLineNo">2129</span>  public HTableDescriptor[] listTables() throws IOException {<a name="line.2129"></a>
+<span class="sourceLineNo">2130</span>    MasterKeepAliveConnection master = getKeepAliveMasterService();<a name="line.2130"></a>
+<span class="sourceLineNo">2131</span>    try {<a name="line.2131"></a>
+<span class="sourceLineNo">2132</span>      MasterProtos.GetTableDescriptorsRequest req =<a name="line.2132"></a>
+<span class="sourceLineNo">2133</span>        RequestConverter.buildGetTableDescriptorsRequest((List&lt;TableName&gt;)null);<a name="line.2133"></a>
+<span class="sourceLineNo">2134</span>      return ProtobufUtil.getHTableDescriptorArray(master.getTableDescriptors(null, req));<a name="line.2134"></a>
+<span class="sourceLineNo">2135</span>    } catch (ServiceException se) {<a name="line.2135"></a>
+<span class="sourceLineNo">2136</span>      throw ProtobufUtil.getRemoteException(se);<a name="line.2136"></a>
+<span class="sourceLineNo">2137</span>    } finally {<a name="line.2137"></a>
+<span class="sourceLineNo">2138</span>      master.close();<a name="line.2138"></a>
+<span class="sourceLineNo">2139</span>    }<a name="line.2139"></a>
 <span class="sourceLineNo">2140</span>  }<a name="line.2140"></a>
 <span class="sourceLineNo">2141</span><a name="line.2141"></a>
 <span class="sourceLineNo">2142</span>  /**<a name="line.2142"></a>
@@ -2152,123 +2152,137 @@
 <span class="sourceLineNo">2144</span>   */<a name="line.2144"></a>
 <span class="sourceLineNo">2145</span>  @Deprecated<a name="line.2145"></a>
 <span class="sourceLineNo">2146</span>  @Override<a name="line.2146"></a>
-<span class="sourceLineNo">2147</span>  public TableName[] listTableNames() throws IOException {<a name="line.2147"></a>
-<span class="sourceLineNo">2148</span>    MasterKeepAliveConnection master = getKeepAliveMasterService();<a name="line.2148"></a>
-<span class="sourceLineNo">2149</span>    try {<a name="line.2149"></a>
-<span class="sourceLineNo">2150</span>      return ProtobufUtil.getTableNameArray(master.getTableNames(null,<a name="line.2150"></a>
-<span class="sourceLineNo">2151</span>        MasterProtos.GetTableNamesRequest.newBuilder().build())<a name="line.2151"></a>
-<span class="sourceLineNo">2152</span>        .getTableNamesList());<a name="line.2152"></a>
-<span class="sourceLineNo">2153</span>    } catch (ServiceException se) {<a name="line.2153"></a>
-<span class="sourceLineNo">2154</span>      throw ProtobufUtil.getRemoteException(se);<a name="line.2154"></a>
-<span class="sourceLineNo">2155</span>    } finally {<a name="line.2155"></a>
-<span class="sourceLineNo">2156</span>      master.close();<a name="line.2156"></a>
-<span class="sourceLineNo">2157</span>    }<a name="line.2157"></a>
-<span class="sourceLineNo">2158</span>  }<a name="line.2158"></a>
-<span class="sourceLineNo">2159</span><a name="line.2159"></a>
-<span class="sourceLineNo">2160</span>  /**<a name="line.2160"></a>
-<span class="sourceLineNo">2161</span>   * @deprecated Use {@link<a name="line.2161"></a>
-<span class="sourceLineNo">2162</span>   *  org.apache.hadoop.hbase.client.Admin#getTableDescriptorsByTableName(java.util.List)} instead<a name="line.2162"></a>
-<span class="sourceLineNo">2163</span>   */<a name="line.2163"></a>
-<span class="sourceLineNo">2164</span>  @Deprecated<a name="line.2164"></a>
-<span class="sourceLineNo">2165</span>  @Override<a name="line.2165"></a>
-<span class="sourceLineNo">2166</span>  public HTableDescriptor[] getHTableDescriptorsByTableName(<a name="line.2166"></a>
-<span class="sourceLineNo">2167</span>      List&lt;TableName&gt; tableNames) throws IOException {<a name="line.2167"></a>
-<span class="sourceLineNo">2168</span>    if (tableNames == null || tableNames.isEmpty()) return new HTableDescriptor[0];<a name="line.2168"></a>
-<span class="sourceLineNo">2169</span>    MasterKeepAliveConnection master = getKeepAliveMasterService();<a name="line.2169"></a>
-<span class="sourceLineNo">2170</span>    try {<a name="line.2170"></a>
-<span class="sourceLineNo">2171</span>      MasterProtos.GetTableDescriptorsRequest req =<a name="line.2171"></a>
-<span class="sourceLineNo">2172</span>        RequestConverter.buildGetTableDescriptorsRequest(tableNames);<a name="line.2172"></a>
-<span class="sourceLineNo">2173</span>      return ProtobufUtil.getHTableDescriptorArray(master.getTableDescriptors(null, req));<a name="line.2173"></a>
-<span class="sourceLineNo">2174</span>    } catch (ServiceException se) {<a name="line.2174"></a>
-<span class="sourceLineNo">2175</span>      throw ProtobufUtil.getRemoteException(se);<a name="line.2175"></a>
-<span class="sourceLineNo">2176</span>    } finally {<a name="line.2176"></a>
-<span class="sourceLineNo">2177</span>      master.close();<a name="line.2177"></a>
-<span class="sourceLineNo">2178</span>    }<a name="line.2178"></a>
-<span class="sourceLineNo">2179</span>  }<a name="line.2179"></a>
-<span class="sourceLineNo">2180</span><a name="line.2180"></a>
-<span class="sourceLineNo">2181</span>  /**<a name="line.2181"></a>
-<span class="sourceLineNo">2182</span>   * @deprecated Use<a name="line.2182"></a>
-<span class="sourceLineNo">2183</span>   *  {@link org.apache.hadoop.hbase.client.Admin#getTableDescriptorsByTableName(java.util.List)}<a name="line.2183"></a>
-<span class="sourceLineNo">2184</span>   *  instead<a name="line.2184"></a>
-<span class="sourceLineNo">2185</span>   */<a name="line.2185"></a>
-<span class="sourceLineNo">2186</span>  @Deprecated<a name="line.2186"></a>
-<span class="sourceLineNo">2187</span>  @Override<a name="line.2187"></a>
-<span class="sourceLineNo">2188</span>  public HTableDescriptor[] getHTableDescriptors(List&lt;String&gt; names) throws IOException {<a name="line.2188"></a>
-<span class="sourceLineNo">2189</span>    List&lt;TableName&gt; tableNames = new ArrayList&lt;TableName&gt;(names.size());<a name="line.2189"></a>
-<span class="sourceLineNo">2190</span>    for(String name : names) {<a name="line.2190"></a>
-<span class="sourceLineNo">2191</span>      tableNames.add(TableName.valueOf(name));<a name="line.2191"></a>
+<span class="sourceLineNo">2147</span>  public String[] getTableNames() throws IOException {<a name="line.2147"></a>
+<span class="sourceLineNo">2148</span>    TableName[] tableNames = listTableNames();<a name="line.2148"></a>
+<span class="sourceLineNo">2149</span>    String[] result = new String[tableNames.length];<a name="line.2149"></a>
+<span class="sourceLineNo">2150</span>    for (int i = 0; i &lt; tableNames.length; i++) {<a name="line.2150"></a>
+<span class="sourceLineNo">2151</span>      result[i] = tableNames[i].getNameAsString();<a name="line.2151"></a>
+<span class="sourceLineNo">2152</span>    }<a name="line.2152"></a>
+<span class="sourceLineNo">2153</span>    return result;<a name="line.2153"></a>
+<span class="sourceLineNo">2154</span>  }<a name="line.2154"></a>
+<span class="sourceLineNo">2155</span><a name="line.2155"></a>
+<span class="sourceLineNo">2156</span>  /**<a name="line.2156"></a>
+<span class="sourceLineNo">2157</span>   * @deprecated Use {@link org.apache.hadoop.hbase.client.Admin#listTableNames()} instead<a name="line.2157"></a>
+<span class="sourceLineNo">2158</span>   */<a name="line.2158"></a>
+<span class="sourceLineNo">2159</span>  @Deprecated<a name="line.2159"></a>
+<span class="sourceLineNo">2160</span>  @Override<a name="line.2160"></a>
+<span class="sourceLineNo">2161</span>  public TableName[] listTableNames() throws IOException {<a name="line.2161"></a>
+<span class="sourceLineNo">2162</span>    MasterKeepAliveConnection master = getKeepAliveMasterService();<a name="line.2162"></a>
+<span class="sourceLineNo">2163</span>    try {<a name="line.2163"></a>
+<span class="sourceLineNo">2164</span>      return ProtobufUtil.getTableNameArray(master.getTableNames(null,<a name="line.2164"></a>
+<span class="sourceLineNo">2165</span>        MasterProtos.GetTableNamesRequest.newBuilder().build())<a name="line.2165"></a>
+<span class="sourceLineNo">2166</span>        .getTableNamesList());<a name="line.2166"></a>
+<span class="sourceLineNo">2167</span>    } catch (ServiceException se) {<a name="line.2167"></a>
+<span class="sourceLineNo">2168</span>      throw ProtobufUtil.getRemoteException(se);<a name="line.2168"></a>
+<span class="sourceLineNo">2169</span>    } finally {<a name="line.2169"></a>
+<span class="sourceLineNo">2170</span>      master.close();<a name="line.2170"></a>
+<span class="sourceLineNo">2171</span>    }<a name="line.2171"></a>
+<span class="sourceLineNo">2172</span>  }<a name="line.2172"></a>
+<span class="sourceLineNo">2173</span><a name="line.2173"></a>
+<span class="sourceLineNo">2174</span>  /**<a name="line.2174"></a>
+<span class="sourceLineNo">2175</span>   * @deprecated Use {@link<a name="line.2175"></a>
+<span class="sourceLineNo">2176</span>   *  org.apache.hadoop.hbase.client.Admin#getTableDescriptorsByTableName(java.util.List)} instead<a name="line.2176"></a>
+<span class="sourceLineNo">2177</span>   */<a name="line.2177"></a>
+<span class="sourceLineNo">2178</span>  @Deprecated<a name="line.2178"></a>
+<span class="sourceLineNo">2179</span>  @Override<a name="line.2179"></a>
+<span class="sourceLineNo">2180</span>  public HTableDescriptor[] getHTableDescriptorsByTableName(<a name="line.2180"></a>
+<span class="sourceLineNo">2181</span>      List&lt;TableName&gt; tableNames) throws IOException {<a name="line.2181"></a>
+<span class="sourceLineNo">2182</span>    if (tableNames == null || tableNames.isEmpty()) return new HTableDescriptor[0];<a name="line.2182"></a>
+<span class="sourceLineNo">2183</span>    MasterKeepAliveConnection master = getKeepAliveMasterService();<a name="line.2183"></a>
+<span class="sourceLineNo">2184</span>    try {<a name="line.2184"></a>
+<span class="sourceLineNo">2185</span>      MasterProtos.GetTableDescriptorsRequest req =<a name="line.2185"></a>
+<span class="sourceLineNo">2186</span>        RequestConverter.buildGetTableDescriptorsRequest(tableNames);<a name="line.2186"></a>
+<span class="sourceLineNo">2187</span>      return ProtobufUtil.getHTableDescriptorArray(master.getTableDescriptors(null, req));<a name="line.2187"></a>
+<span class="sourceLineNo">2188</span>    } catch (ServiceException se) {<a name="line.2188"></a>
+<span class="sourceLineNo">2189</span>      throw ProtobufUtil.getRemoteException(se);<a name="line.2189"></a>
+<span class="sourceLineNo">2190</span>    } finally {<a name="line.2190"></a>
+<span class="sourceLineNo">2191</span>      master.close();<a name="line.2191"></a>
 <span class="sourceLineNo">2192</span>    }<a name="line.2192"></a>
-<span class="sourceLineNo">2193</span><a name="line.2193"></a>
-<span class="sourceLineNo">2194</span>    return getHTableDescriptorsByTableName(tableNames);<a name="line.2194"></a>
-<span class="sourceLineNo">2195</span>  }<a name="line.2195"></a>
-<span class="sourceLineNo">2196</span><a name="line.2196"></a>
-<span class="sourceLineNo">2197</span>  @Override<a name="line.2197"></a>
-<span class="sourceLineNo">2198</span>  public NonceGenerator getNonceGenerator() {<a name="line.2198"></a>
-<span class="sourceLineNo">2199</span>    return nonceGenerator;<a name="line.2199"></a>
-<span class="sourceLineNo">2200</span>  }<a name="line.2200"></a>
-<span class="sourceLineNo">2201</span><a name="line.2201"></a>
-<span class="sourceLineNo">2202</span>  /**<a name="line.2202"></a>
-<span class="sourceLineNo">2203</span>   * Connects to the master to get the table descriptor.<a name="line.2203"></a>
-<span class="sourceLineNo">2204</span>   * @param tableName table name<a name="line.2204"></a>
-<span class="sourceLineNo">2205</span>   * @throws java.io.IOException if the connection to master fails or if the table<a name="line.2205"></a>
-<span class="sourceLineNo">2206</span>   *  is not found.<a name="line.2206"></a>
-<span class="sourceLineNo">2207</span>   * @deprecated Use {@link<a name="line.2207"></a>
-<span class="sourceLineNo">2208</span>   *  org.apache.hadoop.hbase.client.Admin#getTableDescriptor(org.apache.hadoop.hbase.TableName)}<a name="line.2208"></a>
-<span class="sourceLineNo">2209</span>   *  instead<a name="line.2209"></a>
-<span class="sourceLineNo">2210</span>   */<a name="line.2210"></a>
-<span class="sourceLineNo">2211</span>  @Deprecated<a name="line.2211"></a>
-<span class="sourceLineNo">2212</span>  @Override<a name="line.2212"></a>
-<span class="sourceLineNo">2213</span>  public HTableDescriptor getHTableDescriptor(final TableName tableName)<a name="line.2213"></a>
-<span class="sourceLineNo">2214</span>  throws IOException {<a name="line.2214"></a>
-<span class="sourceLineNo">2215</span>    if (tableName == null) return null;<a name="line.2215"></a>
-<span class="sourceLineNo">2216</span>    MasterKeepAliveConnection master = getKeepAliveMasterService();<a name="line.2216"></a>
-<span class="sourceLineNo">2217</span>    MasterProtos.GetTableDescriptorsResponse htds;<a name="line.2217"></a>
-<span class="sourceLineNo">2218</span>    try {<a name="line.2218"></a>
-<span class="sourceLineNo">2219</span>      MasterProtos.GetTableDescriptorsRequest req =<a name="line.2219"></a>
-<span class="sourceLineNo">2220</span>          RequestConverter.buildGetTableDescriptorsRequest(tableName);<a name="line.2220"></a>
-<span class="sourceLineNo">2221</span>      htds = master.getTableDescriptors(null, req);<a name="line.2221"></a>
-<span class="sourceLineNo">2222</span>    } catch (ServiceException se) {<a name="line.2222"></a>
-<span class="sourceLineNo">2223</span>      throw ProtobufUtil.getRemoteException(se);<a name="line.2223"></a>
-<span class="sourceLineNo">2224</span>    } finally {<a name="line.2224"></a>
-<span class="sourceLineNo">2225</span>      master.close();<a name="line.2225"></a>
-<span class="sourceLineNo">2226</span>    }<a name="line.2226"></a>
-<span class="sourceLineNo">2227</span>    if (!htds.getTableSchemaList().isEmpty()) {<a name="line.2227"></a>
-<span class="sourceLineNo">2228</span>      return HTableDescriptor.convert(htds.getTableSchemaList().get(0));<a name="line.2228"></a>
-<span class="sourceLineNo">2229</span>    }<a name="line.2229"></a>
-<span class="sourceLineNo">2230</span>    throw new TableNotFoundException(tableName.getNameAsString());<a name="line.2230"></a>
-<span class="sourceLineNo">2231</span>  }<a name="line.2231"></a>
-<span class="sourceLineNo">2232</span><a name="line.2232"></a>
-<span class="sourceLineNo">2233</span>  /**<a name="line.2233"></a>
-<span class="sourceLineNo">2234</span>   * @deprecated Use {@link<a name="line.2234"></a>
-<span class="sourceLineNo">2235</span>   *  org.apache.hadoop.hbase.client.Admin#getTableDescriptor(org.apache.hadoop.hbase.TableName)}<a name="line.2235"></a>
-<span class="sourceLineNo">2236</span>   *  instead<a name="line.2236"></a>
-<span class="sourceLineNo">2237</span>   */<a name="line.2237"></a>
-<span class="sourceLineNo">2238</span>  @Deprecated<a name="line.2238"></a>
-<span class="sourceLineNo">2239</span>  @Override<a name="line.2239"></a>
-<span class="sourceLineNo">2240</span>  public HTableDescriptor getHTableDescriptor(final byte[] tableName)<a name="line.2240"></a>
-<span class="sourceLineNo">2241</span>  throws IOException {<a name="line.2241"></a>
-<span class="sourceLineNo">2242</span>    return getHTableDescriptor(TableName.valueOf(tableName));<a name="line.2242"></a>
-<span class="sourceLineNo">2243</span>  }<a name="line.2243"></a>
-<span class="sourceLineNo">2244</span><a name="line.2244"></a>
-<span class="sourceLineNo">2245</span>  @Override<a name="line.2245"></a>
-<span class="sourceLineNo">2246</span>  public TableState getTableState(TableName tableName) throws IOException {<a name="line.2246"></a>
-<span class="sourceLineNo">2247

<TRUNCATED>

Mime
View raw message