IGNITE-7520 Provide util-methods to get baseline from context - Fixes #3431.
authorEdShangGG <eshangareev@gridgain.com>
Thu, 1 Feb 2018 13:34:05 +0000 (16:34 +0300)
committerAlexey Goncharuk <alexey.goncharuk@gmail.com>
Thu, 1 Feb 2018 13:34:05 +0000 (16:34 +0300)
Signed-off-by: Alexey Goncharuk <alexey.goncharuk@gmail.com>
modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java

index 548fb1b..1d80a9e 100755 (executable)
@@ -10325,6 +10325,34 @@ public abstract class IgniteUtils {
     }
 
     /**
+     * @param ctx Context.
+     *
+     * @return instance of current baseline topology if it exists
+     */
+    public static BaselineTopology getBaselineTopology(@NotNull GridKernalContext ctx) {
+        return ctx.state().clusterState().baselineTopology();
+    }
+
+
+    /**
+     * @param cctx Context.
+     *
+     * @return instance of current baseline topology if it exists
+     */
+    public static BaselineTopology getBaselineTopology(@NotNull GridCacheSharedContext cctx) {
+        return getBaselineTopology(cctx.kernalContext());
+    }
+
+    /**
+     * @param cctx Context.
+     *
+     * @return instance of current baseline topology if it exists
+     */
+    public static BaselineTopology getBaselineTopology(@NotNull GridCacheContext cctx) {
+        return getBaselineTopology(cctx.kernalContext());
+    }
+
+    /**
      * @param addr pointer in memory
      * @param len how much byte to read (should divide 8)
      *