From 86cd980bd4996dc0ff3e73e5bda0eaa01f6f3449 Mon Sep 17 00:00:00 2001 From: "Brandyn A. White" Date: Fri, 3 Aug 2012 15:39:26 -0400 Subject: [PATCH] Block in select, remove old comment Signed-off-by: Brandyn A. White --- hadoopy/_local.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hadoopy/_local.py b/hadoopy/_local.py index d0ac6d9..d9e63ae 100644 --- a/hadoopy/_local.py +++ b/hadoopy/_local.py @@ -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: @@ -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))