@Override public void release() { try { requestCancel(); } catch (TeiidComponentException e) { LogManager.logWarning(LogConstants.CTX_DQP, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30026,requestID)); } }
@Override public void run() { try { RequestWorkItem wi = workItemRef.get(); if (wi != null) { String reason = QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31096, finalTimeout); wi.requestCancel(reason); } } catch (TeiidComponentException e) { LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30018)); } } }, timeout));
@Override public void run() { try { RequestWorkItem wi = workItemRef.get(); if (wi != null) { String reason = QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31096, finalTimeout); wi.requestCancel(reason); } } catch (TeiidComponentException e) { LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30018)); } } }, timeout));
public boolean requestAtomicRequestCancel(AtomicRequestID ari) throws TeiidComponentException { // in the case that this does not support partial results; cancel // the original processor request. if(!requestMsg.supportsPartialResults()) { return requestCancel(); } DataTierTupleSource connectorRequest = this.connectorInfo.get(ari); if (connectorRequest != null) { connectorRequest.cancelRequest(); return true; } LogManager.logDetail(LogConstants.CTX_DQP, "Connector request not found. AtomicRequestID=", ari); //$NON-NLS-1$ return false; }
@Override public void run() { try { RequestWorkItem wi = workItemRef.get(); if (wi != null) { LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31096, wi.requestID, finalTimeout)); wi.requestCancel(); } } catch (TeiidComponentException e) { LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30018)); } } }, timeout));
public void requestClose() throws TeiidComponentException { if (this.state == ProcessingState.CLOSE || this.closeRequested) { if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_DQP, "Request already closing" + requestID); //$NON-NLS-1$ } return; } if (!this.doneProducingBatches) { this.requestCancel("To immediately halt work as close was called"); //$NON-NLS-1$ //pending work should be canceled for fastest clean up } else { //it's safe to transition directly to close this.state = ProcessingState.CLOSE; } this.closeRequested = true; this.doMoreWork(); }
public void requestClose() throws TeiidComponentException { if (this.state == ProcessingState.CLOSE || this.closeRequested) { if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_DQP, "Request already closing" + requestID); //$NON-NLS-1$ } return; } if (!this.doneProducingBatches) { this.requestCancel(); //pending work should be canceled for fastest clean up } else { //it's safe to transition directly to close this.state = ProcessingState.CLOSE; } this.closeRequested = true; this.doMoreWork(); }
public void requestClose() throws TeiidComponentException { if (this.state == ProcessingState.CLOSE || this.closeRequested) { if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_DQP, "Request already closing" + requestID); //$NON-NLS-1$ } return; } if (!this.doneProducingBatches) { this.requestCancel("To immediately halt work as close was called"); //$NON-NLS-1$ //pending work should be canceled for fastest clean up } else { //it's safe to transition directly to close this.state = ProcessingState.CLOSE; } this.closeRequested = true; this.doMoreWork(); }
private boolean cancelRequest(RequestID requestID, String reason) throws TeiidComponentException { boolean markCancelled = false; RequestWorkItem workItem = safeGetWorkItem(requestID); if (workItem != null) { markCancelled = workItem.requestCancel(reason); } if (markCancelled) { logMMCommand(workItem, Event.CANCEL, null, null); } else { LogManager.logDetail(LogConstants.CTX_DQP, QueryPlugin.Util.getString("DQPCore.failed_to_cancel", requestID)); //$NON-NLS-1$ } return markCancelled; }
private boolean cancelRequest(RequestID requestID, String reason) throws TeiidComponentException { boolean markCancelled = false; RequestWorkItem workItem = safeGetWorkItem(requestID); if (workItem != null) { markCancelled = workItem.requestCancel(reason); } if (markCancelled) { logMMCommand(workItem, Event.CANCEL, null, null); } else { LogManager.logDetail(LogConstants.CTX_DQP, QueryPlugin.Util.getString("DQPCore.failed_to_cancel", requestID)); //$NON-NLS-1$ } return markCancelled; }
private boolean cancelRequest(RequestID requestID) throws TeiidComponentException { if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_DQP, "cancelQuery for requestID=" + requestID); //$NON-NLS-1$ } boolean markCancelled = false; RequestWorkItem workItem = safeGetWorkItem(requestID); if (workItem != null) { markCancelled = workItem.requestCancel(); } if (markCancelled) { logMMCommand(workItem, Event.CANCEL, null, null); } else { LogManager.logDetail(LogConstants.CTX_DQP, QueryPlugin.Util.getString("DQPCore.failed_to_cancel", requestID)); //$NON-NLS-1$ } return markCancelled; }
} catch (InterruptedException e) { try { requestCancel(); } catch (TeiidComponentException e1) { throw new TeiidRuntimeException(QueryPlugin.Event.TEIID30543, e1);
} catch (InterruptedException e) { try { requestCancel("Interrupted"); //$NON-NLS-1$ } catch (TeiidComponentException e1) { throw new TeiidRuntimeException(QueryPlugin.Event.TEIID30543, e1);
} catch (InterruptedException e) { try { requestCancel("Interrupted"); //$NON-NLS-1$ } catch (TeiidComponentException e1) { throw new TeiidRuntimeException(QueryPlugin.Event.TEIID30543, e1);
@Test public void testCancelWithCaching() throws Exception { QueryMetadataInterface metadata = RealMetadataFactory.exampleBQTCached(); CacheDirective cd = new CacheDirective(); this.connectorManager.cacheDirective = cd; helpSetupDataTierManager(); Command command = helpSetupRequest("SELECT stringkey from bqt1.smalla", 1, metadata).getCommand(); this.context.getSession().setSessionId("different"); RegisterRequestParameter rrp = new RegisterRequestParameter(); rrp.connectorBindingId = "x"; TupleSource ts = dtm.registerRequest(context, command, "foo", rrp); assertTrue(ts instanceof CachingTupleSource); assertEquals(4, pullTuples(ts, 4)); ((CachingTupleSource)ts).item.requestCancel(""); assertEquals(1, connectorManager.getExecuteCount().get()); assertFalse(rrp.doNotCache); ts.closeSource(); //should force read all assertFalse(((CachingTupleSource)ts).dtts.errored); assertNull(((CachingTupleSource)ts).dtts.scope); assertEquals(0, this.rm.getRsCache().getCachePutCount()); }