MCPcopy Index your code
hub / github.com/OpenTSDB/asynchbase / sync

Method sync

src/RegionClient.java:426–442  ·  view source on GitHub ↗

Introduces a sync point for all outstanding RPCs. All RPCs known to this RegionClient, whether they are buffered, in flight, pending, etc., will get grouped together in the Deferred returned, thereby introducing a sync point past which we can guarantee that all RPCs have completed (succe

()

Source from the content-addressed store, hash-verified

424 * everything that was buffered at the time of the call has been flushed.
425 */
426 Deferred<Object> sync() {
427 flush();
428
429 ArrayList<Deferred<Object>> rpcs = getInflightRpcs(); // Never null.
430 // There are only two cases to handle here thanks to the invariant that
431 // says that if we inflight isn't empty, then pending is null.
432 if (rpcs.isEmpty()) {
433 rpcs = getPendingRpcs();
434 }
435
436 if (rpcs == null) {
437 return Deferred.fromResult(null);
438 }
439 @SuppressWarnings("unchecked")
440 final Deferred<Object> sync = (Deferred) Deferred.group(rpcs);
441 return sync;
442 }
443
444 /**
445 * Returns a possibly empty list of all the RPCs that are in-flight.

Callers 1

flushMethod · 0.80

Calls 4

flushMethod · 0.95
getInflightRpcsMethod · 0.95
getPendingRpcsMethod · 0.95
isEmptyMethod · 0.80

Tested by

no test coverage detected