/** * Add the query to the deadline priority queue * * @exception IllegalArgumentException * if the query deadline has not been set. * * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/772"> * Query timeout only checked at operator start/stop. </a> */ void addQueryToDeadlineQueue(final AbstractRunningQuery query) { final long deadline = query.getDeadline(); if (deadline == Long.MAX_VALUE) { /* * Do not allow queries with an unbounded deadline into the priority * queue. */ throw new IllegalArgumentException(); } final long deadlineNanos = TimeUnit.MILLISECONDS.toNanos(deadline); deadlineQueue.add(new QueryDeadline(deadlineNanos, query)); }
getQueryController(), queryId, bopId, -1/* shardId */, true/* lastInvocation */); acceptChunk(emptyMessage);
@Override final public void halt(final Void v) { lock.lock(); try { // signal normal completion. future.halt((Void) v); // interrupt anything which is running. cancel(true/* mayInterruptIfRunning */); } finally { lock.unlock(); } }
/** * Check the deadline on the query. If the query is not terminated and the * deadline has expired, then the query is terminated as a side-effect. * * @param nowNanosIsIgnored * A current timestamp. * * @return <code>null</code> if the query is terminated and * <code>this</code> if the query is not terminated. */ QueryDeadline checkDeadline(final long nowNanosIsIgnored) { final AbstractRunningQuery q = queryRef.get(); if (q == null) { /* * The weak reference to the query has been cleared. This query is * known to be terminated. */ return null; } // Check the deadline. q.checkDeadline(); if (q.isDone()) { // Query is terminated. return null; } // Query is running and deadline is not expired. return this; }
if (q != null && !q.isDone()) q.consumeChunk(); } catch (InterruptedException e) {
realSource.release(); releaseAcceptedMessages(); cancelled |= cancelRunningOperators(mayInterruptIfRunning); if (controller) { cancelled |= cancelQueryOnPeers(future.getCause(), runState.getServiceIds()); releaseNativeMemoryForQuery(); if (isController()) QueryLog.log(this); final long elapsed = getElapsed(); queryEngine.counters.elapsedMillis.add(elapsed);
final IQueryAttributes tmp = runningQuery.getAttributes(); runningQuery.setDeadline(deadline); + runningQuery.getQueryId()); if (pendingCancelLRU.containsKey(runningQuery.getQueryId())) { runningQuery.cancel(true/* mayInterruptIfRunning */); pendingCancelLRU.remove(runningQuery.getQueryId()); runningQuery.startQuery(msg);
runningQuery1.setDeadline(deadline1Millis); runningQuery2.setDeadline(deadline2Millis); TimeUnit.MILLISECONDS.toNanos(runningQuery1.getDeadline()), runningQuery1); TimeUnit.MILLISECONDS.toNanos(runningQuery2.getDeadline()), runningQuery2);
@SuppressWarnings("rawtypes") final Set doneOn = runState.getDoneOn(msg.getBOpId()); doLastPass(msg.getBOpId(), doneOn); return; triggerOperatorsAwaitingLastPass(); releaseNativeMemoryForOperator(msg.getBOpId()); + ", msg=" + msg + ", runState=" + runState); halt((Void) null); halt(t);
getQueryController(), queryId, bopId, -1/* shardId */, true/* lastInvocation */); acceptChunk(emptyMessage); log.info("Triggering last pass: " + bopId); doLastPass(bopId, doneOn);
.addChild(runningSubquery);
if (!q.acceptChunk(msg)) {
realSource.release(); releaseAcceptedMessages(); cancelled |= cancelRunningOperators(mayInterruptIfRunning); if (controller) { cancelled |= cancelQueryOnPeers(future.getCause(), runState.getServiceIds()); releaseNativeMemoryForQuery(); if (isController()) QueryLog.log(this); final long elapsed = getElapsed(); queryEngine.counters.elapsedMillis.add(elapsed);
final IQueryAttributes tmp = runningQuery.getAttributes(); runningQuery.setDeadline(deadline); + runningQuery.getQueryId()); if (pendingCancelLRU.containsKey(runningQuery.getQueryId())) { runningQuery.cancel(true/* mayInterruptIfRunning */); pendingCancelLRU.remove(runningQuery.getQueryId()); runningQuery.startQuery(msg);
runningQuery1.setDeadline(deadline1Millis); runningQuery2.setDeadline(deadline2Millis); TimeUnit.MILLISECONDS.toNanos(runningQuery1.getDeadline()), runningQuery1); TimeUnit.MILLISECONDS.toNanos(runningQuery2.getDeadline()), runningQuery2);
@SuppressWarnings("rawtypes") final Set doneOn = runState.getDoneOn(msg.getBOpId()); doLastPass(msg.getBOpId(), doneOn); return; triggerOperatorsAwaitingLastPass(); releaseNativeMemoryForOperator(msg.getBOpId()); + ", msg=" + msg + ", runState=" + runState); halt((Void) null); halt(t);
getQueryController(), queryId, bopId, -1/* shardId */, true/* lastInvocation */); acceptChunk(emptyMessage); log.info("Triggering last pass: " + bopId); doLastPass(bopId, doneOn);
.addChild(runningSubquery);
/** * Check the deadline on the query. If the query is not terminated and the * deadline has expired, then the query is terminated as a side-effect. * * @param nowNanosIsIgnored * A current timestamp. * * @return <code>null</code> if the query is terminated and * <code>this</code> if the query is not terminated. */ QueryDeadline checkDeadline(final long nowNanosIsIgnored) { final AbstractRunningQuery q = queryRef.get(); if (q == null) { /* * The weak reference to the query has been cleared. This query is * known to be terminated. */ return null; } // Check the deadline. q.checkDeadline(); if (q.isDone()) { // Query is terminated. return null; } // Query is running and deadline is not expired. return this; }
if (q != null && !q.isDone()) q.consumeChunk(); } catch (InterruptedException e) {