Fail all RPCs in a collection or attempt to reschedule them if possible. @param rpcs A possibly empty but non-null collection of RPCs. @param exception The exception with which to fail RPCs that can't be retried.
(final Collection<HBaseRpc> rpcs,
final ConnectionResetException exception)
| 1205 | * retried. |
| 1206 | */ |
| 1207 | private void failOrRetryRpcs(final Collection<HBaseRpc> rpcs, |
| 1208 | final ConnectionResetException exception) { |
| 1209 | for (final HBaseRpc rpc : rpcs) { |
| 1210 | final RegionInfo region = rpc.getRegion(); |
| 1211 | if (region == null // Can't retry, dunno where this RPC should go. |
| 1212 | || rpc.failfast()) { |
| 1213 | rpc.callback(exception); |
| 1214 | } else { |
| 1215 | final NotServingRegionException nsre = |
| 1216 | new NotServingRegionException("Connection reset: " |
| 1217 | + exception.getMessage(), rpc); |
| 1218 | // Re-schedule the RPC by (ab)using the NSRE handling mechanism. |
| 1219 | hbase_client.handleNSRE(rpc, region.name(), nsre); |
| 1220 | } |
| 1221 | } |
| 1222 | } |
| 1223 | |
| 1224 | @Override |
| 1225 | public void handleUpstream(final ChannelHandlerContext ctx, |
no test coverage detected