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);
}
}
Aggregations