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

Method compare

src/MultiAction.java:494–511  ·  view source on GitHub ↗
(final BatchableRpc a, final BatchableRpc b)

Source from the content-addressed store, hash-verified

492 }
493
494 @Override
495 /**
496 * Compares two RPCs.
497 */
498 public int compare(final BatchableRpc a, final BatchableRpc b) {
499 int d;
500 if ((d = Bytes.memcmp(a.getRegion().name(), b.getRegion().name())) != 0) {
501 return d;
502 } else if ((d = a.code() - b.code()) != 0) { // Sort by code before key.
503 // Note that DeleteRequest.code() < PutRequest.code() and this matters
504 // as the RegionServer processes deletes before puts, and we want to
505 // send RPCs in the same order as they will be processed.
506 return d;
507 } else if ((d = Bytes.memcmp(a.key, b.key)) != 0) {
508 return d;
509 }
510 return Bytes.memcmp(a.family(), b.family());
511 }
512
513 }
514

Callers

nothing calls this directly

Calls 5

memcmpMethod · 0.95
familyMethod · 0.65
nameMethod · 0.45
getRegionMethod · 0.45
codeMethod · 0.45

Tested by

no test coverage detected