Search in sources :

Example 11 with SessionOptions

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;
}
Also used : IteratorSetting(org.apache.accumulo.core.client.IteratorSetting) SessionOptions(datawave.query.tables.SessionOptions) ScannerSession(datawave.query.tables.ScannerSession)

Aggregations

SessionOptions (datawave.query.tables.SessionOptions)11 IteratorSetting (org.apache.accumulo.core.client.IteratorSetting)11 ScannerChunk (datawave.query.tables.async.ScannerChunk)7 Range (org.apache.accumulo.core.data.Range)7 Query (datawave.webservice.query.Query)5 UUID (java.util.UUID)5 Test (org.junit.Test)5 DatawaveFatalQueryException (datawave.query.exceptions.DatawaveFatalQueryException)3 ScannerSession (datawave.query.tables.ScannerSession)3 PreConditionFailedQueryException (datawave.webservice.query.exception.PreConditionFailedQueryException)3 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)3 Text (org.apache.hadoop.io.Text)3 ParseException (org.apache.commons.jexl2.parser.ParseException)2 TimeoutExceptionIterator (datawave.core.iterators.TimeoutExceptionIterator)1 TimeoutIterator (datawave.core.iterators.TimeoutIterator)1 DoNotPerformOptimizedQueryException (datawave.query.exceptions.DoNotPerformOptimizedQueryException)1 InvalidQueryException (datawave.query.exceptions.InvalidQueryException)1 IdentifierOpLiteral (datawave.query.jexl.JexlASTHelper.IdentifierOpLiteral)1 LiteralRange (datawave.query.jexl.LiteralRange)1 BoundedRange (datawave.query.jexl.nodes.BoundedRange)1