use of org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope in project fluo by apache.
the class NotificationIteratorTest method testFullCompaction.
@Test
public void testFullCompaction() {
IteratorScope scope = IteratorScope.majc;
TestData input = getTestData();
TestData output = new TestData(newNI(input, scope, true));
TestData expected = new TestData();
expected.add("0 ntfy foo:bar 7", "");
expected.add("1 ntfy foo:bar 3", "");
expected.add("1 ntfy foo:baz 1", "");
expected.add("2 ntfy foo:baz 3", "");
expected.add("9 ntfy foo:bar 3", "");
Assert.assertEquals(expected, output);
input = getMixedTestData();
expected = new TestData();
expected.add("0 ntfy zoo:bar 7", "");
expected.add("0 zoo bar WRITE 16", "11");
expected.add("0 zoo bar DATA 11", "15");
expected.add("1 zoo bar WRITE 16", "11");
expected.add("1 zoo bar DATA 11", "15");
expected.add("2 zoo bar WRITE 16", "11");
expected.add("2 zoo bar DATA 11", "15");
output = new TestData(newNI(input, scope, true));
Assert.assertEquals(expected, output);
}
use of org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope in project fluo by apache.
the class NotificationIteratorTest method testLots.
@Test
public void testLots() {
IteratorScope scope = IteratorScope.scan;
Random rand = new Random(42L);
TestData input = new TestData();
for (int i = 0; i < 1000; i++) {
int maxTs = Math.max(1, rand.nextInt(50));
for (int j = 0; j < maxTs; j++) {
input.add("row" + i + " ntfy foo:baz " + j, "");
}
}
TestData output = new TestData(newNI(input, scope, true));
rand = new Random(42L);
TestData expected = new TestData();
for (int i = 0; i < 1000; i++) {
int maxTs = Math.max(1, rand.nextInt(50)) - 1;
expected.add("row" + i + " ntfy foo:baz " + maxTs, "");
}
Assert.assertEquals(expected, output);
}
Aggregations