use of org.apache.rya.api.persist.utils.RyaDaoQueryWrapper in project incubator-rya by apache.
the class InferenceEngine method setRyaDAO.
public synchronized void setRyaDAO(final RyaDAO<?> ryaDAO) {
this.ryaDAO = ryaDAO;
ryaDaoQueryWrapper = new RyaDaoQueryWrapper(ryaDAO);
}
use of org.apache.rya.api.persist.utils.RyaDaoQueryWrapper in project incubator-rya by apache.
the class InferenceEngine method init.
public void init() throws InferenceEngineException {
try {
if (isInitialized()) {
return;
}
checkNotNull(conf, "Configuration is null");
checkNotNull(ryaDAO, "RdfDao is null");
checkArgument(ryaDAO.isInitialized(), "RdfDao is not initialized");
ryaDaoQueryWrapper = new RyaDaoQueryWrapper(ryaDAO, conf);
refreshGraph();
if (schedule.get()) {
timer = new Timer(InferenceEngine.class.getName());
timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
try {
refreshGraph();
} catch (final InferenceEngineException e) {
throw new RuntimeException(e);
}
}
}, refreshGraphSchedule.get(), refreshGraphSchedule.get());
}
setInitialized(true);
} catch (final RyaDAOException e) {
throw new InferenceEngineException(e);
}
}
Aggregations