hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [30/51] [partial] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd.
Date Sat, 10 Jun 2017 15:00:20 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/476c54ed/devapidocs/org/apache/hadoop/metrics2/class-use/MetricHistogram.html
----------------------------------------------------------------------
diff --git a/devapidocs/org/apache/hadoop/metrics2/class-use/MetricHistogram.html b/devapidocs/org/apache/hadoop/metrics2/class-use/MetricHistogram.html
index bc9ad26..4c691a0 100644
--- a/devapidocs/org/apache/hadoop/metrics2/class-use/MetricHistogram.html
+++ b/devapidocs/org/apache/hadoop/metrics2/class-use/MetricHistogram.html
@@ -223,18 +223,30 @@ service.</div>
 </tr>
 <tr class="rowColor">
 <td class="colFirst"><code>private <a href="../../../../../org/apache/hadoop/metrics2/MetricHistogram.html"
title="interface in org.apache.hadoop.metrics2">MetricHistogram</a></code></td>
-<td class="colLast"><span class="typeNameLabel">MetricsSnapshotSourceImpl.</span><code><span
class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/master/MetricsSnapshotSourceImpl.html#snapshotRestoreTimeHisto">snapshotRestoreTimeHisto</a></span></code>&nbsp;</td>
+<td class="colLast"><span class="typeNameLabel">MetricsMasterQuotaSourceImpl.</span><code><span
class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.html#snapshotObserverSizeComputationTimeHisto">snapshotObserverSizeComputationTimeHisto</a></span></code>&nbsp;</td>
 </tr>
 <tr class="altColor">
 <td class="colFirst"><code>private <a href="../../../../../org/apache/hadoop/metrics2/MetricHistogram.html"
title="interface in org.apache.hadoop.metrics2">MetricHistogram</a></code></td>
-<td class="colLast"><span class="typeNameLabel">MetricsSnapshotSourceImpl.</span><code><span
class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/master/MetricsSnapshotSourceImpl.html#snapshotTimeHisto">snapshotTimeHisto</a></span></code>&nbsp;</td>
+<td class="colLast"><span class="typeNameLabel">MetricsMasterQuotaSourceImpl.</span><code><span
class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.html#snapshotObserverSnapshotFetchTimeHisto">snapshotObserverSnapshotFetchTimeHisto</a></span></code>&nbsp;</td>
 </tr>
 <tr class="rowColor">
 <td class="colFirst"><code>private <a href="../../../../../org/apache/hadoop/metrics2/MetricHistogram.html"
title="interface in org.apache.hadoop.metrics2">MetricHistogram</a></code></td>
-<td class="colLast"><span class="typeNameLabel">MetricsMasterFilesystemSourceImpl.</span><code><span
class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/master/MetricsMasterFilesystemSourceImpl.html#splitSizeHisto">splitSizeHisto</a></span></code>&nbsp;</td>
+<td class="colLast"><span class="typeNameLabel">MetricsMasterQuotaSourceImpl.</span><code><span
class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.html#snapshotObserverTimeHisto">snapshotObserverTimeHisto</a></span></code>&nbsp;</td>
 </tr>
 <tr class="altColor">
 <td class="colFirst"><code>private <a href="../../../../../org/apache/hadoop/metrics2/MetricHistogram.html"
title="interface in org.apache.hadoop.metrics2">MetricHistogram</a></code></td>
+<td class="colLast"><span class="typeNameLabel">MetricsSnapshotSourceImpl.</span><code><span
class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/master/MetricsSnapshotSourceImpl.html#snapshotRestoreTimeHisto">snapshotRestoreTimeHisto</a></span></code>&nbsp;</td>
+</tr>
+<tr class="rowColor">
+<td class="colFirst"><code>private <a href="../../../../../org/apache/hadoop/metrics2/MetricHistogram.html"
title="interface in org.apache.hadoop.metrics2">MetricHistogram</a></code></td>
+<td class="colLast"><span class="typeNameLabel">MetricsSnapshotSourceImpl.</span><code><span
class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/master/MetricsSnapshotSourceImpl.html#snapshotTimeHisto">snapshotTimeHisto</a></span></code>&nbsp;</td>
+</tr>
+<tr class="altColor">
+<td class="colFirst"><code>private <a href="../../../../../org/apache/hadoop/metrics2/MetricHistogram.html"
title="interface in org.apache.hadoop.metrics2">MetricHistogram</a></code></td>
+<td class="colLast"><span class="typeNameLabel">MetricsMasterFilesystemSourceImpl.</span><code><span
class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/master/MetricsMasterFilesystemSourceImpl.html#splitSizeHisto">splitSizeHisto</a></span></code>&nbsp;</td>
+</tr>
+<tr class="rowColor">
+<td class="colFirst"><code>private <a href="../../../../../org/apache/hadoop/metrics2/MetricHistogram.html"
title="interface in org.apache.hadoop.metrics2">MetricHistogram</a></code></td>
 <td class="colLast"><span class="typeNameLabel">MetricsMasterFilesystemSourceImpl.</span><code><span
class="memberNameLink"><a href="../../../../../org/apache/hadoop/hbase/master/MetricsMasterFilesystemSourceImpl.html#splitTimeHisto">splitTimeHisto</a></span></code>&nbsp;</td>
 </tr>
 </tbody>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/476c54ed/devapidocs/overview-tree.html
----------------------------------------------------------------------
diff --git a/devapidocs/overview-tree.html b/devapidocs/overview-tree.html
index 1e62252..1903c18 100644
--- a/devapidocs/overview-tree.html
+++ b/devapidocs/overview-tree.html
@@ -3268,6 +3268,7 @@
 <li type="circle">org.apache.hadoop.hbase.master.normalizer.<a href="org/apache/hadoop/hbase/master/normalizer/RegionNormalizerChore.html"
title="class in org.apache.hadoop.hbase.master.normalizer"><span class="typeNameLink">RegionNormalizerChore</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.master.cleaner.<a href="org/apache/hadoop/hbase/master/cleaner/ReplicationMetaCleaner.html"
title="class in org.apache.hadoop.hbase.master.cleaner"><span class="typeNameLink">ReplicationMetaCleaner</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.master.cleaner.<a href="org/apache/hadoop/hbase/master/cleaner/ReplicationZKNodeCleanerChore.html"
title="class in org.apache.hadoop.hbase.master.cleaner"><span class="typeNameLink">ReplicationZKNodeCleanerChore</span></a></li>
+<li type="circle">org.apache.hadoop.hbase.quotas.<a href="org/apache/hadoop/hbase/quotas/SnapshotQuotaObserverChore.html"
title="class in org.apache.hadoop.hbase.quotas"><span class="typeNameLink">SnapshotQuotaObserverChore</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.quotas.<a href="org/apache/hadoop/hbase/quotas/SpaceQuotaRefresherChore.html"
title="class in org.apache.hadoop.hbase.quotas"><span class="typeNameLink">SpaceQuotaRefresherChore</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.master.<a href="org/apache/hadoop/hbase/master/SplitLogManager.TimeoutMonitor.html"
title="class in org.apache.hadoop.hbase.master"><span class="typeNameLink">SplitLogManager.TimeoutMonitor</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.regionserver.<a href="org/apache/hadoop/hbase/regionserver/StorefileRefresherChore.html"
title="class in org.apache.hadoop.hbase.regionserver"><span class="typeNameLink">StorefileRefresherChore</span></a></li>
@@ -3393,6 +3394,8 @@
 <li type="circle">org.apache.hadoop.hbase.snapshot.<a href="org/apache/hadoop/hbase/snapshot/SnapshotManifestV2.html"
title="class in org.apache.hadoop.hbase.snapshot"><span class="typeNameLink">SnapshotManifestV2</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.snapshot.<a href="org/apache/hadoop/hbase/snapshot/SnapshotManifestV2.ManifestBuilder.html"
title="class in org.apache.hadoop.hbase.snapshot"><span class="typeNameLink">SnapshotManifestV2.ManifestBuilder</span></a>
(implements org.apache.hadoop.hbase.snapshot.<a href="org/apache/hadoop/hbase/snapshot/SnapshotManifest.RegionVisitor.html"
title="interface in org.apache.hadoop.hbase.snapshot">SnapshotManifest.RegionVisitor</a>&lt;TRegion,TFamily&gt;)</li>
 <li type="circle">org.apache.hadoop.hbase.master.<a href="org/apache/hadoop/hbase/master/SnapshotOfRegionAssignmentFromMeta.html"
title="class in org.apache.hadoop.hbase.master"><span class="typeNameLink">SnapshotOfRegionAssignmentFromMeta</span></a></li>
+<li type="circle">org.apache.hadoop.hbase.quotas.<a href="org/apache/hadoop/hbase/quotas/SnapshotQuotaObserverChore.SnapshotWithSize.html"
title="class in org.apache.hadoop.hbase.quotas"><span class="typeNameLink">SnapshotQuotaObserverChore.SnapshotWithSize</span></a></li>
+<li type="circle">org.apache.hadoop.hbase.quotas.<a href="org/apache/hadoop/hbase/quotas/SnapshotQuotaObserverChore.StoreFileReference.html"
title="class in org.apache.hadoop.hbase.quotas"><span class="typeNameLink">SnapshotQuotaObserverChore.StoreFileReference</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.snapshot.<a href="org/apache/hadoop/hbase/snapshot/SnapshotReferenceUtil.html"
title="class in org.apache.hadoop.hbase.snapshot"><span class="typeNameLink">SnapshotReferenceUtil</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.util.<a href="org/apache/hadoop/hbase/util/SortedList.html"
title="class in org.apache.hadoop.hbase.util"><span class="typeNameLink">SortedList</span></a>&lt;E&gt;
(implements java.util.<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true"
title="class or interface in java.util">List</a>&lt;E&gt;, java.util.<a
href="http://docs.oracle.com/javase/8/docs/api/java/util/RandomAccess.html?is-external=true"
title="class or interface in java.util">RandomAccess</a>)</li>
 <li type="circle">org.apache.hadoop.hbase.quotas.<a href="org/apache/hadoop/hbase/quotas/SpaceQuotaSnapshot.html"
title="class in org.apache.hadoop.hbase.quotas"><span class="typeNameLink">SpaceQuotaSnapshot</span></a></li>
@@ -5129,6 +5132,7 @@
 <li type="circle">org.apache.hadoop.hbase.util.<a href="org/apache/hadoop/hbase/util/IdReadWriteLock.ReferenceType.html"
title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">IdReadWriteLock.ReferenceType</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.util.<a href="org/apache/hadoop/hbase/util/HBaseFsck.ErrorReporter.ERROR_CODE.html"
title="enum in org.apache.hadoop.hbase.util"><span class="typeNameLink">HBaseFsck.ErrorReporter.ERROR_CODE</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.favored.<a href="org/apache/hadoop/hbase/favored/FavoredNodesPlan.Position.html"
title="enum in org.apache.hadoop.hbase.favored"><span class="typeNameLink">FavoredNodesPlan.Position</span></a></li>
+<li type="circle">org.apache.hadoop.hbase.replication.regionserver.<a href="org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceShipperThread.WorkerState.html"
title="enum in org.apache.hadoop.hbase.replication.regionserver"><span class="typeNameLink">ReplicationSourceShipperThread.WorkerState</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.security.visibility.expression.<a href="org/apache/hadoop/hbase/security/visibility/expression/Operator.html"
title="enum in org.apache.hadoop.hbase.security.visibility.expression"><span class="typeNameLink">Operator</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.security.access.<a href="org/apache/hadoop/hbase/security/access/AccessControlFilter.Strategy.html"
title="enum in org.apache.hadoop.hbase.security.access"><span class="typeNameLink">AccessControlFilter.Strategy</span></a></li>
 <li type="circle">org.apache.hadoop.hbase.security.access.<a href="org/apache/hadoop/hbase/security/access/AccessController.OpType.html"
title="enum in org.apache.hadoop.hbase.security.access"><span class="typeNameLink">AccessController.OpType</span></a></li>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/476c54ed/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/Version.html b/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
index 58cbf79..a976616 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
@@ -16,11 +16,11 @@
 <span class="sourceLineNo">008</span>@InterfaceAudience.Private<a name="line.8"></a>
 <span class="sourceLineNo">009</span>public class Version {<a name="line.9"></a>
 <span class="sourceLineNo">010</span>  public static final String version = "3.0.0-SNAPSHOT";<a
name="line.10"></a>
-<span class="sourceLineNo">011</span>  public static final String revision =
"30817b922ed72ba5630d8cea3d26bba9fef346e4";<a name="line.11"></a>
+<span class="sourceLineNo">011</span>  public static final String revision =
"ea64dbef7f5239ab2162d0bd3dccded60e20ecda";<a name="line.11"></a>
 <span class="sourceLineNo">012</span>  public static final String user = "jenkins";<a
name="line.12"></a>
-<span class="sourceLineNo">013</span>  public static final String date = "Fri
Jun  9 14:39:05 UTC 2017";<a name="line.13"></a>
+<span class="sourceLineNo">013</span>  public static final String date = "Sat
Jun 10 14:39:04 UTC 2017";<a name="line.13"></a>
 <span class="sourceLineNo">014</span>  public static final String url = "git://asf920.gq1.ygridcore.net/home/jenkins/jenkins-slave/workspace/hbase_generate_website/hbase";<a
name="line.14"></a>
-<span class="sourceLineNo">015</span>  public static final String srcChecksum
= "0bf0d03062d078ec9d8e0f407e783cfa";<a name="line.15"></a>
+<span class="sourceLineNo">015</span>  public static final String srcChecksum
= "0347fbff381e8e942b1429ce992adda0";<a name="line.15"></a>
 <span class="sourceLineNo">016</span>}<a name="line.16"></a>
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/476c54ed/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyRpcConnection.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyRpcConnection.html b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyRpcConnection.html
index 92ba371..f627b29 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyRpcConnection.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/ipc/NettyRpcConnection.html
@@ -79,8 +79,8 @@
 <span class="sourceLineNo">071</span><a name="line.71"></a>
 <span class="sourceLineNo">072</span>  private static final Log LOG = LogFactory.getLog(NettyRpcConnection.class);<a
name="line.72"></a>
 <span class="sourceLineNo">073</span><a name="line.73"></a>
-<span class="sourceLineNo">074</span>  private static final ScheduledExecutorService
RELOGIN_EXECUTOR = Executors<a name="line.74"></a>
-<span class="sourceLineNo">075</span>      .newSingleThreadScheduledExecutor(Threads.newDaemonThreadFactory("Relogin"));<a
name="line.75"></a>
+<span class="sourceLineNo">074</span>  private static final ScheduledExecutorService
RELOGIN_EXECUTOR =<a name="line.74"></a>
+<span class="sourceLineNo">075</span>      Executors.newSingleThreadScheduledExecutor(Threads.newDaemonThreadFactory("Relogin"));<a
name="line.75"></a>
 <span class="sourceLineNo">076</span><a name="line.76"></a>
 <span class="sourceLineNo">077</span>  private final NettyRpcClient rpcClient;<a
name="line.77"></a>
 <span class="sourceLineNo">078</span><a name="line.78"></a>
@@ -97,8 +97,8 @@
 <span class="sourceLineNo">089</span>        rpcClient.userProvider.isHBaseSecurityEnabled(),
rpcClient.codec, rpcClient.compressor);<a name="line.89"></a>
 <span class="sourceLineNo">090</span>    this.rpcClient = rpcClient;<a name="line.90"></a>
 <span class="sourceLineNo">091</span>    byte[] connectionHeaderPreamble = getConnectionHeaderPreamble();<a
name="line.91"></a>
-<span class="sourceLineNo">092</span>    this.connectionHeaderPreamble = Unpooled.directBuffer(connectionHeaderPreamble.length)<a
name="line.92"></a>
-<span class="sourceLineNo">093</span>        .writeBytes(connectionHeaderPreamble);<a
name="line.93"></a>
+<span class="sourceLineNo">092</span>    this.connectionHeaderPreamble =<a
name="line.92"></a>
+<span class="sourceLineNo">093</span>        Unpooled.directBuffer(connectionHeaderPreamble.length).writeBytes(connectionHeaderPreamble);<a
name="line.93"></a>
 <span class="sourceLineNo">094</span>    ConnectionHeader header = getConnectionHeader();<a
name="line.94"></a>
 <span class="sourceLineNo">095</span>    this.connectionHeaderWithLength = Unpooled.directBuffer(4
+ header.getSerializedSize());<a name="line.95"></a>
 <span class="sourceLineNo">096</span>    this.connectionHeaderWithLength.writeInt(header.getSerializedSize());<a
name="line.96"></a>
@@ -223,8 +223,8 @@
 <span class="sourceLineNo">215</span><a name="line.215"></a>
 <span class="sourceLineNo">216</span>            // add ReadTimeoutHandler to
deal with server doesn't response connection header<a name="line.216"></a>
 <span class="sourceLineNo">217</span>            // because of the different
configuration in client side and server side<a name="line.217"></a>
-<span class="sourceLineNo">218</span>            p.addFirst(new ReadTimeoutHandler(<a
name="line.218"></a>
-<span class="sourceLineNo">219</span>                RpcClient.DEFAULT_SOCKET_TIMEOUT_READ,
TimeUnit.MILLISECONDS));<a name="line.219"></a>
+<span class="sourceLineNo">218</span>            p.addFirst(<a name="line.218"></a>
+<span class="sourceLineNo">219</span>              new ReadTimeoutHandler(RpcClient.DEFAULT_SOCKET_TIMEOUT_READ,
TimeUnit.MILLISECONDS));<a name="line.219"></a>
 <span class="sourceLineNo">220</span>            p.addLast(chHandler);<a name="line.220"></a>
 <span class="sourceLineNo">221</span>            connectionHeaderPromise.addListener(new
FutureListener&lt;Boolean&gt;() {<a name="line.221"></a>
 <span class="sourceLineNo">222</span>              @Override<a name="line.222"></a>
@@ -289,51 +289,76 @@
 <span class="sourceLineNo">281</span>        }).channel();<a name="line.281"></a>
 <span class="sourceLineNo">282</span>  }<a name="line.282"></a>
 <span class="sourceLineNo">283</span><a name="line.283"></a>
-<span class="sourceLineNo">284</span>  @Override<a name="line.284"></a>
-<span class="sourceLineNo">285</span>  public synchronized void sendRequest(final
Call call, HBaseRpcController hrc)<a name="line.285"></a>
-<span class="sourceLineNo">286</span>      throws IOException {<a name="line.286"></a>
-<span class="sourceLineNo">287</span>    if (reloginInProgress) {<a name="line.287"></a>
-<span class="sourceLineNo">288</span>      throw new IOException("Can not send
request because relogin is in progress.");<a name="line.288"></a>
-<span class="sourceLineNo">289</span>    }<a name="line.289"></a>
-<span class="sourceLineNo">290</span>    hrc.notifyOnCancel(new RpcCallback&lt;Object&gt;()
{<a name="line.290"></a>
-<span class="sourceLineNo">291</span><a name="line.291"></a>
-<span class="sourceLineNo">292</span>      @Override<a name="line.292"></a>
-<span class="sourceLineNo">293</span>      public void run(Object parameter)
{<a name="line.293"></a>
-<span class="sourceLineNo">294</span>        setCancelled(call);<a name="line.294"></a>
-<span class="sourceLineNo">295</span>        synchronized (this) {<a name="line.295"></a>
-<span class="sourceLineNo">296</span>          if (channel != null) {<a name="line.296"></a>
-<span class="sourceLineNo">297</span>            channel.pipeline().fireUserEventTriggered(new
CallEvent(CANCELLED, call));<a name="line.297"></a>
-<span class="sourceLineNo">298</span>          }<a name="line.298"></a>
-<span class="sourceLineNo">299</span>        }<a name="line.299"></a>
-<span class="sourceLineNo">300</span>      }<a name="line.300"></a>
-<span class="sourceLineNo">301</span>    }, new CancellationCallback() {<a
name="line.301"></a>
-<span class="sourceLineNo">302</span><a name="line.302"></a>
-<span class="sourceLineNo">303</span>      @Override<a name="line.303"></a>
-<span class="sourceLineNo">304</span>      public void run(boolean cancelled)
throws IOException {<a name="line.304"></a>
-<span class="sourceLineNo">305</span>        if (cancelled) {<a name="line.305"></a>
-<span class="sourceLineNo">306</span>          setCancelled(call);<a name="line.306"></a>
-<span class="sourceLineNo">307</span>        } else {<a name="line.307"></a>
-<span class="sourceLineNo">308</span>          if (channel == null) {<a name="line.308"></a>
-<span class="sourceLineNo">309</span>            connect();<a name="line.309"></a>
-<span class="sourceLineNo">310</span>          }<a name="line.310"></a>
-<span class="sourceLineNo">311</span>          scheduleTimeoutTask(call);<a
name="line.311"></a>
-<span class="sourceLineNo">312</span>          channel.writeAndFlush(call).addListener(new
ChannelFutureListener() {<a name="line.312"></a>
-<span class="sourceLineNo">313</span><a name="line.313"></a>
-<span class="sourceLineNo">314</span>            @Override<a name="line.314"></a>
-<span class="sourceLineNo">315</span>            public void operationComplete(ChannelFuture
future) throws Exception {<a name="line.315"></a>
-<span class="sourceLineNo">316</span>              // Fail the call if we failed
to write it out. This usually because the channel is<a name="line.316"></a>
-<span class="sourceLineNo">317</span>              // closed. This is needed
because we may shutdown the channel inside event loop and<a name="line.317"></a>
-<span class="sourceLineNo">318</span>              // there may still be some
pending calls in the event loop queue after us.<a name="line.318"></a>
-<span class="sourceLineNo">319</span>              if (!future.isSuccess()) {<a
name="line.319"></a>
-<span class="sourceLineNo">320</span>                call.setException(toIOE(future.cause()));<a
name="line.320"></a>
-<span class="sourceLineNo">321</span>              }<a name="line.321"></a>
-<span class="sourceLineNo">322</span>            }<a name="line.322"></a>
-<span class="sourceLineNo">323</span>          });<a name="line.323"></a>
-<span class="sourceLineNo">324</span>        }<a name="line.324"></a>
-<span class="sourceLineNo">325</span>      }<a name="line.325"></a>
-<span class="sourceLineNo">326</span>    });<a name="line.326"></a>
-<span class="sourceLineNo">327</span>  }<a name="line.327"></a>
-<span class="sourceLineNo">328</span>}<a name="line.328"></a>
+<span class="sourceLineNo">284</span>  private void write(Channel ch, final Call
call) {<a name="line.284"></a>
+<span class="sourceLineNo">285</span>    ch.writeAndFlush(call).addListener(new
ChannelFutureListener() {<a name="line.285"></a>
+<span class="sourceLineNo">286</span><a name="line.286"></a>
+<span class="sourceLineNo">287</span>      @Override<a name="line.287"></a>
+<span class="sourceLineNo">288</span>      public void operationComplete(ChannelFuture
future) throws Exception {<a name="line.288"></a>
+<span class="sourceLineNo">289</span>        // Fail the call if we failed to
write it out. This usually because the channel is<a name="line.289"></a>
+<span class="sourceLineNo">290</span>        // closed. This is needed because
we may shutdown the channel inside event loop and<a name="line.290"></a>
+<span class="sourceLineNo">291</span>        // there may still be some pending
calls in the event loop queue after us.<a name="line.291"></a>
+<span class="sourceLineNo">292</span>        if (!future.isSuccess()) {<a
name="line.292"></a>
+<span class="sourceLineNo">293</span>          call.setException(toIOE(future.cause()));<a
name="line.293"></a>
+<span class="sourceLineNo">294</span>        }<a name="line.294"></a>
+<span class="sourceLineNo">295</span>      }<a name="line.295"></a>
+<span class="sourceLineNo">296</span>    });<a name="line.296"></a>
+<span class="sourceLineNo">297</span>  }<a name="line.297"></a>
+<span class="sourceLineNo">298</span><a name="line.298"></a>
+<span class="sourceLineNo">299</span>  @Override<a name="line.299"></a>
+<span class="sourceLineNo">300</span>  public synchronized void sendRequest(final
Call call, HBaseRpcController hrc) throws IOException {<a name="line.300"></a>
+<span class="sourceLineNo">301</span>    if (reloginInProgress) {<a name="line.301"></a>
+<span class="sourceLineNo">302</span>      throw new IOException("Can not send
request because relogin is in progress.");<a name="line.302"></a>
+<span class="sourceLineNo">303</span>    }<a name="line.303"></a>
+<span class="sourceLineNo">304</span>    hrc.notifyOnCancel(new RpcCallback&lt;Object&gt;()
{<a name="line.304"></a>
+<span class="sourceLineNo">305</span><a name="line.305"></a>
+<span class="sourceLineNo">306</span>      @Override<a name="line.306"></a>
+<span class="sourceLineNo">307</span>      public void run(Object parameter)
{<a name="line.307"></a>
+<span class="sourceLineNo">308</span>        setCancelled(call);<a name="line.308"></a>
+<span class="sourceLineNo">309</span>        synchronized (this) {<a name="line.309"></a>
+<span class="sourceLineNo">310</span>          if (channel != null) {<a name="line.310"></a>
+<span class="sourceLineNo">311</span>            channel.pipeline().fireUserEventTriggered(new
CallEvent(CANCELLED, call));<a name="line.311"></a>
+<span class="sourceLineNo">312</span>          }<a name="line.312"></a>
+<span class="sourceLineNo">313</span>        }<a name="line.313"></a>
+<span class="sourceLineNo">314</span>      }<a name="line.314"></a>
+<span class="sourceLineNo">315</span>    }, new CancellationCallback() {<a
name="line.315"></a>
+<span class="sourceLineNo">316</span><a name="line.316"></a>
+<span class="sourceLineNo">317</span>      @Override<a name="line.317"></a>
+<span class="sourceLineNo">318</span>      public void run(boolean cancelled)
throws IOException {<a name="line.318"></a>
+<span class="sourceLineNo">319</span>        if (cancelled) {<a name="line.319"></a>
+<span class="sourceLineNo">320</span>          setCancelled(call);<a name="line.320"></a>
+<span class="sourceLineNo">321</span>        } else {<a name="line.321"></a>
+<span class="sourceLineNo">322</span>          if (channel == null) {<a name="line.322"></a>
+<span class="sourceLineNo">323</span>            connect();<a name="line.323"></a>
+<span class="sourceLineNo">324</span>          }<a name="line.324"></a>
+<span class="sourceLineNo">325</span>          scheduleTimeoutTask(call);<a
name="line.325"></a>
+<span class="sourceLineNo">326</span>          final Channel ch = channel;<a
name="line.326"></a>
+<span class="sourceLineNo">327</span>          // We must move the whole writeAndFlush
call inside event loop otherwise there will be a<a name="line.327"></a>
+<span class="sourceLineNo">328</span>          // race condition.<a name="line.328"></a>
+<span class="sourceLineNo">329</span>          // In netty's DefaultChannelPipeline,
it will find the first outbound handler in the<a name="line.329"></a>
+<span class="sourceLineNo">330</span>          // current thread and then schedule
a task to event loop which will start the process from<a name="line.330"></a>
+<span class="sourceLineNo">331</span>          // that outbound handler. It is
possible that the first handler is<a name="line.331"></a>
+<span class="sourceLineNo">332</span>          // BufferCallBeforeInitHandler
when we call writeAndFlush here, but the connection is set<a name="line.332"></a>
+<span class="sourceLineNo">333</span>          // up at the same time so in the
event loop thread we remove the<a name="line.333"></a>
+<span class="sourceLineNo">334</span>          // BufferCallBeforeInitHandler,
and then our writeAndFlush task comes, still calls the<a name="line.334"></a>
+<span class="sourceLineNo">335</span>          // write method of BufferCallBeforeInitHandler.<a
name="line.335"></a>
+<span class="sourceLineNo">336</span>          // This may be considered as a
bug of netty, but anyway there is a work around so let's<a name="line.336"></a>
+<span class="sourceLineNo">337</span>          // fix it by ourselves first.<a
name="line.337"></a>
+<span class="sourceLineNo">338</span>          if (ch.eventLoop().inEventLoop())
{<a name="line.338"></a>
+<span class="sourceLineNo">339</span>            write(ch, call);<a name="line.339"></a>
+<span class="sourceLineNo">340</span>          } else {<a name="line.340"></a>
+<span class="sourceLineNo">341</span>            ch.eventLoop().execute(new Runnable()
{<a name="line.341"></a>
+<span class="sourceLineNo">342</span><a name="line.342"></a>
+<span class="sourceLineNo">343</span>              @Override<a name="line.343"></a>
+<span class="sourceLineNo">344</span>              public void run() {<a name="line.344"></a>
+<span class="sourceLineNo">345</span>                write(ch, call);<a name="line.345"></a>
+<span class="sourceLineNo">346</span>              }<a name="line.346"></a>
+<span class="sourceLineNo">347</span>            });<a name="line.347"></a>
+<span class="sourceLineNo">348</span>          }<a name="line.348"></a>
+<span class="sourceLineNo">349</span>        }<a name="line.349"></a>
+<span class="sourceLineNo">350</span>      }<a name="line.350"></a>
+<span class="sourceLineNo">351</span>    });<a name="line.351"></a>
+<span class="sourceLineNo">352</span>  }<a name="line.352"></a>
+<span class="sourceLineNo">353</span>}<a name="line.353"></a>
 
 
 


Mime
View raw message