helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ka...@apache.org
Subject git commit: [HELIX-502] Start containers with more memory by default
Date Wed, 20 Aug 2014 20:06:05 GMT
Repository: helix
Updated Branches:
  refs/heads/master 0e36354bb -> 363c049e3


[HELIX-502] Start containers with more memory by default


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/363c049e
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/363c049e
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/363c049e

Branch: refs/heads/master
Commit: 363c049e3ad874269ca765d9407b4f6623a56e70
Parents: 0e36354
Author: Kanak Biscuitwala <kanak@apache.org>
Authored: Wed Aug 20 13:01:11 2014 -0700
Committer: Kanak Biscuitwala <kanak@apache.org>
Committed: Wed Aug 20 13:01:11 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/helix/model/InstanceConfig.java   |  2 +-
 .../apache/helix/provisioning/yarn/AppLauncher.java   |  6 +++---
 .../provisioning/yarn/AppStatusReportGenerator.java   | 14 ++++++++++++--
 .../helix/provisioning/yarn/YarnProvisioner.java      |  6 +++---
 4 files changed, 19 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/363c049e/helix-core/src/main/java/org/apache/helix/model/InstanceConfig.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/model/InstanceConfig.java b/helix-core/src/main/java/org/apache/helix/model/InstanceConfig.java
index f3edb62..7f49194 100644
--- a/helix-core/src/main/java/org/apache/helix/model/InstanceConfig.java
+++ b/helix-core/src/main/java/org/apache/helix/model/InstanceConfig.java
@@ -313,7 +313,7 @@ public class InstanceConfig extends HelixProperty {
         }
       }
     } catch (NoSuchMethodError e) {
-      LOG.error("Could not parse InstanceConfig", e);
+      LOG.error("Could not parse InstanceConfig for additional user config");
     }
     return userConfig;
   }

http://git-wip-us.apache.org/repos/asf/helix/blob/363c049e/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/AppLauncher.java
----------------------------------------------------------------------
diff --git a/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/AppLauncher.java
b/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/AppLauncher.java
index 2be7062..891013b 100644
--- a/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/AppLauncher.java
+++ b/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/AppLauncher.java
@@ -245,7 +245,7 @@ public class AppLauncher {
     // Set java executable command
     LOG.info("Setting up app master launch command");
     vargs.add(Environment.JAVA_HOME.$() + "/bin/java");
-    int amMemory = 1024;
+    int amMemory = 4096;
     // Set Xmx based on am memory size
     vargs.add("-Xmx" + amMemory + "m");
     // Set class name
@@ -433,7 +433,7 @@ public class AppLauncher {
         prevReport = reportMessage;
         Thread.sleep(10000);
       } catch (Exception e) {
-        LOG.error("Exception while getting info ", e);
+        LOG.error("Exception while getting info", e);
         break;
       }
     }
@@ -508,7 +508,7 @@ public class AppLauncher {
         prevReport = reportMessage;
         Thread.sleep(10000);
       } catch (Exception e) {
-        LOG.error("Exception while getting info ");
+        LOG.error("Exception while getting info", e);
         break;
       }
     }

http://git-wip-us.apache.org/repos/asf/helix/blob/363c049e/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/AppStatusReportGenerator.java
----------------------------------------------------------------------
diff --git a/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/AppStatusReportGenerator.java
b/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/AppStatusReportGenerator.java
index 5fba08f..6458518 100644
--- a/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/AppStatusReportGenerator.java
+++ b/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/AppStatusReportGenerator.java
@@ -22,6 +22,7 @@ package org.apache.helix.provisioning.yarn;
 import java.util.Map;
 
 import org.apache.helix.HelixConnection;
+import org.apache.helix.HelixDataAccessor;
 import org.apache.helix.api.Cluster;
 import org.apache.helix.api.Participant;
 import org.apache.helix.api.Resource;
@@ -35,6 +36,7 @@ import org.apache.helix.api.id.ResourceId;
 import org.apache.helix.controller.provisioner.ContainerId;
 import org.apache.helix.controller.provisioner.ContainerState;
 import org.apache.helix.manager.zk.ZkHelixConnection;
+import org.apache.helix.model.ExternalView;
 
 public class AppStatusReportGenerator {
   static String TAB = "\t";
@@ -53,8 +55,16 @@ public class AppStatusReportGenerator {
     for (ResourceId resourceId : resources.keySet()) {
       builder.append("SERVICE").append(TAB).append(resourceId).append(NEWLINE);
       Resource resource = resources.get(resourceId);
-      Map<ParticipantId, State> serviceStateMap =
-          resource.getExternalView().getStateMap(PartitionId.from(resourceId.stringify()
+ "_0"));
+      Map<ParticipantId, State> serviceStateMap = null;
+      if (resource != null) {
+        HelixDataAccessor accessor = connection.createDataAccessor(clusterId);
+        ExternalView externalView =
+            accessor.getProperty(accessor.keyBuilder().externalView(resourceId.stringify()));
+        if (externalView != null) {
+          serviceStateMap =
+              externalView.getStateMap(PartitionId.from(resourceId.stringify() + "_0"));
+        }
+      }
 
       builder.append(TAB).append("CONTAINER_NAME").append(TAB).append(TAB)
           .append("CONTAINER_STATE").append(TAB).append("SERVICE_STATE").append(TAB)

http://git-wip-us.apache.org/repos/asf/helix/blob/363c049e/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/YarnProvisioner.java
----------------------------------------------------------------------
diff --git a/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/YarnProvisioner.java
b/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/YarnProvisioner.java
index ad2f5f4..4266688 100644
--- a/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/YarnProvisioner.java
+++ b/helix-provisioning/src/main/java/org/apache/helix/provisioning/yarn/YarnProvisioner.java
@@ -230,7 +230,7 @@ public class YarnProvisioner implements Provisioner, TargetProvider, ContainerPr
     LOG.info("Setting up app master command");
     vargs.add(Environment.JAVA_HOME.$() + "/bin/java");
     // Set Xmx based on am memory size
-    vargs.add("-Xmx" + 1024 + "m");
+    vargs.add("-Xmx" + 4096 + "m");
     // Set class name
     vargs.add(ParticipantLauncher.class.getCanonicalName());
     // Set params for container participant
@@ -358,9 +358,9 @@ public class YarnProvisioner implements Provisioner, TargetProvider, ContainerPr
       } else if (!existingContainersIdSet.contains(participantId)) {
         // Unallocated containers must be allocated
         ContainerSpec containerSpec = new ContainerSpec(participantId);
-        int mem = 1024;
+        int mem = 4096;
         if (_resourceConfig.getUserConfig() != null) {
-          mem = _resourceConfig.getUserConfig().getIntField("memory", 1024);
+          mem = _resourceConfig.getUserConfig().getIntField("memory", mem);
         }
         containerSpec.setMemory(mem);
         containersToAcquire.add(containerSpec);


Mime
View raw message