auth = connector.securityOperations().getUserAuthorizations(connector.whoami());
}
if (opts != null && opts.threads > 0)
threads = opts.threads;
BatchScanner scanner = connector.createBatchScanner(tableName, auth, threads);
if (opts != null) {
if (opts.iterators != null) {
for (org.apache.accumulo.proxy.thrift.IteratorSetting iter : opts.iterators) {
IteratorSetting is = new IteratorSetting(iter.getPriority(), iter.getName(), iter.getIteratorClass(), iter.getProperties());
scanner.addScanIterator(is);
}
}
ArrayList<Range> ranges = new ArrayList<Range>();
if (opts.ranges == null) {
ranges.add(new Range());
} else {
for (org.apache.accumulo.proxy.thrift.Range range : opts.ranges) {
Range aRange = new Range(range.getStart() == null ? null : Util.fromThrift(range.getStart()), true, range.getStop() == null ? null
: Util.fromThrift(range.getStop()), false);
ranges.add(aRange);
}
}
scanner.setRanges(ranges);
if (opts.columns != null) {
for (ScanColumn col : opts.columns) {
if (col.isSetColQualifier())
scanner.fetchColumn(ByteBufferUtil.toText(col.colFamily), ByteBufferUtil.toText(col.colQualifier));
else
scanner.fetchColumnFamily(ByteBufferUtil.toText(col.colFamily));
}
}
}
UUID uuid = UUID.randomUUID();
ScannerPlusIterator spi = new ScannerPlusIterator();
spi.scanner = scanner;
spi.iterator = scanner.iterator();
scannerCache.put(uuid, spi);
return uuid.toString();
} catch (Exception e) {
handleExceptionTNF(e);
return null;