ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [17/37] incubator-ignite git commit: #IGNITE-857 Code format
Date Thu, 28 May 2015 21:02:15 GMT
#IGNITE-857 Code format


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

Branch: refs/heads/ignite-gg-10369
Commit: 9bed1ffef6cdb4b69550e443637c61523733b0f5
Parents: b7ef1a8
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Wed May 27 15:40:04 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Wed May 27 15:40:04 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/mesos/ClusterProperties.java  |  2 +-
 .../apache/ignite/mesos/IgniteScheduler.java    | 58 +++++++++-----------
 2 files changed, 27 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9bed1ffe/modules/mesos/src/main/java/org/apache/ignite/mesos/ClusterProperties.java
----------------------------------------------------------------------
diff --git a/modules/mesos/src/main/java/org/apache/ignite/mesos/ClusterProperties.java b/modules/mesos/src/main/java/org/apache/ignite/mesos/ClusterProperties.java
index c23fcea..25216ca 100644
--- a/modules/mesos/src/main/java/org/apache/ignite/mesos/ClusterProperties.java
+++ b/modules/mesos/src/main/java/org/apache/ignite/mesos/ClusterProperties.java
@@ -164,7 +164,7 @@ public class ClusterProperties {
     private String igniteCfg = null;
 
     /** */
-    public static final String IGNITE_CONFIG_XML_URL = "IGNITE_XML_CONFIG_URL";
+    public static final String IGNITE_CONFIG_XML_URL = "IGNITE_CONFIG_XML_URL";
 
     /** Url to ignite config. */
     private String igniteCfgUrl = null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9bed1ffe/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
----------------------------------------------------------------------
diff --git a/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java b/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
index 05d8c4f..9041629 100644
--- a/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
+++ b/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
@@ -112,6 +112,9 @@ public class IgniteScheduler implements Scheduler {
      * @return Task.
      */
     protected Protos.TaskInfo createTask(Protos.Offer offer, IgniteTask igniteTask, Protos.TaskID
taskId) {
+        String cfgUrl = clusterProps.igniteConfigUrl() != null ?
+            clusterProps.igniteConfigUrl() : resourceProvider.igniteConfigUrl();
+
         Protos.CommandInfo.Builder builder = Protos.CommandInfo.newBuilder()
             .setEnvironment(Protos.Environment.newBuilder().addVariables(Protos.Environment.Variable.newBuilder()
                 .setName("IGNITE_TCP_DISCOVERY_ADDRESSES")
@@ -121,39 +124,30 @@ public class IgniteScheduler implements Scheduler {
                     clusterProps.ignitePackageUrl() : resourceProvider.igniteUrl())
                 .setExtract(true))
             .addUris(Protos.CommandInfo.URI.newBuilder()
-                .setValue(clusterProps.igniteConfigUrl() != null ?
-                    clusterProps.igniteConfigUrl() : resourceProvider.igniteConfigUrl()));
-
-        if (resourceProvider.resourceUrl() != null || clusterProps.usersLibsUrl() != null)
{
-            if (clusterProps.igniteConfigUrl() != null) {
-                builder.addUris(Protos.CommandInfo.URI.newBuilder()
-                    .setValue(clusterProps.igniteConfigUrl())
-                    .setExtract(true));
-
-                String[] split = clusterProps.igniteConfigUrl().split("/");
-
-                builder.setValue("cp *.jar ./gridgain-community-*/libs/ "
-                    + "&& ./gridgain-community-*/bin/ignite.sh "
-                    + split[split.length - 1]
-                    + " -J-Xmx" + String.valueOf((int)igniteTask.mem() + "m")
-                    + " -J-Xms" + String.valueOf((int)igniteTask.mem()) + "m");
-            }
-            else {
-                for (String url : resourceProvider.resourceUrl())
-                    builder.addUris(Protos.CommandInfo.URI.newBuilder().setValue(url));
-
-                builder.setValue("cp *.jar ./gridgain-community-*/libs/ "
-                    + "&& ./gridgain-community-*/bin/ignite.sh "
-                    + resourceProvider.configName()
-                    + " -J-Xmx" + String.valueOf((int)igniteTask.mem() + "m")
-                    + " -J-Xms" + String.valueOf((int)igniteTask.mem()) + "m");
-            }
+                .setValue(cfgUrl));
+
+        if (clusterProps.usersLibsUrl() != null)
+            builder.addUris(Protos.CommandInfo.URI.newBuilder()
+                .setValue(clusterProps.usersLibsUrl())
+                .setExtract(true));
+        else if (resourceProvider.resourceUrl() != null) {
+            for (String url : resourceProvider.resourceUrl())
+                builder.addUris(Protos.CommandInfo.URI.newBuilder().setValue(url));
+        }
+
+        String cfgName = resourceProvider.configName();
+
+        if (clusterProps.igniteConfigUrl() != null) {
+            String[] split = clusterProps.igniteConfigUrl().split("/");
+
+            cfgName = split[split.length - 1];
         }
-        else
-            builder.setValue("./gridgain-community-*/bin/ignite.sh "
-                + resourceProvider.configName()
-                + " -J-Xmx" + String.valueOf((int)igniteTask.mem() + "m")
-                + " -J-Xms" + String.valueOf((int)igniteTask.mem()) + "m");
+
+        builder.setValue("find . -maxdepth 1 -name \"*.jar\" -exec cp {} ./gridgain-community-*/libs/
\\; && "
+            + "./gridgain-community-*/bin/ignite.sh "
+            + cfgName
+            + " -J-Xmx" + String.valueOf((int)igniteTask.mem() + "m")
+            + " -J-Xms" + String.valueOf((int)igniteTask.mem()) + "m");
 
         return Protos.TaskInfo.newBuilder()
             .setName("Ignite node " + taskId.getValue())


Mime
View raw message