ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ag...@apache.org
Subject [05/11] ignite git commit: master Add a method to quickly check if a node is in baseline topology
Date Wed, 24 Jan 2018 15:01:50 GMT
master Add a method to quickly check if a node is in baseline topology


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

Branch: refs/heads/ignite-6643
Commit: fa1564522cc544ffcff7e22e6af2cf19dea53ae5
Parents: 8d42789
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Wed Jan 24 10:46:34 2018 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Wed Jan 24 10:46:34 2018 +0300

----------------------------------------------------------------------
 .../ignite/internal/managers/discovery/DiscoCache.java    |  8 ++++++++
 .../processors/cache/persistence/file/FilePageStore.java  |  2 +-
 .../processors/cluster/GridClusterStateProcessor.java     | 10 ++++++----
 3 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/fa156452/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
index f73f420..7bc0344 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
@@ -276,6 +276,14 @@ public class DiscoCache {
     }
 
     /**
+     * @param node Node to check.
+     * @return {@code True} if the node is in baseline or if baseline is not set.
+     */
+    public boolean baselineNode(ClusterNode node) {
+        return nodeIdToConsIdx == null || nodeIdToConsIdx.get(node.id()) != null;
+    }
+
+    /**
      * @return Oldest alive server node.
      */
     @SuppressWarnings("ForLoopReplaceableByForEach")

http://git-wip-us.apache.org/repos/asf/ignite/blob/fa156452/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
index ddf6062..1153c88 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
@@ -126,7 +126,7 @@ public class FilePageStore implements PageStore {
     /**
      * Page store version.
      */
-    public int version() {
+    @Override public int version() {
         return VERSION;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/fa156452/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
index 54e0f56..73c9d7f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
@@ -243,12 +243,14 @@ public class GridClusterStateProcessor extends GridProcessorAdapter
implements I
      * @throws IgniteCheckedException If write to metastore has failed.
      */
     public void resetBranchingHistory(long newBranchingHash) throws IgniteCheckedException
{
-        globalState.baselineTopology().resetBranchingHistory(newBranchingHash);
+        if (!compatibilityMode()) {
+            globalState.baselineTopology().resetBranchingHistory(newBranchingHash);
 
-        writeBaselineTopology(globalState.baselineTopology(), null);
+            writeBaselineTopology(globalState.baselineTopology(), null);
 
-        U.log(log,
-            String.format("Branching history of current BaselineTopology is reset to the
value %d", newBranchingHash));
+            U.log(log,
+                String.format("Branching history of current BaselineTopology is reset to
the value %d", newBranchingHash));
+        }
     }
 
     /**


Mime
View raw message