Author: tmckay
Date: 2012-12-14 14:16:55 +0000 (Fri, 14 Dec 2012)
New Revision: 5593
Modified:
branches/elephant/sage/python/sage/aviary/aviaryoperations.py
Log:
Allow sync calls for hadoop to simply return (status, data)
Modified: branches/elephant/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- branches/elephant/sage/python/sage/aviary/aviaryoperations.py 2012-12-14 13:16:22 UTC
(rev 5592)
+++ branches/elephant/sage/python/sage/aviary/aviaryoperations.py 2012-12-14 14:16:55 UTC
(rev 5593)
@@ -328,6 +328,13 @@
self.subtype = subtype
self.client_pool = ClientPool(wsdl, None)
+ # Things in Aviary that were born as swap-ins/analogs for
+ # existing QMF methods need to pass synchronous results back
+ # in a MethodResult object because that's what code expected
+ # from QMF. However, newer stuff (like hadoop) doesn't need
+ # to wrap results this way. Let it be controlled.
+ self.use_MethodResult_for_sync_calls = True
+
def get_hosts(self, resource, subtype):
if resource == self.resource and \
(not subtype or self.subtype == subtype):
@@ -435,8 +442,11 @@
result = meth(*meth_args, **meth_kwargs)
except Exception, e:
result = e
- sync.get_completion()(*process_results(result))
- return MethodResult(sync)
+ if self.use_MethodResult_for_sync_calls:
+ sync.get_completion()(*process_results(result))
+ return MethodResult(sync)
+ else:
+ return process_results(result)
class _AviaryJobMethods(_AviaryCommon):
def __init__(self, locator, transports, datadir, job_servers):
@@ -891,6 +901,9 @@
resource,
subtype)
+ # Equivalence? We don't want no stinking QMF structural equivalence!
+ self.use_MethodResult_for_sync_calls = False
+
def start_name_node(self, host, bin_file, owner, callback=None):
client = self.client_pool.get_object()
Show replies by date