/** * Calls ObjectStore.releaseGoFaster() if this object wraps a Results object from an * ObjectStoreInterMineImpl. * * @throws ObjectStoreException if ObjectStoreInterMineImpl.releaseGoFaster() throws the exception */ public synchronized void releaseGoFaster() throws ObjectStoreException { goingFaster--; if (goingFaster == 0) { ObjectStore os = osResults.getObjectStore(); if (os instanceof ObjectStoreInterMineImpl) { ((ObjectStoreInterMineImpl) os).releaseGoFaster(osResults.getQuery()); } } }
/** * Calls ObjectStore.goFaster() if this object wraps a Results object from an * ObjectStoreInterMineImpl. * * @throws ObjectStoreException if ObjectStoreInterMineImpl.goFaster() throws the exception */ public synchronized void goFaster() throws ObjectStoreException { goingFaster++; if (goingFaster == 1) { osResults = changeResultBatchSize(osResults, BIG_BATCH_SIZE); ObjectStore os = osResults.getObjectStore(); if (os instanceof ObjectStoreInterMineImpl) { ((ObjectStoreInterMineImpl) os).goFaster(osResults.getQuery()); } } }
/** * Returns the ObjectStore's maximum allowable offset. * * @return an int */ public int getMaxRetrievableIndex() { return osResults.getObjectStore().getMaxOffset(); }
/** * Make a copy of a Results object, but with a different batch size. * * @param oldResults the original Results objects * @param newBatchSize the new batch size * @return a new Results object with a new batch size */ private Results changeResultBatchSize(Results oldResults, int newBatchSize) { Results newResults = oldResults.getObjectStore().execute(oldResults.getQuery(), newBatchSize, true, true, true); return newResults; }