/** * Configure iterator settings for a table prior to its creation. * * Additional calls to this method before table creation will overwrite previous iterator * settings. * * @param setting * object specifying the properties of the iterator * * @since 2.0.0 * * @see TableOperations#attachIterator(String, IteratorSetting) */ public NewTableConfiguration attachIterator(IteratorSetting setting) { return attachIterator(setting, EnumSet.allOf(IteratorScope.class)); }
ntc.attachIterator(iteratorSetting, scopeEnumSet);
private void configureIterators(NewTableConfiguration ntc) { IteratorSetting gcIter = new IteratorSetting(10, ColumnConstants.GC_CF.toString(), GarbageCollectionIterator.class); GarbageCollectionIterator.setZookeepers(gcIter, config.getAppZookeepers()); // the order relative to gc iter should not matter IteratorSetting ntfyIter = new IteratorSetting(11, ColumnConstants.NOTIFY_CF.toString(), NotificationIterator.class); EnumSet<IteratorScope> scopes = EnumSet.of(IteratorUtil.IteratorScope.majc, IteratorUtil.IteratorScope.minc); ntc.attachIterator(gcIter, scopes); ntc.attachIterator(ntfyIter, scopes); }