本文整理了Java中org.teiid.translator.ExecutionContext.getExecutionCountIdentifier()
方法的一些代码示例,展示了ExecutionContext.getExecutionCountIdentifier()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExecutionContext.getExecutionCountIdentifier()
方法的具体详情如下:
包路径:org.teiid.translator.ExecutionContext
类名称:ExecutionContext
方法名:getExecutionCountIdentifier
[英]Execution count defines an id; where every access to the connector from the server in a given command execution boundary is uniquely defined; Like for example in the case of "batched execution" of commands, each execution of command gets new identifier.
[中]执行计数定义一个id;其中,在给定命令执行边界中,从服务器对连接器的每次访问都是唯一定义的;与“批处理执行”命令的情况类似,每次执行命令都会获得新的标识符。
代码示例来源:origin: teiid/teiid
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$
}
代码示例来源:origin: org.teiid.connectors/translator-jdbc
/**
* 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$
}
代码示例来源:origin: teiid/teiid
public FakeExecutionContextImpl(ExecutionContext c) {
super(c.getVdbName(), c.getVdbVersion(), c.getCommandPayload(), c
.getConnectionId(), c.getConnectorIdentifier(), Long.valueOf(c
.getRequestId()), c.getPartIdentifier(), c
.getExecutionCountIdentifier());
}
代码示例来源:origin: org.jboss.teiid.extensions/database-service
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
}
}
}
内容来源于网络,如有侵权,请联系作者删除!