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

Method multiPutWithOneBadRpcInBatch

test/TestIntegration.java:535–570  ·  view source on GitHub ↗

Send a bunch of edits with one that references a non-existent family.

()

Source from the content-addressed store, hash-verified

533
534 /** Send a bunch of edits with one that references a non-existent family. */
535 @Test
536 public void multiPutWithOneBadRpcInBatch() throws Exception {
537 client.setFlushInterval(FAST_FLUSH);
538 final PutRequest put1 = new PutRequest(table, "mk1", family, "m1", "mpb1");
539 // The following edit is destined to a non-existent family.
540 final PutRequest put2 = new PutRequest(table, "mk2", family + family,
541 "m2", "mpb2");
542 final PutRequest put3 = new PutRequest(table, "mk3", family, "m3", "mpb3");
543 try {
544 final ArrayList<Deferred<Object>> ds = new ArrayList<Deferred<Object>>(3);
545 ds.add(client.put(put1));
546 ds.add(client.put(put2));
547 ds.add(client.put(put3));
548 Deferred.groupInOrder(ds).join();
549 } catch (DeferredGroupException e) {
550 final ArrayList<Object> results = e.results();
551 final Object res2 = results.get(1);
552 if (!(res2 instanceof NoSuchColumnFamilyException)) {
553 throw new AssertionError("res2 wasn't a NoSuchColumnFamilyException: "
554 + res2);
555 }
556 assertEquals(put2, ((NoSuchColumnFamilyException) res2).getFailedRpc());
557 final GetRequest get1 = new GetRequest(table, "mk1", family, "m1");
558 ArrayList<KeyValue> kvs = client.get(get1).join();
559 assertSizeIs(1, kvs);
560 assertEq("mpb1", kvs.get(0).value());
561 final GetRequest get2 = new GetRequest(table, "mk2", family, "m2");
562 assertSizeIs(0, client.get(get2).join());
563 final GetRequest get3 = new GetRequest(table, "mk3", family, "m3");
564 kvs = client.get(get3).join();
565 assertSizeIs(1, kvs);
566 assertEq("mpb3", kvs.get(0).value());
567 return;
568 }
569 throw new AssertionError("Should never be here");
570 }
571
572 /** Lots of buffered counter increments from multiple threads. */
573 @Test

Callers

nothing calls this directly

Calls 8

assertSizeIsMethod · 0.95
assertEqMethod · 0.95
setFlushIntervalMethod · 0.80
putMethod · 0.80
getFailedRpcMethod · 0.65
valueMethod · 0.65
addMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected