Search in sources :

Example 1 with CardinalityStatementPattern

use of org.apache.rya.indexing.accumulo.entity.StarQuery.CardinalityStatementPattern in project incubator-rya by apache.

the class EntityTupleSet method init.

private void init() {
    try {
        accCon = ConfigUtils.getConnector(conf);
    } catch (AccumuloException e) {
        e.printStackTrace();
    } catch (AccumuloSecurityException e) {
        e.printStackTrace();
    }
    try {
        if (conf.isUseStats() && conf.isUseSelectivity()) {
            ProspectorServiceEvalStatsDAO evalDao = new ProspectorServiceEvalStatsDAO(accCon, conf);
            evalDao.init();
            AccumuloSelectivityEvalDAO ase = new AccumuloSelectivityEvalDAO(conf, accCon);
            ase.setRdfEvalDAO(evalDao);
            ase.init();
            cardinality = starQuery.getCardinality(ase);
            CardinalityStatementPattern csp = starQuery.getMinCardSp(ase);
            minCard = csp.getCardinality();
            minSp = csp.getSp();
        } else {
            // TODO come up with a better default if cardinality is not
            // initialized
            cardinality = minCard = 1;
            minSp = starQuery.getNodes().get(0);
        }
    } catch (final Exception e) {
        LOG.warn("A problem was encountered while initializing the EntityTupleSet.", e);
    }
}
Also used : AccumuloException(org.apache.accumulo.core.client.AccumuloException) CardinalityStatementPattern(org.apache.rya.indexing.accumulo.entity.StarQuery.CardinalityStatementPattern) ProspectorServiceEvalStatsDAO(org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO) AccumuloSelectivityEvalDAO(org.apache.rya.joinselect.AccumuloSelectivityEvalDAO) AccumuloSecurityException(org.apache.accumulo.core.client.AccumuloSecurityException) SailException(org.openrdf.sail.SailException) QueryEvaluationException(org.openrdf.query.QueryEvaluationException) AccumuloSecurityException(org.apache.accumulo.core.client.AccumuloSecurityException) AccumuloException(org.apache.accumulo.core.client.AccumuloException)

Aggregations

AccumuloException (org.apache.accumulo.core.client.AccumuloException)1 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)1 CardinalityStatementPattern (org.apache.rya.indexing.accumulo.entity.StarQuery.CardinalityStatementPattern)1 AccumuloSelectivityEvalDAO (org.apache.rya.joinselect.AccumuloSelectivityEvalDAO)1 ProspectorServiceEvalStatsDAO (org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO)1 QueryEvaluationException (org.openrdf.query.QueryEvaluationException)1 SailException (org.openrdf.sail.SailException)1