ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [3/6] ignite git commit: Optimized daemon node attribute lookup.
Date Fri, 04 Mar 2016 09:21:23 GMT
Optimized daemon node attribute lookup.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/67be1491
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/67be1491
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/67be1491

Branch: refs/heads/ignite-atomic-good-lock-bench
Commit: 67be1491c4b672aab9cf275409eb612ba2bfa553
Parents: cfcb03f
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Thu Mar 3 22:13:17 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Thu Mar 3 22:13:17 2016 +0300

----------------------------------------------------------------------
 .../spi/discovery/tcp/internal/TcpDiscoveryNode.java  | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/67be1491/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
index 0be0bea..c5dda6c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
@@ -142,6 +142,12 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements
Cluste
     @GridToStringExclude
     private transient boolean cacheCli;
 
+    /** Daemon node initialization flag. */
+    private transient volatile boolean daemonInit;
+
+    /** Daemon node flag. */
+    private transient boolean daemon;
+
     /**
      * Public default no-arg constructor for {@link Externalizable} interface.
      */
@@ -374,7 +380,13 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements
Cluste
 
     /** {@inheritDoc} */
     @Override public boolean isDaemon() {
-        return "true".equalsIgnoreCase((String)attribute(ATTR_DAEMON));
+        if (!daemonInit) {
+            daemon = "true".equalsIgnoreCase((String)attribute(ATTR_DAEMON));
+
+            daemonInit = true;
+        }
+
+        return daemon;
     }
 
     /** {@inheritDoc} */


Mime
View raw message