Search in sources :

Example 6 with DefaultQueryPlanner

use of datawave.query.planner.DefaultQueryPlanner in project datawave by NationalSecurityAgency.

the class WiredQueryExecutorBeanTest method testCreatingContext.

@Test
public void testCreatingContext() throws Exception {
    DefaultQueryPlanner defaultQueryPlanner = ctx.getBean("DefaultQueryPlanner", DefaultQueryPlanner.class);
    Assert.assertNotNull(defaultQueryPlanner);
}
Also used : DefaultQueryPlanner(datawave.query.planner.DefaultQueryPlanner) Test(org.junit.Test)

Example 7 with DefaultQueryPlanner

use of datawave.query.planner.DefaultQueryPlanner in project datawave by NationalSecurityAgency.

the class LookupUUIDTune method configure.

@Override
public void configure(QueryPlanner planner) {
    if (planner instanceof DefaultQueryPlanner) {
        DefaultQueryPlanner dqp = DefaultQueryPlanner.class.cast(planner);
        dqp.setCacheDataTypes(enableCaching);
        if (transforms != null) {
            dqp.setTransformRules(transforms);
        }
        if (disableComplexFunctions) {
            dqp.setDisableAnyFieldLookup(true);
            dqp.setDisableBoundedLookup(true);
            dqp.setDisableCompositeFields(true);
            dqp.setDisableExpandIndexFunction(true);
            dqp.setDisableTestNonExistentFields(true);
            if (reduceResponse)
                try {
                    Class iteratorClass = Class.forName(this.queryIteratorClass);
                    dqp.setQueryIteratorClass(iteratorClass);
                } catch (ClassNotFoundException e) {
                    throw new IllegalStateException("Cannot Instantiate queryIteratorClass: " + this.queryIteratorClass, e);
                }
        }
        if (enablePreload) {
            dqp.setPreloadOptions(true);
        }
    }
}
Also used : DefaultQueryPlanner(datawave.query.planner.DefaultQueryPlanner)

Example 8 with DefaultQueryPlanner

use of datawave.query.planner.DefaultQueryPlanner in project datawave by NationalSecurityAgency.

the class AbstractFunctionalQuery method querySetUp.

@Before
public void querySetUp() throws IOException {
    log.debug("---------  querySetUp  ---------");
    this.logic = createQueryLogic();
    QueryTestTableHelper.configureLogicToScanTables(this.logic);
    this.logic.setFullTableScanEnabled(false);
    this.logic.setIncludeDataTypeAsField(true);
    this.logic.setDateIndexHelperFactory(new DateIndexHelperFactory());
    this.logic.setMarkingFunctions(new Default());
    this.logic.setMetadataHelperFactory(new MetadataHelperFactory());
    this.logic.setQueryPlanner(new DefaultQueryPlanner());
    this.logic.setResponseObjectFactory(new DefaultResponseObjectFactory());
    this.logic.setCollectTimingDetails(true);
    this.logic.setLogTimingDetails(true);
    this.logic.setMinimumSelectivity(0.03D);
    this.logic.setMaxIndexScanTimeMillis(5000);
    // count logic
    countLogic.setIncludeDataTypeAsField(true);
    countLogic.setFullTableScanEnabled(false);
    countLogic.setDateIndexHelperFactory(new DateIndexHelperFactory());
    countLogic.setMarkingFunctions(new Default());
    countLogic.setMetadataHelperFactory(new MetadataHelperFactory());
    countLogic.setQueryPlanner(new DefaultQueryPlanner());
    countLogic.setResponseObjectFactory(new DefaultResponseObjectFactory());
    QueryTestTableHelper.configureLogicToScanTables(countLogic);
    // init must set auths
    testInit();
    Assert.assertNotNull(this.auths);
    authSet.clear();
    authSet.add(this.auths);
    SubjectIssuerDNPair dn = SubjectIssuerDNPair.of("userDn", "issuerDn");
    DatawaveUser user = new DatawaveUser(dn, DatawaveUser.UserType.USER, Sets.newHashSet(this.auths.toString().split(",")), null, null, -1L);
    this.principal = new DatawavePrincipal(Collections.singleton(user));
    this.testHarness = new QueryLogicTestHarness(this);
}
Also used : DefaultResponseObjectFactory(datawave.webservice.query.result.event.DefaultResponseObjectFactory) SubjectIssuerDNPair(datawave.security.authorization.SubjectIssuerDNPair) DatawaveUser(datawave.security.authorization.DatawaveUser) DefaultQueryPlanner(datawave.query.planner.DefaultQueryPlanner) Default(datawave.marking.MarkingFunctions.Default) DatawavePrincipal(datawave.security.authorization.DatawavePrincipal) DateIndexHelperFactory(datawave.query.util.DateIndexHelperFactory) MetadataHelperFactory(datawave.query.util.MetadataHelperFactory) Before(org.junit.Before)

Example 9 with DefaultQueryPlanner

use of datawave.query.planner.DefaultQueryPlanner in project datawave by NationalSecurityAgency.

the class ExceededOrThresholdMarkerJexlNodeTest method getShardQueryLogic.

private ShardQueryLogic getShardQueryLogic() throws IOException {
    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 10 with DefaultQueryPlanner

use of datawave.query.planner.DefaultQueryPlanner in project datawave by NationalSecurityAgency.

the class IndexQueryLogicTest method querySetUp.

@Before
public void querySetUp() throws IOException {
    log.debug("---------  querySetUp  ---------");
    // Super call to pick up authSet initialization
    super.querySetUp();
    this.logic = new IndexQueryLogic();
    QueryTestTableHelper.configureLogicToScanTables(this.logic);
    this.logic.setFullTableScanEnabled(false);
    this.logic.setIncludeDataTypeAsField(true);
    this.logic.setIncludeGroupingContext(true);
    this.logic.setDateIndexHelperFactory(new DateIndexHelperFactory());
    this.logic.setMarkingFunctions(new MarkingFunctions.Default());
    this.logic.setMetadataHelperFactory(new MetadataHelperFactory());
    this.logic.setQueryPlanner(new DefaultQueryPlanner());
    this.logic.setResponseObjectFactory(new DefaultResponseObjectFactory());
    // init must set auths
    testInit();
    SubjectIssuerDNPair dn = SubjectIssuerDNPair.of("userDn", "issuerDn");
    DatawaveUser user = new DatawaveUser(dn, DatawaveUser.UserType.USER, Sets.newHashSet(this.auths.toString().split(",")), null, null, -1L);
    this.principal = new DatawavePrincipal(Collections.singleton(user));
    this.testHarness = new QueryLogicTestHarness(this);
}
Also used : DefaultResponseObjectFactory(datawave.webservice.query.result.event.DefaultResponseObjectFactory) SubjectIssuerDNPair(datawave.security.authorization.SubjectIssuerDNPair) DatawaveUser(datawave.security.authorization.DatawaveUser) QueryLogicTestHarness(datawave.query.testframework.QueryLogicTestHarness) DefaultQueryPlanner(datawave.query.planner.DefaultQueryPlanner) DatawavePrincipal(datawave.security.authorization.DatawavePrincipal) DateIndexHelperFactory(datawave.query.util.DateIndexHelperFactory) MarkingFunctions(datawave.marking.MarkingFunctions) MetadataHelperFactory(datawave.query.util.MetadataHelperFactory) Before(org.junit.Before)

Aggregations

DefaultQueryPlanner (datawave.query.planner.DefaultQueryPlanner)12 ShardQueryLogic (datawave.query.tables.ShardQueryLogic)5 DateIndexHelperFactory (datawave.query.util.DateIndexHelperFactory)4 MetadataHelperFactory (datawave.query.util.MetadataHelperFactory)4 Before (org.junit.Before)4 MarkingFunctions (datawave.marking.MarkingFunctions)3 URL (java.net.URL)3 Test (org.junit.Test)3 KryoDocumentDeserializer (datawave.query.function.deserializer.KryoDocumentDeserializer)2 RegexPushdownTransformRule (datawave.query.planner.rules.RegexPushdownTransformRule)2 DatawavePrincipal (datawave.security.authorization.DatawavePrincipal)2 DatawaveUser (datawave.security.authorization.DatawaveUser)2 SubjectIssuerDNPair (datawave.security.authorization.SubjectIssuerDNPair)2 DefaultResponseObjectFactory (datawave.webservice.query.result.event.DefaultResponseObjectFactory)2 Default (datawave.marking.MarkingFunctions.Default)1 DatawaveFatalQueryException (datawave.query.exceptions.DatawaveFatalQueryException)1 FullTableScansDisallowedException (datawave.query.exceptions.FullTableScansDisallowedException)1 MetadataHelperQueryModelProvider (datawave.query.planner.MetadataHelperQueryModelProvider)1 QueryModelProvider (datawave.query.planner.QueryModelProvider)1 QueryPlanner (datawave.query.planner.QueryPlanner)1