ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [2/2] incubator-ignite git commit: # Removed shmem from communication
Date Sat, 14 Mar 2015 00:38:07 GMT
# Removed shmem from communication


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

Branch: refs/heads/sprint-2-shmem
Commit: d0ac78f3ed00ed367166fb254928e2cbbecd413f
Parents: c014b00
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Fri Mar 13 17:39:17 2015 -0700
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Fri Mar 13 17:39:17 2015 -0700

----------------------------------------------------------------------
 .../igfs/IgfsIpcEndpointConfiguration.java      |  2 +-
 .../ignite/internal/util/IgniteUtils.java       | 26 ++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d0ac78f3/modules/core/src/main/java/org/apache/ignite/igfs/IgfsIpcEndpointConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsIpcEndpointConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsIpcEndpointConfiguration.java
index 0b0e9cc..7315007 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsIpcEndpointConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsIpcEndpointConfiguration.java
@@ -27,7 +27,7 @@ import static org.apache.ignite.igfs.IgfsIpcEndpointType.*;
  */
 public class IgfsIpcEndpointConfiguration {
     /** Default endpoint type is TCP. */
-    public static IgfsIpcEndpointType DFLT_TYPE = TCP;
+    public static IgfsIpcEndpointType DFLT_TYPE = U.hasSharedMemory() ? SHMEM : TCP;
 
     /** Default host. */
     public static String DFLT_HOST = "127.0.0.1";

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d0ac78f3/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 0719964..7804c9d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -33,6 +33,7 @@ import org.apache.ignite.internal.processors.cache.version.*;
 import org.apache.ignite.internal.processors.streamer.*;
 import org.apache.ignite.internal.transactions.*;
 import org.apache.ignite.internal.util.io.*;
+import org.apache.ignite.internal.util.ipc.shmem.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
@@ -305,6 +306,9 @@ public abstract class IgniteUtils {
     private static final ConcurrentMap<ClassLoader, ConcurrentMap<String, Class>>
classCache =
         new ConcurrentHashMap8<>();
 
+    /** */
+    private static volatile Boolean hasShmem;
+
     /**
      * Initializes enterprise check.
      */
@@ -9036,4 +9040,26 @@ public abstract class IgniteUtils {
         if (!cond)
             throw new IgniteException("Parameter failed condition check: " + condDesc);
     }
+
+    /**
+     * @return Whether shared memory libraries exist.
+     */
+    public static boolean hasSharedMemory() {
+        if (hasShmem == null) {
+            if (isWindows())
+                hasShmem = false;
+            else {
+                try {
+                    IpcSharedMemoryNativeLoader.load();
+
+                    hasShmem = true;
+                }
+                catch (IgniteCheckedException e) {
+                    hasShmem = false;
+                }
+            }
+        }
+
+        return hasShmem;
+    }
 }


Mime
View raw message