Skip to content

Commit

Permalink
Merge pull request spotify#1649 from trustyou/add_archives
Browse files Browse the repository at this point in the history
Add the archive parameters to HadoopJobRunner
  • Loading branch information
erikbern committed Apr 12, 2016
2 parents 9c16402 + 78f21bb commit 64d6b83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion luigi/contrib/hadoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,15 @@ class HadoopJobRunner(JobRunner):
def __init__(self, streaming_jar, modules=None, streaming_args=None,
libjars=None, libjars_in_hdfs=None, jobconfs=None,
input_format=None, output_format=None,
end_job_with_atomic_move_dir=True):
end_job_with_atomic_move_dir=True, archives=None):
def get(x, default):
return x is not None and x or default
self.streaming_jar = streaming_jar
self.modules = get(modules, [])
self.streaming_args = get(streaming_args, [])
self.libjars = get(libjars, [])
self.libjars_in_hdfs = get(libjars_in_hdfs, [])
self.archives = get(archives, [])
self.jobconfs = get(jobconfs, {})
self.input_format = input_format
self.output_format = output_format
Expand Down Expand Up @@ -478,6 +479,10 @@ def run_job(self, job, tracking_url_callback=None):
if libjars:
arglist += ['-libjars', ','.join(libjars)]

# 'archives' is also a generic option
if self.archives:
arglist += ['-archives', ','.join(self.archives)]

# Add static files and directories
extra_files = get_extra_files(job.extra_files())

Expand Down

0 comments on commit 64d6b83

Please sign in to comment.