Fix start-impala-cluster.py with -s 0.

Bug: Division by zero.

Starting only the statestored and catalogd can be
useful for debugging purposes. For example, it is
often convenient to start a single customized impalad
with start-impalad.sh, but that requires having
the statestored and catalogd already up.

Change-Id: I9abe40de6c6caea26b6faa03b7495f25cb07e0ac
Reviewed-on: http://gerrit.cloudera.org:8080/2666
Reviewed-by: Alex Behm <[email protected]>
Tested-by: Internal Jenkins


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

Branch: refs/heads/master
Commit: 51eef3a3ad09f97a4c319e635dfa068f39d2e92a
Parents: ce92844
Author: Alex Behm <[email protected]>
Authored: Wed Mar 30 11:43:26 2016 -0700
Committer: Internal Jenkins <[email protected]>
Committed: Thu Mar 31 03:18:44 2016 +0000

----------------------------------------------------------------------
 bin/start-impala-cluster.py | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/51eef3a3/bin/start-impala-cluster.py
----------------------------------------------------------------------
diff --git a/bin/start-impala-cluster.py b/bin/start-impala-cluster.py
index 1302a66..9c1f75f 100755
--- a/bin/start-impala-cluster.py
+++ b/bin/start-impala-cluster.py
@@ -212,6 +212,10 @@ def build_rm_args(instance_num):
   return RM_ARGS % (llama_address, cgroup_path, fs_cfg_path)
 
 def start_impalad_instances(cluster_size):
+  if cluster_size == 0:
+    # No impalad instances should be started.
+    return
+
   # The default memory limit for an impalad is 80% of the total system memory. 
On a
   # mini-cluster with 3 impalads that means 240%. Since having an impalad be 
OOM killed
   # is very annoying, the mem limit will be reduced. This can be overridden 
using the

Reply via email to