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

Method putBatched

test/TestRegionClientSendRpc.java:76–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74 }
75
76 @Test
77 public void putBatched() throws Exception {
78 when(hbase_client.getFlushInterval()).thenReturn((short)1000);
79 final PutRequest put = new PutRequest(TABLE, KEY, FAMILY, QUALIFIER, VALUE);
80 put.region = region;
81 final Deferred<Object> deferred = put.getDeferred();
82
83 region_client.sendRpc(put);
84
85 try {
86 deferred.join(1);
87 } catch (TimeoutException e) { }
88 final MultiAction batched_rpcs =
89 Whitebox.getInternalState(region_client, "batched_rpcs");
90 assertNotNull(batched_rpcs);
91 assertEquals(1, batched_rpcs.size());
92 PowerMockito.verifyStatic(never());
93 Channels.write((Channel)any(), (ChannelBuffer)any());
94 verify(hbase_client, never()).sendRpcToRegion(put);
95 assertEquals(0, rpcs_inflight.size());
96 assertEquals(0, region_client.stats().rpcsSent());
97 assertEquals(0, region_client.stats().writesBlocked());
98 assertEquals(1, region_client.stats().pendingBatchedRPCs());
99 assertEquals(0, region_client.stats().pendingRPCs());
100 assertEquals(0, timer.tasks.size());
101 }
102
103 @Test
104 public void putNoFlushing() throws Exception {

Callers

nothing calls this directly

Calls 11

sizeMethod · 0.95
getFlushIntervalMethod · 0.80
sendRpcMethod · 0.80
sendRpcToRegionMethod · 0.80
rpcsSentMethod · 0.80
writesBlockedMethod · 0.80
getDeferredMethod · 0.45
sizeMethod · 0.45
statsMethod · 0.45
pendingBatchedRPCsMethod · 0.45
pendingRPCsMethod · 0.45

Tested by

no test coverage detected