Search in sources :

Example 46 with IteratorScope

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);
}
Also used : IteratorScope(org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope) Test(org.junit.Test)

Example 47 with IteratorScope

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);
}
Also used : Random(java.util.Random) IteratorScope(org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope) Test(org.junit.Test)

Aggregations

IteratorScope (org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope)47 IteratorSetting (org.apache.accumulo.core.client.IteratorSetting)18 EnumSet (java.util.EnumSet)13 TreeMap (java.util.TreeMap)10 AccumuloException (org.apache.accumulo.core.client.AccumuloException)10 Test (org.junit.Test)10 HashMap (java.util.HashMap)4 AccumuloClient (org.apache.accumulo.core.client.AccumuloClient)4 NamespaceNotFoundException (org.apache.accumulo.core.client.NamespaceNotFoundException)4 HashSet (java.util.HashSet)3 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)3 KeepCountOnlyUidAggregator (datawave.ingest.table.aggregator.KeepCountOnlyUidAggregator)2 ShardIndexKeyFunctor (datawave.ingest.table.bloomfilter.ShardIndexKeyFunctor)2 Map (java.util.Map)2 Column (org.apache.accumulo.core.client.IteratorSetting.Column)2 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)2 NewTableConfiguration (org.apache.accumulo.core.client.admin.NewTableConfiguration)2 TableOperations (org.apache.accumulo.core.client.admin.TableOperations)2 Range (org.apache.accumulo.core.data.Range)2 Test (org.junit.jupiter.api.Test)2