public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators( // @formatter:on IteratorScope scope, SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, IteratorEnvironment env) throws IOException { return loadIterators(scope, source, extent, conf, ssiList, ssio, env, true); }
public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators( // @formatter:on IteratorScope scope, SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, IteratorEnvironment env) throws IOException { List<IterInfo> emptyList = Collections.emptyList(); Map<String,Map<String,String>> emptyMap = Collections.emptyMap(); return loadIterators(scope, source, extent, conf, emptyList, emptyMap, env); }
private static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIteratorsHelper( // @formatter:on IteratorScope scope, SortedKeyValueIterator<K,V> source, AccumuloConfiguration conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, IteratorEnvironment env, boolean useAccumuloClassLoader, String classLoaderContext) throws IOException { List<IterInfo> iters = new ArrayList<>(ssiList); Map<String,Map<String,String>> allOptions = new HashMap<>(); parseIteratorConfiguration(scope, iters, ssio, allOptions, conf); return loadIterators(source, iters, allOptions, env, useAccumuloClassLoader, classLoaderContext); }
SortedKeyValueIterator<Key,Value> buildIterator(SortedKeyValueIterator<Key,Value> systemIter, TCondition tc) throws IOException { ArrayByteSequence key = new ArrayByteSequence(tc.iterators); MergedIterConfig mic = mergedIterCache.get(key); if (mic == null) { IterConfig ic = compressedIters.decompress(tc.iterators); List<IterInfo> mergedIters = new ArrayList<>(tableIters.size() + ic.ssiList.size()); Map<String,Map<String,String>> mergedItersOpts = new HashMap<>( tableIterOpts.size() + ic.ssio.size()); IteratorUtil.mergeIteratorConfig(mergedIters, mergedItersOpts, tableIters, tableIterOpts, ic.ssiList, ic.ssio); mic = new MergedIterConfig(mergedIters, mergedItersOpts); mergedIterCache.put(key, mic); } return IteratorUtil.loadIterators(systemIter, mic.mergedIters, mic.mergedItersOpts, tie, true, context, classCache); }
public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators( // @formatter:on IteratorScope scope, SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, List<IteratorSetting> iterators, IteratorEnvironment env) throws IOException { List<IterInfo> ssiList = new ArrayList<>(); Map<String,Map<String,String>> ssio = new HashMap<>(); for (IteratorSetting is : iterators) { ssiList.add(new IterInfo(is.getPriority(), is.getIteratorClass(), is.getName())); ssio.put(is.getName(), is.getOptions()); } return loadIterators(scope, source, extent, conf, ssiList, ssio, env, true); }
public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators( // @formatter:on SortedKeyValueIterator<K,V> source, Collection<IterInfo> iters, Map<String,Map<String,String>> iterOpts, IteratorEnvironment env, boolean useAccumuloClassLoader, String context, Map<String,Class<? extends SortedKeyValueIterator<K,V>>> classCache) throws IOException { // wrap the source in a SynchronizedIterator in case any of the additional configured iterators // want to use threading SortedKeyValueIterator<K,V> prev = source; try { for (IterInfo iterInfo : iters) { Class<? extends SortedKeyValueIterator<K,V>> clazz = null; log.trace("Attempting to load iterator class {}", iterInfo.className); if (classCache != null) { clazz = classCache.get(iterInfo.className); if (clazz == null) { clazz = loadClass(useAccumuloClassLoader, context, iterInfo); classCache.put(iterInfo.className, clazz); } } else { clazz = loadClass(useAccumuloClassLoader, context, iterInfo); } SortedKeyValueIterator<K,V> skvi = clazz.newInstance(); Map<String,String> options = iterOpts.get(iterInfo.iterName);
skvi = IteratorUtil.loadIterators(smi, tm.values(), serverSideIteratorOptions, new ClientSideIteratorEnvironment(getSamplerConfiguration() != null, getIteratorSamplerConfigurationInternal()),
iterator = IteratorUtil.loadIterators(IteratorScope.scan, iterator, null, tableConf, serverSideIteratorList, serverSideIteratorOptions, new IterEnv()); } else { iterator = IteratorUtil.loadIterators(iterator, serverSideIteratorList, serverSideIteratorOptions, new IterEnv(), false, null);
public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators( // @formatter:on IteratorScope scope, SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, IteratorEnvironment env) throws IOException { return loadIterators(scope, source, extent, conf, ssiList, ssio, env, true); }
IteratorUtil.loadIterators(visFilter, iterInfos, iterOpts, iterEnv, true, context));
public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators( // @formatter:on IteratorScope scope, SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, IteratorEnvironment env) throws IOException { List<IterInfo> emptyList = Collections.emptyList(); Map<String,Map<String,String>> emptyMap = Collections.emptyMap(); return loadIterators(scope, source, extent, conf, emptyList, emptyMap, env); }
.loadIterators(env.getIteratorScope(), cfsi, extent, acuTableConf, iterators, iterEnv));
public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators( // @formatter:on IteratorScope scope, SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, IteratorEnvironment env, boolean useAccumuloClassLoader, String classLoaderContext) throws IOException { List<IterInfo> iters = new ArrayList<>(ssiList); Map<String,Map<String,String>> allOptions = new HashMap<>(); parseIteratorConfiguration(scope, iters, ssio, allOptions, conf); return loadIterators(source, iters, allOptions, env, useAccumuloClassLoader, classLoaderContext); }
IteratorUtil.loadIterators(IteratorScope.scan, visFilter, extent, acuTableConf, options.serverSideIteratorList, options.serverSideIteratorOptions, iterEnv, false));
public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators( // @formatter:on IteratorScope scope, SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, IteratorEnvironment env, boolean useAccumuloClassLoader) throws IOException { List<IterInfo> iters = new ArrayList<>(ssiList); Map<String,Map<String,String>> allOptions = new HashMap<>(); parseIteratorConfiguration(scope, iters, ssio, allOptions, conf); return loadIterators(source, iters, allOptions, env, useAccumuloClassLoader, conf.get(Property.TABLE_CLASSPATH)); }
SortedKeyValueIterator<Key,Value> buildIterator(SortedKeyValueIterator<Key,Value> systemIter, TCondition tc) throws IOException { ArrayByteSequence key = new ArrayByteSequence(tc.iterators); MergedIterConfig mic = mergedIterCache.get(key); if (mic == null) { IterConfig ic = compressedIters.decompress(tc.iterators); List<IterInfo> mergedIters = new ArrayList<>(tableIters.size() + ic.ssiList.size()); Map<String,Map<String,String>> mergedItersOpts = new HashMap<>( tableIterOpts.size() + ic.ssio.size()); IteratorUtil.mergeIteratorConfig(mergedIters, mergedItersOpts, tableIters, tableIterOpts, ic.ssiList, ic.ssio); mic = new MergedIterConfig(mergedIters, mergedItersOpts); mergedIterCache.put(key, mic); } return IteratorUtil.loadIterators(systemIter, mic.mergedIters, mic.mergedItersOpts, tie, true, context, classCache); }
private static SortedKeyValueIterator<Key,Value> createScanIterator(KeyExtent ke, Collection<SortedKeyValueIterator<Key,Value>> mapfiles, Authorizations authorizations, byte[] defaultLabels, HashSet<Column> columnSet, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, boolean useTableIterators, TableConfiguration conf) throws IOException { SortedMapIterator smi = new SortedMapIterator(new TreeMap<Key,Value>()); List<SortedKeyValueIterator<Key,Value>> iters = new ArrayList<>(mapfiles.size() + 1); iters.addAll(mapfiles); iters.add(smi); MultiIterator multiIter = new MultiIterator(iters, ke); DeletingIterator delIter = new DeletingIterator(multiIter, false); ColumnFamilySkippingIterator cfsi = new ColumnFamilySkippingIterator(delIter); SortedKeyValueIterator<Key,Value> colFilter = ColumnQualifierFilter.wrap(cfsi, columnSet); SortedKeyValueIterator<Key,Value> visFilter = VisibilityFilter.wrap(colFilter, authorizations, defaultLabels); if (useTableIterators) return IteratorUtil.loadIterators(IteratorScope.scan, visFilter, ke, conf, ssiList, ssio, null); return visFilter; }
public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators( // @formatter:on IteratorScope scope, SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, List<IteratorSetting> iterators, IteratorEnvironment env) throws IOException { List<IterInfo> ssiList = new ArrayList<>(); Map<String,Map<String,String>> ssio = new HashMap<>(); for (IteratorSetting is : iterators) { ssiList.add(new IterInfo(is.getPriority(), is.getIteratorClass(), is.getName())); ssio.put(is.getName(), is.getOptions()); } return loadIterators(scope, source, extent, conf, ssiList, ssio, env, true); }
return IteratorUtil.loadIterators(IteratorScope.scan, visFilter, null, acuTableConf, serverSideIteratorList, serverSideIteratorOptions, iterEnv, false);
public SortedKeyValueIterator<Key,Value> createFilter(SortedKeyValueIterator<Key,Value> inner) throws IOException { byte[] defaultLabels = {}; inner = new ColumnFamilySkippingIterator(new DeletingIterator(inner, false)); SortedKeyValueIterator<Key,Value> cqf = ColumnQualifierFilter.wrap(inner, new HashSet<>(fetchedColumns)); SortedKeyValueIterator<Key,Value> vf = VisibilityFilter.wrap(cqf, auths, defaultLabels); AccumuloConfiguration conf = new MockConfiguration(table.settings); MockIteratorEnvironment iterEnv = new MockIteratorEnvironment(auths); SortedKeyValueIterator<Key,Value> result = iterEnv .getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan, vf, null, conf, serverSideIteratorList, serverSideIteratorOptions, iterEnv, false)); return result; }