scanner.addScanIterator(cfg);
scanner.addScanIterator(cfg);
scanner.addScanIterator(cfg);
/** * Apply the configured iterators to the scanner. * * @param iterators * the iterators to set * @param scanner * the scanner to configure * @deprecated since 1.7.0; Use {@link #jobIterators} instead. */ @Deprecated protected void setupIterators(List<IteratorSetting> iterators, Scanner scanner) { for (IteratorSetting iterator : iterators) { scanner.addScanIterator(iterator); } }
protected void addScanIterators(final Shell shellState, CommandLine cl, final Scanner scanner, final String tableName) throws Exception { List<IteratorSetting> tableScanIterators; if (cl.hasOption(profileOpt.getOpt())) { String profile = cl.getOptionValue(profileOpt.getOpt()); tableScanIterators = shellState.iteratorProfiles.get(profile); if (tableScanIterators == null) { throw new IllegalArgumentException("Profile " + profile + " does not exist"); } for (IteratorSetting iteratorSetting : tableScanIterators) { ensureTserversCanLoadIterator(shellState, tableName, iteratorSetting.getIteratorClass()); } } else { tableScanIterators = shellState.scanIteratorOptions.get(tableName); if (tableScanIterators == null) { Shell.log.debug("Found no scan iterators to set"); return; } } Shell.log.debug("Found " + tableScanIterators.size() + " scan iterators to set"); for (IteratorSetting setting : tableScanIterators) { Shell.log.debug("Setting scan iterator " + setting.getName() + " at priority " + setting.getPriority() + " using class name " + setting.getIteratorClass()); for (Entry<String,String> option : setting.getOptions().entrySet()) { Shell.log.debug("Setting option for " + setting.getName() + ": " + option.getKey() + "=" + option.getValue()); } scanner.addScanIterator(setting); } }
public static Text findMax(Scanner scanner, Text start, boolean is, Text end, boolean ie) throws TableNotFoundException { scanner.setBatchSize(12); IteratorSetting cfg = new IteratorSetting(Integer.MAX_VALUE, SortedKeyIterator.class); scanner.addScanIterator(cfg); if (start == null) { start = new Text(); is = true; } if (end == null) end = findInitialEnd(scanner); return _findMax(scanner, start, is, end, ie); } }
final Scanner scanner = shellState.getAccumuloClient().createScanner(tableName, auths); for (IteratorSetting s : tableScanIterators) { scanner.addScanIterator(s); scanner.addScanIterator(setting);
public void deleteProblemReports(Table.ID table) throws Exception { if (isMeta(table)) { Iterator<ProblemReport> pri = iterator(table); while (pri.hasNext()) { pri.next().removeFromZooKeeper(context); } return; } Scanner scanner = context.createScanner(MetadataTable.NAME, Authorizations.EMPTY); scanner.addScanIterator(new IteratorSetting(1, "keys-only", SortedKeyIterator.class)); scanner.setRange(new Range(new Text("~err_" + table))); Mutation delMut = new Mutation(new Text("~err_" + table)); boolean hasProblems = false; for (Entry<Key,Value> entry : scanner) { hasProblems = true; delMut.putDelete(entry.getKey().getColumnFamily(), entry.getKey().getColumnQualifier()); } if (hasProblems) MetadataTableUtil.getMetadataTable(context).update(delMut); }
/** * Adds all the common regex filter {@link IteratorSetting}s to the provided {@link Scanner} so * certain metadata keys in a table are ignored. * @param scanner the {@link Scanner} to add the regex filter {@link IteratorSetting}s to. */ public static void addCommonScannerIteratorsTo(final Scanner scanner) { for (final IteratorSetting iteratorSetting : COMMON_REG_EX_FILTER_SETTINGS) { scanner.addScanIterator(iteratorSetting); } }
/** * Adds all the common regex filter {@link IteratorSetting}s to the provided {@link Scanner} so * certain metadata keys in a table are ignored. * @param scanner the {@link Scanner} to add the regex filter {@link IteratorSetting}s to. */ public static void addCommonScannerIteratorsTo(final Scanner scanner) { for (final IteratorSetting iteratorSetting : COMMON_REG_EX_FILTER_SETTINGS) { scanner.addScanIterator(iteratorSetting); } }
/** * Adds all the common regex filter {@link IteratorSetting}s to the provided {@link Scanner} so * certain metadata keys in a table are ignored. * @param scanner the {@link Scanner} to add the regex filter {@link IteratorSetting}s to. */ public static void addCommonScannerIteratorsTo(final Scanner scanner) { for (final IteratorSetting iteratorSetting : COMMON_REG_EX_FILTER_SETTINGS) { scanner.addScanIterator(iteratorSetting); } }
@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { final String tableName = OptUtil.getTableOpt(cl, shellState); final ScanInterpreter interpeter = getInterpreter(cl, tableName, shellState); // handle first argument, if present, the authorizations list to // scan with final Authorizations auths = getAuths(cl, shellState); final Scanner scanner = shellState.getAccumuloClient().createScanner(tableName, auths); scanner.addScanIterator( new IteratorSetting(Integer.MAX_VALUE, "NOVALUE", SortedKeyIterator.class)); // handle session-specific scan iterators addScanIterators(shellState, cl, scanner, tableName); // handle remaining optional arguments scanner.setRange(getRange(cl, interpeter)); scanner.setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS); // handle columns fetchColumns(cl, scanner, interpeter); // output / delete the records final BatchWriter writer = shellState.getAccumuloClient().createBatchWriter(tableName, new BatchWriterConfig().setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS)); FormatterConfig config = new FormatterConfig(); config.setPrintTimestamps(cl.hasOption(timestampOpt.getOpt())); shellState.printLines( new DeleterFormatter(writer, scanner, config, shellState, cl.hasOption(forceOpt.getOpt())), false); return 0; }
protected void setupIterators(TaskAttemptContext context, Scanner scanner, String tableName, @SuppressWarnings("deprecation") RangeInputSplit split) { IteratorSetting iteratorSetting = new IteratorSetting( WHOLE_ROW_ITERATOR_PRIORITY, WholeRowIterator.class); scanner.addScanIterator(iteratorSetting); }
protected void setupIterators(TaskAttemptContext context, Scanner scanner, String tableName, @SuppressWarnings("deprecation") RangeInputSplit split) { IteratorSetting iteratorSetting = new IteratorSetting( WHOLE_ROW_ITERATOR_PRIORITY, WholeRowIterator.class); scanner.addScanIterator(iteratorSetting); }
public static Scanner createScanner(Connector connector, String tableName, Collection<Authorizations> authorizations, Query query) throws TableNotFoundException { Scanner scanner = ScannerHelper.createScanner(connector, tableName, authorizations); scanner.addScanIterator(getQueryInfoIterator(query, false)); return scanner; }
ScanTask(Connector conn, String tableName, long time) throws Exception { scanner = conn.createScanner(tableName, Authorizations.EMPTY); IteratorSetting slow = new IteratorSetting(30, "slow", SlowIterator.class); SlowIterator.setSleepTime(slow, time); scanner.addScanIterator(slow); }
public static void configureScanner(Scanner scanner) { scanner.fetchColumnFamily(ByteUtil.toText(ColumnConstants.NOTIFY_CF)); scanner.addScanIterator(new IteratorSetting(11, NotificationIterator.class)); } }
public static void configureScanner(Scanner scanner) { scanner.fetchColumnFamily(ByteUtil.toText(ColumnConstants.NOTIFY_CF)); scanner.addScanIterator(new IteratorSetting(11, NotificationIterator.class)); } }
public static void configureScanner(Scanner scanner) { scanner.fetchColumnFamily(ByteUtil.toText(ColumnConstants.NOTIFY_CF)); scanner.addScanIterator(new IteratorSetting(11, NotificationIterator.class)); } }
public static Text findMax(Scanner scanner, Text start, boolean is, Text end, boolean ie) throws TableNotFoundException { scanner.setBatchSize(12); IteratorSetting cfg = new IteratorSetting(Integer.MAX_VALUE, SortedKeyIterator.class); scanner.addScanIterator(cfg); if (start == null) { start = new Text(); is = true; } if (end == null) end = findInitialEnd(scanner); return _findMax(scanner, start, is, end, ie); } }