Skip to content

Commit

Permalink
Block in select, remove old comment
Browse files Browse the repository at this point in the history
Signed-off-by: Brandyn A. White <[email protected]>
  • Loading branch information
Brandyn A. White committed Aug 3, 2012
1 parent 18906d4 commit 86cd980
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions hadoopy/_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,11 @@ def run_task(self, kvs, cmdenvs=()):
if self.max_input is not None and self.max_input <= num:
break
while True:
r, w, _ = select.select([out_r_fd], [in_w_fd], [], .001)
r, w, _ = select.select([out_r_fd], [in_w_fd], [])
if r: # If data is available to be read, than get it
yield tbfp_r.next()
elif w and kv is not None:
elif w:
tbfp_w.write(kv)
kv = None
elif w and kv is None: # We can write but have already written
break
# Get any remaining values
while True:
Expand Down Expand Up @@ -156,7 +154,6 @@ def launch_local(in_name, out_name, script_path, max_input=None,
in_kvs = hadoopy.readtb(in_name)
else:
in_kvs = in_name
#script_path, task, files=(), max_input=None, pipe=True, python_cmd='python', remove_tempdir=True
if 'reduce' in script_info['tasks']:
kvs = list(LocalTask(script_path, 'map', files, max_input, pipe,
python_cmd, remove_tempdir).run_task(in_kvs, cmdenvs))
Expand Down

0 comments on commit 86cd980

Please sign in to comment.