You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2020/08/04 11:27:01 UTC
[ignite] branch master updated: Revert "IGNITE-13262 Cleanup
duplicated code. Refactored to IgniteLogger. Cleanup self references in
IgniteUtils. - Fixes #8044."
This is an automated email from the ASF dual-hosted git repository.
akuznetsov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new f28fac6 Revert "IGNITE-13262 Cleanup duplicated code. Refactored to IgniteLogger. Cleanup self references in IgniteUtils. - Fixes #8044."
f28fac6 is described below
commit f28fac66efccbd0367c311558ebe93b45ba56f37
Author: Alexey Kuznetsov <ak...@apache.org>
AuthorDate: Tue Aug 4 18:26:32 2020 +0700
Revert "IGNITE-13262 Cleanup duplicated code. Refactored to IgniteLogger. Cleanup self references in IgniteUtils. - Fixes #8044."
This reverts commit 83de845a21200b4fc786eb7ecf943a5114393bdf.
---
.../GridClientConnectionManagerAdapter.java | 39 ++++++------
.../client/impl/connection/GridClientTopology.java | 7 +-
.../client/util/GridClientStripedLock.java | 5 +-
.../internal/client/util/GridClientUtils.java | 45 +++++++++++++
.../apache/ignite/internal/util/IgniteUtils.java | 74 +++++++++++-----------
5 files changed, 108 insertions(+), 62 deletions(-)
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java
index c599b01..6fde7ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java
@@ -33,6 +33,7 @@ import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
+import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.ssl.SSLContext;
import org.apache.ignite.IgniteCheckedException;
@@ -50,6 +51,7 @@ import org.apache.ignite.internal.client.impl.GridClientThreadFactory;
import org.apache.ignite.internal.client.marshaller.GridClientMarshaller;
import org.apache.ignite.internal.client.marshaller.optimized.GridClientZipOptimizedMarshaller;
import org.apache.ignite.internal.client.util.GridClientStripedLock;
+import org.apache.ignite.internal.client.util.GridClientUtils;
import org.apache.ignite.internal.processors.rest.client.message.GridClientHandshakeResponse;
import org.apache.ignite.internal.processors.rest.client.message.GridClientMessage;
import org.apache.ignite.internal.processors.rest.client.message.GridClientPingPacket;
@@ -66,6 +68,7 @@ import org.apache.ignite.logger.java.JavaLogger;
import org.apache.ignite.plugin.security.SecurityCredentials;
import org.jetbrains.annotations.Nullable;
+import static java.util.logging.Level.INFO;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MACS;
import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.CLIENT_CLOSED;
import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.FAILED;
@@ -81,7 +84,7 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
private static final int INIT_RETRY_INTERVAL = 1000;
/** Class logger. */
- private final IgniteLogger log;
+ private final Logger log;
/** All local enabled MACs. */
private final Collection<String> macs;
@@ -154,7 +157,7 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
this.routers = new ArrayList<>(routers);
this.top = top;
- log = new JavaLogger(Logger.getLogger(getClass().getName()));
+ log = Logger.getLogger(getClass().getName());
executor = cfg.getExecutorService() != null ? cfg.getExecutorService() :
Executors.newCachedThreadPool(new GridClientThreadFactory("exec", true));
@@ -409,7 +412,7 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
catch (Exception e) {
if (cause == null)
cause = e;
- else if (log.isInfoEnabled())
+ else if (log.isLoggable(INFO))
log.info("Unable to connect to grid node [srvAddr=" + srv + ", msg=" + e.getMessage() + ']');
}
}
@@ -506,8 +509,8 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
/** {@inheritDoc} */
@Override public void terminateConnection(GridClientConnection conn, GridClientNode node, Throwable e) {
- if (log.isDebugEnabled())
- log.debug("Connection with remote node was terminated [node=" + node + ", srvAddr=" +
+ if (log.isLoggable(Level.FINE))
+ log.fine("Connection with remote node was terminated [node=" + node + ", srvAddr=" +
conn.serverAddress() + ", errMsg=" + e.getMessage() + ']');
closeIdle();
@@ -542,9 +545,9 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
conn.close(CLIENT_CLOSED, waitCompletion);
if (pingExecutor != null)
- U.shutdownNow(GridClientConnectionManager.class, pingExecutor, log);
+ GridClientUtils.shutdownNow(GridClientConnectionManager.class, pingExecutor, log);
- U.shutdownNow(GridClientConnectionManager.class, executor, log);
+ GridClientUtils.shutdownNow(GridClientConnectionManager.class, executor, log);
if (srv != null)
srv.stop();
@@ -587,25 +590,25 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
*/
private static class NioListener implements GridNioServerListener {
/** */
- private final IgniteLogger log;
+ private final Logger log;
/**
* @param log Logger.
*/
- private NioListener(IgniteLogger log) {
+ private NioListener(Logger log) {
this.log = log;
}
/** {@inheritDoc} */
@Override public void onConnected(GridNioSession ses) {
- if (log.isDebugEnabled())
- log.debug("Session connected: " + ses);
+ if (log.isLoggable(Level.FINE))
+ log.fine("Session connected: " + ses);
}
/** {@inheritDoc} */
@Override public void onDisconnected(GridNioSession ses, @Nullable Exception e) {
- if (log.isDebugEnabled())
- log.debug("Session disconnected: " + ses);
+ if (log.isLoggable(Level.FINE))
+ log.fine("Session disconnected: " + ses);
GridClientFutureAdapter<Boolean> handshakeFut =
ses.removeMeta(GridClientNioTcpConnection.SES_META_HANDSHAKE);
@@ -648,7 +651,7 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
conn.handleResponse((GridClientMessage)msg);
}
catch (IOException e) {
- log.error("Failed to parse response.", e);
+ log.log(Level.SEVERE, "Failed to parse response.", e);
}
}
}
@@ -679,16 +682,16 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
/** {@inheritDoc} */
@Override public void onSessionWriteTimeout(GridNioSession ses) {
- if (log.isDebugEnabled())
- log.debug("Closing NIO session because of write timeout.");
+ if (log.isLoggable(Level.FINE))
+ log.fine("Closing NIO session because of write timeout.");
ses.close();
}
/** {@inheritDoc} */
@Override public void onSessionIdleTimeout(GridNioSession ses) {
- if (log.isDebugEnabled())
- log.debug("Closing NIO session because of idle timeout.");
+ if (log.isLoggable(Level.FINE))
+ log.fine("Closing NIO session because of idle timeout.");
ses.close();
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientTopology.java
index 04bf7de..c537f17 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientTopology.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientTopology.java
@@ -32,7 +32,6 @@ import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.logging.Logger;
-import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.client.GridClientConfiguration;
import org.apache.ignite.internal.client.GridClientDisconnectedException;
import org.apache.ignite.internal.client.GridClientException;
@@ -41,10 +40,10 @@ import org.apache.ignite.internal.client.GridClientProtocol;
import org.apache.ignite.internal.client.GridClientTopologyListener;
import org.apache.ignite.internal.client.impl.GridClientNodeImpl;
import org.apache.ignite.internal.client.impl.GridClientThreadFactory;
+import org.apache.ignite.internal.client.util.GridClientUtils;
import org.apache.ignite.internal.util.typedef.C1;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.logger.java.JavaLogger;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MACS;
@@ -54,7 +53,7 @@ import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MACS;
*/
public class GridClientTopology {
/** Logger. */
- private static final IgniteLogger log = new JavaLogger(Logger.getLogger(GridClientTopology.class.getName()));
+ private static final Logger log = Logger.getLogger(GridClientTopology.class.getName());
/** Topology cache */
private Map<UUID, GridClientNodeImpl> nodes = Collections.emptyMap();
@@ -413,7 +412,7 @@ public class GridClientTopology {
* Shutdowns executor service that performs listener notification.
*/
public void shutdown() {
- U.shutdownNow(GridClientTopology.class, exec, log);
+ GridClientUtils.shutdownNow(GridClientTopology.class, exec, log);
}
/**
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/util/GridClientStripedLock.java b/modules/core/src/main/java/org/apache/ignite/internal/client/util/GridClientStripedLock.java
index cea9f23..0e617d2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/util/GridClientStripedLock.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/util/GridClientStripedLock.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.client.util;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
-import org.apache.ignite.internal.util.typedef.internal.U;
/**
* This is an utility class for 'splitting' locking of some
@@ -59,7 +58,7 @@ public class GridClientStripedLock {
* @return Lock.
*/
public Lock getLock(int key) {
- return locks[U.safeAbs(key) % locks.length];
+ return locks[GridClientUtils.safeAbs(key) % locks.length];
}
/**
@@ -68,7 +67,7 @@ public class GridClientStripedLock {
* @return Lock.
*/
public Lock getLock(long key) {
- return locks[U.safeAbs((int)(key % locks.length))];
+ return locks[GridClientUtils.safeAbs((int)(key % locks.length))];
}
/**
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/util/GridClientUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/client/util/GridClientUtils.java
index 5e50fd4..3e922d2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/util/GridClientUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/util/GridClientUtils.java
@@ -22,7 +22,11 @@ import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
+import java.util.List;
import java.util.UUID;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Logger;
import org.apache.ignite.internal.IgniteFeatures;
import org.apache.ignite.internal.IgniteNodeAttributes;
import org.apache.ignite.internal.client.GridClient;
@@ -126,6 +130,35 @@ public abstract class GridClientUtils {
}
/**
+ * Shutdowns given {@code ExecutorService} and wait for executor service to stop.
+ *
+ * @param owner The ExecutorService owner.
+ * @param exec ExecutorService to shutdown.
+ * @param log The logger to possible exceptions and warnings.
+ */
+ public static void shutdownNow(Class<?> owner, ExecutorService exec, Logger log) {
+ if (exec != null) {
+ List<Runnable> tasks = exec.shutdownNow();
+
+ if (!tasks.isEmpty())
+ log.warning("Runnable tasks outlived thread pool executor service [owner=" + getSimpleName(owner) +
+ ", tasks=" + tasks + ']');
+
+ try {
+ exec.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
+ }
+ catch (InterruptedException ignored) {
+ log.warning("Got interrupted while waiting for executor service to stop.");
+
+ exec.shutdownNow();
+
+ // Preserve interrupt status.
+ Thread.currentThread().interrupt();
+ }
+ }
+ }
+
+ /**
* Gets simple class name taking care of empty names.
*
* @param cls Class to get the name for.
@@ -136,6 +169,18 @@ public abstract class GridClientUtils {
}
/**
+ * Gets absolute value for integer. If integer is {@link Integer#MIN_VALUE}, then {@code 0} is returned.
+ *
+ * @param i Integer.
+ * @return Absolute value.
+ */
+ public static int safeAbs(int i) {
+ i = Math.abs(i);
+
+ return i < 0 ? 0 : i;
+ }
+
+ /**
* Checks that all cluster nodes support specified feature.
*
* @param client Client.
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index bbb15b1..a8e4f5f 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -1205,7 +1205,7 @@ public abstract class IgniteUtils {
* @return {@code True} if ordering is supported.
*/
public static boolean discoOrdered(DiscoverySpi discoSpi) {
- DiscoverySpiOrderSupport ann = getAnnotation(discoSpi.getClass(), DiscoverySpiOrderSupport.class);
+ DiscoverySpiOrderSupport ann = U.getAnnotation(discoSpi.getClass(), DiscoverySpiOrderSupport.class);
return ann != null && ann.value();
}
@@ -1282,7 +1282,7 @@ public abstract class IgniteUtils {
* @param msg Message.
*/
public static void dumpStack(@Nullable IgniteLogger log, String msg) {
- error(log, "Dumping stack.", new Exception(msg));
+ U.error(log, "Dumping stack.", new Exception(msg));
}
/**
@@ -1459,7 +1459,7 @@ public abstract class IgniteUtils {
mxBean.dumpAllThreads(mxBean.isObjectMonitorUsageSupported(), mxBean.isSynchronizerUsageSupported());
GridStringBuilder sb = new GridStringBuilder(THREAD_DUMP_MSG)
- .a(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss z").format(new Date(currentTimeMillis()))).a(NL);
+ .a(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss z").format(new Date(U.currentTimeMillis()))).a(NL);
for (ThreadInfo info : threadInfos) {
printThreadInfo(info, sb, deadlockedThreadsIds);
@@ -1636,12 +1636,12 @@ public abstract class IgniteUtils {
return cls.getDeclaredConstructor();
}
catch (Exception ignore) {
- Method ctorFac = ctorFactory();
- Object sunRefFac = sunReflectionFactory();
+ Method ctorFac = U.ctorFactory();
+ Object sunRefFac = U.sunReflectionFactory();
if (ctorFac != null && sunRefFac != null)
try {
- ctor = (Constructor)ctorFac.invoke(sunRefFac, cls, objectConstructor());
+ ctor = (Constructor)ctorFac.invoke(sunRefFac, cls, U.objectConstructor());
}
catch (IllegalAccessException | InvocationTargetException e) {
throw new IgniteCheckedException("Failed to get object constructor for class: " + cls, e);
@@ -4004,7 +4004,7 @@ public abstract class IgniteUtils {
url = new URL(springCfgPath);
}
catch (MalformedURLException e) {
- url = resolveIgniteUrl(springCfgPath);
+ url = U.resolveIgniteUrl(springCfgPath);
if (url == null)
url = resolveInClasspath(springCfgPath);
@@ -4720,7 +4720,7 @@ public abstract class IgniteUtils {
*/
public static void quietAndInfo(IgniteLogger log, String msg) {
if (log.isQuiet())
- quiet(false, msg);
+ U.quiet(false, msg);
if (log.isInfoEnabled())
log.info(msg);
@@ -5052,7 +5052,7 @@ public abstract class IgniteUtils {
List<Runnable> tasks = exec.shutdownNow();
if (!F.isEmpty(tasks))
- warn(log, "Runnable tasks outlived thread pool executor service [owner=" + getSimpleName(owner) +
+ U.warn(log, "Runnable tasks outlived thread pool executor service [owner=" + getSimpleName(owner) +
", tasks=" + tasks + ']');
try {
@@ -5545,7 +5545,7 @@ public abstract class IgniteUtils {
if (size == -1)
return null;
- HashMap<K, V> map = newHashMap(size);
+ HashMap<K, V> map = U.newHashMap(size);
for (int i = 0; i < size; i++)
map.put((K)in.readObject(), (V)in.readObject());
@@ -6092,10 +6092,10 @@ public abstract class IgniteUtils {
if (obj instanceof GridPeerDeployAware)
return ((GridPeerDeployAware)obj).deployClass();
- if (isPrimitiveArray(obj))
+ if (U.isPrimitiveArray(obj))
return obj.getClass();
- if (!isJdk(obj.getClass()))
+ if (!U.isJdk(obj.getClass()))
return obj.getClass();
if (obj instanceof Iterable<?>) {
@@ -6111,7 +6111,7 @@ public abstract class IgniteUtils {
if (e != null) {
Object k = e.getKey();
- if (k != null && !isJdk(k.getClass()))
+ if (k != null && !U.isJdk(k.getClass()))
return k.getClass();
Object v = e.getValue();
@@ -6179,7 +6179,7 @@ public abstract class IgniteUtils {
if (ldr == null)
ldr = gridClassLoader;
- String lambdaParent = lambdaEnclosingClassName(clsName);
+ String lambdaParent = U.lambdaEnclosingClassName(clsName);
try {
ldr.loadClass(lambdaParent == null ? clsName : lambdaParent);
@@ -6337,7 +6337,7 @@ public abstract class IgniteUtils {
if (obj instanceof Iterable)
return peerDeployAware0((Iterable)obj);
- if (obj.getClass().isArray() && !isPrimitiveArray(obj))
+ if (obj.getClass().isArray() && !U.isPrimitiveArray(obj))
return peerDeployAware0((Object[])obj);
return peerDeployAware(obj);
@@ -8059,7 +8059,7 @@ public abstract class IgniteUtils {
f.get();
}
catch (IgniteCheckedException e) {
- error(log, "Failed to execute future: " + f, e);
+ U.error(log, "Failed to execute future: " + f, e);
}
}
});
@@ -8741,9 +8741,9 @@ public abstract class IgniteUtils {
int dot = fileName.lastIndexOf('.');
if (dot < 0 || dot == fileName.length() - 1)
- return fileName + '-' + id8(nodeId);
+ return fileName + '-' + U.id8(nodeId);
else
- return fileName.substring(0, dot) + '-' + id8(nodeId) + fileName.substring(dot);
+ return fileName.substring(0, dot) + '-' + U.id8(nodeId) + fileName.substring(dot);
}
/**
@@ -8867,7 +8867,7 @@ public abstract class IgniteUtils {
* @throws ClassNotFoundException If class not found.
*/
public static Class<?> forName(String clsName, @Nullable ClassLoader ldr) throws ClassNotFoundException {
- return forName(clsName, ldr, null);
+ return U.forName(clsName, ldr, null);
}
/**
@@ -9149,7 +9149,7 @@ public abstract class IgniteUtils {
* @return {@code True} if error is invalid argument error on MAC.
*/
public static boolean isMacInvalidArgumentError(Exception e) {
- return isMacOs() && e instanceof SocketException && e.getMessage() != null &&
+ return U.isMacOs() && e instanceof SocketException && e.getMessage() != null &&
e.getMessage().toLowerCase().contains("invalid argument");
}
@@ -9205,7 +9205,7 @@ public abstract class IgniteUtils {
((LifecycleAware)obj).stop();
}
catch (Exception e) {
- error(log, "Failed to stop component (ignoring): " + obj, e);
+ U.error(log, "Failed to stop component (ignoring): " + obj, e);
}
}
}
@@ -9504,7 +9504,7 @@ public abstract class IgniteUtils {
File readme = new File(igniteDir, "README.txt");
if (!readme.exists()) {
- writeStringToFile(readme,
+ U.writeStringToFile(readme,
"This is Apache Ignite working directory that contains information that \n" +
" Ignite nodes need in order to function normally.\n" +
"Don't delete it unless you're sure you know what you're doing.\n\n" +
@@ -9563,7 +9563,7 @@ public abstract class IgniteUtils {
}
if (delIfExist && dir.exists()) {
- if (!delete(dir))
+ if (!U.delete(dir))
throw new IgniteCheckedException("Failed to delete directory: " + dir);
}
@@ -10417,7 +10417,7 @@ public abstract class IgniteUtils {
assert arr != null;
try {
- return unmarshal(ctx.config().getMarshaller(), arr, clsLdr);
+ return U.unmarshal(ctx.config().getMarshaller(), arr, clsLdr);
}
catch (IgniteCheckedException e) {
throw e;
@@ -10446,7 +10446,7 @@ public abstract class IgniteUtils {
assert arr != null;
try {
- return unmarshal(ctx.marshaller(), arr, clsLdr);
+ return U.unmarshal(ctx.marshaller(), arr, clsLdr);
}
catch (IgniteCheckedException e) {
throw e;
@@ -10735,8 +10735,8 @@ public abstract class IgniteUtils {
if (adjustedWalArchiveSize > dsCfg.getMaxWalArchiveSize()) {
if (log != null)
- quietAndInfo(log, "Automatically adjusted max WAL archive size to " +
- readableSize(adjustedWalArchiveSize, false) +
+ U.quietAndInfo(log, "Automatically adjusted max WAL archive size to " +
+ U.readableSize(adjustedWalArchiveSize, false) +
" (to override, use DataStorageConfiguration.setMaxWalArchiveSize)");
return adjustedWalArchiveSize;
@@ -10785,7 +10785,7 @@ public abstract class IgniteUtils {
}
@Override public FileVisitResult visitFileFailed(Path file, IOException exc) {
- error(null, "file skipped - " + file, exc);
+ U.error(null, "file skipped - " + file, exc);
// Skip directory or file
return FileVisitResult.CONTINUE;
@@ -10793,7 +10793,7 @@ public abstract class IgniteUtils {
@Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
if (exc != null)
- error(null, "error during size calculation of directory - " + dir, exc);
+ U.error(null, "error during size calculation of directory - " + dir, exc);
// Ignoring
return FileVisitResult.CONTINUE;
@@ -10826,7 +10826,7 @@ public abstract class IgniteUtils {
}
@Override public FileVisitResult visitFileFailed(Path file, IOException exc) {
- error(null, "file skipped during recursive search - " + file, exc);
+ U.error(null, "file skipped during recursive search - " + file, exc);
// Ignoring.
return FileVisitResult.CONTINUE;
@@ -10834,7 +10834,7 @@ public abstract class IgniteUtils {
@Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
if (exc != null)
- error(null, "error during recursive search - " + dir, exc);
+ U.error(null, "error during recursive search - " + dir, exc);
// Ignoring.
return FileVisitResult.CONTINUE;
@@ -11316,7 +11316,7 @@ public abstract class IgniteUtils {
return spi instanceof TcpDiscoverySpi
? ((TcpDiscoverySpi)spi).isLocalNodeCoordinator()
- : F.eq(discoMgr.localNode(), oldest(discoMgr.aliveServerNodes(), null));
+ : F.eq(discoMgr.localNode(), U.oldest(discoMgr.aliveServerNodes(), null));
}
/**
@@ -11526,7 +11526,7 @@ public abstract class IgniteUtils {
int cntr = val.get1();
if (cntr == 0)
- val.set2(currentTimeMillis());
+ val.set2(U.currentTimeMillis());
val.set1(++cntr);
@@ -11540,16 +11540,16 @@ public abstract class IgniteUtils {
int cntr = val.get1();
if (--cntr == 0) {
- long timeout = currentTimeMillis() - val.get2();
+ long timeout = U.currentTimeMillis() - val.get2();
if (timeout > readLockThreshold) {
GridStringBuilder sb = new GridStringBuilder();
sb.a(LOCK_HOLD_MESSAGE + timeout + " ms." + nl());
- printStackTrace(Thread.currentThread().getId(), sb);
+ U.printStackTrace(Thread.currentThread().getId(), sb);
- warn(log, sb.toString());
+ U.warn(log, sb.toString());
}
}
@@ -11705,7 +11705,7 @@ public abstract class IgniteUtils {
lsnr.accept(t);
}
catch (Exception e) {
- warn(log, "Listener error", e);
+ U.warn(log, "Listener error", e);
}
}
}