Search in sources :

Example 1 with ShardQueryLogic

use of datawave.query.tables.ShardQueryLogic in project datawave by NationalSecurityAgency.

the class LookupUUIDTune method configure.

@Override
public void configure(BaseQueryLogic<Entry<Key, Value>> logic) {
    if (logic instanceof ShardQueryLogic) {
        ShardQueryLogic rsq = ShardQueryLogic.class.cast(logic);
        rsq.setBypassAccumulo(bypassAccumulo);
        rsq.setSpeculativeScanning(speculativeScanning);
        rsq.setCacheModel(enableCaching);
        rsq.setPrimaryToSecondaryFieldMap(primaryToSecondaryFieldMap);
        rsq.setEnforceUniqueTermsWithinExpressions(enforceUniqueTermsWithinExpressions);
        if (querySyntaxParsers != null) {
            rsq.setQuerySyntaxParsers(querySyntaxParsers);
        }
        if (reduceResponse) {
            rsq.setParseTldUids(true);
            // setup SeekingQueryPlanner in case the queryIterator requires it
            SeekingQueryPlanner planner = new SeekingQueryPlanner();
            planner.setMaxFieldHitsBeforeSeek(maxFieldHitsBeforeSeek);
            planner.setMaxKeysBeforeSeek(maxKeysBeforeSeek);
            rsq.setQueryPlanner(planner);
            if (maxPageSize != -1) {
                rsq.setMaxPageSize(maxPageSize);
            }
            if (pageByteTrigger != -1) {
                rsq.setPageByteTrigger(pageByteTrigger);
            }
        }
    }
}
Also used : ShardQueryLogic(datawave.query.tables.ShardQueryLogic) SeekingQueryPlanner(datawave.query.planner.SeekingQueryPlanner)

Example 2 with ShardQueryLogic

use of datawave.query.tables.ShardQueryLogic in project datawave by NationalSecurityAgency.

the class GroupingDocumentTransformer method createGroupFieldsList.

public void createGroupFieldsList(Collection<String> groupFieldsSet) {
    this.groupFieldsList = Lists.newArrayList(groupFieldsSet);
    QueryModel model = ((ShardQueryLogic) logic).getQueryModel();
    for (String groupField : groupFieldsSet) {
        String f = model.getReverseAliasForField(groupField);
        if (f != null && !f.isEmpty()) {
            this.groupFieldsList.add(f);
        }
    }
}
Also used : ShardQueryLogic(datawave.query.tables.ShardQueryLogic) QueryModel(datawave.query.model.QueryModel)

Example 3 with ShardQueryLogic

use of datawave.query.tables.ShardQueryLogic in project datawave by NationalSecurityAgency.

the class MixedGeoAndGeoWaveTest method getQueryResults.

private List<DefaultEvent> getQueryResults(String queryString) throws Exception {
    ShardQueryLogic logic = getShardQueryLogic();
    Iterator iter = getResultsIterator(queryString, logic);
    List<DefaultEvent> events = new ArrayList<>();
    while (iter.hasNext()) events.add((DefaultEvent) iter.next());
    return events;
}
Also used : DefaultEvent(datawave.webservice.query.result.event.DefaultEvent) ShardQueryLogic(datawave.query.tables.ShardQueryLogic) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList)

Example 4 with ShardQueryLogic

use of datawave.query.tables.ShardQueryLogic in project datawave by NationalSecurityAgency.

the class MixedGeoAndGeoWaveTest method getShardQueryLogic.

private ShardQueryLogic getShardQueryLogic() {
    ShardQueryLogic logic = new ShardQueryLogic(this.logic);
    // increase the depth threshold
    logic.setMaxDepthThreshold(20);
    // set the pushdown threshold really high to avoid collapsing uids into shards (overrides setCollapseUids if #terms is greater than this threshold)
    ((DefaultQueryPlanner) (logic.getQueryPlanner())).setPushdownThreshold(1000000);
    URL hdfsSiteConfig = this.getClass().getResource("/testhadoop.config");
    logic.setHdfsSiteConfigURLs(hdfsSiteConfig.toExternalForm());
    setupIvarator(logic);
    return logic;
}
Also used : ShardQueryLogic(datawave.query.tables.ShardQueryLogic) DefaultQueryPlanner(datawave.query.planner.DefaultQueryPlanner) URL(java.net.URL)

Example 5 with ShardQueryLogic

use of datawave.query.tables.ShardQueryLogic in project datawave by NationalSecurityAgency.

the class ContentFunctionQueryTest method getShardQueryLogic.

private ShardQueryLogic getShardQueryLogic(boolean useIvarator) {
    ShardQueryLogic logic = new ShardQueryLogic(this.logic);
    // increase the depth threshold
    logic.setMaxDepthThreshold(20);
    // set the pushdown threshold really high to avoid collapsing uids into shards (overrides setCollapseUids if #terms is greater than this threshold)
    ((DefaultQueryPlanner) (logic.getQueryPlanner())).setPushdownThreshold(1000000);
    URL hdfsSiteConfig = this.getClass().getResource("/testhadoop.config");
    logic.setHdfsSiteConfigURLs(hdfsSiteConfig.toExternalForm());
    logic.setIvaratorCacheDirConfigs(ivaratorCacheDirConfigs);
    if (useIvarator)
        setupIvarator(logic);
    return logic;
}
Also used : ShardQueryLogic(datawave.query.tables.ShardQueryLogic) DefaultQueryPlanner(datawave.query.planner.DefaultQueryPlanner) URL(java.net.URL)

Aggregations

ShardQueryLogic (datawave.query.tables.ShardQueryLogic)18 ArrayList (java.util.ArrayList)8 Iterator (java.util.Iterator)8 DefaultQueryPlanner (datawave.query.planner.DefaultQueryPlanner)5 DefaultEvent (datawave.webservice.query.result.event.DefaultEvent)5 URL (java.net.URL)5 MarkingFunctions (datawave.marking.MarkingFunctions)3 DateIndexHelperFactory (datawave.query.util.DateIndexHelperFactory)3 MetadataHelperFactory (datawave.query.util.MetadataHelperFactory)3 Before (org.junit.Before)3 KryoDocumentDeserializer (datawave.query.function.deserializer.KryoDocumentDeserializer)2 QueryData (datawave.webservice.query.configuration.QueryData)2 QueryModel (datawave.query.model.QueryModel)1 SeekingQueryPlanner (datawave.query.planner.SeekingQueryPlanner)1 DatawavePrincipal (datawave.security.authorization.DatawavePrincipal)1 DatawaveUser (datawave.security.authorization.DatawaveUser)1 SubjectIssuerDNPair (datawave.security.authorization.SubjectIssuerDNPair)1 DefaultResponseObjectFactory (datawave.webservice.query.result.event.DefaultResponseObjectFactory)1 File (java.io.File)1