ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [4/6] incubator-ignite git commit: # IGNITE-465: WIP.
Date Thu, 12 Mar 2015 14:29:53 GMT
# IGNITE-465: WIP.


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

Branch: refs/heads/ignite-465
Commit: 04d7797001770b165d81af57e2106b1ec37a7d0c
Parents: 16863f2
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Thu Mar 12 16:54:50 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Thu Mar 12 16:54:50 2015 +0300

----------------------------------------------------------------------
 .../internal/util/ipc/IpcEndpointFactory.java   |  4 +-
 .../util/ipc/IpcServerEndpointFactory.java      | 72 --------------------
 .../shmem/IpcSharedMemoryServerEndpoint.java    | 15 ++++
 3 files changed, 17 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/04d77970/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/IpcEndpointFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/IpcEndpointFactory.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/IpcEndpointFactory.java
index 4debeac..06710fb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/IpcEndpointFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/IpcEndpointFactory.java
@@ -54,8 +54,8 @@ public class IpcEndpointFactory {
             port = -1;
 
         return "shmem".equalsIgnoreCase(split[0]) ?
-            connectSharedMemoryEndpoint(port > 0 ? port : IpcSharedMemoryServerEndpoint.DFLT_PORT,
log) :
-            connectTcpEndpoint(split[0], port > 0 ? port : IpcServerTcpEndpoint.DFLT_PORT);
+            connectSharedMemoryEndpoint(port > 0 ? port : IpcSharedMemoryServerEndpoint.DFLT_IPC_PORT,
log) :
+            connectTcpEndpoint(split[0], port > 0 ? port : IpcServerTcpEndpoint.DFLT_IPC_PORT);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/04d77970/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/IpcServerEndpointFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/IpcServerEndpointFactory.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/IpcServerEndpointFactory.java
deleted file mode 100644
index 13ebcd6..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/IpcServerEndpointFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.util.ipc;
-
-import org.apache.ignite.*;
-import org.apache.ignite.igfs.*;
-import org.apache.ignite.internal.util.ipc.loopback.*;
-import org.apache.ignite.internal.util.ipc.shmem.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-
-import java.util.*;
-
-/**
- * Grid IpcServerEndpoint configuration deserializer.
- */
-public class IpcServerEndpointFactory {
-    /**
-     * Create IPC server endpoint from configuration.
-     *
-     * @param endpointCfg Map with properties of the IPC server endpoint config.
-     * @param mgmt Management flag.
-     * @return Deserialized instance of {@link IpcServerEndpoint}.
-     * @throws IgniteCheckedException If any problem with configuration properties setting
has happened.
-     */
-    public static IpcServerEndpoint create(IgfsIpcEndpointConfiguration endpointCfg, boolean
mgmt)
-        throws IgniteCheckedException {
-        A.notNull(endpointCfg, "endpointCfg");
-
-        IgfsIpcEndpointType typ = endpointCfg.getType();
-
-        if (typ == null)
-            throw new IgniteCheckedException("Failed to create server endpoint (type is not
specified)");
-
-        switch (typ) {
-            case SHMEM: {
-                IpcSharedMemoryServerEndpoint endpoint = new IpcSharedMemoryServerEndpoint();
-
-                endpoint.setPort(endpointCfg.getPort());
-                endpoint.setSize(endpointCfg.getMemorySize());
-                endpoint.setTokenDirectoryPath(endpointCfg.getTokenDirectoryPath());
-
-                return endpoint;
-            }
-            case TCP: {
-                IpcServerTcpEndpoint endpoint = new IpcServerTcpEndpoint();
-
-                endpoint.setHost(endpointCfg.getHost());
-                endpoint.setPort(endpointCfg.getPort());
-                endpoint.setManagement(mgmt);
-
-                return endpoint;
-            }
-            default:
-                throw new IgniteCheckedException("Failed to create server endpoint (type
is unknown): " + typ);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/04d77970/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
index bd7174b..8c2fcb0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
@@ -44,6 +44,21 @@ public class IpcSharedMemoryServerEndpoint implements IpcServerEndpoint
{
     /** IPC error message. */
     public static final String OUT_OF_RESOURCES_MSG = "Failed to allocate shared memory segment";
 
+    /** Default endpoint port number. */
+    public static final int DFLT_IPC_PORT = 10500;
+
+    /** Default shared memory space in bytes. */
+    public static final int DFLT_SPACE_SIZE = 256 * 1024;
+
+    /**
+     * Default token directory. Note that this path is relative to {@code IGNITE_HOME/work}
folder
+     * if {@code IGNITE_HOME} system or environment variable specified, otherwise it is relative
to
+     * {@code work} folder under system {@code java.io.tmpdir} folder.
+     *
+     * @see org.apache.ignite.configuration.IgniteConfiguration#getWorkDirectory()
+     */
+    public static final String DFLT_TOKEN_DIR_PATH = "ipc/shmem";
+
     /**
      * Shared memory token file name prefix.
      *


Mime
View raw message