MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / cleanup

Method cleanup

src/RegionClient.java:1178–1199  ·  view source on GitHub ↗

Cleans up any outstanding or lingering RPC (used when shutting down). All RPCs in flight will fail with a ConnectionResetException and all edits buffered will be re-scheduled.

(final Channel chan)

Source from the content-addressed store, hash-verified

1176 * all edits buffered will be re-scheduled.
1177 */
1178 private void cleanup(final Channel chan) {
1179 final ConnectionResetException exception =
1180 new ConnectionResetException(chan);
1181 failOrRetryRpcs(rpcs_inflight.values(), exception);
1182 rpcs_inflight.clear();
1183
1184 final ArrayList<HBaseRpc> rpcs;
1185 final MultiAction batch;
1186 synchronized (this) {
1187 dead = true;
1188 rpcs = pending_rpcs;
1189 pending_rpcs = null;
1190 batch = batched_rpcs;
1191 batched_rpcs = null;
1192 }
1193 if (rpcs != null) {
1194 failOrRetryRpcs(rpcs, exception);
1195 }
1196 if (batch != null) {
1197 batch.callback(exception); // Make it fail.
1198 }
1199 }
1200
1201 /**
1202 * Fail all RPCs in a collection or attempt to reschedule them if possible.

Callers 3

channelDisconnectedMethod · 0.95
channelClosedMethod · 0.95
exceptionCaughtMethod · 0.95

Calls 4

failOrRetryRpcsMethod · 0.95
clearMethod · 0.80
valuesMethod · 0.65
callbackMethod · 0.45

Tested by

no test coverage detected