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

Method multiAction

test/TestRegionClientSendRpc.java:349–378  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

347 }
348
349 @Test
350 public void multiAction() throws Exception {
351 final Counter counter = new Counter();
352 Whitebox.setInternalState(hbase_client, "num_multi_rpcs", counter);
353 final MultiAction ma = new MultiAction();
354 final PutRequest put1 = new PutRequest(TABLE, KEY, FAMILY, QUALIFIER, VALUE);
355 put1.setRegion(region);
356 ma.add(put1);
357 final PutRequest put2 = new PutRequest(TABLE, KEY, FAMILY, QUALIFIER, VALUE);
358 put2.setRegion(region);
359 ma.add(put2);
360 final Deferred<Object> deferred = ma.getDeferred();
361
362 region_client.sendRpc(ma);
363
364 Exception ex = null;
365 try {
366 deferred.join(1);
367 } catch (Exception e) {
368 ex = e;
369 }
370 assertTrue(ex instanceof TimeoutException);
371 PowerMockito.verifyStatic(times(1));
372 Channels.write((Channel)any(), (ChannelBuffer)any());
373 verify(hbase_client, never()).sendRpcToRegion(ma);
374 assertEquals(1, region_client.stats().rpcsSent());
375 assertEquals(0, region_client.stats().pendingBatchedRPCs());
376 assertEquals(0, region_client.stats().pendingRPCs());
377 assertEquals(1, counter.get());
378 }
379
380 @Test
381 public void multiActionToSingle() throws Exception {

Callers

nothing calls this directly

Calls 10

addMethod · 0.95
getMethod · 0.95
setRegionMethod · 0.80
sendRpcMethod · 0.80
sendRpcToRegionMethod · 0.80
rpcsSentMethod · 0.80
getDeferredMethod · 0.45
statsMethod · 0.45
pendingBatchedRPCsMethod · 0.45
pendingRPCsMethod · 0.45

Tested by

no test coverage detected