private void setAnalysisRecords(ResultsMessage response) { if(analysisRecord != null) { if (requestMsg.getShowPlan() != ShowPlan.OFF) { if (processor != null) { PlanNode node = processor.getProcessorPlan().getDescriptionProperties(); node.addProperty(AnalysisRecord.PROP_DATA_BYTES_SENT, String.valueOf(dataBytes.get())); if (planningEnd != 0) { node.addProperty(AnalysisRecord.PROP_PLANNING_TIME, String.valueOf(planningEnd - planningStart)); } response.setPlanDescription(node); } if (analysisRecord.getAnnotations() != null && !analysisRecord.getAnnotations().isEmpty()) { response.setAnnotations(analysisRecord.getAnnotations()); analysisRecord.getAnnotations().clear(); } } if (requestMsg.getShowPlan() == ShowPlan.DEBUG) { response.setDebugLog(analysisRecord.getDebugLog()); analysisRecord.stopDebugLog(); } } }
private void setAnalysisRecords(ResultsMessage response) { if(analysisRecord != null) { if (requestMsg.getShowPlan() != ShowPlan.OFF) { if (processor != null) { PlanNode node = processor.getProcessorPlan().getDescriptionProperties(); node.addProperty(AnalysisRecord.PROP_DATA_BYTES_SENT, String.valueOf(dataBytes.get())); if (planningEnd != 0) { node.addProperty(AnalysisRecord.PROP_PLANNING_TIME, String.valueOf(planningEnd - planningStart)); } response.setPlanDescription(node); } if (analysisRecord.getAnnotations() != null && !analysisRecord.getAnnotations().isEmpty()) { response.setAnnotations(analysisRecord.getAnnotations()); analysisRecord.getAnnotations().clear(); } } if (requestMsg.getShowPlan() == ShowPlan.DEBUG) { response.setDebugLog(analysisRecord.getDebugLog()); analysisRecord.stopDebugLog(); } } }
public PlanNode getPlan(String sessionId, long executionId) { RequestID requestID = new RequestID(sessionId, executionId); if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_DQP, "getPlan for requestID=" + requestID); //$NON-NLS-1$ } RequestWorkItem workItem = safeGetWorkItem(requestID); if (workItem == null) { return null; } QueryProcessor qp = workItem.getProcessor(); if (qp == null) { return null; } return qp.getProcessorPlan().getDescriptionProperties(); }
private void setAnalysisRecords(ResultsMessage response) { if(analysisRecord != null) { if (requestMsg.getShowPlan() != ShowPlan.OFF) { if (processor != null) { PlanNode node = processor.getProcessorPlan().getDescriptionProperties(); node.addProperty(AnalysisRecord.PROP_DATA_BYTES_SENT, String.valueOf(dataBytes.get())); if (planningEnd != 0) { node.addProperty(AnalysisRecord.PROP_PLANNING_TIME, String.valueOf(planningEnd - planningStart)); } response.setPlanDescription(node); } if (analysisRecord.getAnnotations() != null && !analysisRecord.getAnnotations().isEmpty()) { response.setAnnotations(analysisRecord.getAnnotations()); analysisRecord.getAnnotations().clear(); } } if (requestMsg.getShowPlan() == ShowPlan.DEBUG) { response.setDebugLog(analysisRecord.getDebugLog()); analysisRecord.stopDebugLog(); } } }
public PlanNode getPlan(String sessionId, long executionId) { RequestID requestID = new RequestID(sessionId, executionId); if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_DQP, "getPlan for requestID=" + requestID); //$NON-NLS-1$ } RequestWorkItem workItem = safeGetWorkItem(requestID); if (workItem == null) { return null; } QueryProcessor qp = workItem.getProcessor(); if (qp == null) { return null; } return qp.getProcessorPlan().getDescriptionProperties(); }
public PlanNode getPlan(String sessionId, long executionId) { RequestID requestID = new RequestID(sessionId, executionId); if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_DQP, "getPlan for requestID=" + requestID); //$NON-NLS-1$ } RequestWorkItem workItem = safeGetWorkItem(requestID); if (workItem == null) { return null; } QueryProcessor qp = workItem.getProcessor(); if (qp == null) { return null; } return qp.getProcessorPlan().getDescriptionProperties(); }
if (this.currentState != null && this.currentState.processor.getProcessorPlan() != command) {
if (this.currentState != null && this.currentState.processor.getProcessorPlan() != command) {
if (this.currentState != null && this.currentState.processor.getProcessorPlan() != command) {
@Override protected TupleSource createTupleSource() throws TeiidComponentException, TeiidProcessingException { TupleBuffer tb = bc.collectTuples(); CachedResults cr = new CachedResults(); cr.setResults(tb, qp.getProcessorPlan()); Determinism determinismLevel = qp.getContext().getDeterminismLevel(); if (hint != null && hint.getDeterminism() != null) { LogManager.logTrace(LogConstants.CTX_DQP, new Object[] { "Cache hint modified the query determinism from ",determinismLevel, " to ", hint.getDeterminism() }); //$NON-NLS-1$ //$NON-NLS-2$ determinismLevel = hint.getDeterminism(); } cache.put(cid, determinismLevel, cr, hint != null?hint.getTtl():null); context.setDeterminismLevel(determinismLevel); success = true; return tb.createIndexedTupleSource(); }
@Override protected TupleSource createTupleSource() throws TeiidComponentException, TeiidProcessingException { TupleBuffer tb = bc.collectTuples(); CachedResults cr = new CachedResults(); cr.setResults(tb, qp.getProcessorPlan()); Determinism determinismLevel = qp.getContext().getDeterminismLevel(); if (hint != null && hint.getDeterminism() != null) { LogManager.logTrace(LogConstants.CTX_DQP, new Object[] { "Cache hint modified the query determinism from ",determinismLevel, " to ", hint.getDeterminism() }); //$NON-NLS-1$ //$NON-NLS-2$ determinismLevel = hint.getDeterminism(); } cache.put(cid, determinismLevel, cr, hint != null?hint.getTtl():null); context.setDeterminismLevel(determinismLevel); success = true; return tb.createIndexedTupleSource(); }
@Override protected TupleSource createTupleSource() throws TeiidComponentException, TeiidProcessingException { TupleBuffer tb = bc.collectTuples(); CachedResults cr = new CachedResults(); cr.setResults(tb, qp.getProcessorPlan()); Determinism determinismLevel = qp.getContext().getDeterminismLevel(); if (hint != null && hint.getDeterminism() != null) { LogManager.logTrace(LogConstants.CTX_DQP, new Object[] { "Cache hint modified the query determinism from ",determinismLevel, " to ", hint.getDeterminism() }); //$NON-NLS-1$ //$NON-NLS-2$ determinismLevel = hint.getDeterminism(); } cache.put(cid, determinismLevel, cr, hint != null?hint.getTtl():null); context.setDeterminismLevel(determinismLevel); success = true; return tb.createIndexedTupleSource(); }
void logMMCommand(RequestWorkItem workItem, Event status, Long rowCount, Long cpuTime) { if ((status != Event.PLAN && !LogManager.isMessageToBeRecorded(LogConstants.CTX_COMMANDLOGGING, MessageLevel.INFO)) || (status == Event.PLAN && !LogManager.isMessageToBeRecorded(LogConstants.CTX_COMMANDLOGGING, MessageLevel.TRACE))) { return; } RequestMessage msg = workItem.requestMsg; DQPWorkContext workContext = DQPWorkContext.getWorkContext(); RequestID rID = workItem.requestID; String txnID = null; TransactionContext tc = workItem.getTransactionContext(); if (tc != null && tc.getTransactionType() != Scope.NONE) { txnID = tc.getTransactionId(); } String appName = workContext.getAppName(); // Log to request log CommandLogMessage message = null; if (status == Event.NEW) { message = new CommandLogMessage(System.currentTimeMillis(), rID.toString(), txnID, workContext.getSessionId(), appName, workContext.getUserName(), workContext.getVdbName(), workContext.getVdbVersion(), msg.getCommandString(), cpuTime); } else { QueryProcessor qp = workItem.getProcessor(); PlanNode plan = null; if (LogManager.isMessageToBeRecorded(LogConstants.CTX_COMMANDLOGGING, MessageLevel.TRACE) && qp != null) { plan = qp.getProcessorPlan().getDescriptionProperties(); } message = new CommandLogMessage(System.currentTimeMillis(), rID.toString(), txnID, workContext.getSessionId(), workContext.getUserName(), workContext.getVdbName(), workContext.getVdbVersion(), rowCount, status, plan); } LogManager.log(status == Event.PLAN?MessageLevel.TRACE:MessageLevel.INFO, LogConstants.CTX_COMMANDLOGGING, message); }
PlanNode plan = null; if (LogManager.isMessageToBeRecorded(LogConstants.CTX_COMMANDLOGGING, MessageLevel.TRACE) && qp != null) { plan = qp.getProcessorPlan().getDescriptionProperties();
PlanNode plan = null; if (LogManager.isMessageToBeRecorded(LogConstants.CTX_COMMANDLOGGING, MessageLevel.TRACE) && qp != null) { plan = qp.getProcessorPlan().getDescriptionProperties();
CachedResults cr = new CachedResults(); cr.setCommand(originalCommand); cr.setResults(resultsBuffer, processor.getProcessorPlan()); if (requestMsg.getRowLimit() > 0 && resultsBuffer.getRowCount() == requestMsg.getRowLimit() + (collector.isSaveLastRow()?1:0)) { cr.setRowLimit(requestMsg.getRowLimit());
CachedResults cr = new CachedResults(); cr.setCommand(originalCommand); cr.setResults(resultsBuffer, processor.getProcessorPlan()); if (requestMsg.getRowLimit() > 0 && resultsBuffer.getRowCount() == requestMsg.getRowLimit() + (collector.isSaveLastRow()?1:0)) { cr.setRowLimit(requestMsg.getRowLimit());
CachedResults cr = new CachedResults(); cr.setCommand(originalCommand); cr.setResults(resultsBuffer, processor.getProcessorPlan()); if (requestMsg.getRowLimit() > 0 && resultsBuffer.getRowCount() == requestMsg.getRowLimit() + (collector.isSaveLastRow()?1:0)) { cr.setRowLimit(requestMsg.getRowLimit());