ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-9179 Baseline: Added separate task for collecting info about baseline.
Date Fri, 03 Aug 2018 09:34:14 GMT
Repository: ignite
Updated Branches:
  refs/heads/master f825dfc69 -> ff7372b71


IGNITE-9179 Baseline: Added separate task for collecting info about baseline.


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

Branch: refs/heads/master
Commit: ff7372b7128df3b57ee02b735cc3010645697b7a
Parents: f825dfc
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Fri Aug 3 16:31:41 2018 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Fri Aug 3 16:31:41 2018 +0700

----------------------------------------------------------------------
 .../visor/baseline/VisorBaselineTask.java       |  2 +-
 .../visor/baseline/VisorBaselineViewTask.java   | 73 ++++++++++++++++++++
 .../internal/visor/tx/VisorTxTaskArg.java       |  1 -
 .../internal/visor/tx/VisorTxTaskResult.java    |  7 --
 4 files changed, 74 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ff7372b7/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java
index 721b4b3..3c00452 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java
@@ -34,7 +34,7 @@ import org.apache.ignite.internal.visor.VisorOneNodeTask;
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Task that will collect baseline topology information.
+ * Task that will collect information about baseline topology and can change its state.
  */
 @GridInternal
 public class VisorBaselineTask extends VisorOneNodeTask<VisorBaselineTaskArg, VisorBaselineTaskResult>
{

http://git-wip-us.apache.org/repos/asf/ignite/blob/ff7372b7/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineViewTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineViewTask.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineViewTask.java
new file mode 100644
index 0000000..472b907
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineViewTask.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.visor.baseline;
+
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.internal.cluster.IgniteClusterEx;
+import org.apache.ignite.internal.processors.task.GridInternal;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.visor.VisorJob;
+import org.apache.ignite.internal.visor.VisorOneNodeTask;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Task that will collect information about baseline topology.
+ */
+@GridInternal
+public class VisorBaselineViewTask extends VisorOneNodeTask<Void, VisorBaselineTaskResult>
{
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override protected VisorBaselineViewJob job(Void arg) {
+        return new VisorBaselineViewJob(arg, debug);
+    }
+
+    /**
+     * Job that will collect baseline topology information.
+     */
+    private static class VisorBaselineViewJob extends VisorJob<Void, VisorBaselineTaskResult>
{
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /**
+         * @param arg Formal job argument.
+         * @param debug Debug flag.
+         */
+        private VisorBaselineViewJob(Void arg, boolean debug) {
+            super(arg, debug);
+        }
+
+        /** {@inheritDoc} */
+        @Override protected VisorBaselineTaskResult run(@Nullable Void arg) throws IgniteException
{
+            IgniteClusterEx cluster = ignite.cluster();
+
+            return new VisorBaselineTaskResult(
+                ignite.cluster().active(),
+                cluster.topologyVersion(),
+                cluster.currentBaselineTopology(),
+                cluster.forServers().nodes()
+            );
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(VisorBaselineViewJob.class, this);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ff7372b7/modules/core/src/main/java/org/apache/ignite/internal/visor/tx/VisorTxTaskArg.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/tx/VisorTxTaskArg.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/tx/VisorTxTaskArg.java
index 80bf8b5..6f157e9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/tx/VisorTxTaskArg.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/tx/VisorTxTaskArg.java
@@ -24,7 +24,6 @@ import java.util.List;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.visor.VisorDataTransferObject;
-import org.apache.ignite.internal.visor.baseline.VisorBaselineTask;
 import org.apache.ignite.transactions.TransactionState;
 import org.jetbrains.annotations.Nullable;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ff7372b7/modules/core/src/main/java/org/apache/ignite/internal/visor/tx/VisorTxTaskResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/tx/VisorTxTaskResult.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/tx/VisorTxTaskResult.java
index 4864a77..1d49fd9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/tx/VisorTxTaskResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/tx/VisorTxTaskResult.java
@@ -20,17 +20,10 @@ package org.apache.ignite.internal.visor.tx;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
-import java.util.Collection;
 import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import org.apache.ignite.cluster.BaselineNode;
-import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.visor.VisorDataTransferObject;
-import org.apache.ignite.internal.visor.baseline.VisorBaselineNode;
-import org.apache.ignite.internal.visor.baseline.VisorBaselineTask;
 
 /**
  * Result for {@link VisorTxTask}.


Mime
View raw message