public static void parseIterConf(IteratorScope scope, List<IterInfo> iters, Map<String,Map<String,String>> allOptions, AccumuloConfiguration conf) { final Property scopeProperty = getProperty(scope); final String scopePropertyKey = scopeProperty.getKey(); for (Entry<String,String> entry : conf.getAllPropertiesWithPrefix(scopeProperty).entrySet()) { String suffix = entry.getKey().substring(scopePropertyKey.length()); String suffixSplit[] = suffix.split("\\.", 3); if (suffixSplit.length == 1) { String sa[] = entry.getValue().split(","); int prio = Integer.parseInt(sa[0]); String className = sa[1]; iters.add(new IterInfo(prio, className, suffixSplit[0])); } else if (suffixSplit.length == 3 && suffixSplit[1].equals("opt")) { String iterName = suffixSplit[0]; String optName = suffixSplit[2]; Map<String,String> options = allOptions.get(iterName); if (options == null) { options = new HashMap<>(); allOptions.put(iterName, options); } options.put(optName, entry.getValue()); } else { throw new IllegalArgumentException("Invalid iterator format: " + entry.getKey()); } } Collections.sort(iters, ITER_INFO_COMPARATOR); }
/** * Fetch the correct configuration key prefix for the given scope. Throws an * IllegalArgumentException if no property exists for the given scope. * * @deprecated since 1.7.0 This method returns a type that is not part of the public API and is * not guaranteed to be stable. The method was deprecated to discourage its use. */ @Deprecated public static Property getProperty(IteratorScope scope) { return IteratorUtil.getProperty(scope); } }
public static void parseIterConf(IteratorScope scope, List<IterInfo> iters, Map<String,Map<String,String>> allOptions, AccumuloConfiguration conf) { final Property scopeProperty = getProperty(scope); final String scopePropertyKey = scopeProperty.getKey(); for (Entry<String,String> entry : conf.getAllPropertiesWithPrefix(scopeProperty).entrySet()) { String suffix = entry.getKey().substring(scopePropertyKey.length()); String suffixSplit[] = suffix.split("\\.", 3); if (suffixSplit.length == 1) { String sa[] = entry.getValue().split(","); int prio = Integer.parseInt(sa[0]); String className = sa[1]; iters.add(new IterInfo(prio, className, suffixSplit[0])); } else if (suffixSplit.length == 3 && suffixSplit[1].equals("opt")) { String iterName = suffixSplit[0]; String optName = suffixSplit[2]; Map<String,String> options = allOptions.get(iterName); if (options == null) { options = new HashMap<>(); allOptions.put(iterName, options); } options.put(optName, entry.getValue()); } else { throw new IllegalArgumentException("Invalid iterator format: " + entry.getKey()); } } Collections.sort(iters, new IterInfoComparator()); }