Package private method to allow the timeout timer or other methods to remove an RPCfrom the inflight map. Note that the RPC ID has to be set in the RPC for this to work. And if, somehow, we pop a different RPC from the map then we'll make sure to callback the popped RPC @param rpc The RPC to remove
(final HBaseRpc rpc, final boolean timedout)
| 2037 | * @return The RPC that was removed |
| 2038 | */ |
| 2039 | HBaseRpc removeRpc(final HBaseRpc rpc, final boolean timedout) { |
| 2040 | final HBaseRpc old_rpc = rpcs_inflight.remove(rpc.rpc_id); |
| 2041 | if (old_rpc != rpc) { |
| 2042 | LOG.error("Removed the wrong RPC " + old_rpc + |
| 2043 | " when we meant to remove " + rpc); |
| 2044 | if (old_rpc != null) { |
| 2045 | old_rpc.callback(new NonRecoverableException( |
| 2046 | "Removed the wrong RPC from client " + this)); |
| 2047 | } |
| 2048 | } |
| 2049 | if (timedout) { |
| 2050 | rpcs_timedout.incrementAndGet(); |
| 2051 | } |
| 2052 | return old_rpc; |
| 2053 | } |
| 2054 | |
| 2055 | /** @return Package private method to fetch the associated HBase client */ |
| 2056 | HBaseClient getHBaseClient() { |