ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [2/5] incubator-ignite git commit: # IGNITE-222: WIP on removing enterprise flag.
Date Wed, 11 Feb 2015 12:48:26 GMT
# IGNITE-222: WIP on removing enterprise flag.


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

Branch: refs/heads/sprint-1
Commit: 69772c7fba54fe569e0fd2b4c5cc88a7d4bce814
Parents: b3cf44b
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Feb 11 13:20:21 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Feb 11 13:20:21 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/GridKernalContext.java      |  5 ---
 .../ignite/internal/GridKernalContextImpl.java  | 13 +-----
 .../apache/ignite/internal/GridProductImpl.java | 11 ++++-
 .../apache/ignite/internal/IgniteKernal.java    | 45 +-------------------
 .../processors/rest/GridRestProcessor.java      |  2 +-
 .../ignite/internal/product/IgniteProduct.java  |  8 ++++
 .../junits/GridTestKernalContext.java           |  3 +-
 7 files changed, 23 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/69772c7f/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
index 152cfa6..9ae4304 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
@@ -470,11 +470,6 @@ public interface GridKernalContext extends Iterable<GridComponent>
{
     public GridPerformanceSuggestions performance();
 
     /**
-     * @return Enterprise release flag.
-     */
-    public boolean isEnterprise();
-
-    /**
      * Gets user version for given class loader by checking
      * {@code META-INF/ignite.xml} file for {@code userVersion} attribute. If
      * {@code ignite.xml} file is not found, or user version is not specified there,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/69772c7f/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
index 3bd3f7c..9d325c5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
@@ -315,9 +315,6 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
     /** Performance suggestions. */
     private final GridPerformanceSuggestions perf = new GridPerformanceSuggestions();
 
-    /** Enterprise release flag. */
-    private boolean ent;
-
     /**
      * No-arg constructor is required by externalization.
      */
@@ -339,7 +336,6 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
      *  @param mgmtExecSvc Management executor service.
      *  @param ggfsExecSvc GGFS executor service.
      *  @param restExecSvc REST executor service.
-     *  @param ent Release enterprise flag.
      */
     @SuppressWarnings("TypeMayBeWeakened")
     protected GridKernalContextImpl(
@@ -353,8 +349,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
         ExecutorService p2pExecSvc,
         ExecutorService mgmtExecSvc,
         ExecutorService ggfsExecSvc,
-        ExecutorService restExecSvc,
-        boolean ent) {
+        ExecutorService restExecSvc) {
         assert grid != null;
         assert cfg != null;
         assert gw != null;
@@ -362,7 +357,6 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
         this.grid = grid;
         this.cfg = cfg;
         this.gw = gw;
-        this.ent = ent;
         this.utilityCachePool = utilityCachePool;
         this.execSvc = execSvc;
         this.sysExecSvc = sysExecSvc;
@@ -794,11 +788,6 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
     }
 
     /** {@inheritDoc} */
-    @Override public boolean isEnterprise() {
-        return ent;
-    }
-
-    /** {@inheritDoc} */
     @Override public void printMemoryStats() {
         X.println(">>> ");
         X.println(">>> Grid memory stats [grid=" + gridName() + ']');

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/69772c7f/modules/core/src/main/java/org/apache/ignite/internal/GridProductImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridProductImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridProductImpl.java
index 618d52b..aa598c5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridProductImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridProductImpl.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal;
 
+import org.apache.ignite.*;
 import org.apache.ignite.internal.product.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
@@ -37,7 +38,7 @@ public class GridProductImpl implements IgniteProduct, Externalizable {
     public static final String COPYRIGHT = "2015 Copyright(C) Apache Software Foundation";
 
     /** Enterprise edition flag. */
-    public static final boolean ENT;
+    private static final boolean ENT;
 
     /** Ignite version. */
     public static final String VER;
@@ -168,6 +169,14 @@ public class GridProductImpl implements IgniteProduct, Externalizable
{
     }
 
     /** {@inheritDoc} */
+    @Override public void ackVisor(IgniteLogger log) {
+        if (ENT)
+            U.quietAndInfo(log, "To start GUI Management & Monitoring run ggvisorui.{sh|bat}");
+        else
+            U.quietAndInfo(log, "To start Console Management & Monitoring run ignitevisorcmd.{sh|bat}");
+    }
+
+    /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         out.writeObject(ctx);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/69772c7f/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index b598390..5181bcc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -78,8 +78,6 @@ import org.apache.ignite.plugin.*;
 import org.apache.ignite.plugin.security.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.authentication.*;
-import org.apache.ignite.spi.authentication.noop.*;
-import org.apache.ignite.spi.securesession.noop.*;
 import org.jetbrains.annotations.*;
 
 import javax.management.*;
@@ -663,7 +661,7 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
         try {
             GridKernalContextImpl ctx =
                 new GridKernalContextImpl(log, this, cfg, gw, utilityCachePool, execSvc,
sysExecSvc, p2pExecSvc,
-                    mgmtExecSvc, ggfsExecSvc, restExecSvc, ENT);
+                    mgmtExecSvc, ggfsExecSvc, restExecSvc);
 
             nodeLoc = new ClusterNodeLocalMapImpl(ctx);
 
@@ -784,9 +782,6 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
             // Suggest configuration optimizations.
             suggestOptimizations(ctx, cfg);
 
-            if (!ctx.isEnterprise())
-                warnNotSupportedFeaturesForOs(cfg);
-
             // Notify discovery manager the first to make sure that topology is discovered.
             ctx.discovery().onKernalStart();
 
@@ -1087,8 +1082,6 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
                     "License ID: " + lic.id().toString().toUpperCase() + NL +
                     "Licensed to: " + lic.userOrganization() + NL;
             }
-            else
-                assert !ENT;
 
             body +=
                 "----" + NL +
@@ -1198,35 +1191,6 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
     }
 
     /**
-     * Warns user about unsupported features which was configured in OS edition.
-     *
-     * @param cfg Grid configuration.
-     */
-    private void warnNotSupportedFeaturesForOs(IgniteConfiguration cfg) {
-        Collection<String> msgs = new ArrayList<>();
-
-        if (!F.isEmpty(cfg.getSegmentationResolvers()))
-            msgs.add("Network segmentation detection.");
-
-        if (cfg.getSecureSessionSpi() != null && !(cfg.getSecureSessionSpi() instanceof
NoopSecureSessionSpi))
-            msgs.add("Secure session SPI.");
-
-        if (cfg.getAuthenticationSpi() != null && !(cfg.getAuthenticationSpi() instanceof
NoopAuthenticationSpi))
-            msgs.add("Authentication SPI.");
-
-        if (!F.isEmpty(msgs)) {
-            U.quietAndInfo(log, "The following features are not supported in open source
edition, " +
-                "related configuration settings will be ignored " +
-                "(consider downloading enterprise edition from http://www.gridgain.com):");
-
-            for (String s : msgs)
-                U.quietAndInfo(log, "  ^-- " + s);
-
-            U.quietAndInfo(log, "");
-        }
-    }
-
-    /**
      * Creates attributes map and fills it in.
      *
      * @param cfg Grid configuration.
@@ -1673,10 +1637,7 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
         if (isDaemon())
             return;
 
-        if (ctx.isEnterprise())
-            U.quietAndInfo(log, "To start GUI Management & Monitoring run ggvisorui.{sh|bat}");
-        else
-            U.quietAndInfo(log, "To start Console Management & Monitoring run ignitevisorcmd.{sh|bat}");
+        ctx.product().ackVisor(log);
     }
 
     /**
@@ -2071,8 +2032,6 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
                         "License ID: " + lic.id().toString().toUpperCase() + NL +
                         "Licensed to: " + lic.userOrganization() + NL;
                 }
-                else
-                    assert !ENT;
 
                 body +=
                     "----" + NL +

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/69772c7f/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
index 8023f70..b4ddf81 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
@@ -175,7 +175,7 @@ public class GridRestProcessor extends GridProcessorAdapter {
 
             GridRestResponse res = new GridRestResponse(STATUS_SECURITY_CHECK_FAILED, e.getMessage());
 
-            if (ctx.isEnterprise()) {
+            if (ctx.secureSession().enabled()) {
                 try {
                     res.sessionTokenBytes(updateSessionToken(req, subjCtx));
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/69772c7f/modules/core/src/main/java/org/apache/ignite/internal/product/IgniteProduct.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/product/IgniteProduct.java
b/modules/core/src/main/java/org/apache/ignite/internal/product/IgniteProduct.java
index 333c765..cb3674f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/product/IgniteProduct.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/product/IgniteProduct.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.product;
 
+import org.apache.ignite.*;
 import org.apache.ignite.lang.*;
 import org.jetbrains.annotations.*;
 
@@ -64,4 +65,11 @@ public interface IgniteProduct {
      * @return Latest version string or {@code null} if information is not available.
      */
     @Nullable public String latestVersion();
+
+    /**
+     * Acks Visor instructions.
+     *
+     * @param log Logger.
+     */
+    public void ackVisor(IgniteLogger log);
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/69772c7f/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
index 00f6fef..d9c9d6d 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
@@ -44,8 +44,7 @@ public class GridTestKernalContext extends GridKernalContextImpl {
             null,
             null,
             null,
-            null,
-            false);
+            null);
 
         GridTestUtils.setFieldValue(grid(), "cfg", config());
     }


Mime
View raw message