r5604 - in branches/elephant: cumin/python/cumin/gridhadoop sage/python/sage/aviary
by croberts@fedoraproject.org
Author: croberts
Date: 2012-12-14 22:07:55 +0000 (Fri, 14 Dec 2012)
New Revision: 5604
Modified:
branches/elephant/cumin/python/cumin/gridhadoop/namenode.py
branches/elephant/sage/python/sage/aviary/aviaryoperations.py
Log:
stop_name_node is now wired-in and working. Name nodes are functional!
Modified: branches/elephant/cumin/python/cumin/gridhadoop/namenode.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/namenode.py 2012-12-14 21:39:45 UTC (rev 5603)
+++ branches/elephant/cumin/python/cumin/gridhadoop/namenode.py 2012-12-14 22:07:55 UTC (rev 5604)
@@ -135,7 +135,7 @@
def do_invoke(self, invoc, id, args):
self.invoc = invoc
(hadoophost) = args
- self.app.remote.stop_name_node(hadoophost, id, invoc.make_callback())
+ self.app.remote.stop_name_node(hadoophost, [float(id)], invoc.make_callback())
def get_title(self, session):
return "Remove name nodes"
@@ -153,7 +153,7 @@
if not self.errors.get(session):
#TODO get hosts associated with each id
- hadoophost = "TODO"
+ hadoophost = "grid2.lab.bos.redhat.com:9090"
self.task.invoke(session, ids, (hadoophost))
def render_title(self, session):
Modified: branches/elephant/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- branches/elephant/sage/python/sage/aviary/aviaryoperations.py 2012-12-14 21:39:45 UTC (rev 5603)
+++ branches/elephant/sage/python/sage/aviary/aviaryoperations.py 2012-12-14 22:07:55 UTC (rev 5604)
@@ -994,7 +994,7 @@
if type(id) in (str,unicode):
new_ref.ipc = id
else:
- new_ref.id = int(id)
+ new_ref.id = float(id)
except Exception:
raise Exception("Invalid HadoopID value")
refs.append(new_ref)
11 years, 4 months
r5603 - in branches/elephant/cumin: model python/cumin/gridhadoop
by croberts@fedoraproject.org
Author: croberts
Date: 2012-12-14 21:39:45 +0000 (Fri, 14 Dec 2012)
New Revision: 5603
Modified:
branches/elephant/cumin/model/cumin.xml
branches/elephant/cumin/model/rosemary.xml
branches/elephant/cumin/python/cumin/gridhadoop/namenode.py
Log:
Ok, get_name_node_list is now up and working. The object selector for name nodes should yield live data now.
Modified: branches/elephant/cumin/model/cumin.xml
===================================================================
--- branches/elephant/cumin/model/cumin.xml 2012-12-14 21:17:18 UTC (rev 5602)
+++ branches/elephant/cumin/model/cumin.xml 2012-12-14 21:39:45 UTC (rev 5603)
@@ -48,8 +48,9 @@
<package name="com.redhat.cumin.grid.hadoop">
<class name="NameNode" storage="none">
<property name="ID" type="sstr"/>
+ <property name="Ipc" type="sstr"/>
<property name="Submitted" type="sstr"/>
- <property name="Status" type="sstr"/>
+ <property name="State" type="sstr"/>
<property name="Uptime" type="sstr"/>
<property name="Owner" type="sstr"/>
<property name="Location" type="sstr"/>
Modified: branches/elephant/cumin/model/rosemary.xml
===================================================================
--- branches/elephant/cumin/model/rosemary.xml 2012-12-14 21:17:18 UTC (rev 5602)
+++ branches/elephant/cumin/model/rosemary.xml 2012-12-14 21:39:45 UTC (rev 5603)
@@ -40,11 +40,14 @@
<property name="ID">
<title>Id</title>
</property>
+ <property name="Ipc">
+ <title>Ipc</title>
+ </property>
<property name="Submitted">
<title>Submitted</title>
</property>
- <property name="Status">
- <title>Status</title>
+ <property name="State">
+ <title>State</title>
</property>
<property name="Uptime">
<title>Uptime</title>
Modified: branches/elephant/cumin/python/cumin/gridhadoop/namenode.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/namenode.py 2012-12-14 21:17:18 UTC (rev 5602)
+++ branches/elephant/cumin/python/cumin/gridhadoop/namenode.py 2012-12-14 21:39:45 UTC (rev 5603)
@@ -14,6 +14,19 @@
def get_sage_results(self, values):
results = self.app.remote.get_name_node_list()
return results
+
+ def process_record(self, key, record):
+ field_data = list()
+ for column in self.columns:
+ try:
+ val = record[column.name.lower()]
+ except AttributeError:
+ if (column.name == "Ipc"):
+ val = record.ref.ipc
+ else:
+ val = record.ref.id
+ field_data.append(val)
+ return field_data
class NameNodeSelector(ObjectSelector):
def __init__(self, app, name):
@@ -21,7 +34,7 @@
super(NameNodeSelector, self).__init__(app, name, cls)
- self.add_search_filter(self.table.loc_col)
+ self.add_search_filter(self.table.ipc_col)
self.table.adapter = NameNodeAdapter(app, cls)
task = NameNodeCreate(app)
@@ -38,26 +51,22 @@
def render_title(self, session):
return "HDFS Name nodes"
- def get_qmf_results(self, session):
- values = self.get_data_values(session)
- return self.table.adapter.get_sage_results(values)
-
class NameNodeTable(ObjectQmfSelectorTable):
def __init__(self, app, name, cls):
super(NameNodeTable, self).__init__(app, name, cls)
- self.loc_col = ObjectTableColumn(app, "loccol", cls.Location)
- self.loc_col.width = "20%"
+ self.ipc_col = ObjectTableColumn(app, "ipc", cls.Ipc)
+ self.ipc_col.width = "20%"
self.id_col = ObjectTableColumn(app, "idcol", cls.ID)
self.sub_col = ObjectTableColumn(app, "sub", cls.Submitted)
- self.status_col = ObjectTableColumn(app, "statuscol", cls.Status)
+ self.state_col = ObjectTableColumn(app, "statecol", cls.State)
self.uptime_col = ObjectTableColumn(app, "uptimecol", cls.Uptime)
self.owner_col = ObjectTableColumn(app, "ownercol", cls.Owner)
- self.add_column(self.loc_col)
+ self.add_column(self.ipc_col)
self.add_column(self.id_col)
self.add_column(self.sub_col)
- self.add_column(self.status_col)
+ self.add_column(self.state_col)
self.add_column(self.uptime_col)
self.add_column(self.owner_col)
11 years, 4 months
r5602 - branches/elephant/sage/rpc-defs/aviary
by croberts@fedoraproject.org
Author: croberts
Date: 2012-12-14 21:17:18 +0000 (Fri, 14 Dec 2012)
New Revision: 5602
Modified:
branches/elephant/sage/rpc-defs/aviary/aviary-hadoop.xsd
Log:
Updating xsd to pick-up definition for "submitted"
Modified: branches/elephant/sage/rpc-defs/aviary/aviary-hadoop.xsd
===================================================================
--- branches/elephant/sage/rpc-defs/aviary/aviary-hadoop.xsd 2012-12-14 21:02:38 UTC (rev 5601)
+++ branches/elephant/sage/rpc-defs/aviary/aviary-hadoop.xsd 2012-12-14 21:17:18 UTC (rev 5602)
@@ -81,6 +81,7 @@
<xs:sequence>
<xs:element name="ref" type="hdp:HadoopID"/>
<xs:element name="owner" type="xs:string"/>
+ <xs:element name="submitted" type="xs:int"/>
<xs:element name="uptime" type="xs:int"/>
<xs:element name="state" type="hdp:HadoopStateType"/>
<xs:element name="status" type="mrg:Status"/>
@@ -121,4 +122,4 @@
<xs:element name="StopTaskTrackerResponse" type="hdp:HadoopStopResponse"/>
<xs:element name="GetTaskTracker" type="hdp:HadoopQuery"/>
<xs:element name="GetTaskTrackerResponse" type="hdp:HadoopQueryResponse"/>
-</xs:schema>
+</xs:schema>
\ No newline at end of file
11 years, 4 months
r5601 - branches/elephant/cumin/python/cumin/gridhadoop
by croberts@fedoraproject.org
Author: croberts
Date: 2012-12-14 21:02:38 +0000 (Fri, 14 Dec 2012)
New Revision: 5601
Modified:
branches/elephant/cumin/python/cumin/gridhadoop/datanode.py
branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py
branches/elephant/cumin/python/cumin/gridhadoop/jobtracker.py
branches/elephant/cumin/python/cumin/gridhadoop/namenode.py
branches/elephant/cumin/python/cumin/gridhadoop/tasktracker.py
Log:
Now using sage get_name_node_list to get the list of real live name nodes. It may or may not be working properly though since I'm not seeing any returned nodes yet.
Modified: branches/elephant/cumin/python/cumin/gridhadoop/datanode.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/datanode.py 2012-12-14 20:04:43 UTC (rev 5600)
+++ branches/elephant/cumin/python/cumin/gridhadoop/datanode.py 2012-12-14 21:02:38 UTC (rev 5601)
@@ -19,7 +19,7 @@
super(DataNodeSelector, self).__init__(app, name, cls)
self.add_search_filter(self.table.nn_col)
- self.table.adapter = HadoopAdapter(app, cls, None)
+ self.table.adapter = HadoopAdapter(app, cls)
task = DataNodeCreate(app)
link = TaskLink(app, "dataNode_create", task)
Modified: branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py 2012-12-14 20:04:43 UTC (rev 5600)
+++ branches/elephant/cumin/python/cumin/gridhadoop/hadoop.py 2012-12-14 21:02:38 UTC (rev 5601)
@@ -16,9 +16,8 @@
strings = StringCatalog(__file__)
class HadoopAdapter(ObjectQmfAdapter):
- def __init__(self, app, cls, remoteDataMethod):
+ def __init__(self, app, cls):
super(HadoopAdapter, self).__init__(app, cls)
- self.remoteDataMethod = remoteDataMethod
self.cls = cls
def get_count(self, values):
@@ -26,40 +25,36 @@
return len(data)
def get_sage_results(self, values):
- session = values['session']
-
- # TODO make some sage call and return the results
- # Here, we call self.remoteDataMethod
+ # Here's some fake data, eventually force the derived class to implement this
results = MethodResult()
+ results.status = "OK"
results.data = {"node1":{"Name":"node1.lab.bos.redhat.com",\
- "ID":"12345", \
- "Submitted":"11/14/2012", \
- "Status":"Running", \
- "Uptime":"2+00:54:56", \
- "Owner":"croberts", \
- "Location":"http://mrg7.lab.bos.redhat.com:40222",\
- "NameNode":"796210 @ http://mrg16.lab.bos.redhat.com:50061",\
- "JobTracker":"799639 @ http://mrg44.lab.bos.redhat.com:57339"}, \
+ "ID":"12345", \
+ "Submitted":"11/14/2012", \
+ "Status":"FAKE*Running", \
+ "Uptime":"2+00:54:56", \
+ "Owner":"croberts", \
+ "Location":"@http://mrg7.lab.bos.redhat.com:40222",\
+ "NameNode":"796210 @ http://mrg16.lab.bos.redhat.com:50061",\
+ "JobTracker":"799639 @ http://mrg44.lab.bos.redhat.com:57339"}, \
"node2":{"Name":"node2.lab.bos.redhat.com",\
- "ID":"56789", \
- "Submitted":"11/15/2012", \
- "Status":"Running", \
- "Uptime":"1+00:24:56", \
- "Owner":"croberts", \
- "Location":"http://mrg8.lab.bos.redhat.com:40222",\
- "NameNode":"720565 @ http://mrg14.lab.bos.redhat.com:44594",\
- "JobTracker":"799639 @ http://mrg44.lab.bos.redhat.com:57339"}}
-
- return results
+ "ID":"56789", \
+ "Submitted":"11/15/2012", \
+ "Status":"FAKE*Running", \
+ "Uptime":"1+00:24:56", \
+ "Owner":"croberts", \
+ "Location":"http://mrg8.lab.bos.redhat.com:40222",\
+ "NameNode":"720565 @ http://mrg14.lab.bos.redhat.com:44594",\
+ "JobTracker":"799639 @ http://mrg44.lab.bos.redhat.com:57339"}}
+ return (results.status, results.data)
def do_get_data(self, values):
- results = self.get_sage_results(values)
- namenodes = results.data
-
- if namenodes is None or len(namenodes) == 0:
+ (status, data) = self.get_sage_results(values)
+ log.debug("Return status from sage call is: %s" % status)
+ if data is None or len(data) == 0:
return {}
- return namenodes
+ return data
def process_record(self, key, record):
field_data = list()
@@ -127,8 +122,7 @@
if items:
self.param.set(session, items[0])
- super(HadoopHostField.HadoopHostOptions, self).do_process \
- (session)
+ super(HadoopHostField.HadoopHostOptions, self).do_process(session)
def do_get_items(self, session):
hosts = self.app.remote.get_hosts("SCHEDULER", "HADOOP")
Modified: branches/elephant/cumin/python/cumin/gridhadoop/jobtracker.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/jobtracker.py 2012-12-14 20:04:43 UTC (rev 5600)
+++ branches/elephant/cumin/python/cumin/gridhadoop/jobtracker.py 2012-12-14 21:02:38 UTC (rev 5601)
@@ -19,7 +19,7 @@
super(JobTrackerSelector, self).__init__(app, name, cls)
self.add_search_filter(self.table.loc_col)
- self.table.adapter = HadoopAdapter(app, cls, None)
+ self.table.adapter = HadoopAdapter(app, cls)
task = JobTrackerCreate(app)
link = TaskLink(app, "jobTracker_create", task)
Modified: branches/elephant/cumin/python/cumin/gridhadoop/namenode.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/namenode.py 2012-12-14 20:04:43 UTC (rev 5600)
+++ branches/elephant/cumin/python/cumin/gridhadoop/namenode.py 2012-12-14 21:02:38 UTC (rev 5601)
@@ -10,6 +10,11 @@
from sage.util import *
+class NameNodeAdapter(HadoopAdapter):
+ def get_sage_results(self, values):
+ results = self.app.remote.get_name_node_list()
+ return results
+
class NameNodeSelector(ObjectSelector):
def __init__(self, app, name):
cls = app.model.com_redhat_cumin_grid_hadoop.NameNode
@@ -17,7 +22,7 @@
super(NameNodeSelector, self).__init__(app, name, cls)
self.add_search_filter(self.table.loc_col)
- self.table.adapter = HadoopAdapter(app, cls, None)
+ self.table.adapter = NameNodeAdapter(app, cls)
task = NameNodeCreate(app)
link = TaskLink(app, "nameNode_create", task)
Modified: branches/elephant/cumin/python/cumin/gridhadoop/tasktracker.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/tasktracker.py 2012-12-14 20:04:43 UTC (rev 5600)
+++ branches/elephant/cumin/python/cumin/gridhadoop/tasktracker.py 2012-12-14 21:02:38 UTC (rev 5601)
@@ -19,7 +19,7 @@
super(TaskTrackerSelector, self).__init__(app, name, cls)
self.add_search_filter(self.table.jt_col)
- self.table.adapter = HadoopAdapter(app, cls, None)
+ self.table.adapter = HadoopAdapter(app, cls)
task = TaskTrackerCreate(app)
link = TaskLink(app, "taskTracker_create", task)
11 years, 4 months
r5600 - branches/elephant/sage/python/sage/aviary
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-12-14 20:04:43 +0000 (Fri, 14 Dec 2012)
New Revision: 5600
Modified:
branches/elephant/sage/python/sage/aviary/aviaryoperations.py
Log:
Add get_name_node_list, fix error in all the "get_" methods
Modified: branches/elephant/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- branches/elephant/sage/python/sage/aviary/aviaryoperations.py 2012-12-14 17:33:47 UTC (rev 5599)
+++ branches/elephant/sage/python/sage/aviary/aviaryoperations.py 2012-12-14 20:04:43 UTC (rev 5600)
@@ -937,26 +937,43 @@
self._operate_on_ids(host, ids, callback, "stopNameNode")
def get_name_node(self, host, ids, callback=None):
- return self._operate_on_ids(self, host, ids, callback, "getNameNode")
+ return self._operate_on_ids(host, ids, callback, "getNameNode")
def stop_data_node(self, host, ids, callback):
self._operate_on_ids(host, ids, callback, "stopDataNode")
def get_data_node(self, host, ids, callback=None):
- return self._operate_on_ids(self, host, ids, callback, "getDataNode")
+ return self._operate_on_ids(host, ids, callback, "getDataNode")
def stop_job_tracker(self, host, ids, callback):
self._operate_on_ids(host, ids, callback, "stopJobTracker")
def get_job_tracker(self, host, ids, callback=None):
- return self._operate_on_ids(self, host, ids, callback, "getJobTracker")
+ return self._operate_on_ids(host, ids, callback, "getJobTracker")
def stop_task_tracker(self, host, ids, callback):
self._operate_on_ids(host, ids, callback, "stopTaskTracker")
def get_task_tracker(self, host, ids, callback=None):
- return self._operate_on_ids(self, host, ids, callback, "getTaskTracker")
+ return self._operate_on_ids(host, ids, callback, "getTaskTracker")
+ def get_name_node_list(self, callback=None):
+ try:
+ status = "OK"
+ hosts = self.get_hosts(self.resource, self.subtype)
+ data = []
+ for h in hosts:
+ s, n = self.get_name_node(h, [])
+ if s == "OK":
+ data.extend(n)
+ except Exception, e:
+ status = e
+ data = None
+ if callback:
+ callback(status, data)
+ else:
+ return (status, data)
+
def _operate_on_ids(self, host, ids, callback, meth_name):
if callback:
assert callable(callback)
11 years, 4 months
r5599 - branches/elephant/cumin/python/cumin/gridhadoop
by croberts@fedoraproject.org
Author: croberts
Date: 2012-12-14 17:33:47 +0000 (Fri, 14 Dec 2012)
New Revision: 5599
Modified:
branches/elephant/cumin/python/cumin/gridhadoop/datanode.py
branches/elephant/cumin/python/cumin/gridhadoop/jobtracker.py
branches/elephant/cumin/python/cumin/gridhadoop/namenode.py
branches/elephant/cumin/python/cumin/gridhadoop/tasktracker.py
Log:
More wiring of new aviary methods in sage. Now relying on the built-in async nature and error handling by using invoc.make_callback() instead of custom callback.
Modified: branches/elephant/cumin/python/cumin/gridhadoop/datanode.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/datanode.py 2012-12-14 17:14:01 UTC (rev 5598)
+++ branches/elephant/cumin/python/cumin/gridhadoop/datanode.py 2012-12-14 17:33:47 UTC (rev 5599)
@@ -66,7 +66,13 @@
self.form = DataNodeDeleteForm(app, self.name, self, cls)
self.invoc = None
+
+ def do_invoke(self, invoc, id, args):
+ self.invoc = invoc
+ (hadoophost) = args
+ self.app.remote.stop_data_node(hadoophost, id, invoc.make_callback())
+
def get_title(self, session):
return "Remove data nodes"
@@ -76,14 +82,16 @@
class DataNodeDeleteForm(HadoopNodeDeleteForm):
def process_submit(self, session):
- name_nodes_to_kill = self.selection.get(session)
-
- if not self.errors.get(session):
- print "Here is where I'd make a call to kill some data nodes [%s]" % name_nodes_to_kill
- #self.task.invoke(session, name_nodes_to_kill)
-
+ self.validate(session)
+ ids = self.selection.get(session)
url = self.return_url.get(session)
self.page.redirect.set(session, url)
+
+ if not self.errors.get(session):
+ #TODO get hosts associated with each id
+ hadoophost = "TODO"
+ self.task.invoke(session, ids, (hadoophost))
+
def render_title(self, session):
return "Remove data nodes"
Modified: branches/elephant/cumin/python/cumin/gridhadoop/jobtracker.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/jobtracker.py 2012-12-14 17:14:01 UTC (rev 5598)
+++ branches/elephant/cumin/python/cumin/gridhadoop/jobtracker.py 2012-12-14 17:33:47 UTC (rev 5599)
@@ -65,6 +65,11 @@
self.form = JobTrackerDeleteForm(app, self.name, self, cls)
self.invoc = None
+
+ def do_invoke(self, invoc, id, args):
+ self.invoc = invoc
+ (hadoophost) = args
+ self.app.remote.stop_job_tracker(hadoophost, id, invoc.make_callback())
def get_title(self, session):
return "Remove job trackers"
@@ -75,14 +80,15 @@
class JobTrackerDeleteForm(HadoopNodeDeleteForm):
def process_submit(self, session):
- name_nodes_to_kill = self.selection.get(session)
-
- if not self.errors.get(session):
- print "Here is where I'd make a call to kill some job trackers [%s]" % name_nodes_to_kill
- #self.task.invoke(session, name_nodes_to_kill)
-
+ self.validate(session)
+ ids = self.selection.get(session)
url = self.return_url.get(session)
self.page.redirect.set(session, url)
+
+ if not self.errors.get(session):
+ #TODO get hosts associated with each id
+ hadoophost = "TODO"
+ self.task.invoke(session, ids, (hadoophost))
def render_title(self, session):
return "Remove job trackers"
Modified: branches/elephant/cumin/python/cumin/gridhadoop/namenode.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/namenode.py 2012-12-14 17:14:01 UTC (rev 5598)
+++ branches/elephant/cumin/python/cumin/gridhadoop/namenode.py 2012-12-14 17:33:47 UTC (rev 5599)
@@ -72,13 +72,7 @@
def do_invoke(self, session, object, invoc, args):
self.invoc = invoc
(binfile, owner, hadoophost) = args
-
- try:
- call_async(self.callback, self.app.remote.start_name_node, hadoophost, binfile, owner)
- except Exception, e:
- invoc.status = invoc.FAILED
- log.debug("Creating name node failed", exc_info=True)
- invoc.end()
+ self.app.remote.start_name_node(hadoophost, binfile, owner, invoc.make_callback())
def get_title(self, session, x):
return "Create a name node"
@@ -123,6 +117,11 @@
self.form = NameNodeDeleteForm(app, self.name, self, cls)
self.invoc = None
+
+ def do_invoke(self, invoc, id, args):
+ self.invoc = invoc
+ (hadoophost) = args
+ self.app.remote.stop_name_node(hadoophost, id, invoc.make_callback())
def get_title(self, session):
return "Remove name nodes"
@@ -133,14 +132,15 @@
class NameNodeDeleteForm(HadoopNodeDeleteForm):
def process_submit(self, session):
- name_nodes_to_kill = self.selection.get(session)
-
- if not self.errors.get(session):
- print "Here is where I'd make a call to kill some name nodes [%s]" % name_nodes_to_kill
- #self.task.invoke(session, name_nodes_to_kill)
-
+ self.validate(session)
+ ids = self.selection.get(session)
url = self.return_url.get(session)
self.page.redirect.set(session, url)
+
+ if not self.errors.get(session):
+ #TODO get hosts associated with each id
+ hadoophost = "TODO"
+ self.task.invoke(session, ids, (hadoophost))
def render_title(self, session):
return "Remove name nodes"
Modified: branches/elephant/cumin/python/cumin/gridhadoop/tasktracker.py
===================================================================
--- branches/elephant/cumin/python/cumin/gridhadoop/tasktracker.py 2012-12-14 17:14:01 UTC (rev 5598)
+++ branches/elephant/cumin/python/cumin/gridhadoop/tasktracker.py 2012-12-14 17:33:47 UTC (rev 5599)
@@ -65,6 +65,11 @@
self.form = TaskTrackerDeleteForm(app, self.name, self, cls)
self.invoc = None
+
+ def do_invoke(self, invoc, id, args):
+ self.invoc = invoc
+ (hadoophost) = args
+ self.app.remote.stop_task_tracker(hadoophost, id, invoc.make_callback())
def get_title(self, session):
return "Remove task trackers"
@@ -75,14 +80,15 @@
class TaskTrackerDeleteForm(HadoopNodeDeleteForm):
def process_submit(self, session):
- name_nodes_to_kill = self.selection.get(session)
-
- if not self.errors.get(session):
- print "Here is where I'd make a call to kill some task trackers [%s]" % name_nodes_to_kill
- #self.task.invoke(session, name_nodes_to_kill)
-
+ self.validate(session)
+ ids = self.selection.get(session)
url = self.return_url.get(session)
self.page.redirect.set(session, url)
+
+ if not self.errors.get(session):
+ #TODO get hosts associated with each id
+ hadoophost = "TODO"
+ self.task.invoke(session, ids, (hadoophost))
def render_title(self, session):
return "Remove task trackers"
11 years, 4 months
r5598 - trunk/sage/python/sage/qmf
by eallen@fedoraproject.org
Author: eallen
Date: 2012-12-14 17:14:01 +0000 (Fri, 14 Dec 2012)
New Revision: 5598
Modified:
trunk/sage/python/sage/qmf/qmfoperations.py
Log:
Fix for BZ886921 Queue Purge failing. Caused by new required "filter" argument to purge call.
Modified: trunk/sage/python/sage/qmf/qmfoperations.py
===================================================================
--- trunk/sage/python/sage/qmf/qmfoperations.py 2012-12-14 15:47:58 UTC (rev 5597)
+++ trunk/sage/python/sage/qmf/qmfoperations.py 2012-12-14 17:14:01 UTC (rev 5598)
@@ -77,7 +77,7 @@
def purge_queue(self, queue, count, callback):
assert callback
- self._call(queue, "purge", callback, 0, 0, count)
+ self._call(queue, "purge", callback, 0, 0, count, {})
# scheduler operations
11 years, 4 months
r5597 - branches/elephant/sage/python/sage/aviary
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-12-14 15:47:58 +0000 (Fri, 14 Dec 2012)
New Revision: 5597
Modified:
branches/elephant/sage/python/sage/aviary/aviaryoperations.py
Log:
Add stop and get for all types.
Modified: branches/elephant/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- branches/elephant/sage/python/sage/aviary/aviaryoperations.py 2012-12-14 15:47:00 UTC (rev 5596)
+++ branches/elephant/sage/python/sage/aviary/aviaryoperations.py 2012-12-14 15:47:58 UTC (rev 5597)
@@ -933,49 +933,31 @@
t.start()
def stop_name_node(self, host, ids, callback):
- assert callable(callback)
+ assert callback
+ self._operate_on_ids(host, ids, callback, "stopNameNode")
- if type(ids) not in (list, tuple):
- ids = (ids)
+ def get_name_node(self, host, ids, callback=None):
+ return self._operate_on_ids(self, host, ids, callback, "getNameNode")
- client = self.client_pool.get_object()
- self._setup_client(client,
- self.servers,
- host,
- "stopNameNode")
+ def stop_data_node(self, host, ids, callback):
+ self._operate_on_ids(host, ids, callback, "stopDataNode")
- refs = []
- for id in ids:
- new_ref = client.factory.create("ns1:HadoopID")
- try:
- if type(id) in (str,unicode):
- new_ref.ipc = id
- else:
- new_ref.id = int(id)
- except Exception:
- raise Exception("Invalid HadoopID value")
- refs.append(new_ref)
+ def get_data_node(self, host, ids, callback=None):
+ return self._operate_on_ids(self, host, ids, callback, "getDataNode")
- def result_tuple(result, host):
- data = None
- result = self._pretty_result(result, host)
- if isinstance(result, Exception):
- status = result
- else:
- status = _AviaryCommon._get_status(result.status)
- if status == "OK" and hasattr(result, "results"):
- data = result.results
- return (status, data)
+ def stop_job_tracker(self, host, ids, callback):
+ self._operate_on_ids(host, ids, callback, "stopJobTracker")
- def my_callback(result):
- self.client_pool.return_object(client)
- callback(*result_tuple(result, host))
+ def get_job_tracker(self, host, ids, callback=None):
+ return self._operate_on_ids(self, host, ids, callback, "getJobTracker")
- t = CallThread(self.call_client_retry, my_callback,
- client, "stopNameNode", refs)
- t.start()
+ def stop_task_tracker(self, host, ids, callback):
+ self._operate_on_ids(host, ids, callback, "stopTaskTracker")
- def get_name_node(self, host, ids, callback=None):
+ def get_task_tracker(self, host, ids, callback=None):
+ return self._operate_on_ids(self, host, ids, callback, "getTaskTracker")
+
+ def _operate_on_ids(self, host, ids, callback, meth_name):
if callback:
assert callable(callback)
@@ -986,7 +968,7 @@
self._setup_client(client,
self.servers,
host,
- "getNameNode")
+ meth_name)
refs = []
for id in ids:
@@ -1017,14 +999,14 @@
callback(*result_tuple(result, host))
t = CallThread(self.call_client_retry, my_callback,
- client, "getNameNode", refs)
+ client, meth_name, refs)
t.start()
else:
def my_process_results(result):
return result_tuple(result, host)
res = self._call_sync(self.call_client_retry, my_process_results,
- client, "getNameNode", refs)
+ client, meth_name, refs)
self.client_pool.return_object(client)
return res;
11 years, 4 months
r5596 - in trunk/cumin: python/cumin python/cumin/grid resources
by croberts@fedoraproject.org
Author: croberts
Date: 2012-12-14 15:47:00 +0000 (Fri, 14 Dec 2012)
New Revision: 5596
Modified:
trunk/cumin/python/cumin/grid/dashboard.py
trunk/cumin/python/cumin/stat.py
trunk/cumin/resources/app.js
Log:
Per BZ883784, swapping the free/used stats on the plumage charts for memory/cpu so that used is on the bottom, free is on the top....same colors.
Modified: trunk/cumin/python/cumin/grid/dashboard.py
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.py 2012-12-14 15:19:48 UTC (rev 5595)
+++ trunk/cumin/python/cumin/grid/dashboard.py 2012-12-14 15:47:00 UTC (rev 5596)
@@ -56,14 +56,16 @@
charts.add_child(chart)
chart = self.PoolMemoryChart(app, "fmem", app.model.com_redhat_grid_plumage.OSUtil)
- chart.stats = ["usedmem", "freemem"]
+ chart.stats = ["freemem", "usedmem"]
+ chart.colors = ["#992600", "#009926"]
chart.max_samples = 250
chart.duration.param.default = "86400"
chart.chart_type = "stacked"
charts.add_child(chart)
chart = self.PoolCpuChart(app, "fcpu", app.model.com_redhat_grid_plumage.OSUtil)
- chart.stats = [ "usedcpu", "freecpu"]
+ chart.stats = [ "freecpu", "usedcpu"]
+ chart.colors = ["#992600", "#009926"]
chart.max_samples = 250
chart.duration.param.default = "86400"
chart.chart_type = "stacked"
Modified: trunk/cumin/python/cumin/stat.py
===================================================================
--- trunk/cumin/python/cumin/stat.py 2012-12-14 15:19:48 UTC (rev 5595)
+++ trunk/cumin/python/cumin/stat.py 2012-12-14 15:47:00 UTC (rev 5596)
@@ -2,6 +2,7 @@
import logging
from datetime import datetime, timedelta
from time import time, sleep
+from urllib import pathname2url
from wooly import Widget, Page, Parameter, Attribute
from wooly.util import StringCatalog, escape_entity, Writer
@@ -144,6 +145,7 @@
self.stats = ()
self.chart_type = None
self.title = None
+ self.colors = None
self.stats_tmpl = WidgetTemplate(self, "stat_html")
@@ -178,6 +180,10 @@
if self.chart_type:
params.append("type=%s" % self.chart_type)
+ if self.colors:
+ for color in self.colors:
+ params.append("color=%s" % pathname2url(color))
+
return params
def render_href(self, session):
@@ -230,6 +236,10 @@
if self.mode:
params.append("mode=%s" % self.mode)
+ if self.colors:
+ for color in self.colors:
+ params.append("color=%s" % pathname2url(color))
+
params.append("maxsamp=%s" % self.max_samples)
return params
@@ -489,6 +499,10 @@
self.maxsamp = IntegerParameter(app, "maxsamp")
self.maxsamp.default = 0
self.add_parameter(self.maxsamp)
+
+ param = Parameter(app, "cparam")
+ self.colors = ListParameter(app, "color", param)
+ self.add_parameter(self.colors)
self.cache = ImageCache()
@@ -794,7 +808,7 @@
return chart.create()
class FlashLineChart(Widget):
- colors = ('#FF0000', '#0000FF', '#00FF00', '#FF00FF', '#FFFF00', '#00FFFF', '#000000')
+ colors = ('#009926','#992600','#0036d6','#ffc414','730099','#ff00cc')
one_day = 24 * 60 * 60
def __init__(self, app, name, page):
super(FlashLineChart, self).__init__(app, name)
@@ -879,6 +893,8 @@
height = self.page.container_height.get(session)
mode = self.page.mode.get(session)
method = self.page.method.get(session)
+ if len(self.page.colors.get(session)) > 0:
+ self.colors = self.page.colors.get(session)
time_span = self.get_time_span(session)
duration = self.get_duration(session)
@@ -921,6 +937,7 @@
# create the chart dict
chart = self.get_chart(session, adapter, stats, samples, time_span, max_value, min_value, append, end_seconds_ago)
#print "**********\n"+chart.create()
+ chart.colors = self.colors
chart.graph_div = "%s_chart" % chart.id.replace(".", "_")
# doing this the ugly way for python 2.4
if self.stackSeries == True:
Modified: trunk/cumin/resources/app.js
===================================================================
--- trunk/cumin/resources/app.js 2012-12-14 15:19:48 UTC (rev 5595)
+++ trunk/cumin/resources/app.js 2012-12-14 15:47:00 UTC (rev 5596)
@@ -588,6 +588,7 @@
.append([ json.x_axis.labels.labels[i].text ]);
}
dataContainer['stackSeries'] = json.stackSeries == 1 ? true:false;
+ dataContainer['colors'] = json.colors;
return dataContainer;
}
@@ -651,7 +652,7 @@
},
series: getSeries(dataContainer),
stackSeries: dataContainer['stackSeries'],
- seriesColors: ['#009926','#992600','#0036d6','#ffc414','730099','#ff00cc'],
+ seriesColors: dataContainer['colors'],
seriesDefaults: {
lineWidth:1,
fill:true,
11 years, 4 months
r5595 - branches/elephant/sage/python/sage/aviary
by tmckay@fedoraproject.org
Author: tmckay
Date: 2012-12-14 15:19:48 +0000 (Fri, 14 Dec 2012)
New Revision: 5595
Modified:
branches/elephant/sage/python/sage/aviary/aviaryoperations.py
Log:
Add get_name_node
Modified: branches/elephant/sage/python/sage/aviary/aviaryoperations.py
===================================================================
--- branches/elephant/sage/python/sage/aviary/aviaryoperations.py 2012-12-14 14:58:59 UTC (rev 5594)
+++ branches/elephant/sage/python/sage/aviary/aviaryoperations.py 2012-12-14 15:19:48 UTC (rev 5595)
@@ -975,6 +975,59 @@
client, "stopNameNode", refs)
t.start()
+ def get_name_node(self, host, ids, callback=None):
+ if callback:
+ assert callable(callback)
+
+ if type(ids) not in (list, tuple):
+ ids = (ids)
+
+ client = self.client_pool.get_object()
+ self._setup_client(client,
+ self.servers,
+ host,
+ "getNameNode")
+
+ refs = []
+ for id in ids:
+ new_ref = client.factory.create("ns1:HadoopID")
+ try:
+ if type(id) in (str,unicode):
+ new_ref.ipc = id
+ else:
+ new_ref.id = int(id)
+ except Exception:
+ raise Exception("Invalid HadoopID value")
+ refs.append(new_ref)
+
+ def result_tuple(result, host):
+ data = None
+ result = self._pretty_result(result, host)
+ if isinstance(result, Exception):
+ status = result
+ else:
+ status = _AviaryCommon._get_status(result.status)
+ if status == "OK" and hasattr(result, "results"):
+ data = result.results
+ return (status, data)
+
+ if callback:
+ def my_callback(result):
+ self.client_pool.return_object(client)
+ callback(*result_tuple(result, host))
+
+ t = CallThread(self.call_client_retry, my_callback,
+ client, "getNameNode", refs)
+ t.start()
+ else:
+ def my_process_results(result):
+ return result_tuple(result, host)
+
+ res = self._call_sync(self.call_client_retry, my_process_results,
+ client, "getNameNode", refs)
+ self.client_pool.return_object(client)
+ return res;
+
class AviaryOperations(Catalog):
def __init__(self, name, datadir,
locator_uri="",
11 years, 4 months