use of org.apache.rya.accumulo.AccumuloRdfEvalStatsDAO in project incubator-rya by apache.
the class SparqlQueryPigEngine method init.
public void init() throws Exception {
Preconditions.checkNotNull(sparqlToPigTransformVisitor, "Sparql To Pig Transform Visitor must not be null");
logger.info("Initializing Sparql Query Pig Engine");
if (hadoopDir != null) {
// set hadoop dir property
System.setProperty("HADOOPDIR", hadoopDir);
}
if (pigServer == null) {
pigServer = new PigServer(execType);
}
if (inference || stats) {
final String instance = sparqlToPigTransformVisitor.getInstance();
final String zoo = sparqlToPigTransformVisitor.getZk();
final String user = sparqlToPigTransformVisitor.getUser();
final String pass = sparqlToPigTransformVisitor.getPassword();
final Connector connector = new ZooKeeperInstance(instance, zoo).getConnector(user, new PasswordToken(pass.getBytes(StandardCharsets.UTF_8)));
final String tablePrefix = sparqlToPigTransformVisitor.getTablePrefix();
conf.setTablePrefix(tablePrefix);
if (inference) {
logger.info("Using inference");
inferenceEngine = new InferenceEngine();
ryaDAO = new AccumuloRyaDAO();
ryaDAO.setConf(conf);
ryaDAO.setConnector(connector);
ryaDAO.init();
inferenceEngine.setRyaDAO(ryaDAO);
inferenceEngine.setConf(conf);
inferenceEngine.setSchedule(false);
inferenceEngine.init();
}
if (stats) {
logger.info("Using stats");
rdfEvalStatsDAO = new AccumuloRdfEvalStatsDAO();
rdfEvalStatsDAO.setConf(conf);
rdfEvalStatsDAO.setConnector(connector);
// rdfEvalStatsDAO.setEvalTable(tablePrefix + RdfCloudTripleStoreConstants.TBL_EVAL_SUFFIX);
rdfEvalStatsDAO.init();
rdfCloudTripleStoreEvaluationStatistics = new RdfCloudTripleStoreEvaluationStatistics<AccumuloRdfConfiguration>(conf, rdfEvalStatsDAO);
}
}
}
Aggregations