Search in sources :

Example 1 with IteratorScope

use of org.apache.accumulo.proxy.thrift.IteratorScope in project accumulo by apache.

the class TestProxyNamespaceOperations method namespaceIteratorConflict.

@Test(expected = AccumuloException.class)
public void namespaceIteratorConflict() throws TException {
    IteratorSetting setting = new IteratorSetting(40, "DebugTheThings", "org.apache.accumulo.core.iterators.DebugIterator", new HashMap<>());
    Set<IteratorScope> scopes = new HashSet<>();
    scopes.add(IteratorScope.SCAN);
    tpc.proxy().attachNamespaceIterator(userpass, testnamespace, setting, scopes);
    tpc.proxy().checkNamespaceIteratorConflicts(userpass, testnamespace, setting, scopes);
}
Also used : IteratorSetting(org.apache.accumulo.proxy.thrift.IteratorSetting) IteratorScope(org.apache.accumulo.proxy.thrift.IteratorScope) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 2 with IteratorScope

use of org.apache.accumulo.proxy.thrift.IteratorScope in project accumulo by apache.

the class TestProxyNamespaceOperations method namespaceIterators.

@Test
public void namespaceIterators() throws TException {
    IteratorSetting setting = new IteratorSetting(40, "DebugTheThings", "org.apache.accumulo.core.iterators.DebugIterator", new HashMap<>());
    Set<IteratorScope> scopes = new HashSet<>();
    scopes.add(IteratorScope.SCAN);
    tpc.proxy().attachNamespaceIterator(userpass, testnamespace, setting, scopes);
    assertEquals(setting, tpc.proxy().getNamespaceIteratorSetting(userpass, testnamespace, "DebugTheThings", IteratorScope.SCAN));
    assertTrue(tpc.proxy().listNamespaceIterators(userpass, testnamespace).containsKey("DebugTheThings"));
    Set<IteratorScope> scopes2 = new HashSet<>();
    scopes2.add(IteratorScope.MINC);
    tpc.proxy().checkNamespaceIteratorConflicts(userpass, testnamespace, setting, scopes2);
    tpc.proxy().removeNamespaceIterator(userpass, testnamespace, "DebugTheThings", scopes);
    assertFalse(tpc.proxy().listNamespaceIterators(userpass, testnamespace).containsKey("DebugTheThings"));
}
Also used : IteratorSetting(org.apache.accumulo.proxy.thrift.IteratorSetting) IteratorScope(org.apache.accumulo.proxy.thrift.IteratorScope) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

HashSet (java.util.HashSet)2 IteratorScope (org.apache.accumulo.proxy.thrift.IteratorScope)2 IteratorSetting (org.apache.accumulo.proxy.thrift.IteratorSetting)2 Test (org.junit.Test)2