rhmessaging commits: r2847 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-19 17:20:36 -0500 (Wed, 19 Nov 2008)
New Revision: 2847
Modified:
mgmt/trunk/cumin/python/cumin/brokerlink.py
mgmt/trunk/cumin/python/cumin/exchange.py
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/cumin/python/cumin/queue.py
mgmt/trunk/cumin/python/cumin/system.py
Log:
Fixed problem with showing dialogs from broker details tab.
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-11-19 22:19:40 UTC (rev 2846)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-11-19 22:20:36 UTC (rev 2847)
@@ -601,12 +601,15 @@
return "No, do not restore if broker restarts"
class BrokerLinkAdd(BrokerLinkAddForm):
- def process_cancel(self, session):
+ def get_args(self, session):
+ return (self.frame.get_object(session), )
+
+ def process_cancel(self, session, *args):
branch = session.branch()
self.frame.show_view(branch)
self.page.set_redirect_url(session, branch.marshal())
- def process_submit(self, session):
+ def process_submit(self, session, reg):
if self.validate(session):
pass
else:
@@ -623,7 +626,6 @@
link.host = host
link.port = port
link.durable = (durable == "yes")
- reg = self.frame.get_object(session)
args = {"reg": reg,
"username": username,
@@ -634,7 +636,7 @@
action.invoke(link, args)
# navigate back to main queue frame
- self.process_cancel(session)
+ self.process_cancel(session, (reg,))
class BrokerSetClose(CuminBulkActionForm):
def process_return(self, session):
Modified: mgmt/trunk/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/exchange.py 2008-11-19 22:19:40 UTC (rev 2846)
+++ mgmt/trunk/cumin/python/cumin/exchange.py 2008-11-19 22:20:36 UTC (rev 2847)
@@ -463,14 +463,14 @@
class ExchangeAdd(ExchangeForm):
def get_args(self, session):
- return self.frame.frame.get_args(session)
+ return (self.frame.get_object(session), )
- def process_cancel(self, session):
+ def process_cancel(self, session, *args):
branch = session.branch()
self.frame.show_view(branch)
self.page.set_redirect_url(session, branch.marshal())
- def process_submit(self, session):
+ def process_submit(self, session, *args):
errors = self.validate(session)
if errors:
@@ -491,8 +491,8 @@
self.process_cancel(session)
- def render_title(self, session):
- return "Add Exchange"
+ def render_title(self, session, reg):
+ return "Add Exchange to the Broker '%s'" % reg.name
class ExchangeStats(TabbedModeSet):
def __init__(self, app, name):
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-11-19 22:19:40 UTC (rev 2846)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-11-19 22:20:36 UTC (rev 2847)
@@ -779,6 +779,7 @@
def show(self, session, reg):
frame = self.cumin_class.show_object(session, reg)
+ frame.set_object(session, reg)
return frame.exchange_add.show(session)
def do_invoke(self, exchange, args, completion):
@@ -808,6 +809,7 @@
def show(self, session, reg):
frame = self.cumin_class.show_object(session, reg)
+ frame.set_object(session, reg)
return frame.link_add.show(session)
def do_invoke(self, link, args, completion):
@@ -841,8 +843,9 @@
def get_verb(self, session):
return "Add"
- def show(self, session, queue):
- frame = self.cumin_class.show_object(session, queue)
+ def show(self, session, reg):
+ frame = self.cumin_class.show_object(session, reg)
+ frame.set_object(session, reg)
return frame.queue_add.show(session)
def do_invoke(self, queue, args, completion):
Modified: mgmt/trunk/cumin/python/cumin/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/queue.py 2008-11-19 22:19:40 UTC (rev 2846)
+++ mgmt/trunk/cumin/python/cumin/queue.py 2008-11-19 22:20:36 UTC (rev 2847)
@@ -491,12 +491,15 @@
return "Ring Strict"
class QueueAdd(QueueForm):
- def process_cancel(self, session):
+ def get_args(self, session):
+ return (self.frame.get_object(session), )
+
+ def process_cancel(self, session, *args):
branch = session.branch()
self.frame.show_view(branch)
self.page.set_redirect_url(session, branch.marshal())
- def process_submit(self, session):
+ def process_submit(self, session, reg):
queue_name = self.namef.get(session)
durable = self.durable.get(session)
@@ -510,7 +513,6 @@
queue = Queue()
queue.name = queue_name
queue.durable = (durable == "yes")
- reg = self.frame.get_object(session)
args = {}
args["reg"] = reg
@@ -541,8 +543,7 @@
# navigate back to main queue frame
self.process_cancel(session)
- def render_title(self, session, *args):
- reg = self.frame.get_object(session)
+ def render_title(self, session, reg):
return "Add Queue to the Broker '%s'" % reg.name
class QueueRemove(CuminConfirmForm):
Modified: mgmt/trunk/cumin/python/cumin/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.py 2008-11-19 22:19:40 UTC (rev 2846)
+++ mgmt/trunk/cumin/python/cumin/system.py 2008-11-19 22:20:36 UTC (rev 2847)
@@ -20,7 +20,7 @@
col = self.NameColumn(app, "name")
self.add_column(col)
self.set_default_column(col)
-
+
def render_title(self, session, *args):
count = System.select().count()
return "Systems %s" % fmt_count(count)
@@ -142,7 +142,7 @@
def render_sql_where(self, session, system):
elems = list()
- elems.append("machine = %(nodeName)s")
+ elems.append("system = %(nodeName)s")
elems.append("s.deletion_time is null")
return "where %s" % " and ".join(elems)
15 years, 7 months
rhmessaging commits: r2846 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-19 17:19:40 -0500 (Wed, 19 Nov 2008)
New Revision: 2846
Modified:
mgmt/trunk/cumin/python/cumin/job.py
mgmt/trunk/cumin/python/cumin/job.strings
mgmt/trunk/cumin/python/cumin/page.py
mgmt/trunk/cumin/python/cumin/page.strings
Log:
Added 'Your Jobs' tab to Home tabset
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-11-19 21:03:27 UTC (rev 2845)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-11-19 22:19:40 UTC (rev 2846)
@@ -238,7 +238,8 @@
return "j.custom_id = %(custom_id)s"
def get_find_sql_values(self, session, pool):
- return {"custom_id": self.job_search.get(session), "pool": pool.id}
+ return {"custom_id": self.job_search.get(session)}
+ #return {"custom_id": self.job_search.get(session), "pool": pool.id}
def get_full_item_count(self, session, *args):
# request item count will phase=="a"
Modified: mgmt/trunk/cumin/python/cumin/job.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.strings 2008-11-19 21:03:27 UTC (rev 2845)
+++ mgmt/trunk/cumin/python/cumin/job.strings 2008-11-19 22:19:40 UTC (rev 2846)
@@ -33,6 +33,7 @@
left outer join job_stats as c on c.id = j.stats_curr_id
left outer join job_stats as p on p.id = j.stats_prev_id
inner join scheduler as s on s.id = j.scheduler_id
+inner join submitter as b on b.id = j.submitter_id
[JobSet.count_sql]
select count(1)
Modified: mgmt/trunk/cumin/python/cumin/page.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/page.py 2008-11-19 21:03:27 UTC (rev 2845)
+++ mgmt/trunk/cumin/python/cumin/page.py 2008-11-19 22:19:40 UTC (rev 2846)
@@ -210,6 +210,7 @@
self.add_child(heading)
self.add_tab(self.OverviewTab(app, "over"))
+ self.add_tab(self.MyGridJobs(app, "jobs"))
self.add_tab(self.AccountTab(app, "acct"))
def render_change_password_href(self, session):
@@ -237,6 +238,23 @@
self.frame.change_password.show(branch)
return branch.marshal()
+ class MyGridJobs(JobTab):
+ def render_title(self, session):
+ return "Your Grid Jobs %s" % fmt_count(self.get_item_count(session))
+
+ def render_sql_where(self, session, *args):
+ user = session.user_session.subject.name
+ elems = list()
+ elems.append("b.name like '%s%s'" % (user, "%"))
+ elems.append(self.get_phase_sql(session))
+ return "where %s" % " and ".join(elems)
+
+ def get_sql_values(self, session, *args):
+ pass
+
+ def get_visible_columns(self, session):
+ return self.get_request_visible_columns(session, ["custom_group", "scheduler", "submitter"])
+
class MessagingView(TabbedModeSet):
def __init__(self, app, name):
super(MessagingView, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/page.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/page.strings 2008-11-19 21:03:27 UTC (rev 2845)
+++ mgmt/trunk/cumin/python/cumin/page.strings 2008-11-19 22:19:40 UTC (rev 2846)
@@ -228,3 +228,27 @@
<div class="TabbedModeSet mode">{mode}</div>
</div>
+
+[MyGridJobs.html]
+ <div class="rfloat">{phase}</div>
+<form id="{id}" style="clear:right;" method="post" action="?">
+
+ <div class="sactions">
+ <h2>Act on Selected Jobs:</h2>
+ {hold} {release} {remove}
+ </div>
+
+ <table class="mobjects">
+ <thead>
+ <tr>
+ <th class="setnav" colspan="{column_count}">
+ <div class="rfloat">{page}</div>
+ {count}
+ </th>
+ </tr>
+ <tr>{headers}</tr>
+ </thead>
+ <tbody>{items}</tbody>
+ </table>
+ <div>{hidden_inputs}</div>
+</form>
15 years, 7 months
rhmessaging commits: r2845 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-11-19 16:03:27 -0500 (Wed, 19 Nov 2008)
New Revision: 2845
Modified:
mgmt/trunk/mint/python/mint/update.py
Log:
do check for hasattr as last case
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2008-11-19 17:21:39 UTC (rev 2844)
+++ mgmt/trunk/mint/python/mint/update.py 2008-11-19 21:03:27 UTC (rev 2845)
@@ -85,10 +85,7 @@
if name in mint.schema.schemaReservedWordsMap:
name = mint.schema.schemaReservedWordsMap.get(name)
- if not hasattr(getattr(mint, cls), name):
- # Discard attrs that we don't have in our schema
- log.debug("Class '%s' has no field '%s'" % ("mint.schema." + cls, name))
- elif key.type == 10:
+ if key.type == 10:
# Navigate to referenced objects
if name.endswith("Ref"):
name = name[:-3]
@@ -116,6 +113,9 @@
elif key.type == 14:
# convert UUIDs into their string representation, to be handled by sqlobject
results[name] = str(value)
+ elif not hasattr(getattr(mint, cls), name):
+ # Discard attrs that we don't have in our schema
+ log.debug("Class '%s' has no field '%s'" % (cls, name))
else:
results[name] = value
if orphan:
15 years, 7 months
rhmessaging commits: r2844 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-11-19 12:21:39 -0500 (Wed, 19 Nov 2008)
New Revision: 2844
Modified:
mgmt/trunk/mint/python/mint/__init__.py
mgmt/trunk/mint/python/mint/update.py
Log:
more database optimizations, namely by connection reuse, and better caching of qmfId-to-dbId mappings
Modified: mgmt/trunk/mint/python/mint/__init__.py
===================================================================
--- mgmt/trunk/mint/python/mint/__init__.py 2008-11-19 16:40:42 UTC (rev 2843)
+++ mgmt/trunk/mint/python/mint/__init__.py 2008-11-19 17:21:39 UTC (rev 2844)
@@ -341,30 +341,26 @@
def setCloseListener(self, connCloseListener):
self.connCloseListener = connCloseListener
- def getObjectId(self, cls, id):
- if isinstance(id, qpid.qmfconsole.ObjectId):
- first = id.first
- second = id.second
- dbId = None
- if (first, second) in self.qmfIdToDbIdMap:
- dbId = self.qmfIdToDbIdMap[(first, second)]
- else:
- try:
- try:
- conn = self.dbConn.getConnection()
- cursor = conn.cursor()
- cursor.execute("select id from %s where source_scope_id = %s and source_object_id = %s" \
- % (self.dbStyle.pythonClassToDBTable(cls.__name__), first, second));
- rec = cursor.fetchone()
- dbId = rec[0]
- self.qmfIdToDbIdMap[(first, second)] = dbId
- except Exception:
- raise ObjectNotFound()
- finally:
- conn.close()
- return dbId
- else:
- raise ObjectNotFound()
+# def getObjectId(self, cls, id, conn):
+# if isinstance(id, qpid.qmfconsole.ObjectId):
+# first = id.first
+# second = id.second
+# dbId = None
+# if (first, second) in self.qmfIdToDbIdMap:
+# dbId = self.qmfIdToDbIdMap[(first, second)]
+# else:
+# try:
+# cursor = conn.cursor()
+# cursor.execute("select id from %s where source_scope_id = %s and source_object_id = %s" \
+# % (self.dbStyle.pythonClassToDBTable(cls.__name__), first, second));
+# rec = cursor.fetchone()
+# dbId = rec[0]
+# self.qmfIdToDbIdMap[(first, second)] = dbId
+# except Exception:
+# raise ObjectNotFound()
+# return dbId
+# else:
+# raise ObjectNotFound()
def __pythonValueToDB(self, key, value):
if key == "qmfClassKey":
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2008-11-19 16:40:42 UTC (rev 2843)
+++ mgmt/trunk/mint/python/mint/update.py 2008-11-19 17:21:39 UTC (rev 2844)
@@ -38,6 +38,7 @@
pass
def run(self):
+ conn = self.model.dbConn.getConnection()
while True:
try:
priority, update = self.updates.get(True, 1)
@@ -54,8 +55,10 @@
continue
try:
- update.process(self.model)
+ update.process(self.model, conn)
+ conn.commit()
except:
+ conn.rollback()
log.exception("Update failed")
pass
@@ -70,10 +73,10 @@
def getStatsClass(self, cls):
return cls + "Stats"
- def process(self):
+ def process(self, model, conn):
pass
- def processAttributes(self, attrs, cls, model):
+ def processAttributes(self, attrs, cls, model, conn):
results = {}
orphan = False
@@ -82,45 +85,39 @@
if name in mint.schema.schemaReservedWordsMap:
name = mint.schema.schemaReservedWordsMap.get(name)
- try:
- if not hasattr(getattr(mint, cls), name):
- # Discard attrs that we don't have in our schema
- log.debug("Class '%s' has no field '%s'" % ("mint.schema." + cls, name))
- elif key.type == 10:
- # Navigate to referenced objects
- if name.endswith("Ref"):
- name = name[:-3]
- className = name[0].upper() + name[1:]
- otherClass = getattr(mint, className, None)
- if otherClass:
- foreignKey = name + "_id"
- try:
- results[foreignKey] = model.getObjectId(otherClass, value)
- except KeyError:
- log.info("Referenced object %s '%s' not found by key '%s'" % (className, value, foreignKey))
- except mint.ObjectNotFound:
- if not orphan:
- log.info("Referenced object %s '%s' not found, deferring creation of orphan object" % (className, value))
- # store object in orphan map, will be picked up later when parent info is received
- if (className, value.first, value.second) not in model.orphanObjectMap:
- model.orphanObjectMap[(className, value.first, value.second)] = set()
- model.orphanObjectMap[(className, value.first, value.second)].add(self)
- orphan = True
- else:
- log.error("Class '%s' not found" % className)
- elif key.type == 8:
- # convert ABSTIME types
- if value:
- results[name] = time_unwarp(datetime.fromtimestamp(value/1000000000))
- else:
- results[name] = None
- elif key.type == 14:
- # convert UUIDs into their string representation, to be handled by sqlobject
- results[name] = str(value)
+ if not hasattr(getattr(mint, cls), name):
+ # Discard attrs that we don't have in our schema
+ log.debug("Class '%s' has no field '%s'" % ("mint.schema." + cls, name))
+ elif key.type == 10:
+ # Navigate to referenced objects
+ if name.endswith("Ref"):
+ name = name[:-3]
+ className = name[0].upper() + name[1:]
+ otherClass = getattr(mint, className, None)
+ if otherClass:
+ foreignKey = name + "_id"
+ if (value.first, value.second) in model.qmfIdToDbIdMap:
+ results[foreignKey] = model.qmfIdToDbIdMap[(value.first, value.second)]
+ elif not orphan:
+ log.info("Referenced object %s '%s' not found, deferring creation of orphan object" % (className, value))
+ # store object in orphan map, will be picked up later when parent info is received
+ if (className, value.first, value.second) not in model.orphanObjectMap:
+ model.orphanObjectMap[(className, value.first, value.second)] = set()
+ model.orphanObjectMap[(className, value.first, value.second)].add(self)
+ orphan = True
else:
- results[name] = value
- except Exception:
- continue
+ log.error("Class '%s' not found" % className)
+ elif key.type == 8:
+ # convert ABSTIME types
+ if value:
+ results[name] = time_unwarp(datetime.fromtimestamp(value/1000000000))
+ else:
+ results[name] = None
+ elif key.type == 14:
+ # convert UUIDs into their string representation, to be handled by sqlobject
+ results[name] = str(value)
+ else:
+ results[name] = value
if orphan:
return None
else:
@@ -130,165 +127,127 @@
def __init__(self, broker, obj):
ModelUpdate.__init__(self, broker, obj)
- def process(self, model):
- try:
- pkg, cls, hash = self.qmfObj.getClassKey()
- origCls = cls
- if cls in mint.schema.schemaReservedWordsMap:
- cls = mint.schema.schemaReservedWordsMap.get(cls)
- cls = cls[0].upper()+cls[1:]
- sqlCls = model.dbStyle.pythonClassToDBTable(cls)
+ def process(self, model, conn):
+ pkg, cls, hash = self.qmfObj.getClassKey()
+ origCls = cls
+ if cls in mint.schema.schemaReservedWordsMap:
+ cls = mint.schema.schemaReservedWordsMap.get(cls)
+ cls = cls[0].upper()+cls[1:]
+ sqlCls = model.dbStyle.pythonClassToDBTable(cls)
- if not hasattr(mint, cls):
- # Discard classes that we don't have in our schema
- log.debug("Class '%s' is not in the schema" % (cls))
- return
+ if not hasattr(mint, cls):
+ # Discard classes that we don't have in our schema
+ log.debug("Class '%s' is not in the schema" % (cls))
+ return
- properties = self.qmfObj.getProperties()
- timestamps = self.qmfObj.getTimestamps()
- id = self.qmfObj.getObjectId()
+ properties = self.qmfObj.getProperties()
+ timestamps = self.qmfObj.getTimestamps()
+ id = self.qmfObj.getObjectId()
- attrs = self.processAttributes(properties, cls, model)
- if attrs == None:
- # object is orphan, a parent dependency was not found;
- # insertion in db is deferred until parent info is received
- return
+ attrs = self.processAttributes(properties, cls, model, conn)
+ if attrs == None:
+ # object is orphan, a parent dependency was not found;
+ # insertion in db is deferred until parent info is received
+ return
- attrs["recTime"] = time_unwarp(datetime.fromtimestamp(timestamps[0]/1000000000))
- attrs["creationTime"] = time_unwarp(datetime.fromtimestamp(timestamps[1]/1000000000))
- if timestamps[2] != 0:
- attrs["deletionTime"] = time_unwarp(datetime.fromtimestamp(timestamps[2]/1000000000))
- log.debug("%s(%s) marked deleted", cls, id)
+ attrs["recTime"] = time_unwarp(datetime.fromtimestamp(timestamps[0]/1000000000))
+ attrs["creationTime"] = time_unwarp(datetime.fromtimestamp(timestamps[1]/1000000000))
+ if timestamps[2] != 0:
+ attrs["deletionTime"] = time_unwarp(datetime.fromtimestamp(timestamps[2]/1000000000))
+ log.debug("%s(%s) marked deleted", cls, id)
- attrs["sourceScopeId"] = id.first
- attrs["sourceObjectId"] = id.second
- attrs["qmfClassKey"] = "%s, %s, %s" % (pkg, origCls, hash)
- attrs["managedBroker"] = str(self.broker.getBrokerId())
+ attrs["sourceScopeId"] = id.first
+ attrs["sourceObjectId"] = id.second
+ attrs["qmfClassKey"] = "%s, %s, %s" % (pkg, origCls, hash)
+ attrs["managedBroker"] = str(self.broker.getBrokerId())
- try:
- try:
- conn = model.dbConn.getConnection()
- cursor = conn.cursor()
- sql = model.generateSQLUpdate(sqlCls, attrs, id)
+ cursor = conn.cursor()
+ sql = model.generateSQLUpdate(sqlCls, attrs, id)
+ #log.debug("SQL: %s", sql)
+ cursor.execute(sql)
+ if cursor.rowcount == 0:
+ # update failed, need to insert
+ sql = model.generateSQLInsert(sqlCls, attrs)
+ #log.debug("SQL: %s", sql)
+ cursor.execute(sql)
+ log.debug("%s(%s) created", cls, id)
+
+ if (id.first, id.second) not in model.qmfIdToDbIdMap:
+ sql = " ; select currval('%s_id_seq')" % (sqlCls)
+ #log.debug("SQL: %s", sql)
+ cursor.execute(sql)
+ rec = cursor.fetchone()
+ dbId = rec[0]
+ model.qmfIdToDbIdMap[(id.first, id.second)] = dbId
+
+ if cls == "Broker" and str(self.broker.getBrokerId()) in model.managedBrokers:
+ broker, dbObjId = model.managedBrokers[str(self.broker.getBrokerId())]
+ if dbObjId == 0:
+ sql = model.generateSQLUpdateWhere("broker_registration", \
+ {"broker_id": model.qmfIdToDbIdMap[(id.first, id.second)]}, \
+ {"url": self.broker.getFullUrl()})
#log.debug("SQL: %s", sql)
cursor.execute(sql)
- if cursor.rowcount == 0:
- sql = model.generateSQLInsert(sqlCls, attrs)
- #log.debug("SQL: %s", sql)
- cursor.execute(sql)
- log.debug("%s(%s) created", cls, id)
- conn.commit()
- except Exception, e:
- conn.rollback()
- print e
- print_exc()
- finally:
- conn.close()
+ model.managedBrokers[str(self.broker.getBrokerId())] = (broker, dbId)
- if (cls, id.first, id.second) in model.orphanObjectMap:
- # this object is the parent of orphan objects in the map, re-enqueue for insertion
- orphanObjects = model.orphanObjectMap.pop((cls, id.first, id.second))
- for orphanObj in orphanObjects:
- model.updateThread.enqueue(orphanObj)
- log.info("Inserted %d orphan objects whose creation had been deferred" % (len(orphanObjects)))
+ if (cls, id.first, id.second) in model.orphanObjectMap:
+ # this object is the parent of orphan objects in the map, re-enqueue for insertion
+ orphanObjects = model.orphanObjectMap.pop((cls, id.first, id.second))
+ for orphanObj in orphanObjects:
+ model.updateThread.enqueue(orphanObj)
+ log.info("Inserted %d orphan objects whose creation had been deferred" % (len(orphanObjects)))
- if cls == "Broker":
- if str(self.broker.getBrokerId()) in model.managedBrokers:
- broker, dbObjId = model.managedBrokers[str(self.broker.getBrokerId())]
- if dbObjId == 0:
- try:
- try:
- conn = model.dbConn.getConnection()
- cursor = conn.cursor()
- sql = model.generateSQLSelectWhere(sqlCls, {"managed_broker": str(self.broker.getBrokerId())})
- #log.debug("SQL: %s", sql)
- cursor.execute(sql)
- rec = cursor.fetchone()
- dbObjId = rec[0]
- ###cursor = conn.cursor()
- sql = model.generateSQLUpdateWhere("broker_registration", {"broker_id": dbObjId}, \
- {"url": self.broker.getFullUrl()})
- #log.debug("SQL: %s", sql)
- cursor.execute(sql)
- conn.commit()
- model.managedBrokers[str(self.broker.getBrokerId())] = (broker, dbObjId)
- except Exception, e:
- conn.rollback()
- print e
- print_exc()
- finally:
- conn.close()
- except:
- print_exc()
-
class StatisticUpdate(ModelUpdate):
def __init__(self, broker, obj):
ModelUpdate.__init__(self, broker, obj)
- def process(self, model):
- try:
- pkg, cls, hash = self.qmfObj.getClassKey()
+ def process(self, model, conn):
+ pkg, cls, hash = self.qmfObj.getClassKey()
- origCls = cls
- if cls in mint.schema.schemaReservedWordsMap:
- cls = mint.schema.schemaReservedWordsMap.get(cls)
- cls = cls[0].upper()+cls[1:]
- sqlCls = model.dbStyle.pythonClassToDBTable(cls)
+ origCls = cls
+ if cls in mint.schema.schemaReservedWordsMap:
+ cls = mint.schema.schemaReservedWordsMap.get(cls)
+ cls = cls[0].upper()+cls[1:]
+ sqlCls = model.dbStyle.pythonClassToDBTable(cls)
- if not hasattr(mint, cls):
- # Discard classes that we don't have in our schema
- log.debug("Class '%s' is not in the schema" % (cls))
- return
+ if not hasattr(mint, cls):
+ # Discard classes that we don't have in our schema
+ log.debug("Class '%s' is not in the schema" % (cls))
+ return
- statistics = self.qmfObj.getStatistics()
- timestamps = self.qmfObj.getTimestamps()
- id = self.qmfObj.getObjectId()
-
- statsCls = self.getStatsClass(cls)
- sqlStatsCls = model.dbStyle.pythonClassToDBTable(statsCls)
+ statistics = self.qmfObj.getStatistics()
+ timestamps = self.qmfObj.getTimestamps()
+ id = self.qmfObj.getObjectId()
- attrs = self.processAttributes(statistics, statsCls, model)
- if attrs == None:
- # object is orphan, a parent dependency was not found;
- # insertion in db is deferred until parent info is received
- return
+ statsCls = self.getStatsClass(cls)
+ sqlStatsCls = model.dbStyle.pythonClassToDBTable(statsCls)
- attrs["recTime"] = time_unwarp(datetime.fromtimestamp(timestamps[0]/1000000000))
+ attrs = self.processAttributes(statistics, statsCls, model, conn)
+ if attrs == None:
+ # object is orphan, a parent dependency was not found;
+ # insertion in db is deferred until parent info is received
+ return
- try:
- try:
- conn = model.dbConn.getConnection()
- cursor = conn.cursor()
- subSql = model.generateSQLSelect(sqlCls, id)
+ attrs["recTime"] = time_unwarp(datetime.fromtimestamp(timestamps[0]/1000000000))
- mintCls = getattr(mint, cls)
- attrs[sqlCls + "_id"] = model.getObjectId(mintCls, id)
- sql = model.generateSQLInsert(sqlStatsCls, attrs)
+ cursor = conn.cursor()
+ subSql = model.generateSQLSelect(sqlCls, id)
+ sql = model.generateSQLInsert(sqlStatsCls, attrs, {sqlCls + "_id": subSql})
+ #log.debug("SQL: %s", sql)
+ cursor.execute(sql)
- #log.debug("SQL: %s", sql)
- cursor.execute(sql)
+ sql = "select currval('%s_id_seq')" % (sqlStatsCls)
+ #log.debug("SQL: %s", sql)
+ cursor.execute(sql)
+ rec = cursor.fetchone()
+ dbStatsId = rec[0]
+ log.debug("%s(%s) created", statsCls, id)
- sql = "select currval('%s_id_seq')" % (sqlStatsCls)
- #log.debug("SQL: %s", sql)
- cursor.execute(sql)
- rec = cursor.fetchone()
- dbStatsId = rec[0]
- log.debug("%s(%s) created", statsCls, id)
+ sql = model.generateSQLUpdate(sqlCls, {"stats_curr_id": dbStatsId}, id, updateStats=True)
+ #log.debug("SQL: %s", sql)
+ cursor.execute(sql)
- sql = model.generateSQLUpdate(sqlCls, {"stats_curr_id": dbStatsId}, id, updateStats=True)
- #log.debug("SQL: %s", sql)
- cursor.execute(sql)
- conn.commit()
- except Exception, e:
- conn.rollback()
- print e
- print_exc()
- finally:
- conn.close()
- except:
- print_exc()
-
class MethodUpdate(ModelUpdate):
def __init__(self, broker, seq, response):
ModelUpdate.__init__(self, broker, response)
15 years, 7 months
rhmessaging commits: r2843 - in mgmt/trunk: mace and 5 other directories.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2008-11-19 11:40:42 -0500 (Wed, 19 Nov 2008)
New Revision: 2843
Added:
mgmt/trunk/mace/
mgmt/trunk/mace/cpp/
mgmt/trunk/mace/cpp/COPYING
mgmt/trunk/mace/cpp/Makefile.am
mgmt/trunk/mace/cpp/README
mgmt/trunk/mace/cpp/bootstrap
mgmt/trunk/mace/cpp/build-aux/
mgmt/trunk/mace/cpp/configure.ac
mgmt/trunk/mace/cpp/etc/
mgmt/trunk/mace/cpp/etc/mace.conf
mgmt/trunk/mace/cpp/m4/
mgmt/trunk/mace/cpp/m4/clock_time.m4
mgmt/trunk/mace/cpp/m4/compiler-flags.m4
mgmt/trunk/mace/cpp/m4/cppunit.m4
mgmt/trunk/mace/cpp/m4/extensions.m4
mgmt/trunk/mace/cpp/src/
mgmt/trunk/mace/cpp/src/GridSim.cpp
mgmt/trunk/mace/cpp/src/Makefile.am
mgmt/trunk/mace/cpp/src/qmfgen/
mgmt/trunk/mace/cpp/src/qmfgen/Makefile.am
mgmt/trunk/mace/cpp/src/qmfgen/condor-management-schema.xml
mgmt/trunk/mace/cpp/src/qmfgen/mace.xml
mgmt/trunk/mace/cpp/src/qmfgen/sesame.xml
Log:
mace - grid simulation
Added: mgmt/trunk/mace/cpp/COPYING
===================================================================
--- mgmt/trunk/mace/cpp/COPYING (rev 0)
+++ mgmt/trunk/mace/cpp/COPYING 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,15 @@
+Copyright (C) 2007 Red Hat Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Added: mgmt/trunk/mace/cpp/Makefile.am
===================================================================
--- mgmt/trunk/mace/cpp/Makefile.am (rev 0)
+++ mgmt/trunk/mace/cpp/Makefile.am 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,14 @@
+AUTOMAKE_OPTIONS = 1.9.6 foreign
+ACLOCAL_AMFLAGS = -I m4
+
+
+EXTRA_DIST = README etc/mace.conf
+
+sysconf_DATA = etc/mace.conf
+
+SUBDIRS = src
+
+# Update libtool, if needed.
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status --recheck
+
Added: mgmt/trunk/mace/cpp/README
===================================================================
--- mgmt/trunk/mace/cpp/README (rev 0)
+++ mgmt/trunk/mace/cpp/README 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,16 @@
+sesame - A System agent for the Qpid Management Framework
+
+Pre-requisites:
+
+ Apache Qpid - You will need either the source tree for Qpid or and
+ installed copy of Qpid. The version must be M4 or later.
+
+ https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid
+
+ Alternatively, you can install the qmf-devel RPM and its dependencies.
+
+
+To use a checkout ./configure --with-qpid-checkout=<path_to_qpid>
+
+* 'make' will build the module
+
Added: mgmt/trunk/mace/cpp/bootstrap
===================================================================
--- mgmt/trunk/mace/cpp/bootstrap (rev 0)
+++ mgmt/trunk/mace/cpp/bootstrap 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# Copyright (C) 2007, 2008 Red Hat Inc.
+#
+# This file is part of Red Hat Messaging.
+#
+# Red Hat Messaging is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+#
+# The GNU Lesser General Public License is available in the file COPYING.
+
+set -e
+aclocal -I m4
+autoheader
+libtoolize --automake
+
+# Create initial Makefile fragments that will force make to generate
+# the real ones.
+cat > src/qmfgen/qmfgen.mk <<EOF
+\$(top_srcdir)/src/qmfgen/qmfgen.mk: force
+ \$(qmfgen_cmd)
+EOF
+
+automake --add-missing
+autoconf
Property changes on: mgmt/trunk/mace/cpp/bootstrap
___________________________________________________________________
Name: svn:executable
+ *
Added: mgmt/trunk/mace/cpp/configure.ac
===================================================================
--- mgmt/trunk/mace/cpp/configure.ac (rev 0)
+++ mgmt/trunk/mace/cpp/configure.ac 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,189 @@
+dnl # Copyright (C) 2007, 2008 Red Hat Inc.
+dnl #
+dnl # This file is part of Red Hat Messaging.
+dnl #
+dnl # Red Hat Messaging is free software; you can redistribute it and/or
+dnl # modify it under the terms of the GNU Lesser General Public
+dnl # License as published by the Free Software Foundation; either
+dnl # version 2.1 of the License, or (at your option) any later version.
+dnl #
+dnl # This library is distributed in the hope that it will be useful,
+dnl # but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl # Lesser General Public License for more details.
+dnl #
+dnl # You should have received a copy of the GNU Lesser General Public
+dnl # License along with this library; if not, write to the Free Software
+dnl # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+dnl # USA
+dnl #
+dnl # The GNU Lesser General Public License is available in the file COPYING.
+dnl
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT([mace], [0.1], [rhemrg-users-list(a)redhat.com])
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects])
+
+# Minimum Autoconf version required.
+AC_PREREQ(2.59)
+
+AC_CONFIG_HEADERS([src/config.h])
+AC_CONFIG_SRCDIR([src/GridSim.cpp])
+
+AC_PROG_CC_STDC
+AM_PROG_CC_C_O
+AC_PROG_CXX
+AC_USE_SYSTEM_EXTENSIONS
+AC_LANG([C++])
+
+AC_ARG_ENABLE(warnings,
+[ --enable-warnings turn on lots of compiler warnings (recommended)],
+[case "${enableval}" in
+ yes|no) ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for warnings option]) ;;
+ esac],
+ [enableval=yes])
+
+# Warnings: Enable as many as possible, keep the code clean. Please
+# do not disable warnings or remove -Werror without discussing on
+# rhm-users list.
+#
+# The following warnings are deliberately omitted, they warn on valid code.
+# -Wunreachable-code -Wpadded -Winline
+# -Wshadow - warns about boost headers.
+
+if test "${enableval}" = yes; then
+ gl_COMPILER_FLAGS(-Werror)
+ gl_COMPILER_FLAGS(-pedantic)
+ gl_COMPILER_FLAGS(-Wall)
+ gl_COMPILER_FLAGS(-Wextra)
+ gl_COMPILER_FLAGS(-Wno-shadow)
+ gl_COMPILER_FLAGS(-Wpointer-arith)
+ gl_COMPILER_FLAGS(-Wcast-qual)
+ gl_COMPILER_FLAGS(-Wcast-align)
+ gl_COMPILER_FLAGS(-Wno-long-long)
+ gl_COMPILER_FLAGS(-Wvolatile-register-var)
+ gl_COMPILER_FLAGS(-Winvalid-pch)
+ gl_COMPILER_FLAGS(-Wno-system-headers)
+ AC_SUBST([WARNING_CFLAGS], [$COMPILER_FLAGS])
+ AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
+ COMPILER_FLAGS=
+fi
+
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+AC_SUBST([LIBTOOL_DEPS])
+
+# Select building against qpid checkout or install.
+AC_ARG_WITH([qpid-checkout],
+ [AS_HELP_STRING([--with-qpid-checkout],
+ [Location of qpid checkout to build against (by default use installed qpid)])])
+
+if test x$with_qpid_checkout != x; then
+ QPID_DIR=$with_qpid_checkout
+ QPID_SRC=$QPID_DIR/cpp/src
+ QMF_GEN=$QPID_DIR/cpp/managementgen/qmf-gen
+ test -f $QPID_SRC/qpid/agent/ManagementAgent.h || \
+ AC_MSG_ERROR([$QPID_DIR does not appear to be a valid qpid checkout.])
+ QPID_LIBS="$QPID_SRC/libqmfagent.la"
+ QPID_CXXFLAGS="-I$QPID_SRC -I${QPID_SRC}/gen"
+else
+ fail=0
+ AC_CHECK_PROG([QMF_GEN], [qmf-gen], [qmf-gen], [no])
+ test $QMF_GEN = no &&
+ AC_MSG_ERROR([Missing required qmf-gen. Install package qmf-devel or use --with-qpid-checkout])
+
+ AC_CHECK_HEADERS([qpid/agent/ManagementAgent.h], , [fail=1])
+ # Give any/all diagnostics before failing.
+ test $fail = 1 &&
+ AC_MSG_ERROR([Missing required qpid libraries/headers. Install package qmf-devel or use --with-qpid-checkout])
+ QPID_LIBS="-lqmfagent"
+fi
+AC_SUBST([QMF_GEN])
+AC_SUBST([QPID_DIR])
+AC_SUBST([QPID_LIBS])
+AC_SUBST([QPID_CXXFLAGS])
+
+# For libraries (libcommon) that use dlopen, dlerror, etc.,
+# test whether we need to link with -ldl.
+gl_saved_libs=$LIBS
+AC_SEARCH_LIBS(dlopen, [dl],
+ [test "$ac_cv_search_dlopen" = "none required" ||
+ LIB_DLOPEN=$ac_cv_search_dlopen])
+AC_SUBST([LIB_DLOPEN])
+LIBS=$gl_saved_libs
+
+# Require libdb_cxx (any version between 4.2 and 4.7), for the library, and for db_cxx.h.
+db4_devel_fail=0
+AC_CHECK_HEADER([db_cxx.h], ,[db4_devel_fail=1])
+test $db4_devel_fail == 1 && \
+ AC_MSG_ERROR([db4-devel package missing. Please ensure both db4 and db4-devel are installed. (hint: "yum install db4-devel" should do it...)])
+
+gl_saved_libs=$LIBS
+AC_SEARCH_LIBS([__db_open], [db_cxx-4.7 db_cxx-4.6 db_cxx-4.5 db_cxx-4.4 db_cxx-4.3 db_cxx-4.2],
+ [test "$ac_cv_search___db_open" = "none required" ||
+ LIB_BERKELEY_DB=$ac_cv_search___db_open],
+ AC_MSG_ERROR([Couldn't find required library in range db_cxx-4.2 through db_cxx-4.6]))
+AC_SUBST([LIB_BERKELEY_DB])
+LIBS=$gl_saved_libs
+
+# Determine how to include db_cxx.h:
+# Red Hat needs <db4/db_cxx.h>, Debian needs <db_cxx.h>.
+AC_CHECK_HEADER([db4/db_cxx.h],
+ [DB_CXX_HEADER_PREFIX=db4/])
+if test x$DB_CXX_HEADER_PREFIX = x; then
+ AC_CHECK_HEADER([db_cxx.h],
+ [DB_CXX_HEADER_PREFIX=])
+fi
+AC_SUBST(DB_CXX_HEADER_PREFIX)
+
+# Set the argument to be used in "libtool -version-info ARG".
+QPID_CURRENT=1
+QPID_REVISION=0
+QPID_AGE=1
+LIBTOOL_VERSION_INFO_ARG=$QPID_CURRENT:$QPID_REVISION:$QPID_AGE
+AC_SUBST(LIBTOOL_VERSION_INFO_ARG)
+
+gl_CLOCK_TIME
+
+AC_ARG_ENABLE([apr-platform],
+ [AS_HELP_STRING([--enable-apr-platform],
+ [use the Apache Portable Runtime library for platform (default no)])],
+ [case $enableval in
+ yes|no) enable_APR_PLATFORM=$enableval;;
+ *) AC_MSG_ERROR([Invalid value for --enable-apr-platform: $enableval]);;
+ esac],
+ [enable_APR_PLATFORM=no]
+)
+AM_CONDITIONAL([USE_APR_PLATFORM], [test x$enable_APR_PLATFORM = xyes])
+
+APR_MINIMUM_VERSION=1.2.2
+AC_SUBST(APR_MINIMUM_VERSION)
+AC_SUBST(APR_CXXFLAGS)
+AC_SUBST(USE_APR_PLATFORM)
+
+if test x$enable_APR_PLATFORM = xyes; then
+ PKG_CHECK_MODULES([APR], [apr-1 >= $APR_MINIMUM_VERSION])
+ APR_CXXFLAGS="$APR_CFLAGS -DUSE_APR_PLATFORM=1"
+ USE_APR_PLATFORM=1
+fi
+
+# We use valgrind for the tests. See if it's available.
+AC_CHECK_PROG([VALGRIND], [valgrind], [valgrind])
+
+# If rpmlint is available we'll run it when building RPMs.
+AC_CHECK_PROG([RPMLINT], [rpmlint], [rpmlint])
+AM_CONDITIONAL([HAS_RPMLINT], [test -n "$RPMLINT"])
+
+# Also doxygen for documentation...
+AC_CHECK_PROG([do_doxygen], [doxygen], [yes])
+AM_CONDITIONAL([DOXYGEN], [test x$do_doxygen = xyes])
+
+AC_CONFIG_FILES([
+ Makefile
+ src/Makefile
+ src/qmfgen/Makefile
+ ])
+
+AC_OUTPUT
Added: mgmt/trunk/mace/cpp/etc/mace.conf
===================================================================
--- mgmt/trunk/mace/cpp/etc/mace.conf (rev 0)
+++ mgmt/trunk/mace/cpp/etc/mace.conf 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,45 @@
+##
+## sesame configuration
+##
+
+##===================
+## Broker Connection
+##===================
+
+##
+## Set the host and port of the broker that this agent shall attempt to
+## connect to. The port will default to the appropriate value based on the
+## protocol.
+##
+## For proto=tcp, the default port is 5672
+## proto=ssl, 5671
+## proto=rdma, 5672
+##
+#host=localhost
+#proto=tcp
+#port=5672
+
+##======================
+## Agent Authentication
+##======================
+
+##
+## Set the SASL mechanism (PLAIN by default), and the username and password
+## to be used when authenticating to the broker. If you wish to not store
+## the password in this configuration file, you may use pwd-file to point
+## to an access-restricted file containing the password.
+##
+#mech=PLAIN
+#uid=guest
+#pwd=guest
+#pwd-file=/etc/sesame/password
+
+##==============
+## Data Storage
+##==============
+
+##
+## Set the path to the directory where sesame will store persistent data.
+##
+#state-dir=/var/sesame
+
Added: mgmt/trunk/mace/cpp/m4/clock_time.m4
===================================================================
--- mgmt/trunk/mace/cpp/m4/clock_time.m4 (rev 0)
+++ mgmt/trunk/mace/cpp/m4/clock_time.m4 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,30 @@
+# clock_time.m4 serial 8
+dnl Copyright (C) 2002-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Check for clock_gettime and clock_settime, and set LIB_CLOCK_GETTIME.
+# For a program named, say foo, you should add a line like the following
+# in the corresponding Makefile.am file:
+# foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
+
+AC_DEFUN([gl_CLOCK_TIME],
+[
+ dnl Persuade glibc and Solaris <time.h> to declare these functions.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
+ # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
+
+ # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
+ # programs in the package would end up linked with that potentially-shared
+ # library, inducing unnecessary run-time overhead.
+ gl_saved_libs=$LIBS
+ AC_SEARCH_LIBS(clock_gettime, [rt posix4],
+ [test "$ac_cv_search_clock_gettime" = "none required" ||
+ LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
+ AC_SUBST([LIB_CLOCK_GETTIME])
+ AC_CHECK_FUNCS(clock_gettime clock_settime)
+ LIBS=$gl_saved_libs
+])
Added: mgmt/trunk/mace/cpp/m4/compiler-flags.m4
===================================================================
--- mgmt/trunk/mace/cpp/m4/compiler-flags.m4 (rev 0)
+++ mgmt/trunk/mace/cpp/m4/compiler-flags.m4 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,23 @@
+# serial 3
+# Find valid warning flags for the C Compiler. -*-Autoconf-*-
+dnl Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl Written by Jesse Thilo.
+
+AC_DEFUN([gl_COMPILER_FLAGS],
+ [AC_MSG_CHECKING(whether compiler accepts $1)
+ AC_SUBST(COMPILER_FLAGS)
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $1"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $1"
+ AC_TRY_COMPILE(,
+ [int x;],
+ COMPILER_FLAGS="$COMPILER_FLAGS $1"
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no))
+ CFLAGS="$ac_save_CFLAGS"
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ ])
Added: mgmt/trunk/mace/cpp/m4/cppunit.m4
===================================================================
--- mgmt/trunk/mace/cpp/m4/cppunit.m4 (rev 0)
+++ mgmt/trunk/mace/cpp/m4/cppunit.m4 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,89 @@
+dnl
+dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl
+AC_DEFUN([AM_PATH_CPPUNIT],
+[
+
+AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)],
+ cppunit_config_prefix="$withval", cppunit_config_prefix="")
+AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)],
+ cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
+
+ if test x$cppunit_config_exec_prefix != x ; then
+ cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
+ if test x${CPPUNIT_CONFIG+set} != xset ; then
+ CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
+ fi
+ fi
+ if test x$cppunit_config_prefix != x ; then
+ cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
+ if test x${CPPUNIT_CONFIG+set} != xset ; then
+ CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
+ fi
+ fi
+
+ AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
+ cppunit_version_min=$1
+
+ AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min)
+ no_cppunit=""
+ if test "$CPPUNIT_CONFIG" = "no" ; then
+ AC_MSG_RESULT(no)
+ no_cppunit=yes
+ else
+ CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
+ CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
+ cppunit_version=`$CPPUNIT_CONFIG --version`
+
+ cppunit_major_version=`echo $cppunit_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ cppunit_minor_version=`echo $cppunit_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ cppunit_micro_version=`echo $cppunit_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+
+ cppunit_major_min=`echo $cppunit_version_min | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ if test "x${cppunit_major_min}" = "x" ; then
+ cppunit_major_min=0
+ fi
+
+ cppunit_minor_min=`echo $cppunit_version_min | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ if test "x${cppunit_minor_min}" = "x" ; then
+ cppunit_minor_min=0
+ fi
+
+ cppunit_micro_min=`echo $cppunit_version_min | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test "x${cppunit_micro_min}" = "x" ; then
+ cppunit_micro_min=0
+ fi
+
+ cppunit_version_proper=`expr \
+ $cppunit_major_version \> $cppunit_major_min \| \
+ $cppunit_major_version \= $cppunit_major_min \& \
+ $cppunit_minor_version \> $cppunit_minor_min \| \
+ $cppunit_major_version \= $cppunit_major_min \& \
+ $cppunit_minor_version \= $cppunit_minor_min \& \
+ $cppunit_micro_version \>= $cppunit_micro_min `
+
+ if test "$cppunit_version_proper" = "1" ; then
+ AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
+ else
+ AC_MSG_RESULT(no)
+ no_cppunit=yes
+ fi
+ fi
+
+ if test "x$no_cppunit" = x ; then
+ ifelse([$2], , :, [$2])
+ else
+ CPPUNIT_CFLAGS=""
+ CPPUNIT_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+
+ AC_SUBST(CPPUNIT_CFLAGS)
+ AC_SUBST(CPPUNIT_LIBS)
+])
Added: mgmt/trunk/mace/cpp/m4/extensions.m4
===================================================================
--- mgmt/trunk/mace/cpp/m4/extensions.m4 (rev 0)
+++ mgmt/trunk/mace/cpp/m4/extensions.m4 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,58 @@
+# serial 4 -*- Autoconf -*-
+# Enable extensions on systems that normally disable them.
+
+# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+# Autoconf. Perhaps we can remove this once we can assume Autoconf
+# 2.61 or later everywhere, but since CVS Autoconf mutates rapidly
+# enough in this area it's likely we'll need to redefine
+# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+[
+ AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+ AC_BEFORE([$0], [AC_RUN_IFELSE])
+
+ AC_REQUIRE([AC_GNU_SOURCE])
+ AC_REQUIRE([AC_AIX])
+ AC_REQUIRE([AC_MINIX])
+
+ AH_VERBATIM([__EXTENSIONS__],
+[/* Enable extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif])
+ AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+ [ac_cv_safe_to_define___extensions__],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
+# define __EXTENSIONS__ 1
+ AC_INCLUDES_DEFAULT])],
+ [ac_cv_safe_to_define___extensions__=yes],
+ [ac_cv_safe_to_define___extensions__=no])])
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+])
+
+# gl_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
+ [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
Added: mgmt/trunk/mace/cpp/src/GridSim.cpp
===================================================================
--- mgmt/trunk/mace/cpp/src/GridSim.cpp (rev 0)
+++ mgmt/trunk/mace/cpp/src/GridSim.cpp 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,365 @@
+
+#include <qpid/management/Manageable.h>
+#include <qpid/management/ManagementObject.h>
+#include <qpid/agent/ManagementAgent.h>
+#include <qpid/sys/Mutex.h>
+#include "qpid/sys/SystemInfo.h"
+#include "qpid/framing/Uuid.h"
+#include "qmf/com/redhat/mace/Package.h"
+#include "qmf/com/redhat/sesame/Package.h"
+#include "qmf/com/redhat/sesame/Sysimage.h"
+#include "qmf/mrg/grid/Package.h"
+#include "qmf/com/redhat/mace/GridSim.h"
+#include "qmf/com/redhat/mace/ArgsGridSimStart.h"
+#include "qmf/mrg/grid/Slot.h"
+#include "qmf/mrg/grid/Job.h"
+#include "qmf/mrg/grid/Scheduler.h"
+
+#include <signal.h>
+#include <unistd.h>
+#include <cstdlib>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+
+using namespace std;
+using qpid::management::ManagementAgent;
+using qpid::management::ManagementObject;
+using qpid::management::Manageable;
+using qpid::management::Args;
+using qpid::management::ObjectId;
+using qpid::sys::Mutex;
+using qpid::framing::Uuid;
+namespace _qmf = qmf::com::redhat;
+namespace _grid = qmf::mrg::grid;
+
+class GridSim : public Manageable
+{
+ ManagementAgent* agent;
+ _qmf::mace::GridSim* mgmtObject;
+ uint32_t execNodeCount;
+ uint32_t slotsPerNode;
+ uint32_t slotCount;
+ uint32_t jobCount;
+ uint8_t activityLevel;
+ map<Uuid, ManagementObject*> systems;
+ vector<ManagementObject*> slots;
+ vector<ManagementObject*> jobs;
+ _grid::Scheduler* scheduler;
+
+public:
+
+ GridSim(ManagementAgent* agent, const string& uuidFile);
+ ~GridSim() { mgmtObject->resourceDestroy(); }
+
+ ManagementObject* GetManagementObject(void) const
+ { return mgmtObject; }
+ void run();
+ Manageable::status_t ManagementMethod (uint32_t methodId, Args& args, string& text);
+};
+
+GridSim::GridSim(ManagementAgent* _agent, const string& uuidFile) :
+ agent(_agent), mgmtObject(new _qmf::mace::GridSim(agent, this)),
+ execNodeCount(0), slotsPerNode(0), slotCount(0),
+ jobCount(0), activityLevel(0), scheduler(0)
+{
+ mgmtObject->set_execNodeCount(execNodeCount);
+ mgmtObject->set_slotsPerNode(slotsPerNode);
+ mgmtObject->set_slotCount(slotCount);
+ mgmtObject->set_jobCount(jobCount);
+ mgmtObject->set_activityLevel(activityLevel);
+
+ agent->addObject(mgmtObject, 1);
+}
+
+void GridSim::run()
+{
+ for (;;) {
+ ::sleep(5);
+ }
+}
+
+Manageable::status_t GridSim::ManagementMethod(uint32_t methodId, Args& args, string& text)
+{
+ if (methodId == _qmf::mace::GridSim::METHOD_RESET) {
+ for (map<Uuid, ManagementObject*>::iterator iter = systems.begin();
+ iter != systems.end(); iter++)
+ iter->second->resourceDestroy();
+ systems.clear();
+
+ for (vector<ManagementObject*>::iterator iter = slots.begin();
+ iter != slots.end(); iter++)
+ (*iter)->resourceDestroy();
+ slots.clear();
+
+ for (vector<ManagementObject*>::iterator iter = jobs.begin();
+ iter != jobs.end(); iter++)
+ (*iter)->resourceDestroy();
+ jobs.clear();
+
+ if (scheduler) {
+ scheduler->resourceDestroy();
+ scheduler = 0;
+ }
+
+ return STATUS_OK;
+ }
+ else if (methodId == _qmf::mace::GridSim::METHOD_START) {
+ _qmf::mace::ArgsGridSimStart& ioArgs = (_qmf::mace::ArgsGridSimStart&) args;
+ cout << "START: nodes=" << ioArgs.i_execNodes << " s/n=" << ioArgs.i_slotsPerNode <<
+ " jobs=" << ioArgs.i_jobs << " act=" << (int) ioArgs.i_activity << endl;
+
+ mgmtObject->set_execNodeCount(ioArgs.i_execNodes);
+ mgmtObject->set_slotsPerNode(ioArgs.i_slotsPerNode);
+ mgmtObject->set_slotCount(ioArgs.i_execNodes * ioArgs.i_slotsPerNode);
+ mgmtObject->set_jobCount(ioArgs.i_jobs);
+ mgmtObject->set_activityLevel(ioArgs.i_activity);
+
+ string schedSysName;
+
+ // Do scheduler
+ scheduler = new _grid::Scheduler(agent, this);
+ scheduler->set_Pool("Pool");
+ scheduler->set_System(schedSysName);
+
+ // Do systems
+ for (uint32_t i = 0; i < ioArgs.i_execNodes; i++) {
+ Uuid uuid(true);
+ _qmf::sesame::Sysimage* si(new _qmf::sesame::Sysimage(agent, this, uuid));
+ si->set_osName("Linux");
+ si->set_nodeName("dhcp-100-18-254.bos.redhat.com");
+ si->set_release("2.6.26.6-49.fc8");
+ si->set_version("#1 SMP Fri Oct 17 15:59:36 EDT 2008");
+ si->set_machine("i686");
+ si->set_memTotal(4096);
+ si->set_swapTotal(8192);
+ agent->addObject(si);
+ systems[uuid] = si;
+
+ if (i == 0) {
+ stringstream id;
+ id << uuid;
+ schedSysName = id.str();
+ }
+ }
+
+ // Do scheduler
+ scheduler = new _grid::Scheduler(agent, this);
+ scheduler->set_Pool("Pool");
+ scheduler->set_System(schedSysName);
+ ObjectId schedId = agent->addObject(scheduler);
+
+ // Do slots
+ for (map<Uuid, ManagementObject*>::iterator iter = systems.begin();
+ iter != systems.end(); iter++) {
+ stringstream id;
+ id << iter->first;
+
+ for (uint32_t i = 0; i < ioArgs.i_slotsPerNode; i++) {
+ _grid::Slot* slot(new _grid::Slot(agent, this));
+ slot->set_Pool("Pool");
+ slot->set_System(id.str());
+ agent->addObject(slot);
+ slots.push_back(slot);
+ }
+ }
+
+ // Do jobs
+ for (uint32_t i = 0; i < ioArgs.i_jobs; i++) {
+ _grid::Job* job(new _grid::Job(agent, this));
+ job->set_schedulerRef(schedId);
+ agent->addObject(job);
+ jobs.push_back(job);
+ }
+
+ return STATUS_OK;
+ }
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+struct Option {
+ string placeholder;
+ string defaultVal;
+ string help;
+ string value;
+
+ Option() {}
+ Option(const string& p, const string& d, const string& h) :
+ placeholder(p), defaultVal(d), help(h), value(d) {}
+};
+
+static map<string, Option> options;
+
+//==============================================================
+// Main program
+//==============================================================
+
+ManagementAgent::Singleton* singleton;
+
+void usage()
+{
+ cerr << "Usage: sesame [OPTIONS]" << endl << endl;
+ for (map<string, Option>::iterator iter = options.begin();
+ iter != options.end(); iter++)
+ cerr << " --" << iter->first << " " << iter->second.placeholder <<
+ " (" << iter->second.defaultVal << ") " << iter->second.help << endl;
+ exit(1);
+}
+
+void configure(int argc, char** argv)
+{
+ // Check to see if the config file was overridden
+ for (int i = 1; i < argc; i++) {
+ string arg(argv[i]);
+ if (arg == "--config") {
+ i++;
+ if (i == argc)
+ usage();
+ options["config"].value = string(argv[i]);
+ }
+ if (arg == "--no-config")
+ options["config"].value = string();
+ if (arg == "--help")
+ usage();
+ }
+
+ // Open the config file, if present, and load its values as overrides
+ // to the defaults.
+ if (!options["config"].value.empty()) {
+ ifstream input(options["config"].value.c_str());
+ if (!input.good()) {
+ cerr << "Can't open config file: " << options["config"].value << endl;
+ exit(1);
+ }
+
+ while (!input.eof()) {
+ char line[512];
+ char* cursor;
+ char* val;
+
+ input.getline(line, 512);
+ if (input.fail() && !input.eof()) {
+ cerr << "Line too long in config file: " << options["config"].value << endl;
+ exit(1);
+ }
+
+ if (line[0] != '\0' && line[0] != '#') {
+ cursor = line;
+ while (*cursor != '\0' && *cursor != '=')
+ cursor++;
+ if (*cursor == '\0') {
+ cerr << "Missing value in config line: " << line << endl;
+ exit(1);
+ }
+ *cursor = '\0';
+ val = ++cursor;
+
+ map<string, Option>::iterator iter = options.find(line);
+ if (iter == options.end()) {
+ cerr << "Config file option '" << line << "' not known" << endl;
+ exit(1);
+ }
+
+ iter->second.value = string(val);
+ }
+ }
+
+ input.close();
+ }
+
+ // Run through the command line options and override the defaults and the config file.
+ for (int i = 1; i < argc; i++) {
+ string arg(argv[i]);
+ if (arg == "--no-config")
+ continue;
+ if (arg.substr(0, 2) != "--") {
+ cerr << "Invalid argument: " << arg << endl;
+ usage();
+ }
+
+ map<string, Option>::iterator iter = options.find(arg.substr(2));
+ if (iter == options.end()) {
+ cerr << "Unknown option: " << arg << endl;
+ usage();
+ }
+
+ i++;
+ if (i == argc) {
+ cerr << "No value for option: " << arg << endl;
+ usage();
+ }
+
+ iter->second.value = string(argv[i]);
+ }
+}
+
+void getPassword()
+{
+ string file(options["pwd-file"].value);
+ if (file.empty())
+ return;
+
+ ifstream input(file.c_str());
+ if (!input.good()) {
+ cerr << "Can't read password file" << endl;
+ exit(1);
+ }
+
+ input >> options["pwd"].value;
+ input.close();
+}
+
+void shutdown(int)
+{
+ delete singleton;
+ exit(0);
+}
+
+int main_int(int argc, char** argv)
+{
+ singleton = new ManagementAgent::Singleton();
+ signal(SIGINT, shutdown);
+
+ options["no-config"] = Option("", "", "Don't read configuration file");
+ options["config"] = Option("FILE", CONF_FILE, "Configuration file");
+ options["host"] = Option("ADDR", "localhost", "Broker host name or IP address");
+ options["port"] = Option("N", "5672", "Port for broker service");
+ options["proto"] = Option("NAME", "tcp", "Protocol for broker communication");
+ options["mech"] = Option("NAME", "PLAIN", "Authentication mechanism");
+ options["uid"] = Option("NAME", "guest", "Authentication user name");
+ options["pwd"] = Option("PASSWORD", "guest", "Authentication password");
+ options["pwd-file"] = Option("FILE", "", "File containing password");
+ options["state-dir"] = Option("DIR", LOCSTATE_DIR, "Directory for stored state");
+
+ configure(argc, argv);
+ getPassword();
+
+ // Create the qmf management agent
+ ManagementAgent* agent = singleton->getInstance();
+
+ // Register the schema with the agent
+ _qmf::mace::Package mPackageInit(agent);
+ _qmf::sesame::Package sPackageInit(agent);
+ _grid::Package gPackageInit(agent);
+
+ // Start the agent. It will attempt to make a connection to the
+ // management broker
+ agent->init(options["host"].value, ::atoi(options["port"].value.c_str()), 5, false,
+ options["state-dir"].value + "/agentdata",
+ options["uid"].value, options["pwd"].value,
+ options["mech"].value, options["proto"].value);
+
+ // Allocate core object
+ GridSim core(agent, options["state-dir"].value + "/uuid");
+ core.run();
+}
+
+int main(int argc, char** argv)
+{
+ try {
+ return main_int(argc, argv);
+ } catch(std::exception& e) {
+ cout << "Top Level Exception: " << e.what() << endl;
+ }
+}
+
Added: mgmt/trunk/mace/cpp/src/Makefile.am
===================================================================
--- mgmt/trunk/mace/cpp/src/Makefile.am (rev 0)
+++ mgmt/trunk/mace/cpp/src/Makefile.am 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,14 @@
+SUBDIRS = qmfgen
+mace_CXXFLAGS = -I$(QPID_DIR)/cpp/src -I$(QPID_DIR)/cpp/src/gen -Iqmfgen \
+ -DCONF_FILE=\"$(sysconfdir)/mace.conf\" \
+ -DLOCSTATE_DIR=\"$(localstatedir)/mace\"
+
+include qmfgen/qmfgen.mk
+
+bin_PROGRAMS = mace
+nodist_mace_SOURCES = $(qmfgen_sources)
+mace_SOURCES = GridSim.cpp
+
+mace_LDADD = $(QPID_LIBS)
+
+
Added: mgmt/trunk/mace/cpp/src/qmfgen/Makefile.am
===================================================================
--- mgmt/trunk/mace/cpp/src/qmfgen/Makefile.am (rev 0)
+++ mgmt/trunk/mace/cpp/src/qmfgen/Makefile.am 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,15 @@
+
+force:
+
+SCHEMADOCS = mace.xml condor-management-schema.xml sesame.xml
+EXTRA_DIST = $(SCHEMADOCS)
+
+qmfgen_cmd=$(QMF_GEN) -o $(srcdir)/qmf -m qmfgen.mk -p qmfgen $(SCHEMADOCS)
+
+include qmfgen.mk
+
+all : $(SCHEMADOCS)
+ $(qmfgen_cmd)
+
+clean:
+ rm -rf $(srcdir)/qmf
Added: mgmt/trunk/mace/cpp/src/qmfgen/condor-management-schema.xml
===================================================================
--- mgmt/trunk/mace/cpp/src/qmfgen/condor-management-schema.xml (rev 0)
+++ mgmt/trunk/mace/cpp/src/qmfgen/condor-management-schema.xml 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,713 @@
+<schema package="mrg.grid">
+
+<!--
+/*
+ * Copyright 2008 Red Hat, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<group name="daemon-stats">
+ <property name="CondorPlatform"
+ type="sstr"
+ desc="The Condor platform string for the daemon's platform"/>
+ <property name="CondorVersion"
+ type="sstr"
+ desc="The Condor version string for the daemon's version"/>
+ <property name="DaemonStartTime"
+ type="absTime" unit="nanosecond"
+ desc="Number of nanoseconds since epoch when the daemon
+ was started"/>
+
+ <statistic name="MonitorSelfAge" type="uint32"/>
+ <statistic name="MonitorSelfCPUUsage" type="double"/>
+ <statistic name="MonitorSelfImageSize" type="double"/>
+ <statistic name="MonitorSelfRegisteredSocketCount" type="uint32"/>
+ <statistic name="MonitorSelfResidentSetSize" type="uint32"/>
+ <statistic name="MonitorSelfTime" type="absTime"/>
+</group>
+
+<!--
+CpuBusy = ((LoadAvg - CondorLoadAvg) >= 0.500000)
+CpuBusyTime = 0
+CpuIsBusy = FALSE
+
+HasCheckpointing = TRUE
+HasFileTransfer = TRUE
+HasIOProxy = TRUE
+HasJava = TRUE
+HasJICLocalConfig = TRUE
+HasJICLocalStdin = TRUE
+HasJobDeferral = TRUE
+HasMPI = TRUE
+HasPerFileEncryption = TRUE
+HasReconnect = TRUE
+HasRemoteSyscalls = TRUE
+HasTDP = TRUE
+HasVM = FALSE
+
+JavaMFlops = 8.156164
+JavaVendor = "Free Software Foundation, Inc."
+JavaVersion = "1.4.2"
+
+Subnet = "10.16.43"
+
+Set by Collector:
+ UpdateSequenceNumber = 627
+ UpdatesHistory = "0x00000000000000000000000000000000"
+ UpdatesLost = 0
+ UpdatesSequenced = 58
+ UpdatesTotal = 59
+-->
+
+ <class name="Slot">
+
+ <group name="daemon-stats"/>
+
+ <property name="Pool" type="sstr" index="y"/>
+ <property name="System" type="sstr" index="y"/>
+
+ <property name="AccountingGroup"
+ type="sstr"
+ optional="y"
+ desc="AccountingGroup of the running job, fully
+ qualified with a UidDomain, UidDomain taken from
+ RemoteUser, only present when a job is
+ executing"/>
+ <statistic name="Activity"
+ type="sstr"
+ desc="One of: Idle, No job activity; Busy, Job is
+ running; Suspended, Job is suspended; Vacating,
+ Job is being removed; Killing, Job is being
+ killed; Benchmarking, Benchmarks being run"/>
+ <property name="Arch"
+ type="sstr"
+ desc="Slot's architecture, e.g.: ALPHA, Diginal Alpha;
+ HPPA1, HP PA-RISC 1.x (7000 series); HPPA2, HP
+ PA-RISC 2.x (8000 series); IA64, Intel Itanium;
+ INTEL, Intel x86 (Pentium, Xeon, etc); SGI, SGI
+ MIPS; SUN4u, Sun UltraSparc; SUN4x, Sun Sparc
+ (not UltraSparc); PPC, Power Macintosh; PPC64,
+ 64-bit Power Macintosh; X86_64, AMD/Intel 64-bit
+ x86"/>
+ <property name="CheckpointPlatform"
+ type="sstr"
+ desc="Opaque string encoding OS, hardware and kernel
+ attributes"/>
+ <property name="ClientMachine"
+ type="sstr"
+ optional="y"
+ desc="The hostname of the machine that has claimed the
+ slot, only present when slot is claimed"/>
+ <statistic name="ClockDay"
+ type="uint32"
+ desc="Day of the week: 0 = Sunday, 1 = Monday, ..., 6 =
+ Saturaday"/>
+ <statistic name="ClockMin"
+ type="uint32" unit="minute"
+ desc="Number of elapsed minutes since midnight"/>
+ <property name="ConcurrencyLimits"
+ type="sstr"
+ optional="y"
+ desc="Set of concurrency limits associated with the
+ current job"/>
+ <statistic name="CondorLoadAvg"
+ type="double"
+ desc="Portion of LoadAvg generated by Condor (job or
+ benchmark)"/>
+ <statistic name="ConsoleIdle"
+ type="uint32" unit="second"
+ desc="Seconds since activity on console keyboard or
+ mouse"/>
+ <property name="Cpus"
+ type="uint32"
+ desc="Number of CPUs in slot"/>
+ <!-- XXX: CurrentRank could quite possibly be a statistic -->
+ <property name="CurrentRank"
+ type="double"
+ optional="y"
+ desc="Slots' affinity for running the job it is
+ currently hosting, calculated as Rank expression
+ evaluated in context of the running job's ad"/>
+ <property name="Disk"
+ type="uint32" unit="KiB"
+ desc="Amount of disk space in KiB available in the slot"/>
+ <statistic name="EnteredCurrentActivity"
+ type="absTime" unit="nanosecond"
+ desc="Time at which current Activity was entered,
+ number of nanoseconds since Unix epoch"/>
+ <statistic name="EnteredCurrentState"
+ type="absTime" unit="nanosecond"
+ desc="Time at which current State was entered,
+ number of seconds since Unix epoch"/>
+ <property name="FileSystemDomain"
+ type="sstr"
+ desc="Configured namespace shared by slots with
+ uniformly mounted shared storage"/>
+ <property name="GlobalJobId"
+ type="sstr"
+ optional="y"
+ desc="The running job's GlobalJobId, only present when
+ a job is executing"/>
+ <!-- XXX: ImageSize could quite possibly be a statistic -->
+ <property name="ImageSize"
+ type="uint32" unit="KiB"
+ optional="y"
+ desc="Estimate of the memory image size, in KiB, of the
+ running job, only present when a job is
+ executing, pulled by STARTD_JOB_EXPRS"/>
+ <property name="IsValidCheckpointPlatform"
+ type="lstr"
+ desc="A configurable expression representing if a
+ checkpointed job can run on the slot, part of the
+ slot's Requirements along with the Start
+ expression"/>
+ <!-- XXX: JobId could quite possibly be a statistic, snapshots
+ would show use over time -->
+ <property name="JobId"
+ type="sstr"
+ optional="y"
+ desc="The running job's identifier,
+ i.e. ClusterId.ProcId, only present when a job is
+ executing"/>
+ <property name="JobStart"
+ type="absTime" unit="nanosecond"
+ optional="y"
+ desc="The number of nanosecond since epoch when the job
+ began executing, only present when a job is
+ executing"/>
+ <statistic name="KeyboardIdle"
+ type="uint32" unit="second"
+ desc="Number of seconds since any activity on any
+ keyboard or mouse associated with the machine,
+ including pseudo-terminals"/>
+ <property name="KFlops"
+ type="uint32"
+ desc="Relative floating point performance on a Linpack
+ benchmark"/>
+ <statistic name="LastBenchmark"
+ type="absTime" unit="nanosecond"
+ desc="Number of nanoseconds since epoch when the last
+ benchmark was run"/>
+ <statistic name="LastFetchWorkCompleted"
+ type="absTime" unit="nanosecond"
+ desc="Number of nanoseconds since epoch when the
+ FetchWork Hook returned"/>
+
+ <statistic name="LastFetchWorkSpawned"
+ type="absTime" unit="nanosecond"
+ desc="Number of nanoseconds since epoch when the
+ FetchWork Hook was invoked"/>
+ <statistic name="LastPeriodicCheckpoint"
+ type="absTime" unit="nanosecond"
+ desc="The number of nanoseconds since epoch when the
+ job last performed a periodic checkpoint, only
+ present when a job is executing"/>
+<!--
+ <statistic name="LastHeardFrom"
+ type="absTime" unit="nanosecond"
+ desc="Time when the Collector received an update from
+ the slot, nanoseconds since epoch, inserted by
+ Collector"/>
+-->
+ <statistic name="LoadAvg"
+ type="double"
+ desc="Load average of CPUs hosting the slot"/>
+ <property name="Machine"
+ type="sstr"
+ desc="The fully qualified hostname of slot's host
+ machine"/>
+ <property name="MaxJobRetirementTime"
+ type="lstr" unit="second"
+ desc="Expression evaluated in context of job ad
+ producing the number of seconds a job is allowed
+ to finish before being killed, relevant when job
+ is being kicked out of the slot"/>
+ <property name="Memory"
+ type="uint32" unit="MiB"
+ desc="Amount of RAM available in the slot, in MiB"/>
+ <property name="Mips"
+ type="uint32"
+ desc="Relative integer performance on a Dhrystone
+ benchmark"/>
+ <property name="MyAddress"
+ type="sstr"
+ desc="IP:Port of StartD in charge of the slot"/>
+ <statistic name="MyCurrentTime"
+ type="absTime" unit="nanosecond"
+ desc="The number of nanoseconds since epoch that the
+ slot produced an updated ad"/>
+<!--
+ <property name="MyType"
+ type="sstr"
+ desc="Always 'Machine'"\>
+-->
+ <property name="Name"
+ type="sstr"
+ index="y"
+ desc="Name of the slot, either the same as Machine,
+ slot#@Machine, or a configured value"/>
+ <statistic name="NextFetchWorkDelay"
+ type="int32" unit="second"
+ desc="Number of seconds until the next FetchWork
+ Hook will be invoked, -1 means never"/>
+ <property name="OpSys"
+ type="sstr"
+ desc="Slot's operating system, e.g.: HPUX10, HPUX
+ 10.20; HPUX11, HPUX B.11.00; LINUX, Linux
+ 2.[0,2,4,6].x kernels; OSF1, Diginal Unix 4.x;
+ OSX, Darwin; OSX10_2, Darwin 6.4; SOLARIS25,
+ Solaris 2.4 or 5.5; SOLARIS251, Solaris 2.5.1 or
+ 5.5.1; SOLARIS26, Solaris 2.6 or 5.6; SOLARIS27,
+ Solaris 2.7 or 5.7; SOLARIS28, Solaris 2.8 or
+ 5.8; SOLARIS29, Solaris 2.9 or 5.9; WINNT50,
+ Windows 2000; WINNT51, Windows XP; WINNT52,
+ Windows Server 2003; WINNT60, Windows Vista"/>
+ <property name="PreemptingConcurrencyLimits"
+ type="sstr"
+ optional="y"
+ desc="Set of concurrency limits associated with the
+ preempting job"/>
+ <property name="PreemptingOwner"
+ type="sstr"
+ optional="y"
+ desc="The name of the user originally preempting the
+ current job, i.e. the incoming user, only present
+ when slot is claimed"/>
+ <!-- XXX: PreemptingUser could quite possibly be a statistic -->
+ <property name="PreemptingUser"
+ type="sstr"
+ optional="y"
+ desc="The name of the user preempting the current job,
+ different from PreemptingOwner only if the claim
+ was given to another user who is using it to
+ preempt, only present when slot is claimed"/>
+ <!-- XXX: PreemptingRank could quite possibly be a statistic -->
+ <property name="PreemptingRank"
+ type="double"
+ optional="y"
+ desc="Slots' affinity for running the incoming,
+ preempting, job, calculated as Rank expression
+ evaluated in context of the incoming job's ad,
+ only present when slot is claimed"/>
+ <!-- XXX: RemoteOwner could quite possibly be a statistic, showing
+ use over time -->
+ <property name="RemoteOwner"
+ type="sstr"
+ optional="y"
+ desc="The name of the user who originally claimed the
+ slot, only present when slot is claimed"/>
+ <!-- XXX: RemoteUser could quite possibly be a statistic, showing
+ use over time -->
+ <property name="RemoteUser"
+ type="sstr"
+ optional="y"
+ desc="The name of the user who is currently using the
+ slot, different from RemoteOwner only if the
+ claim was given to another user who is using the
+ slot, only present when slot is claimed"/>
+ <property name="Requirements"
+ type="lstr"
+ desc="Expression evaluated in the context of a job ad
+ to determine if the slot will run a job"/>
+ <property name="PublicNetworkIpAddr"
+ type="sstr"
+ desc="IP:Port used to communicate with the slot"/>
+ <property name="Rank"
+ type="lstr"
+ desc="Configured expression representing how the slot
+ prefers jobs"/>
+ <property name="SlotID"
+ type="uint32"
+ desc="The # in the slot's Name, i.e. Name='slot#@Machine'"/>
+ <property name="Start"
+ type="lstr"
+ desc="Expression evaluated to determine if a slot is
+ willing to start running a job"/>
+ <property name="StarterAbilityList"
+ type="lstr"
+ desc="StringList, comma separated, set of abilities the
+ slot has, i.e. HasFileTransfer,HasJava,HasVM,
+ query with stringListMember('Element',
+ StarterAbilityList)"/>
+ <statistic name="State"
+ type="sstr"
+ desc="One of: Owner, unavailable to Condor; Unclaimed,
+ available to Condor, but no job match yet;
+ Matched, job found, but not yet claimed; Claimed,
+ claimed and job likely running (see Activity);
+ Preempting, running job is being kicked off the
+ slot"/>
+<!--
+ <statistic name="TargetType"
+ type="sstr"
+ desc="Always 'Job'"/>
+-->
+ <statistic name="TimeToLive"
+ type="uint32" unit="second"
+ desc="Number of second until StartD managing the slot
+ has until it will exit"/>
+ <!-- XXX: TotalClaimRunTime is a statistic -->
+ <property name="TotalClaimRunTime"
+ type="uint32" unit="second"
+ optional="y"
+ desc="Number of seconds the current claim has spent
+ running jobs, only present when slot is
+ claimed"/>
+ <!-- XXX: TotalClaimSuspendTime is a statistic -->
+ <property name="TotalClaimSuspendTime"
+ type="uint32" unit="second"
+ optional="y"
+ desc="Number of seconds the current claim has spent
+ with suspended jobs, only present when slot is
+ claimed"/>
+ <statistic name="TotalCondorLoadAvg"
+ type="double"
+ desc="Portion of TotalLoadAvg generated by Condor (jobs
+ or benchmarks)"/>
+ <property name="TotalCpus"
+ type="uint32"
+ desc="Total number of CPUs on slot's host machine, or
+ NUM_CPUS configuration option"/>
+ <property name="TotalDisk"
+ type="uint32" unit="KiB"
+ desc="Amount of disk space available on the slot's host
+ machine"/>
+ <!-- XXX: TotalJobRunTime is a statistic -->
+ <property name="TotalJobRunTime"
+ type="uint32" unit="second"
+ optional="y"
+ desc="Number of seconds the current job has spent
+ running, i.e. Claimed/Busy, only present when
+ slot is claimed"/>
+ <!-- XXX: TotalJobSuspendTime is a statistic -->
+ <property name="TotalJobSuspendTime"
+ type="uint32" unit="second"
+ optional="y"
+ desc="Number of seconds the current job has spent
+ suspended, i.e. Claimed/Suspended, only present
+ when slot is claimed"/>
+ <statistic name="TotalLoadAvg"
+ type="double"
+ desc="Total load average of the slot's host machine"/>
+ <property name="TotalMemory"
+ type="uint32" unit="MiB"
+ desc="Total RAM available on slot's machine, in MiB"/>
+ <property name="TotalSlots"
+ type="uint32"
+ desc="Total number of slots sharing the Machine"/>
+ <statistic name="TotalTimeBackfillBusy"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Backfill and Activity=Busy since the
+ Startd started"/>
+ <statistic name="TotalTimeBackfillIdle"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Backfill and Activity=Idle since the
+ Startd started"/>
+ <statistic name="TotalTimeBackfillKilling"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Backfill and Activity=Killing since the
+ Startd started"/>
+ <statistic name="TotalTimeClaimedBusy"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Claimed and Activity=Busy since the
+ Startd started"/>
+ <statistic name="TotalTimeClaimedIdle"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Claimed and Activity=Idle since the
+ Startd started"/>
+ <statistic name="TotalTimeClaimedRetiring"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Claimed and Activity=Retiring since the
+ Startd started"/>
+ <statistic name="TotalTimeClaimedSuspended"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Claimed and Activity=Suspended since the
+ Startd started"/>
+ <statistic name="TotalTimeMatchedIdle"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Matched and Activity=Idle since the
+ Startd started"/>
+ <statistic name="TotalTimeOwnerIdle"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Owner and Activity=Idle since the
+ Startd started"/>
+ <statistic name="TotalTimePreemptingKilling"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Preempting and Activity=Killing since the
+ Startd started"/>
+ <statistic name="TotalTimePreemptingVacating"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Preempting and Activity=Vacating since the
+ Startd started"/>
+ <statistic name="TotalTimeUnclaimedBenchmarking"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Unclaimed and Activity=Benchmarking since
+ the Startd started"/>
+ <statistic name="TotalTimeUnclaimedIdle"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Unclaimed and Activity=Idle since the
+ Startd started"/>
+ <property name="TotalVirtualMemory"
+ type="uint32" unit="KiB"
+ desc="Amount of swap space available on slot"/>
+ <property name="UidDomain"
+ type="sstr"
+ desc="Configured namespace shared by slots with
+ uniform uid/gid entries, i.e. same logins and
+ groups"/>
+ <property name="VirtualMemory"
+ type="uint32" unit="KiB"
+ desc="Amount of currently available virtual memory
+ (swap space) in KiB"/>
+ <property name="WindowsBuildNumber"
+ type="uint32"
+ desc="Integer extracted from the platform type,
+ representing a build number for a Windows
+ operating system, only present on Windows
+ slots"/>
+ <property name="WindowsMajorVersion"
+ type="uint32"
+ desc="Integer extracted from the platform type,
+ representing a major version number for a Windows
+ operating system, only present on Windows
+ slots, e.g. 5 for OpSys=WINNT50"/>
+ <property name="WindowsMinorVersion"
+ type="uint32"
+ desc="Integer extected from the platform type,
+ representing a minor version numer for a Windows
+ operating system, only present on Windows
+ slots, e.g. 2 for OpSys=WINNT52"/>
+
+<!--
+ <property name="AdditionalAttributes" type="map"/>
+-->
+ </class>
+
+<!--
+Exec Host, Order(Rank?), StartTime, TotalTime (Sys, User), Project, AccountingGroup
+-->
+ <class name="Job">
+ <property name="schedulerRef" type="objId" index="y" references="mrg.grid.Scheduler"/>
+ <property name="submitterRef" type="objId" references="mrg.grid.Submitter"/>
+
+ <property name="AccountingGroup" type="sstr" optional="y" desc=""/>
+ <property name="Args" type="lstr" optional="y" desc=""/>
+ <property name="ClusterId"
+ type="uint32" index="y"
+ desc="The id of the cluster the job belongs
+ to. ClusterIds are unique within a SchedD."/>
+ <property name="Cmd" type="lstr" desc=""/>
+ <property name="ConcurrencyLimits" type="lstr" optional="y" desc=""/>
+ <property name="CustomGroup" type="sstr" optional="y" desc=""/>
+ <property name="CustomId" type="sstr" optional="y" desc=""/>
+ <property name="CustomPriority" type="uint32" optional="y" desc=""/>
+ <property name="GlobalJobId" type="sstr" desc=""/>
+ <property name="In"
+ type="lstr"
+ desc="The file where the job's standard input is read
+ from."/>
+ <property name="Iwd" type="lstr" desc=""/>
+ <property name="JobStatus"
+ type="uint32"
+ desc="One of: 0, unexpanded; 1, idle; 2, running; 3,
+ removed; 4, completed; 5, held; or, 6, submission
+ error"/>
+ <property name="Note"
+ type="lstr" optional="y"
+ desc="An arbitrary note attached to the job."/>
+ <property name="Out"
+ type="lstr"
+ desc="The file where the job's standard output is
+ written."/>
+ <property name="Owner"
+ type="sstr"
+ desc="The submitter of the job."/>
+ <property name="User"
+ type="sstr"
+ desc="The Owner '@' the configured UidDomain namespace"/>
+ <property name="ProcId"
+ type="uint32" index="y"
+ desc="The id of the job within its cluster. ProcIds re
+ unique within a cluster."/>
+ <property name="QDate"
+ type="absTime" unit="nanoseconds"
+ desc="The number of nanoseconds since epoch when the
+ job was submitted."/>
+
+<!--
+ <property name="Requirements" type="lstr" desc=""/>
+ <property name="Scheduler" type="sstr" desc=""/>
+-->
+
+ <property name="JobUniverse"
+ type="uint32"
+ desc=""/>
+
+ <property name="Title" type="sstr" optional="y" desc=""/>
+ <property name="UserLog" type="lstr" optional="y" desc=""/>
+
+ <property name="HoldReason" type="lstr" optional="y" desc=""/>
+
+ <property name="DAGNodeName"
+ type="sstr" optional="y" desc=""/>
+ <property name="DAGParentNodeNames"
+ type="lstr" optional="y"
+ desc="Comma separated list of the job's parent's node
+ names"/>
+ <property name="DAGManJobId"
+ type="uint32" optional="y"
+ desc="The ClusterId of the DAGMan job who spawned the
+ job"/>
+
+ <property name="Ad" type="map" optional="y" desc=""/>
+
+ <method name="GetAd">
+ <arg name="JobAd" dir="O" type="map"
+ desc="(name,value,type) tuples; Values are INTEGER, FLOAT,
+ STRING and EXPR. The EXPR value is not first class,
+ it is an unquoted, with double quotes, string"/>
+ </method>
+
+ <method name="SetAttribute">
+ <arg name="Name" dir="I" type="sstr"/>
+ <arg name="Value" dir="I" type="lstr"/>
+ </method>
+
+ <method name="Hold">
+ <arg name="Reason" dir="I" type="sstr"/>
+ </method>
+
+ <method name="Release">
+ <arg name="Reason" dir="I" type="sstr"/>
+ </method>
+
+ <method name="Remove">
+ <arg name="Reason" dir="I" type="sstr"/>
+ </method>
+
+ <method name="Fetch">
+ <arg name="File" dir="I" type="sstr"/>
+ <arg name="Start" dir="I" type="int32"/>
+ <arg name="End" dir="I" type="int32"/>
+ <arg name="Data" dir="O" type="lstr"/>
+ </method>
+ </class>
+
+ <class name="Scheduler">
+ <group name="daemon-stats"/>
+
+ <property name="Pool" type="sstr" index="y"/>
+ <property name="System" type="sstr" index="y"/>
+
+ <property name="JobQueueBirthdate" type="absTime"/>
+ <property name="MaxJobsRunning" type="uint32" desc=""/>
+ <property name="Machine" type="sstr" desc=""/>
+ <property name="MyAddress" type="sstr" desc=""/>
+ <statistic name="NumUsers" type="uint32"/>
+ <property name="Name" type="sstr" index="y" desc=""/>
+ <property name="PublicNetworkIpAddr" type="sstr" desc=""/>
+ <statistic name="TotalHeldJobs" type="uint32"/>
+ <statistic name="TotalIdleJobs" type="uint32"/>
+ <statistic name="TotalJobAds" type="uint32"/>
+ <statistic name="TotalRemovedJobs" type="uint32"/>
+ <statistic name="TotalRunningJobs" type="uint32"/>
+ </class>
+
+ <class name="Submitter">
+ <property name="schedulerRef" type="objId" parentRef="y" index="y" references="mrg.grid.Scheduler"/>
+
+ <statistic name="HeldJobs" type="uint32"/>
+ <statistic name="IdleJobs" type="uint32"/>
+ <property name="JobQueueBirthdate" type="absTime"/>
+ <property name="Machine" type="sstr"/>
+ <property name="Name" type="sstr" index="y"/>
+ <statistic name="RunningJobs" type="uint32"/>
+ <property name="ScheddName" type="sstr"/>
+ </class>
+
+ <class name="Negotiator">
+ <property name="Pool" type="sstr" index="y"/>
+ <property name="System" type="sstr" index="y"/>
+
+ <property name="Name" type="sstr" index="y"/>
+ <property name="Machine" type="sstr"/>
+ <property name="MyAddress" type="sstr" desc=""/>
+
+ <!-- NOTE: MonitorSelf* statistics are currently missing in 7.0.0 -->
+ <group name="daemon-stats"/>
+
+ <method name="GetLimits">
+ <arg name="Limits" dir="O" type="map"/>
+ </method>
+
+ <method name="SetLimit">
+ <arg name="Name" dir="I" type="sstr"/>
+ <arg name="Max" dir="I" type="double"/>
+ </method>
+
+ <method name="Reconfig"/>
+ </class>
+
+ <class name="Collector">
+ <property name="Pool" type="sstr" index="y"/>
+ <property name="System" type="sstr" index="y"/>
+
+ <property name="CondorPlatform" type="sstr"/>
+ <property name="CondorVersion" type="sstr"/>
+ <property name="Name" type="sstr" index="y"/>
+ <property name="PublicNetworkIpAddr" type="sstr"/>
+ </class>
+
+ <class name="Master">
+
+ <group name="daemon-stats"/>
+
+ <property name="Pool" type="sstr" index="y"/>
+ <property name="System" type="sstr" index="y"/>
+
+ <property name="Name" type="sstr" index="y"/>
+ <property name="Machine" type="sstr"/>
+ <property name="PublicNetworkIpAddr" type="sstr"/>
+ <property name="MyAddress" type="sstr"/>
+ <property name="RealUid" type="int32"/>
+
+ <method name="Start">
+ <arg name="Subsystem"
+ dir="I" type="sstr"
+ desc="The component/subsystem to start: one of STARTD,
+ SCHEDD, COLLECTOR, NEGOTIATOR, KBDD or QUILL"/>
+ </method>
+
+ <method name="Stop">
+ <arg name="Subsystem"
+ dir="I" type="sstr"
+ desc="The component/subsystem to stop: one of STARTD,
+ SCHEDD, COLLECTOR, NEGOTIATOR, KBDD or QUILL"/>
+ </method>
+ </class>
+</schema>
Added: mgmt/trunk/mace/cpp/src/qmfgen/mace.xml
===================================================================
--- mgmt/trunk/mace/cpp/src/qmfgen/mace.xml (rev 0)
+++ mgmt/trunk/mace/cpp/src/qmfgen/mace.xml 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,20 @@
+<schema package="com.redhat.mace">
+
+ <class name="GridSim">
+ <property name="execNodeCount" type="uint32" access="RO"/>
+ <property name="slotsPerNode" type="uint32" access="RO"/>
+ <property name="slotCount" type="uint32" access="RO"/>
+ <property name="jobCount" type="uint32" access="RO"/>
+ <property name="activityLevel" type="uint8" access="RO" desc="0 = none, 100 = all objects every interval"/>
+
+ <method name="reset" desc="Delete all grid objects"/>
+ <method name="start" desc="Set up simulated objects">
+ <arg name="execNodes" type="uint32" dir="I"/>
+ <arg name="slotsPerNode" type="uint32" dir="I"/>
+ <arg name="jobs" type="uint32" dir="I"/>
+ <arg name="activity" type="uint8" dir="I"/>
+ </method>
+ </class>
+
+</schema>
+
Added: mgmt/trunk/mace/cpp/src/qmfgen/sesame.xml
===================================================================
--- mgmt/trunk/mace/cpp/src/qmfgen/sesame.xml (rev 0)
+++ mgmt/trunk/mace/cpp/src/qmfgen/sesame.xml 2008-11-19 16:40:42 UTC (rev 2843)
@@ -0,0 +1,30 @@
+<schema package="com.redhat.sesame">
+
+ <class name="Sysimage">
+ <property name="uuid" index="y" type="uuid" access="RC" desc="UUID of System Image"/>
+
+ <property name="osName" type="sstr" access="RO" desc="Operating System Name"/>
+ <property name="nodeName" type="sstr" access="RO" desc="Node Name"/>
+ <property name="release" type="sstr" access="RO"/>
+ <property name="version" type="sstr" access="RO"/>
+ <property name="machine" type="sstr" access="RO"/>
+
+ <property name="memTotal" type="uint32" access="RO" unit="kByte"/>
+ <property name="swapTotal" type="uint32" access="RO" unit="kByte"/>
+
+ The following statistics are gathered from /proc/meminfo
+
+ <statistic name="memFree" type="uint32" unit="kByte"/>
+ <statistic name="swapFree" type="uint32" unit="kByte"/>
+
+ The following statistics are gathered from /proc/loadavg
+
+ <statistic name="loadAverage1Min" type="float"/>
+ <statistic name="loadAverage5Min" type="float"/>
+ <statistic name="loadAverage10Min" type="float"/>
+ <statistic name="procTotal" type="uint32"/>
+ <statistic name="procRunning" type="uint32"/>
+ </class>
+
+</schema>
+
15 years, 7 months
rhmessaging commits: r2842 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-19 10:30:52 -0500 (Wed, 19 Nov 2008)
New Revision: 2842
Modified:
mgmt/trunk/cumin/python/cumin/queue.py
Log:
Add missing get_args method for QueueBinding form
Modified: mgmt/trunk/cumin/python/cumin/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/queue.py 2008-11-19 15:27:38 UTC (rev 2841)
+++ mgmt/trunk/cumin/python/cumin/queue.py 2008-11-19 15:30:52 UTC (rev 2842)
@@ -61,9 +61,6 @@
self.__purge = self.Purge(app, "purge")
self.add_child(self.__purge)
- self.__move_messages = self.MoveMessages(app, "move_messages")
- self.add_child(self.__move_messages)
-
self.__remove = self.Remove(app, "remove")
self.add_child(self.__remove)
@@ -100,20 +97,6 @@
def render_content(self, session):
return "Purge"
-
- class MoveMessages(FormButton):
- def process_submit(self, session):
- ids = self.parent.ids.get(session)
- self.parent.ids.clear(session)
-
- branch = session.branch()
- frame = self.frame.show_queues_move(branch)
- frame.ids.set(branch, ids)
- self.page.set_redirect_url(session, branch.marshal())
-
- def render_content(self, session):
- return "Move Messages"
-
class Remove(FormButton):
def process_submit(self, session):
ids = self.parent.ids.get(session)
@@ -126,7 +109,6 @@
def render_content(self, session):
return "Remove"
-
class NameColumn(SqlTableColumn):
def render_title(self, session, data):
return "Name"
@@ -290,7 +272,7 @@
def get_visible_columns(self, session):
return self.get_request_visible_columns(session, ["e_id"])
- def render_add_queue_binding_url(self, session, vhost):
+ def render_add_queue_binding_url(self, session, *args):
branch = session.branch()
self.frame.binding_add.show(branch)
return branch.marshal()
@@ -700,19 +682,21 @@
self.errors = self.Errors(self, "errors")
self.add_attribute(self.errors)
+ def get_args(self, session):
+ return self.frame.get_args(session)
+
def render_form_error(self, session, *args):
errors = self.errors.get(session)
if "no_exchanges" in errors:
return "<ul class=\"errors\" style=\"margin:0; float:left;\"><li>%s</li></ul>" % \
"</li><li>".join(errors["no_exchanges"])
- def process_cancel(self, session):
+ def process_cancel(self, session, *args):
branch = session.branch()
self.frame.show_view(branch)
self.page.set_redirect_url(session, branch.marshal())
- def process_submit(self, session):
- queue = self.frame.get_object(session)
+ def process_submit(self, session, queue):
(errors, form_binding_info) = self.bindings.get_binding_errors(session, queue.name)
if not len(form_binding_info):
15 years, 7 months
rhmessaging commits: r2841 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-19 10:27:38 -0500 (Wed, 19 Nov 2008)
New Revision: 2841
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Removing bogus set_object calls
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-11-19 15:25:52 UTC (rev 2840)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-11-19 15:27:38 UTC (rev 2841)
@@ -1085,7 +1085,6 @@
class Purge(CuminAction):
def show(self, session, queue):
frame = self.model.frame.broker
- frame.set_object(session, queue.vhost.broker.registration)
frame.queue.set_object(session, queue)
return frame.queue.purge.show(session)
@@ -1098,7 +1097,6 @@
class Remove(CuminAction):
def show(self, session, queue):
frame = self.model.frame.broker
- frame.set_object(session, queue.vhost.broker.registration)
frame.queue.set_object(session, queue)
return frame.queue.remove.show(session)
@@ -1115,7 +1113,6 @@
class Bind(CuminAction):
def show(self, session, queue):
frame = self.model.frame.broker
- frame.set_object(session, queue.vhost.broker.registration)
frame.queue.set_object(session, queue)
return frame.queue.binding_add.show(session)
15 years, 7 months
rhmessaging commits: r2840 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-11-19 10:25:52 -0500 (Wed, 19 Nov 2008)
New Revision: 2840
Modified:
mgmt/trunk/cumin/python/cumin/job.py
Log:
Fixing exception uncovered by cumin_bench
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-11-18 22:36:37 UTC (rev 2839)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-11-19 15:25:52 UTC (rev 2840)
@@ -948,10 +948,12 @@
class JobStatus(CuminStatus):
def render_color(self, session, job):
- return JobStatusInfo.get_status_color(job.JobStatus)
+ if job:
+ return JobStatusInfo.get_status_color(job.JobStatus)
def render_job_status(self, session, job):
- return JobStatusInfo.get_status_string(job.JobStatus)
+ if job:
+ return JobStatusInfo.get_status_string(job.JobStatus)
class JobGroupSet(CuminTable):
def __init__(self, app, name):
15 years, 7 months
rhmessaging commits: r2839 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-11-18 17:36:37 -0500 (Tue, 18 Nov 2008)
New Revision: 2839
Modified:
mgmt/trunk/mint/python/mint/update.py
Log:
An experimental change
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2008-11-18 22:30:59 UTC (rev 2838)
+++ mgmt/trunk/mint/python/mint/update.py 2008-11-18 22:36:37 UTC (rev 2839)
@@ -261,7 +261,11 @@
conn = model.dbConn.getConnection()
cursor = conn.cursor()
subSql = model.generateSQLSelect(sqlCls, id)
- sql = model.generateSQLInsert(sqlStatsCls, attrs, {sqlCls + "_id": subSql})
+
+ mintCls = getattr(mint, cls)
+ attrs[sqlCls + "_id"] = model.getObjectId(mintCls, id)
+ sql = model.generateSQLInsert(sqlStatsCls, attrs)
+
#log.debug("SQL: %s", sql)
cursor.execute(sql)
15 years, 7 months
rhmessaging commits: r2838 - in mgmt/trunk/mint: sql and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-11-18 17:30:59 -0500 (Tue, 18 Nov 2008)
New Revision: 2838
Modified:
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/python/mint/update.py
mgmt/trunk/mint/sql/schema.sql
Log:
discard updates for classes that are missing from the schema
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2008-11-18 22:04:43 UTC (rev 2837)
+++ mgmt/trunk/mint/python/mint/schema.py 2008-11-18 22:30:59 UTC (rev 2838)
@@ -1257,7 +1257,7 @@
-class SysImage(SQLObject):
+class Sysimage(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -1269,8 +1269,8 @@
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- statsCurr = ForeignKey('SysImageStats', cascade='null', default=None)
- statsPrev = ForeignKey('SysImageStats', cascade='null', default=None)
+ statsCurr = ForeignKey('SysimageStats', cascade='null', default=None)
+ statsPrev = ForeignKey('SysimageStats', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
uuid = BLOBCol(default=None)
osName = StringCol(length=1000, default=None)
@@ -1282,12 +1282,12 @@
swapTotal = IntCol(default=None)
-class SysImageStats(SQLObject):
+class SysimageStats(SQLObject):
class sqlmeta:
lazyUpdate = True
recTime = TimestampCol(default=None)
- sysImage = ForeignKey('SysImage', cascade='null', default=None)
+ sysimage = ForeignKey('Sysimage', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
memFree = IntCol(default=None)
swapFree = IntCol(default=None)
@@ -1474,8 +1474,8 @@
Session.sqlmeta.addJoin(SQLMultipleJoin('SessionStats', joinMethodName='stats'))
-classToSchemaNameMap['SysImage'] = 'SysImage'
-schemaNameToClassMap['SysImage'] = SysImage
+classToSchemaNameMap['Sysimage'] = 'Sysimage'
+schemaNameToClassMap['Sysimage'] = Sysimage
-SysImage.sqlmeta.addJoin(SQLMultipleJoin('SysImageStats', joinMethodName='stats'))
+Sysimage.sqlmeta.addJoin(SQLMultipleJoin('SysimageStats', joinMethodName='stats'))
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2008-11-18 22:04:43 UTC (rev 2837)
+++ mgmt/trunk/mint/python/mint/update.py 2008-11-18 22:30:59 UTC (rev 2838)
@@ -81,43 +81,46 @@
name = key.__repr__()
if name in mint.schema.schemaReservedWordsMap:
name = mint.schema.schemaReservedWordsMap.get(name)
-
- if key.type == 10:
- # Navigate to referenced objects
- if name.endswith("Ref"):
- name = name[:-3]
- className = name[0].upper() + name[1:]
- otherClass = getattr(mint, className, None)
- if otherClass:
- foreignKey = name + "_id"
- try:
- results[foreignKey] = model.getObjectId(otherClass, value)
- except KeyError:
- log.info("Referenced object %s '%s' not found by key '%s'" % (className, value, foreignKey))
- except mint.ObjectNotFound:
- if not orphan:
- log.info("Referenced object %s '%s' not found, deferring creation of orphan object" % (className, value))
- # store object in orphan map, will be picked up later when parent info is received
- if (className, value.first, value.second) not in model.orphanObjectMap:
- model.orphanObjectMap[(className, value.first, value.second)] = set()
- model.orphanObjectMap[(className, value.first, value.second)].add(self)
- orphan = True
+
+ try:
+ if not hasattr(getattr(mint, cls), name):
+ # Discard attrs that we don't have in our schema
+ log.debug("Class '%s' has no field '%s'" % ("mint.schema." + cls, name))
+ elif key.type == 10:
+ # Navigate to referenced objects
+ if name.endswith("Ref"):
+ name = name[:-3]
+ className = name[0].upper() + name[1:]
+ otherClass = getattr(mint, className, None)
+ if otherClass:
+ foreignKey = name + "_id"
+ try:
+ results[foreignKey] = model.getObjectId(otherClass, value)
+ except KeyError:
+ log.info("Referenced object %s '%s' not found by key '%s'" % (className, value, foreignKey))
+ except mint.ObjectNotFound:
+ if not orphan:
+ log.info("Referenced object %s '%s' not found, deferring creation of orphan object" % (className, value))
+ # store object in orphan map, will be picked up later when parent info is received
+ if (className, value.first, value.second) not in model.orphanObjectMap:
+ model.orphanObjectMap[(className, value.first, value.second)] = set()
+ model.orphanObjectMap[(className, value.first, value.second)].add(self)
+ orphan = True
+ else:
+ log.error("Class '%s' not found" % className)
+ elif key.type == 8:
+ # convert ABSTIME types
+ if value:
+ results[name] = time_unwarp(datetime.fromtimestamp(value/1000000000))
+ else:
+ results[name] = None
+ elif key.type == 14:
+ # convert UUIDs into their string representation, to be handled by sqlobject
+ results[name] = str(value)
else:
- log.error("Class '%s' not found" % className)
- elif key.type == 8:
- # convert ABSTIME types
- if value:
- results[name] = time_unwarp(datetime.fromtimestamp(value/1000000000))
- else:
- results[name] = None
- elif key.type == 14:
- # convert UUIDs into their string representation, to be handled by sqlobject
- results[name] = str(value)
- elif not hasattr(getattr(mint, cls), name):
- # Remove attrs that we don't have in our schema
- log.debug("Class '%s' has no field '%s'" % ("mint.schema." + cls, name))
- else:
- results[name] = value
+ results[name] = value
+ except Exception:
+ continue
if orphan:
return None
else:
@@ -129,17 +132,22 @@
def process(self, model):
try:
- properties = self.qmfObj.getProperties()
- timestamps = self.qmfObj.getTimestamps()
- id = self.qmfObj.getObjectId()
pkg, cls, hash = self.qmfObj.getClassKey()
-
origCls = cls
if cls in mint.schema.schemaReservedWordsMap:
cls = mint.schema.schemaReservedWordsMap.get(cls)
cls = cls[0].upper()+cls[1:]
sqlCls = model.dbStyle.pythonClassToDBTable(cls)
+ if not hasattr(mint, cls):
+ # Discard classes that we don't have in our schema
+ log.debug("Class '%s' is not in the schema" % (cls))
+ return
+
+ properties = self.qmfObj.getProperties()
+ timestamps = self.qmfObj.getTimestamps()
+ id = self.qmfObj.getObjectId()
+
attrs = self.processAttributes(properties, cls, model)
if attrs == None:
# object is orphan, a parent dependency was not found;
@@ -220,9 +228,6 @@
def process(self, model):
try:
- statistics = self.qmfObj.getStatistics()
- timestamps = self.qmfObj.getTimestamps()
- id = self.qmfObj.getObjectId()
pkg, cls, hash = self.qmfObj.getClassKey()
origCls = cls
@@ -230,6 +235,15 @@
cls = mint.schema.schemaReservedWordsMap.get(cls)
cls = cls[0].upper()+cls[1:]
sqlCls = model.dbStyle.pythonClassToDBTable(cls)
+
+ if not hasattr(mint, cls):
+ # Discard classes that we don't have in our schema
+ log.debug("Class '%s' is not in the schema" % (cls))
+ return
+
+ statistics = self.qmfObj.getStatistics()
+ timestamps = self.qmfObj.getTimestamps()
+ id = self.qmfObj.getObjectId()
statsCls = self.getStatsClass(cls)
sqlStatsCls = model.dbStyle.pythonClassToDBTable(statsCls)
Modified: mgmt/trunk/mint/sql/schema.sql
===================================================================
--- mgmt/trunk/mint/sql/schema.sql 2008-11-18 22:04:43 UTC (rev 2837)
+++ mgmt/trunk/mint/sql/schema.sql 2008-11-18 22:30:59 UTC (rev 2838)
@@ -838,7 +838,7 @@
running_jobs INT
);
-CREATE TABLE sys_image (
+CREATE TABLE sysimage (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
source_scope_id BIGINT,
@@ -858,12 +858,12 @@
mem_total INT,
swap_total INT
);
-CREATE UNIQUE INDEX sys_image_source_ids_unique ON sys_image (source_scope_id, source_object_id);
+CREATE UNIQUE INDEX sysimage_source_ids_unique ON sysimage (source_scope_id, source_object_id);
-CREATE TABLE sys_image_stats (
+CREATE TABLE sysimage_stats (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- sys_image_id INT,
+ sysimage_id INT,
mem_free INT,
swap_free INT,
load_average1_min FLOAT,
@@ -1096,11 +1096,11 @@
ALTER TABLE submitter_stats ADD CONSTRAINT submitter_id_exists FOREIGN KEY (submitter_id) REFERENCES submitter (id) ON DELETE SET NULL;
-ALTER TABLE sys_image ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES sys_image_stats (id) ON DELETE SET NULL;
+ALTER TABLE sysimage ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES sysimage_stats (id) ON DELETE SET NULL;
-ALTER TABLE sys_image ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES sys_image_stats (id) ON DELETE SET NULL;
+ALTER TABLE sysimage ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES sysimage_stats (id) ON DELETE SET NULL;
-ALTER TABLE sys_image_stats ADD CONSTRAINT sys_image_id_exists FOREIGN KEY (sys_image_id) REFERENCES sys_image (id) ON DELETE SET NULL;
+ALTER TABLE sysimage_stats ADD CONSTRAINT sysimage_id_exists FOREIGN KEY (sysimage_id) REFERENCES sysimage (id) ON DELETE SET NULL;
ALTER TABLE system ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES system_stats (id) ON DELETE SET NULL;
15 years, 7 months