Search in sources :

Example 1 with RyaDaoQueryWrapper

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);
}
Also used : RyaDaoQueryWrapper(org.apache.rya.api.persist.utils.RyaDaoQueryWrapper)

Example 2 with RyaDaoQueryWrapper

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);
    }
}
Also used : Timer(java.util.Timer) TimerTask(java.util.TimerTask) RyaDAOException(org.apache.rya.api.persist.RyaDAOException) RyaDaoQueryWrapper(org.apache.rya.api.persist.utils.RyaDaoQueryWrapper)

Aggregations

RyaDaoQueryWrapper (org.apache.rya.api.persist.utils.RyaDaoQueryWrapper)2 Timer (java.util.Timer)1 TimerTask (java.util.TimerTask)1 RyaDAOException (org.apache.rya.api.persist.RyaDAOException)1