本文整理汇总了Java中org.apache.ignite.internal.util.typedef.internal.U.nl方法的典型用法代码示例。如果您正苦于以下问题:Java U.nl方法的具体用法?Java U.nl怎么用?Java U.nl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.internal.util.typedef.internal.U
的用法示例。
在下文中一共展示了U.nl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeSqlQueryWithTimer
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
* Executes sql query and prints warning if query is too slow.
*
* @param stmt Prepared statement for query.
* @param conn Connection.
* @param sql Sql query.
* @param params Parameters.
* @param timeoutMillis Query timeout.
* @param cancel Query cancel.
* @return Result.
* @throws IgniteCheckedException If failed.
*/
private ResultSet executeSqlQueryWithTimer(PreparedStatement stmt, Connection conn, String sql,
@Nullable Collection<Object> params, int timeoutMillis, @Nullable GridQueryCancel cancel)
throws IgniteCheckedException {
long start = U.currentTimeMillis();
try {
ResultSet rs = executeSqlQuery(conn, stmt, timeoutMillis, cancel);
long time = U.currentTimeMillis() - start;
long longQryExecTimeout = ctx.config().getLongQueryWarningTimeout();
if (time > longQryExecTimeout) {
String msg = "Query execution is too long (" + time + " ms): " + sql;
ResultSet plan = executeSqlQuery(conn, preparedStatementWithParams(conn, "EXPLAIN " + sql,
params, false), 0, null);
plan.next();
// Add SQL explain result message into log.
String longMsg = "Query execution is too long [time=" + time + " ms, sql='" + sql + '\'' +
", plan=" + U.nl() + plan.getString(1) + U.nl() + ", parameters=" +
(params == null ? "[]" : Arrays.deepToString(params.toArray())) + "]";
LT.warn(log, longMsg, msg);
}
return rs;
}
catch (SQLException e) {
onSqlException();
throw new IgniteCheckedException(e);
}
}
示例2: dumpDebugInfo
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void dumpDebugInfo(IgniteLogger log) {
StringBuilder b = new StringBuilder(U.nl());
b.append(">>>").append(U.nl());
b.append(">>>").append("Dumping discovery SPI debug info.").append(U.nl());
b.append(">>>").append(U.nl());
b.append("Local node ID: ").append(getLocalNodeId()).append(U.nl()).append(U.nl());
b.append("Local node: ").append(locNode).append(U.nl()).append(U.nl());
b.append("Internal threads: ").append(U.nl());
b.append(" Message worker: ").append(threadStatus(msgWorker)).append(U.nl());
b.append(" Socket reader: ").append(threadStatus(sockReader)).append(U.nl());
b.append(" Socket writer: ").append(threadStatus(sockWriter)).append(U.nl());
b.append(U.nl());
b.append("Nodes: ").append(U.nl());
for (ClusterNode node : allVisibleNodes())
b.append(" ").append(node.id()).append(U.nl());
b.append(U.nl());
b.append("Stats: ").append(spi.stats).append(U.nl());
U.quietAndInfo(log, b.toString());
}
示例3: format
import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
* @param msg Error message.
* @param locVal Local node value.
* @return Error text.
*/
private static String format(String msg, Object locVal) {
return msg + U.nl() +
">>> => Local node: " + locVal + U.nl();
}