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

Method putRead

test/TestIntegration.java:159–175  ·  view source on GitHub ↗

Write a single thing to HBase and read it back.

()

Source from the content-addressed store, hash-verified

157
158 /** Write a single thing to HBase and read it back. */
159 @Test
160 public void putRead() throws Exception {
161 client.setFlushInterval(FAST_FLUSH);
162 final double write_time = System.currentTimeMillis();
163 final PutRequest put = new PutRequest(table, "k", family, "q", "val");
164 final GetRequest get = new GetRequest(table, "k", family, "q");
165 client.put(put).join();
166 final ArrayList<KeyValue> kvs = client.get(get).join();
167 assertSizeIs(1, kvs);
168 final KeyValue kv = kvs.get(0);
169 assertEq("k", kv.key());
170 assertEq(family, kv.family());
171 assertEq("q", kv.qualifier());
172 assertEq("val", kv.value());
173 final double kvts = kv.timestamp();
174 assertEquals(write_time, kvts, 5000.0); // Within five seconds.
175 }
176
177 /** Write a single thing to HBase and read it back, delete it, read it. */
178 @Test

Callers

nothing calls this directly

Calls 10

assertSizeIsMethod · 0.95
assertEqMethod · 0.95
keyMethod · 0.95
familyMethod · 0.95
qualifierMethod · 0.95
valueMethod · 0.95
timestampMethod · 0.95
setFlushIntervalMethod · 0.80
putMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected