public String toString() { if (!source) { if (event == Event.NEW) { return "\tSTART USER COMMAND:\tstartTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\ttxID=" + transactionID + "\tsessionID=" + sessionID + "\tapplicationName=" + applicationName + "\tprincipal=" + principal + "\tvdbName=" + vdbName + "\tvdbVersion=" + vdbVersion + "\tsql=" + sql; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ } return "\t"+ event +" USER COMMAND:\tendTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\ttxID=" + transactionID + "\tsessionID=" + sessionID + "\tprincipal=" + principal + "\tvdbName=" + vdbName + "\tvdbVersion=" + vdbVersion + "\tfinalRowCount=" + rowCount+ ((plan!=null)?"\tplan=" + plan.toYaml():"") + ((cpuTime!=null)?"\tcpuTime(ns)=" + cpuTime:""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$ //$NON-NLS-13$ } if (event == Event.NEW) { return "\tSTART DATA SRC COMMAND:\tstartTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\tsourceCommandID="+ sourceCommandID + "\texecutionID="+ executionContext.getExecutionCountIdentifier() + "\ttxID=" + transactionID + "\tmodelName="+ modelName + "\ttranslatorName=" + translatorName + "\tsessionID=" + sessionID + "\tprincipal=" + principal + "\tsql=" + sql; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ } return "\t"+ event +" SRC COMMAND:\tendTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\tsourceCommandID="+ sourceCommandID + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ "\texecutionID="+ executionContext.getExecutionCountIdentifier() + "\ttxID=" + transactionID + "\tmodelName="+ modelName + "\ttranslatorName=" + translatorName + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ "\tsessionID=" + sessionID + "\tprincipal=" + principal + ((sourceCommand != null)?"\tsourceCommand=" + StringUtil.toString(sourceCommand, " "):"") + ((rowCount != null)?"\tfinalRowCount=" + rowCount:"") + ((cpuTime!=null)?"\tcpuTime(ns)=" + cpuTime:""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ }
/** * Returns the source comment for the given command * @param context * @param command * @return the comment */ public String getSourceComment(ExecutionContext context, Command command) { if (addSourceComment() && context != null) { return comment.get().format(new Object[] {context.getConnectionId(), context.getRequestId(), context.getPartIdentifier(), context.getExecutionCountIdentifier(), context.getSession().getUserName(), context.getVdbName(), context.getVdbVersion(), context.isTransactional() }); } return ""; //$NON-NLS-1$ }
public FakeExecutionContextImpl(ExecutionContext c) { super(c.getVdbName(), c.getVdbVersion(), c.getCommandPayload(), c .getConnectionId(), c.getConnectorIdentifier(), Long.valueOf(c .getRequestId()), c.getPartIdentifier(), c .getExecutionCountIdentifier()); }
public CommandEnitity(CommandLogMessage msg) { this.time = new Timestamp(msg.getTimestamp()); this.eventType = msg.getStatus().name(); this.sessionId = msg.getSessionID(); this.requestId = msg.getRequestID(); this.vdbName = msg.getVdbName(); this.vdbVersion = msg.getVdbVersion(); this.applicationName = msg.getApplicationName(); this.transactionId = msg.getTransactionID(); this.principal = msg.getPrincipal(); this.sourceCommandId = msg.getSourceCommandID(); this.sourceCommand = msg.isSource(); if (msg.getExecutionContext() != null) { this.executionId = msg.getExecutionContext().getExecutionCountIdentifier(); } this.modelName = msg.getModelName(); this.translatorName = msg.getTranslatorName(); this.sql = msg.getSql(); this.rowCount = msg.getRowCount(); if ((msg.getPlan() != null && msg.getStatus() == Event.PLAN)) { try { this.queryplan = new SerialBlob(msg.getPlan().toString().getBytes()); } catch (SerialException e) { //ignore } catch (SQLException e) { //ignore } } }