use of datawave.query.tables.SessionOptions in project datawave by NationalSecurityAgency.
the class ShardIndexQueryTableStaticMethods method configureLimitedDiscovery.
public static ScannerSession configureLimitedDiscovery(ShardQueryConfiguration config, ScannerFactory scannerFactory, String tableName, Collection<Range> ranges, Collection<String> literals, Collection<String> patterns, boolean reverseIndex, boolean limitToUniqueTerms) throws Exception {
// if we have no ranges, then nothing to scan
if (ranges.isEmpty()) {
return null;
}
ScannerSession bs = scannerFactory.newLimitedScanner(AnyFieldScanner.class, tableName, config.getAuthorizations(), config.getQuery());
bs.setRanges(ranges);
SessionOptions options = new SessionOptions();
options.addScanIterator(configureDateRangeIterator(config));
IteratorSetting setting = configureGlobalIndexDataTypeFilter(config, config.getDatatypeFilter());
if (setting != null) {
options.addScanIterator(setting);
}
setting = configureGlobalIndexTermMatchingIterator(config, literals, patterns, reverseIndex, limitToUniqueTerms);
if (setting != null) {
options.addScanIterator(setting);
}
bs.setOptions(options);
return bs;
}
Aggregations