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

Method timestampsOnGet

test/TestIntegration.java:1589–1610  ·  view source on GitHub ↗

Simple timestamps filter tests on a Get request.

()

Source from the content-addressed store, hash-verified

1587
1588 /** Simple timestamps filter tests on a Get request. */
1589 @Test
1590 public void timestampsOnGet() throws Exception {
1591 client.setFlushInterval(FAST_FLUSH);
1592 final byte[] tableBytes = Bytes.UTF8(table);
1593 final byte[] familyBytes = Bytes.UTF8(family);
1594 final byte[] rowBytes = Bytes.UTF8("row1");
1595 final PutRequest put1 = new PutRequest(tableBytes, rowBytes, familyBytes, Bytes.UTF8("q1"), Bytes.UTF8("v1"), 1L);
1596 final PutRequest put2 = new PutRequest(tableBytes, rowBytes, familyBytes, Bytes.UTF8("q2"), Bytes.UTF8("v2"), 2L);
1597 final PutRequest put3 = new PutRequest(tableBytes, rowBytes, familyBytes, Bytes.UTF8("q3"), Bytes.UTF8("v3"), 3L);
1598 final PutRequest put4 = new PutRequest(tableBytes, rowBytes, familyBytes, Bytes.UTF8("q4"), Bytes.UTF8("v4"), 4L);
1599
1600 Deferred.group(Deferred.group(client.put(put1), client.put(put2)),
1601 Deferred.group(client.put(put3), client.put(put4))).join();
1602
1603 final GetRequest get = new GetRequest(table, "row1");
1604 get.setMinTimestamp(2L);
1605 get.setMaxTimestamp(4L);
1606 ArrayList<KeyValue> kvs = client.get(get).join();
1607 assertSizeIs(2, kvs);
1608 assertEq("v2", kvs.get(0).value());
1609 assertEq("v3", kvs.get(1).value());
1610 }
1611
1612 /** Basic reverse scan test. Modeled after the basic forward scan. */
1613 @Test

Callers

nothing calls this directly

Calls 9

UTF8Method · 0.95
setMinTimestampMethod · 0.95
setMaxTimestampMethod · 0.95
assertSizeIsMethod · 0.95
assertEqMethod · 0.95
setFlushIntervalMethod · 0.80
putMethod · 0.80
valueMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected