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

Method timestampsFilter

test/TestIntegration.java:1474–1499  ·  view source on GitHub ↗

Simple timestamps filter list tests.

()

Source from the content-addressed store, hash-verified

1472
1473 /** Simple timestamps filter list tests. */
1474 @Test
1475 public void timestampsFilter() throws Exception {
1476 client.setFlushInterval(FAST_FLUSH);
1477 final byte[] tableBytes = Bytes.UTF8(table);
1478 final byte[] familyBytes = Bytes.UTF8(family);
1479 final byte[] qualifier = Bytes.UTF8("q");
1480 final PutRequest put1 =
1481 new PutRequest(tableBytes, Bytes.UTF8("tf1"), familyBytes, qualifier, Bytes.UTF8("v1"), 1L);
1482 final PutRequest put2 =
1483 new PutRequest(tableBytes, Bytes.UTF8("tf2"), familyBytes, qualifier, Bytes.UTF8("v2"), 2L);
1484 final PutRequest put3 =
1485 new PutRequest(tableBytes, Bytes.UTF8("tf3"), familyBytes, qualifier, Bytes.UTF8("v3"), 3L);
1486 Deferred.group(client.put(put1), client.put(put2), client.put(put3)).join();
1487 final Scanner scanner = client.newScanner(table);
1488 scanner.setFamily(family);
1489 scanner.setStartKey(Bytes.UTF8("tf"));
1490 scanner.setStopKey(Bytes.UTF8("tf4"));
1491 scanner.setFilter(new TimestampsFilter(1L, 3L));
1492 final ArrayList<ArrayList<KeyValue>> rows = scanner.nextRows().join();
1493 scanner.close().join();
1494 assertSizeIs(2, rows);
1495 assertSizeIs(1, rows.get(0));
1496 assertEq("v1", rows.get(0).get(0).value());
1497 assertSizeIs(1, rows.get(1));
1498 assertEq("v3", rows.get(1).get(0).value());
1499 }
1500
1501 /** Simple first key only filter tests. */
1502 @Test

Callers

nothing calls this directly

Calls 14

UTF8Method · 0.95
setFamilyMethod · 0.95
setStartKeyMethod · 0.95
setStopKeyMethod · 0.95
setFilterMethod · 0.95
nextRowsMethod · 0.95
closeMethod · 0.95
assertSizeIsMethod · 0.95
assertEqMethod · 0.95
setFlushIntervalMethod · 0.80
putMethod · 0.80
newScannerMethod · 0.80

Tested by

no test coverage detected