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

Method enqueueTimeoutCustomTimeout

test/TestHBaseRpc.java:101–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99 }
100
101 @Test
102 public void enqueueTimeoutCustomTimeout() throws Exception {
103 final GetRequest rpc = new GetRequest(TABLE, KEY, FAMILY);
104 rpc.setTimeout(42000);
105 final Deferred<Object> deferred = rpc.getDeferred();
106 assertNull(rpc.timeout_handle);
107 assertEquals(0, timer.tasks.size());
108 assertFalse(rpc.hasTimedOut());
109
110 rpc.enqueueTimeout(regionclient);
111
112 assertEquals(1, timer.tasks.size());
113 assertNotNull(rpc.timeout_handle);
114 assertEquals(42000, rpc.getTimeout());
115 assertEquals(42000, (long)timer.tasks.get(0).getValue());
116 assertFalse(rpc.hasTimedOut());
117 verify(regionclient, never()).removeRpc(any(HBaseRpc.class), anyBoolean());
118 try {
119 deferred.join(1);
120 fail("Expected a TimeoutException");
121 } catch (TimeoutException e) { }
122 }
123
124 @Test (expected = IllegalStateException.class)
125 public void enqueueTimeoutAlreadyTimedout() throws Exception {

Callers

nothing calls this directly

Calls 8

setTimeoutMethod · 0.80
hasTimedOutMethod · 0.80
getTimeoutMethod · 0.80
removeRpcMethod · 0.80
getDeferredMethod · 0.45
sizeMethod · 0.45
enqueueTimeoutMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected