Author: croberts
Date: 2013-02-20 18:35:31 +0000 (Wed, 20 Feb 2013)
New Revision: 5720
Modified:
trunk/cumin/python/cumin/gridhadoop/datanode.py
trunk/cumin/python/cumin/gridhadoop/jobtracker.py
trunk/cumin/python/cumin/gridhadoop/namenode.py
trunk/cumin/python/cumin/gridhadoop/tasktracker.py
trunk/sage/python/sage/aviary/aviaryoperations.py
Log:
Changes to pass description on node creation. Currently description is set to an empty
string until it's wired into the UI.
Modified: trunk/cumin/python/cumin/gridhadoop/datanode.py
===================================================================
--- trunk/cumin/python/cumin/gridhadoop/datanode.py 2013-02-19 14:24:28 UTC (rev 5719)
+++ trunk/cumin/python/cumin/gridhadoop/datanode.py 2013-02-20 18:35:31 UTC (rev 5720)
@@ -129,16 +129,13 @@
self.invoc.status = self.invoc.FAILED
self.invoc.end()
- def fake_call(self, binfile, owner, hadoophost, count, name_node):
- return True
-
def do_invoke(self, session, object, invoc, args):
self.invoc = invoc
- (binfile, owner, hadoophost, count, name_node) = args
+ (binfile, owner, hadoophost, description, count, name_node) = args
try:
self.invoc = invoc
- self.app.remote.start_data_node(hadoophost, name_node, binfile, owner, count,
invoc.make_callback())
+ self.app.remote.start_data_node(hadoophost, name_node, binfile, owner,
description, count, invoc.make_callback())
except Exception, e:
invoc.status = invoc.FAILED
log.debug("Creating data node failed", exc_info=True)
@@ -199,7 +196,8 @@
hadoophost = self.hadoophost.get(session)
count = self.count.get(session)
name_node = self.nn_id.get(session)
- self.task.invoke(session, None, (binfile, owner, hadoophost, count,
name_node))
+ description = ""
+ self.task.invoke(session, None, (binfile, owner, hadoophost, description,
count, name_node))
self.task.exit_with_redirect(session, url)
def render_title(self, session):
Modified: trunk/cumin/python/cumin/gridhadoop/jobtracker.py
===================================================================
--- trunk/cumin/python/cumin/gridhadoop/jobtracker.py 2013-02-19 14:24:28 UTC (rev 5719)
+++ trunk/cumin/python/cumin/gridhadoop/jobtracker.py 2013-02-20 18:35:31 UTC (rev 5720)
@@ -127,16 +127,13 @@
if result == False:
self.invoc.status = self.invoc.FAILED
self.invoc.end()
-
- def fake_call(self, binfile, owner, hadoophost):
- return True
-
+
def do_invoke(self, session, object, invoc, args):
self.invoc = invoc
- (binfile, owner, hadoophost, name_node, count) = args
+ (binfile, owner, hadoophost, name_node, description, count) = args
try:
- self.app.remote.start_job_tracker(hadoophost, name_node, binfile, owner,
count, invoc.make_callback())
+ self.app.remote.start_job_tracker(hadoophost, name_node, binfile, owner,
description, count, invoc.make_callback())
except Exception, e:
invoc.status = invoc.FAILED
log.debug("Creating job tracker failed", exc_info=True)
@@ -186,8 +183,9 @@
owner = session.client_session.username()
hadoophost = self.hadoophost.get(session)
name_node = self.nameNode.get(session)
+ description = ""
count = 1
- self.task.invoke(session, None, (binfile, owner, hadoophost, name_node,
count))
+ self.task.invoke(session, None, (binfile, owner, hadoophost, name_node,
description, count))
self.task.exit_with_redirect(session, url)
def render_title(self, session):
Modified: trunk/cumin/python/cumin/gridhadoop/namenode.py
===================================================================
--- trunk/cumin/python/cumin/gridhadoop/namenode.py 2013-02-19 14:24:28 UTC (rev 5719)
+++ trunk/cumin/python/cumin/gridhadoop/namenode.py 2013-02-20 18:35:31 UTC (rev 5720)
@@ -90,8 +90,8 @@
def do_invoke(self, session, object, invoc, args):
self.invoc = invoc
- (binfile, owner, hadoophost) = args
- self.app.remote.start_name_node(hadoophost, binfile, owner,
invoc.make_callback())
+ (binfile, owner, hadoophost, description) = args
+ self.app.remote.start_name_node(hadoophost, binfile, owner, description,
invoc.make_callback())
def get_title(self, session, x):
return "Create a name node"
@@ -133,7 +133,8 @@
binfile = self.binfile.get(session)
hadoophost = self.hadoophost.get(session)
owner = session.client_session.username()
- self.task.invoke(session, None, (binfile, owner, hadoophost))
+ description = ""
+ self.task.invoke(session, None, (binfile, owner, hadoophost, description))
self.task.exit_with_redirect(session, url)
def render_title(self, session):
Modified: trunk/cumin/python/cumin/gridhadoop/tasktracker.py
===================================================================
--- trunk/cumin/python/cumin/gridhadoop/tasktracker.py 2013-02-19 14:24:28 UTC (rev 5719)
+++ trunk/cumin/python/cumin/gridhadoop/tasktracker.py 2013-02-20 18:35:31 UTC (rev 5720)
@@ -129,15 +129,12 @@
self.invoc.status = self.invoc.FAILED
self.invoc.end()
- def fake_call(self, binfile, owner, hadoophost, count, job_tracker):
- return True
-
def do_invoke(self, session, object, invoc, args):
self.invoc = invoc
- (binfile, owner, hadoophost, count, job_tracker) = args
+ (binfile, owner, hadoophost, description, count, job_tracker) = args
try:
- self.app.remote.start_task_tracker(hadoophost, job_tracker, binfile, owner,
count, invoc.make_callback())
+ self.app.remote.start_task_tracker(hadoophost, job_tracker, binfile, owner,
description, count, invoc.make_callback())
except Exception, e:
invoc.status = invoc.FAILED
log.debug("Creating task trackers failed", exc_info=True)
@@ -192,7 +189,8 @@
hadoophost = self.hadoophost.get(session)
count = self.count.get(session)
job_tracker = self.jt_id.get(session)
- self.task.invoke(session, None, (binfile, owner, hadoophost, count,
job_tracker))
+ description = ""
+ self.task.invoke(session, None, (binfile, owner, hadoophost, description,
count, job_tracker))
self.task.exit_with_redirect(session, url)
def render_title(self, session):
Modified: trunk/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- trunk/sage/python/sage/aviary/aviaryoperations.py 2013-02-19 14:24:28 UTC (rev 5719)
+++ trunk/sage/python/sage/aviary/aviaryoperations.py 2013-02-20 18:35:31 UTC (rev 5720)
@@ -904,7 +904,7 @@
# 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):
+ def start_name_node(self, host, bin_file, owner, description, callback):
assert callable(callback)
client = self.client_pool.get_object()
@@ -929,7 +929,7 @@
callback(*result_tuple(result, host))
t = CallThread(self.call_client_retry, my_callback,
- client, "startNameNode", bin_file, owner)
+ client, "startNameNode", bin_file, owner, description)
t.start()
def stop_name_node(self, host, ids, callback):
@@ -939,8 +939,8 @@
def get_name_node(self, host, ids, owner=None, callback=None):
return self._query_ids(host, ids, owner, callback, "getNameNode")
- def start_data_node(self, host, nn_id, bin_file, owner, count, callback):
- return self._start_node(host, nn_id, bin_file, owner, count,
+ def start_data_node(self, host, nn_id, bin_file, owner, description, count,
callback):
+ return self._start_node(host, nn_id, bin_file, owner, description, count,
"startDataNode", callback)
def stop_data_node(self, host, ids, callback):
@@ -949,8 +949,8 @@
def get_data_node(self, host, ids, owner=None, callback=None):
return self._query_ids(host, ids, owner, callback, "getDataNode")
- def start_job_tracker(self, host, nn_id, bin_file, owner, count, callback):
- return self._start_node(host, nn_id, bin_file, owner, count,
+ def start_job_tracker(self, host, nn_id, bin_file, owner, description, count,
callback):
+ return self._start_node(host, nn_id, bin_file, owner, description, count,
"startJobTracker", callback)
def stop_job_tracker(self, host, ids, callback):
@@ -962,8 +962,8 @@
def stop_task_tracker(self, host, ids, callback):
self._operate_on_ids(host, ids, callback, "stopTaskTracker")
- def start_task_tracker(self, host, nn_id, bin_file, owner, count, callback):
- return self._start_node(host, nn_id, bin_file, owner, count,
+ def start_task_tracker(self, host, nn_id, bin_file, owner, description, count,
callback):
+ return self._start_node(host, nn_id, bin_file, owner, description, count,
"startTaskTracker", callback)
def get_task_tracker(self, host, ids, owner=None, callback=None):
@@ -1007,7 +1007,7 @@
refs.append(ref)
return refs
- def _start_node(self, host, ref_id, bin_file, owner, count,
+ def _start_node(self, host, ref_id, bin_file, owner, description, count,
meth_name, callback):
assert callable(callback)
@@ -1035,7 +1035,7 @@
ref = self._make_id(client, ref_id)
t = CallThread(self.call_client_retry, my_callback,
- client, meth_name, ref, bin_file, owner, count)
+ client, meth_name, ref, bin_file, owner, description, count)
t.start()
def _get_node_list(self, proc, owner, callback):