Skip to content

Commit

Permalink
Set submit options via config.json (#265)
Browse files Browse the repository at this point in the history
* Set submit options via config.json

Set additional option and worker/acker count via config.json

* Changed options dict checking + defaults of workers and ackers to None
  • Loading branch information
Darkless012 authored and dan-blanchard committed Jun 21, 2016
1 parent f66794f commit 4ae8c6a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion streamparse/cli/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _upload_jar(nimbus_client, local_path):
return upload_location


def submit_topology(name=None, env_name="prod", workers=2, ackers=2,
def submit_topology(name=None, env_name="prod", workers=None, ackers=None,
options=None, force=False, debug=False, wait=None,
simple_jar=True):
"""Submit a topology to a remote Storm cluster."""
Expand Down Expand Up @@ -206,6 +206,17 @@ def submit_topology(name=None, env_name="prod", workers=2, ackers=2,
if 'streamparse_run' in inner_shell.execution_command:
inner_shell.execution_command = streamparse_run_path

# Additional options
additional_options = env_config.get('options', {})
if options is not None:
additional_options.update(options)
options = additional_options

if not workers:
workers = env_config.get('worker_count', 2)
if not ackers:
ackers = env_config.get('acker_count', 2)

# Check topology for JVM stuff to see if we need to create uber-jar
if simple_jar:
simple_jar = not any(isinstance(spec, JavaComponentSpec)
Expand Down

0 comments on commit 4ae8c6a

Please sign in to comment.