/** * Prepares the Job by performing an EXPLAIN on the query. * * @param pp the ParallelPrecomputer that will execute this job * @throws ObjectStoreException if an error occurs */ private void prepare(ParallelPrecomputer pp) throws ObjectStoreException { info = pp.getObjectStore().estimate(query); }
/** * Creates precomputed tables for the given query. * * @param q the Query for which to create the precomputed tables * @param category a String describing the category of the precomputed tables * @return the names of the new precomputed tables * @throws ObjectStoreException if anything goes wrong */ public List<String> precompute(Query q, String category) throws ObjectStoreException { return precompute(q, null, false, category); }
/** * {@inheritDoc} */ @Override public ObjectStoreWriterInterMineImpl getNewWriter() throws ObjectStoreException { return new ObjectStoreWriterInterMineImpl(this); }
/** * {@inheritDoc} * * Delegates to the parent ObjectStore */ @Override protected String generateSql(Connection c, Query q, int start, int limit) throws ObjectStoreException { return os.generateSql(c, q, start, limit); }
/** * Create a ParallelPrecomputer. * * @param os an ObjectStoreInterMineImpl * @return a ParallelPrecomputer for the ObjectStore */ protected ParallelPrecomputer getPrecomputer(ObjectStoreInterMineImpl os) { return new ParallelPrecomputer(os, THREAD_COUNT); }
/** * {@inheritDoc} */ @Override public SingletonResults executeSingleton(Query q) { return executeSingleton(q, DEFAULT_BATCH_SIZE, true, true, true); }
/** * {@inheritDoc} * Delegate to the parent ObjectStore. */ @Override public synchronized Map<Object, Integer> getSequence(Set<Object> tables) { return os.getSequence(tables); }
/** * {@inheritDoc} */ @Override protected synchronized void dbLog(long optimise, long estimated, long execute, long permitted, long convert, Query q, String sql) { os.dbLog(optimise, estimated, execute, permitted, convert, q, sql); }
/** * Returns the log used by this objectstore. * * @return the log */ @Override public synchronized Writer getLog() { return os.getLog(); }
/** * {@inheritDoc} */ @Override public boolean getLogEverything() { return os.getLogEverything(); }
/** * {@inheritDoc} */ @Override public boolean getDisableResultsCache() { return os.getDisableResultsCache(); }
/** * Set the cutoff value used to decide if a bag should be put in a table. * * @param minBagTableSize don't use a table to represent bags if the bag is smaller than this * value */ @Override public void setMinBagTableSize(int minBagTableSize) { os.setMinBagTableSize(minBagTableSize); }
/** * {@inheritDoc} * Delegate to the parent ObjectStore. */ @Override public synchronized void checkSequence(Map<Object, Integer> sequence, Query q, String message) throws DataChangedException { //if ((!tablesAltered.isEmpty()) && (!sequence.isEmpty())) { // throw new DataChangedException("Cannot query a writer with uncommitted changes"); //} os.checkSequence(sequence, q, message); }
/** * {@inheritDoc} */ @Override public boolean getLogBeforeExecute() { return os.getLogBeforeExecute(); }
private void checkTables() throws SQLException { osw.performUnsafeOperation(TABLE_DEFINITION, new SQLOperation<Void>() { @Override public Void run(PreparedStatement stm) throws SQLException { if (!DatabaseUtil.tableExists(stm.getConnection(), TABLE_NAME)) { LOG.info("Creating preferences table"); stm.execute(); } return null; } }); }
protected ParallelPrecomputer getPrecomputer(ObjectStoreInterMineImpl os) { if (testPrecomputer == null) { testPrecomputer = new TestParallelPrecomputer(os, THREAD_COUNT); } return testPrecomputer; } }
/** * Prepares the Job by performing an EXPLAIN on the query. * * @param pp the ParallelPrecomputer that will execute this job * @throws ObjectStoreException if an error occurs */ private void prepare(ParallelPrecomputer pp) throws ObjectStoreException { info = pp.getObjectStore().estimate(query); }
/** * {@inheritDoc} */ @Override public ObjectStoreWriterInterMineImpl getNewWriter() throws ObjectStoreException { return new ObjectStoreWriterInterMineImpl(this); }
/** * {@inheritDoc} */ @Override protected synchronized void dbLog(long optimise, long estimated, long execute, long permitted, long convert, Query q, String sql) { os.dbLog(optimise, estimated, execute, permitted, convert, q, sql); }
/** * Returns the log used by this objectstore. * * @return the log */ @Override public synchronized Writer getLog() { return os.getLog(); }