public CacheID(DQPWorkContext context, ParseInfo pi, String sql){ this(pi, sql, context.getVdbName(), context.getVdbVersion(), context.getSessionId(), context.getUserName()); }
public CacheID(DQPWorkContext context, ParseInfo pi, String sql){ this(pi, sql, context.getVdbName(), context.getVdbVersion(), context.getSessionId(), context.getUserName()); }
public CacheID(DQPWorkContext context, ParseInfo pi, String sql){ this(pi, sql, context.getVdbName(), context.getVdbVersion(), context.getSessionId(), context.getUserName()); }
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); }
sqlStr = cmd != null ? cmd.toString() : null; String userName = qr.getWorkContext().getUserName(); String transactionID = null; if ( qr.isTransactional() ) {
sqlStr = cmd != null ? cmd.toString() : null; String userName = qr.getWorkContext().getUserName(); String transactionID = null; if ( qr.isTransactional() ) {
message = new CommandLogMessage(System.currentTimeMillis(), rID.toString(), txnID, workContext.getSessionId(), appName, workContext.getUserName(), workContext.getVdbName(), workContext.getVdbVersion(), msg.getCommandString(), cpuTime); workItem.setTracingSpan(TeiidTracingUtil.getInstance().buildSpan(options, message, msg.getSpanContext())); } else { plan = qp.getProcessorPlan().getDescriptionProperties(); message = new CommandLogMessage(System.currentTimeMillis(), rID.toString(), txnID, workContext.getSessionId(), workContext.getUserName(), workContext.getVdbName(), workContext.getVdbVersion(), rowCount, status, plan); Span span = workItem.getTracingSpan(); if (span != null) {
message = new CommandLogMessage(System.currentTimeMillis(), rID.toString(), txnID, workContext.getSessionId(), appName, workContext.getUserName(), workContext.getVdbName(), workContext.getVdbVersion(), msg.getCommandString(), cpuTime); workItem.setTracingSpan(TeiidTracingUtil.getInstance().buildSpan(options, message, msg.getSpanContext())); } else { plan = qp.getProcessorPlan().getDescriptionProperties(); message = new CommandLogMessage(System.currentTimeMillis(), rID.toString(), txnID, workContext.getSessionId(), workContext.getUserName(), workContext.getVdbName(), workContext.getVdbVersion(), rowCount, status, plan); Span span = workItem.getTracingSpan(); if (span != null) {
sqlStr = cmd != null ? cmd.toString() : null; String userName = qr.getWorkContext().getUserName(); String transactionID = null; if ( qr.isTransactional() ) {
@Test public void testSerialize() throws Exception { DQPWorkContext copy = UnitTestUtil.helpSerialize(example()); assertEquals("5", copy.getSessionId()); //$NON-NLS-1$ assertEquals("userName", copy.getUserName()); //$NON-NLS-1$ assertEquals("vdbName", copy.getVdbName()); //$NON-NLS-1$ assertEquals("1", copy.getVdbVersion()); //$NON-NLS-1$ assertEquals("querybuilder", copy.getAppName()); //$NON-NLS-1$ }
new CommandContext( groupName, workContext.getUserName(), requestMsg.getExecutionPayload(), workContext.getVdbName(),
new CommandContext( groupName, workContext.getUserName(), requestMsg.getExecutionPayload(), workContext.getVdbName(),
new CommandContext( groupName, workContext.getUserName(), requestMsg.getExecutionPayload(), workContext.getVdbName(),