@Test public void testAttachIterator() throws Exception { TableOperationsHelper t = getHelper(); Map<String,String> empty = Collections.emptyMap(); t.attachIterator("table", new IteratorSetting(10, "someName", "foo.bar", empty), EnumSet.of(IteratorScope.scan)); check(t, "table", new String[] {"table.iterator.scan.someName=10,foo.bar",}); t.removeIterator("table", "someName", EnumSet.of(IteratorScope.scan)); check(t, "table", new String[] {}); IteratorSetting setting = new IteratorSetting(10, "someName", "foo.bar"); setting.addOptions(Collections.singletonMap("key", "value")); t.attachIterator("table", setting, EnumSet.of(IteratorScope.majc)); setting = new IteratorSetting(10, "someName", "foo.bar"); t.attachIterator("table", setting, EnumSet.of(IteratorScope.scan)); check(t, "table", new String[] {"table.iterator.majc.someName=10,foo.bar", "table.iterator.majc.someName.opt.key=value", "table.iterator.scan.someName=10,foo.bar",}); t.removeIterator("table", "someName", EnumSet.of(IteratorScope.scan)); setting = new IteratorSetting(20, "otherName", "some.classname"); setting.addOptions(Collections.singletonMap("key", "value")); t.attachIterator("table", setting, EnumSet.of(IteratorScope.majc)); setting = new IteratorSetting(20, "otherName", "some.classname"); t.attachIterator("table", setting, EnumSet.of(IteratorScope.scan)); Map<String,EnumSet<IteratorScope>> two = t.listIterators("table"); assertEquals(2, two.size()); assertTrue(two.containsKey("otherName")); assertEquals(2, two.get("otherName").size()); assertTrue(two.get("otherName").contains(IteratorScope.majc)); assertTrue(two.get("otherName").contains(IteratorScope.scan)); assertTrue(two.containsKey("someName")); assertEquals(1, two.get("someName").size()); assertTrue(two.get("someName").contains(IteratorScope.majc)); t.removeIterator("table", "someName", EnumSet.allOf(IteratorScope.class)); check(t, "table", new String[] {"table.iterator.majc.otherName=20,some.classname", "table.iterator.majc.otherName.opt.key=value", "table.iterator.scan.otherName=20,some.classname",}); setting = t.getIteratorSetting("table", "otherName", IteratorScope.scan); assertEquals(20, setting.getPriority()); assertEquals("some.classname", setting.getIteratorClass()); assertTrue(setting.getOptions().isEmpty()); setting = t.getIteratorSetting("table", "otherName", IteratorScope.majc); assertEquals(20, setting.getPriority()); assertEquals("some.classname", setting.getIteratorClass()); assertFalse(setting.getOptions().isEmpty()); assertEquals(Collections.singletonMap("key", "value"), setting.getOptions()); t.attachIterator("table", setting, EnumSet.of(IteratorScope.minc)); check(t, "table", new String[] {"table.iterator.majc.otherName=20,some.classname", "table.iterator.majc.otherName.opt.key=value", "table.iterator.minc.otherName=20,some.classname", "table.iterator.minc.otherName.opt.key=value", "table.iterator.scan.otherName=20,some.classname",}); try { t.attachIterator("table", setting); fail(); } catch (AccumuloException e) { } setting.setName("thirdName"); try { t.attachIterator("table", setting); fail(); } catch (AccumuloException e) {} setting.setPriority(10); t.setProperty("table", "table.iterator.minc.thirdName.opt.key", "value"); try { t.attachIterator("table", setting); fail(); } catch (AccumuloException e) {} t.removeProperty("table", "table.iterator.minc.thirdName.opt.key"); t.attachIterator("table", setting); }
@Override public void attachIterator(String tableName, IteratorSetting setting) throws AccumuloSecurityException, AccumuloException, TableNotFoundException { attachIterator(tableName, setting, EnumSet.allOf(IteratorScope.class)); }
TableOperationsHelper implements TableOperations { @Override public void attachIterator(String tableName, IteratorSetting setting) throws AccumuloSecurityException, AccumuloException, TableNotFoundException { attachIterator(tableName, setting, EnumSet.allOf(IteratorScope.class)); } }
TableOperationsHelper implements TableOperations { @Override public void attachIterator(String tableName, IteratorSetting setting) throws AccumuloSecurityException, AccumuloException, TableNotFoundException { attachIterator(tableName, setting, EnumSet.allOf(IteratorScope.class)); }  }
TableOperationsHelper implements TableOperations { @Override public void attachIterator(String tableName, IteratorSetting setting) throws AccumuloSecurityException, AccumuloException, TableNotFoundException { attachIterator(tableName, setting, EnumSet.allOf(IteratorScope.class)); }  @Override void attachIterator(String tableName, IteratorSetting setting); @Override void attachIterator(String tableName, IteratorSetting setting,
      EnumSet<IteratorScope> scopes); @Override void removeIterator(String tableName, String name, EnumSet<IteratorScope> scopes); @Override IteratorSetting getIteratorSetting(String tableName, String name, IteratorScope scope); @Override Map<String,EnumSet<IteratorScope>> listIterators(String tableName); static void checkIteratorConflicts(Map<String,String> props, IteratorSetting setting,
      EnumSet<IteratorScope> scopes); @Override void checkIteratorConflicts(String tableName, IteratorSetting setting,
      EnumSet<IteratorScope> scopes); @Override int addConstraint(String tableName, String constraintClassName); @Override void removeConstraint(String tableName, int number); @Override Map<String,Integer> listConstraints(String tableName); }
TableOperationsHelper implements TableOperations { @Override public void attachIterator(String tableName, IteratorSetting setting) throws AccumuloSecurityException, AccumuloException, TableNotFoundException { attachIterator(tableName, setting, EnumSet.allOf(IteratorScope.class)); }  @Override void attachIterator(String tableName, IteratorSetting setting); @Override void attachIterator(String tableName, IteratorSetting setting,
      EnumSet<IteratorScope> scopes); @Override void removeIterator(String tableName, String name, EnumSet<IteratorScope> scopes); @Override IteratorSetting getIteratorSetting(String tableName, String name, IteratorScope scope); @Override Map<String,EnumSet<IteratorScope>> listIterators(String tableName); static void checkIteratorConflicts(Map<String,String> props, IteratorSetting setting,
      EnumSet<IteratorScope> scopes); @Override void checkIteratorConflicts(String tableName, IteratorSetting setting,
      EnumSet<IteratorScope> scopes); @Override int addConstraint(String tableName, String constraintClassName); @Override void removeConstraint(String tableName, int number); @Override Map<String,Integer> listConstraints(String tableName);  }