rhmessaging commits: r4176 - mgmt/newdata/rosemary/python/rosemary.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-30 17:59:05 -0400 (Fri, 30 Jul 2010)
New Revision: 4176
Modified:
mgmt/newdata/rosemary/python/rosemary/model.py
Log:
Don't delete samples with objects; it's too taxing
Modified: mgmt/newdata/rosemary/python/rosemary/model.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/model.py 2010-07-30 21:43:09 UTC (rev 4175)
+++ mgmt/newdata/rosemary/python/rosemary/model.py 2010-07-30 21:59:05 UTC (rev 4176)
@@ -313,10 +313,8 @@
parent_col = SqlColumn(self.sql_samples_table, name, sql_int8)
parent_col.foreign_key_column = id_col
- table = self.sql_samples_table
- name = "%s_fk" % parent_col.name
- constraint = SqlForeignKeyConstraint(table, name, parent_col, id_col)
- constraint.on_delete = "cascade"
+ name = "%s_%s_index" % (self._name, parent_col.name)
+ index = SqlIndex(self._package.sql_schema, name, (parent_col,))
name = "_qmf_update_time"
SqlColumn(self.sql_samples_table, name, sql_timestamp)
14 years, 4 months
rhmessaging commits: r4175 - mgmt/newdata/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-30 17:43:09 -0400 (Fri, 30 Jul 2010)
New Revision: 4175
Modified:
mgmt/newdata/mint/python/mint/update.py
Log:
Consolidate agent id translation; convert integer ids to strings
Modified: mgmt/newdata/mint/python/mint/update.py
===================================================================
--- mgmt/newdata/mint/python/mint/update.py 2010-07-30 18:57:53 UTC (rev 4174)
+++ mgmt/newdata/mint/python/mint/update.py 2010-07-30 21:43:09 UTC (rev 4175)
@@ -239,7 +239,7 @@
agent.objects_by_id[obj_id] = obj
def get_agent_id(self):
- return self.qmf_object.getObjectId().agentName
+ return str(self.qmf_object.getObjectId().agentName)
def get_class(self):
class_key = self.qmf_object.getClassKey()
@@ -492,8 +492,11 @@
self.qmf_agent = qmf_agent
+ def get_agent_id(self):
+ return str(self.qmf_agent.getAgentBank())
+
def do_process(self, cursor, stats):
- agent_id = self.qmf_agent.getAgentBank()
+ agent_id = self.get_agent_id()
try:
agent = self.model.agents_by_id[agent_id]
@@ -524,7 +527,7 @@
class AgentDelete(AgentUpdate):
def do_process(self, cursor, stats):
- agent_id = self.qmf_agent.getAgentBank()
+ agent_id = self.get_agent_id()
try:
agent = self.model.agents_by_id[agent_id]
14 years, 4 months
rhmessaging commits: r4174 - mgmt/newdata/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-30 14:57:53 -0400 (Fri, 30 Jul 2010)
New Revision: 4174
Modified:
mgmt/newdata/cumin/python/cumin/grid/submission.py
Log:
Changes to VM submission jobads to match example
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-07-30 18:11:03 UTC (rev 4173)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-07-30 18:57:53 UTC (rev 4174)
@@ -115,6 +115,7 @@
stdin=None,
stdout=None,
stderr=None,
+ usrlog=None,
attrs={}):
ad = dict()
@@ -133,6 +134,10 @@
put("Iwd", iwd)
put("Requirements", requirements)
put("JobUniverse", universe)
+ put("In", stdin)
+ put("Out", stdout)
+ put("Err", stderr)
+ put("UserLog", usrlog)
for name, value in attrs.items():
put(name, value)
@@ -163,12 +168,15 @@
self.description.help = "This text will identify the submission"
self.add_field(self.description)
- self.directory = self.WorkingDirectoryField(app, "directory")
- self.directory.input.size = 50
- self.directory.required = True
- self.directory.help = "Run the process in this directory"
- self.add_field(self.directory)
+ self.add_fields(app)
+ def add_fields(self, app):
+ self.command = self.CommandField(app, "command")
+ self.command.input.columns = 50
+ self.command.required = True
+ self.command.help = "The path to the executable and any arguments"
+ self.add_field(self.command)
+
self.requirements = self.RequirementsField(app, "requirements")
self.requirements.input.columns = 50
self.requirements.required = True
@@ -176,15 +184,12 @@
"this submission will run"
self.add_field(self.requirements)
- self.add_fields(app)
+ self.directory = self.WorkingDirectoryField(app, "directory")
+ self.directory.input.size = 50
+ self.directory.required = True
+ self.directory.help = "Run the process in this directory"
+ self.add_field(self.directory)
- def add_fields(self, app):
- self.command = self.CommandField(app, "command")
- self.command.input.columns = 50
- self.command.required = True
- self.command.help = "The path to the executable and any arguments"
- self.add_field(self.command)
-
self.universe = self.UniverseField(app, "universe")
self.add_extra_field(self.universe)
@@ -203,6 +208,11 @@
self.stderr.help = "Send error output to this file"
self.add_extra_field(self.stderr)
+ self.usrlog = self.UsrLogField(app, "usrlog")
+ self.usrlog.input.size = 50
+ self.usrlog.help = "User log file"
+ self.add_extra_field(self.usrlog)
+
#self.options = self.OptionsField(app, "options")
#self.add_extra_field(self.options)
@@ -225,6 +235,7 @@
stdin = self.stdin.get(session)
stdout = self.stdout.get(session)
stderr = self.stderr.get(session)
+ usrlog = self.usrlog.get(session)
tokens = shlex.split(command)
@@ -242,6 +253,7 @@
stdin=stdin,
stdout=stdout,
stderr=stderr,
+ usrlog=usrlog,
attrs=attrs)
self.task.exit_with_redirect(session)
@@ -379,6 +391,10 @@
def render_title(self, session):
return "Standard error"
+ class UsrLogField(StringField):
+ def render_title(self, session):
+ return "User Log"
+
# class OptionsField(CheckboxField):
# def __init__(self, app, name):
# super(SubmissionAddForm.OptionsField, self).__init__(app, name)
@@ -408,6 +424,27 @@
def get_title(self, session):
return "Create VM submission"
+ def do_invoke(self, invoc, scheduler,
+ description,
+ executable,
+ arguments=None,
+ requirements=None,
+ universe=None,
+ iwd=None,
+ stdin=None,
+ stdout=None,
+ stderr=None,
+ usrlog=None,
+ attrs={}):
+
+ cmd = "%s %s" % (executable, arguments)
+ arguments = None
+ super(SubmissionVMAdd, self).do_invoke(invoc, scheduler,
+ description, cmd, arguments,
+ requirements, universe, iwd,
+ stdin, stdout, stderr, usrlog,
+ attrs)
+
class SubmissionAddVMForm(SubmissionAddForm):
def add_fields(self, app):
self.disk = self.DiskField(app, "disk")
@@ -416,17 +453,28 @@
self.disk.help = "VM disk img file location"
self.add_field(self.disk)
+ self.requirements = self.RequirementsField(app, "requirements")
+ self.requirements.input.columns = 50
+ self.requirements.required = True
+ self.requirements.help = "Attributes controlling where and when " + \
+ "this submission will run"
+ self.add_field(self.requirements)
+
self.universe = Attribute(app, "universe")
- self.universe.default = "vm"
+ self.universe.default = self.task.UNIVERSE["VM"]
self.add_attribute(self.universe)
self.attributes_ = self.VMAttributes(app, "attributes")
self.add_attribute(self.attributes_)
- self.command = self.Command(app, "command")
- self.command.default = ""
+ self.command = Attribute(app, "command")
+ self.command.default = "QMF Submitted VM"
self.add_attribute(self.command)
+ self.directory = Attribute(app, "directory")
+ self.directory.default = "/tmp"
+ self.add_attribute(self.directory)
+
self.stdin = Attribute(app, "stdin")
self.add_attribute(self.stdin)
@@ -436,25 +484,23 @@
self.stderr = Attribute(app, "stderr")
self.add_attribute(self.stderr)
+ self.usrlog = Attribute(app, "usrlog")
+ self.add_attribute(self.usrlog)
+
class DiskField(StringField):
def render_title(self, session):
return "Disk"
- class Command(Attribute):
- def get(self, session):
- return self.widget.disk.get(session)
-
class VMAttributes(Attribute):
def get(self, session):
vm_ads = list()
- vm_ads.append("vm_type=kvm")
- vm_ads.append("vm_networking=false")
- vm_ads.append("vm_memory=128")
- vm_ads.append("xen_kernal=included")
+ vm_ads.append("ShouldTransferFiles=NEVER")
+ vm_ads.append("JobVMType=kvm")
+ vm_ads.append("JobVMMemory=512")
+ vm_ads.append("VMPARAM_Xen_Kernel=included")
disk = self.widget.disk.get(session)
- vm_ads.append("xan_disk=%s:hda:w" % disk)
- vm_ads.append("executable=%s" % disk)
+ vm_ads.append("VMPARAM_Xen_Disk=%s:hda:w" % disk)
return "\n".join(vm_ads)
@@ -476,6 +522,13 @@
self.dag.help = "DAG descriptor file location"
self.add_field(self.dag)
+ self.requirements = self.RequirementsField(app, "requirements")
+ self.requirements.input.columns = 50
+ self.requirements.required = True
+ self.requirements.help = "Attributes controlling where and when " + \
+ "this submission will run"
+ self.add_field(self.requirements)
+
self.universe = Attribute(app, "universe")
self.universe.default = "scheduler"
self.add_attribute(self.universe)
@@ -483,23 +536,62 @@
self.attributes_ = self.DagAttributes(app, "attributes")
self.add_attribute(self.attributes_)
- self.command = Attribute(app, "command")
- self.command.default = "dag"
- self.add_attribute(self.command)
-
self.stdin = Attribute(app, "stdin")
self.add_attribute(self.stdin)
- self.stdout = Attribute(app, "stdout")
- self.add_attribute(self.stdout)
+ self.command = self.DagCommand(app, "command")
+ self.add_attribute(self.command)
- self.stderr = Attribute(app, "stderr")
- self.add_attribute(self.stderr)
+ self.stdout = self.StdoutField(app, "stdout")
+ self.stdout.input.size = 50
+ self.stdout.help = "Send process output to this file"
+ self.stdout.input.param.default = "diamond.dag.lib.out"
+ self.add_extra_field(self.stdout)
+ self.stderr = self.StderrField(app, "stderr")
+ self.stderr.input.size = 50
+ self.stderr.help = "Send error output to this file"
+ self.stderr.input.param.default = "diamond.dag.lib.err"
+ self.add_extra_field(self.stderr)
+
+ self.usrlog = self.UsrLogField(app, "usrlog")
+ self.usrlog.input.size = 50
+ self.usrlog.help = "User Log File"
+ self.usrlog.input.param.default = "diamond.dag.dagman.log"
+ self.add_extra_field(self.usrlog)
+
+ self.condor = self.CondorVersionField(app, "cv")
+ self.condor.required = True
+ self.condor.input.size = 50
+ self.condor.help = "Condor Version"
+ self.condor.input.param.default = "'7.4.3' 'Mar' '16' '2010' 'BuildID:' 'RH-7.4.3-0.5.el5' 'PRE-RELEASE'"
+ self.add_extra_field(self.condor)
+
class DagField(StringField):
def render_title(self, session):
return "DAG"
+ class CondorVersionField(StringField):
+ def render_title(self, session):
+ return "Condor Version"
+
+ class DagCommand(Attribute):
+ def get(self, session):
+ dag = self.widget.dag.get(session)
+ condor = self.widget.condor.get(session)
+ args = """-f -l . -Debug 3 -Lockfile diamond.dag.lock -AutoRescue 1
+ -DoRescueFrom 0 -Dag diamond.dag -CsdVersion $CondorVersion:' %s ' %s"""
+
+ cmd = "/usr/bin/condor_dagman"
+ return "%s %s" % (cmd, args % (condor, dag))
+
class DagAttributes(Attribute):
def get(self, session):
- return "dag=%s" % self.widget.dag.get(session)
+ ads = list()
+ ads.append("getenv=True")
+ ads.append("remove_kill_sig=SIGUSR1")
+ ads.append("on_exit_remove=( ExitSignal =?= 11 || (ExitCode =!= \
+ UNDEFINED && ExitCode>=0 && ExitCode <= 2))")
+ ads.append("environment=_CONDOR_DAGMAN_LOG=diamond.dag.dagman.out;_CONDOR_MAX_DAGMAN_LOG=0")
+
+ return "\n".join(ads)
14 years, 4 months
rhmessaging commits: r4173 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-30 14:11:03 -0400 (Fri, 30 Jul 2010)
New Revision: 4173
Modified:
mgmt/newdata/cumin/python/cumin/OpenFlashChart.py
Log:
Fix error in json output when both CJSON and JJSON are missing
Modified: mgmt/newdata/cumin/python/cumin/OpenFlashChart.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/OpenFlashChart.py 2010-07-30 14:00:13 UTC (rev 4172)
+++ mgmt/newdata/cumin/python/cumin/OpenFlashChart.py 2010-07-30 18:11:03 UTC (rev 4173)
@@ -85,7 +85,8 @@
return str(attributes).\
replace("': u'", "': '").\
replace(": True,", ": true,").\
- replace(": False,", ": false,")
+ replace(": False,", ": false,").\
+ replace("L, ", ", ")
class Element(Chart):
14 years, 4 months
rhmessaging commits: r4172 - in mgmt/newdata: cumin/etc and 3 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-30 10:00:13 -0400 (Fri, 30 Jul 2010)
New Revision: 4172
Modified:
mgmt/newdata/cumin/bin/cumin-admin
mgmt/newdata/cumin/bin/cumin-data
mgmt/newdata/cumin/bin/cumin-web
mgmt/newdata/cumin/etc/cumin.conf
mgmt/newdata/cumin/instance/etc/cumin.conf
mgmt/newdata/cumin/python/cumin/config.py
mgmt/newdata/cumin/python/cumin/main.py
mgmt/newdata/cumin/python/cumin/session.py
mgmt/newdata/mint/python/mint/main.py
mgmt/newdata/mint/python/mint/session.py
Log:
Switch from single broker config to multiple brokers; the --brokers parameter now accepts a comma-separated list of uris
Modified: mgmt/newdata/cumin/bin/cumin-admin
===================================================================
--- mgmt/newdata/cumin/bin/cumin-admin 2010-07-29 20:16:20 UTC (rev 4171)
+++ mgmt/newdata/cumin/bin/cumin-admin 2010-07-30 14:00:13 UTC (rev 4172)
@@ -36,8 +36,10 @@
print "Command '%s' is unknown" % name
sys.exit(1)
- app = Cumin(config.home, opts.broker, opts.database)
+ broker_uris = [x.strip() for x in opts.brokers.split(",")]
+ app = Cumin(config.home, broker_uris, opts.database)
+
app.check()
app.init()
Modified: mgmt/newdata/cumin/bin/cumin-data
===================================================================
--- mgmt/newdata/cumin/bin/cumin-data 2010-07-29 20:16:20 UTC (rev 4171)
+++ mgmt/newdata/cumin/bin/cumin-data 2010-07-30 14:00:13 UTC (rev 4172)
@@ -24,7 +24,9 @@
model_dir = os.path.join(config.home, "model")
- mint = Mint(model_dir, opts.broker, opts.database)
+ broker_uris = [x.strip() for x in opts.brokers.split(",")]
+
+ mint = Mint(model_dir, broker_uris, opts.database)
mint.print_event_level = opts.print_events
mint.check()
Modified: mgmt/newdata/cumin/bin/cumin-web
===================================================================
--- mgmt/newdata/cumin/bin/cumin-web 2010-07-29 20:16:20 UTC (rev 4171)
+++ mgmt/newdata/cumin/bin/cumin-web 2010-07-30 14:00:13 UTC (rev 4172)
@@ -23,7 +23,9 @@
setup_logging(opts)
- cumin = Cumin(config.home, opts.broker, opts.database,
+ broker_uris = [x.strip() for x in opts.brokers.split(",")]
+
+ cumin = Cumin(config.home, broker_uris, opts.database,
opts.host, opts.port)
cumin.debug = opts.debug
Modified: mgmt/newdata/cumin/etc/cumin.conf
===================================================================
--- mgmt/newdata/cumin/etc/cumin.conf 2010-07-29 20:16:20 UTC (rev 4171)
+++ mgmt/newdata/cumin/etc/cumin.conf 2010-07-30 14:00:13 UTC (rev 4172)
@@ -2,7 +2,7 @@
[common]
# database: dbname=cumin user=cumin host=localhost
-# broker: localhost:5672
+# brokers: localhost:5672
# log-level: info
[web]
Modified: mgmt/newdata/cumin/instance/etc/cumin.conf
===================================================================
--- mgmt/newdata/cumin/instance/etc/cumin.conf 2010-07-29 20:16:20 UTC (rev 4171)
+++ mgmt/newdata/cumin/instance/etc/cumin.conf 2010-07-30 14:00:13 UTC (rev 4172)
@@ -1,6 +1,6 @@
[common]
# database: dbname=cumin user=cumin host=localhost
-# broker: localhost:5672
+# brokers: localhost:5672
# debug: False
[web]
Modified: mgmt/newdata/cumin/python/cumin/config.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/config.py 2010-07-29 20:16:20 UTC (rev 4171)
+++ mgmt/newdata/cumin/python/cumin/config.py 2010-07-30 14:00:13 UTC (rev 4172)
@@ -57,7 +57,7 @@
param = ConfigParameter(self, "database", str)
param.default = "dbname=cumin user=cumin host=localhost"
- param = ConfigParameter(self, "broker", str)
+ param = ConfigParameter(self, "brokers", str)
param.default = "amqp://localhost"
self.log_file = ConfigParameter(self, "log-file", str)
@@ -73,7 +73,7 @@
OptionParser.__init__(self)
self.add_option("--database", default=section.database)
- self.add_option("--broker", default=section.broker)
+ self.add_option("--brokers", default=section.brokers)
self.add_option("--log-file", default=section.log_file)
self.add_option("--log-level", default=section.log_level)
self.add_option("--debug", action="store_true", default=section.debug)
Modified: mgmt/newdata/cumin/python/cumin/main.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/main.py 2010-07-29 20:16:20 UTC (rev 4171)
+++ mgmt/newdata/cumin/python/cumin/main.py 2010-07-30 14:00:13 UTC (rev 4172)
@@ -28,7 +28,7 @@
log = logging.getLogger("cumin")
class Cumin(Application):
- def __init__(self, home, broker_uri, database_dsn,
+ def __init__(self, home, broker_uris, database_dsn,
host="localhost", port=45672):
super(Cumin, self).__init__()
@@ -37,7 +37,7 @@
model_dir = os.path.join(self.home, "model")
self.model = CuminModel(self, model_dir)
- self.session = CuminSession(self, broker_uri)
+ self.session = CuminSession(self, broker_uris)
self.database = CuminDatabase(self, database_dsn)
self.server = CuminServer(self, host, port)
self.admin = CuminAdmin(self)
Modified: mgmt/newdata/cumin/python/cumin/session.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/session.py 2010-07-29 20:16:20 UTC (rev 4171)
+++ mgmt/newdata/cumin/python/cumin/session.py 2010-07-30 14:00:13 UTC (rev 4172)
@@ -6,9 +6,9 @@
log = logging.getLogger("cumin.session")
class CuminSession(object):
- def __init__(self, app, broker_uri):
+ def __init__(self, app, broker_uris):
self.app = app
- self.broker_uri = broker_uri
+ self.broker_uris = broker_uris
self.qmf_session = None
self.qmf_brokers = list()
@@ -45,7 +45,8 @@
rcvEvents=False,
rcvHeartbeats=False)
- self.add_broker(self.broker_uri)
+ for uri in self.broker_uris:
+ self.add_broker(uri)
def stop(self):
log.info("Stopping %s", self)
@@ -97,7 +98,7 @@
self.lock.release()
def __repr__(self):
- return "%s(%s)" % (self.__class__.__name__, self.broker_uri)
+ return "%s(%s)" % (self.__class__.__name__, self.broker_uris)
class CuminConsole(Console):
def __init__(self, session):
Modified: mgmt/newdata/mint/python/mint/main.py
===================================================================
--- mgmt/newdata/mint/python/mint/main.py 2010-07-29 20:16:20 UTC (rev 4171)
+++ mgmt/newdata/mint/python/mint/main.py 2010-07-30 14:00:13 UTC (rev 4172)
@@ -10,11 +10,11 @@
log = logging.getLogger("mint.main")
class Mint(object):
- def __init__(self, model_dir, broker_uri, database_dsn):
+ def __init__(self, model_dir, broker_uris, database_dsn):
self.model = MintModel(self, model_dir)
self.model.sql_logging_enabled = False
- self.session = MintSession(self, broker_uri)
+ self.session = MintSession(self, broker_uris)
self.database = MintDatabase(self, database_dsn)
self.update_enabled = True
Modified: mgmt/newdata/mint/python/mint/session.py
===================================================================
--- mgmt/newdata/mint/python/mint/session.py 2010-07-29 20:16:20 UTC (rev 4171)
+++ mgmt/newdata/mint/python/mint/session.py 2010-07-30 14:00:13 UTC (rev 4172)
@@ -6,9 +6,9 @@
log = logging.getLogger("mint.session")
class MintSession(object):
- def __init__(self, app, broker_uri):
+ def __init__(self, app, broker_uris):
self.app = app
- self.broker_uri = broker_uri
+ self.broker_uris = broker_uris
self.qmf_session = None
self.qmf_brokers = list()
@@ -46,7 +46,8 @@
#for pkg in self.app.model._packages:
# self.qmf_session.bindPackage(pkg._name)
- self.add_broker(self.broker_uri)
+ for uri in self.broker_uris:
+ self.add_broker(uri)
def stop(self):
log.info("Stopping %s", self)
@@ -55,7 +56,7 @@
self.qmf_session.delBroker(qmf_broker)
def __repr__(self):
- return "%s(%s)" % (self.__class__.__name__, self.broker_uri)
+ return "%s(%s)" % (self.__class__.__name__, self.broker_uris)
class MintConsole(Console):
def __init__(self, model):
14 years, 4 months
rhmessaging commits: r4171 - mgmt/newdata/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-29 16:16:20 -0400 (Thu, 29 Jul 2010)
New Revision: 4171
Modified:
mgmt/newdata/mint/python/mint/model.py
mgmt/newdata/mint/python/mint/update.py
Log:
* Some more improvements for cross-agent reference processing
* Put agent id mapping into a common function
* Keep all agent object cache maintainence in the main Update#process
method
Modified: mgmt/newdata/mint/python/mint/model.py
===================================================================
--- mgmt/newdata/mint/python/mint/model.py 2010-07-29 19:30:14 UTC (rev 4170)
+++ mgmt/newdata/mint/python/mint/model.py 2010-07-29 20:16:20 UTC (rev 4171)
@@ -60,20 +60,5 @@
self.model = None
- def get_object_by_id(self, object_id):
- try:
- return self.objects_by_id[object_id]
- except KeyError:
- pass
-
- def add_object(self, obj):
- self.objects_by_id[obj._qmf_object_id] = obj
-
- def delete_object(self, obj):
- try:
- del self.objects_by_id[obj._qmf_object_id]
- except KeyError:
- pass
-
def __repr__(self):
return "%s(%s)" % (self.__class__.__name__, self.id)
Modified: mgmt/newdata/mint/python/mint/update.py
===================================================================
--- mgmt/newdata/mint/python/mint/update.py 2010-07-29 19:30:14 UTC (rev 4170)
+++ mgmt/newdata/mint/python/mint/update.py 2010-07-29 20:16:20 UTC (rev 4171)
@@ -174,22 +174,24 @@
super(ObjectUpdate, self).__init__(model)
self.qmf_object = qmf_object
- self.agent = None
def do_process(self, cursor, stats):
+ agent_id = self.get_agent_id()
+
try:
- agent_id = self.qmf_object.getAgent().getAgentBank()
- self.agent = self.model.agents_by_id[agent_id]
+ agent = self.model.agents_by_id[agent_id]
except KeyError:
raise UpdateDropped()
cls = self.get_class()
obj_id = self.get_object_id()
- obj = self.agent.get_object_by_id(obj_id)
+ obj = None
- if not obj:
+ try:
+ obj = agent.objects_by_id[obj_id]
+ except KeyError:
try:
- obj = cls.get_object_by_qmf_id(cursor, self.agent.id, obj_id)
+ obj = cls.get_object_by_qmf_id(cursor, agent_id, obj_id)
except RosemaryNotFound:
pass
@@ -198,6 +200,9 @@
if obj:
if delete_time != 0:
self.delete_object(cursor, stats, obj)
+
+ agent.objects_by_id.pop(obj._qmf_object_id)
+
return
properties = self.qmf_object.getProperties()
@@ -231,8 +236,11 @@
assert obj
- self.agent.add_object(obj)
+ agent.objects_by_id[obj_id] = obj
+ def get_agent_id(self):
+ return self.qmf_object.getObjectId().agentName
+
def get_class(self):
class_key = self.qmf_object.getClassKey()
name = class_key.getPackageName()
@@ -260,7 +268,7 @@
update_time = datetime.fromtimestamp(update_time / 1000000000)
obj = cls.create_object(cursor)
- obj._qmf_agent_id = self.agent.id
+ obj._qmf_agent_id = self.get_agent_id()
obj._qmf_object_id = self.get_object_id()
obj._qmf_session_id = str(self.qmf_object.getObjectId().getSequence())
obj._qmf_create_time = create_time
@@ -348,8 +356,6 @@
def delete_object(self, cursor, stats, obj):
obj.delete(cursor)
- self.agent.delete_object(obj)
-
self.model.print_event(3, "Deleted %s", obj)
stats.deleted += 1
@@ -394,19 +400,14 @@
raise MappingException("Agent %s is unknown" % value.agentName)
try:
- that_id = str(value.objectName)
- except:
- raise MappingException("Reference isn't an oid")
-
- that = agent.get_object_by_id(that_id)
-
- if not that:
+ that = agent.objects_by_id[value.objectName]
+ except KeyError:
try:
that = ref.that_cls.get_object_by_qmf_id \
- (cursor, self.agent.id, that_id)
+ (cursor, agent.id, value.objectName)
except RosemaryNotFound:
msg = "Referenced object %s hasn't appeared yet"
- raise MappingException(msg % that)
+ raise MappingException(msg % value.objectName)
value = that._id
@@ -479,10 +480,11 @@
def __repr__(self):
name = self.__class__.__name__
+ agent_id = self.get_agent_id()
cls = self.qmf_object.getClassKey().getClassName()
- id = self.qmf_object.getObjectId().objectName
+ obj_id = self.get_object_id()
- return "%s(%s,%s,%s)" % (name, self.agent.id, cls, id)
+ return "%s(%s,%s,%s)" % (name, agent_id, cls, obj_id)
class AgentUpdate(Update):
def __init__(self, model, qmf_agent):
@@ -507,8 +509,6 @@
stats.updated += 1
- # XXX Add periodic update of update_time
-
def delete_agent_objects(self, cursor, stats, agent):
for pkg in self.model._packages:
for cls in pkg._classes:
14 years, 4 months
rhmessaging commits: r4170 - mgmt/newdata/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-29 15:30:14 -0400 (Thu, 29 Jul 2010)
New Revision: 4170
Modified:
mgmt/newdata/cumin/python/cumin/grid/job.py
Log:
Used the new JobServer -> Scheduler linkage
Modified: mgmt/newdata/cumin/python/cumin/grid/job.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/job.py 2010-07-29 19:28:04 UTC (rev 4169)
+++ mgmt/newdata/cumin/python/cumin/grid/job.py 2010-07-29 19:30:14 UTC (rev 4170)
@@ -67,11 +67,8 @@
def get_scheduler(self, session, id):
job_server = self.get_job_server(session, id)
- pool = job_server.Pool
- machine = job_server.Machine
-
cls = self.app.model.com_redhat_grid.Scheduler
- return cls.get_object(session.cursor, Pool=pool, Machine=machine)
+ return cls.get_object(session.cursor, _id=job_server._schedulerRef_id)
def get_href(self, session, id, job_id):
branch = session.branch()
@@ -286,11 +283,8 @@
cls = self.app.model.com_redhat_grid.JobServer
job_server = cls.get_object(session.cursor, _id=submission._jobserverRef_id)
- pool = job_server.Pool
- machine = job_server.Machine
-
cls = self.app.model.com_redhat_grid.Scheduler
- return cls.get_object(session.cursor, Pool=pool, Machine=machine)
+ return cls.get_object(session.cursor, _id=job_server._schedulerRef_id)
class JobAdsSet(PropertySet):
types = {0: "expression",
14 years, 4 months
rhmessaging commits: r4169 - mgmt/newdata/cumin/model.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-29 15:28:04 -0400 (Thu, 29 Jul 2010)
New Revision: 4169
Modified:
mgmt/newdata/cumin/model/condor.xml
Log:
Picked up new schema that has JobServer.schedulerRef
Modified: mgmt/newdata/cumin/model/condor.xml
===================================================================
--- mgmt/newdata/cumin/model/condor.xml 2010-07-29 19:03:34 UTC (rev 4168)
+++ mgmt/newdata/cumin/model/condor.xml 2010-07-29 19:28:04 UTC (rev 4169)
@@ -20,20 +20,21 @@
<group name="DaemonProperties">
<property name="CondorPlatform"
- type="sstr"
- desc="The Condor platform string for the daemon's platform"/>
+ 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"/>
+ type="sstr"
+ desc="The Condor version string for the daemon's version"/>
<property name="DaemonStartTime"
- type="absTime" unit="nanosecond" optional="y"
- desc="Number of nanoseconds since epoch when the daemon
- was started"/>
+ type="absTime" unit="nanosecond" optional="y"
+ desc="Number of nanoseconds since epoch when the daemon
+ was started"/>
</group>
<group name="DaemonStatistics">
<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"/>
@@ -43,8 +44,9 @@
<group name="GridMethods">
<!-- quick test method across agents/objects -->
<method name="echo">
- <arg name="sequence" dir="IO" type="uint32"/>
- <arg name="body" dir="IO" type="lstr"/>
+ <arg name="sequence" dir="IO" type="uint32"/>
+
+ <arg name="body" dir="IO" type="lstr"/>
</method>
</group>
@@ -92,396 +94,405 @@
<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"/>
+ 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"/>
<property 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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)"/>
+ 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"/>
+ type="uint32" unit="second"
+ desc="Seconds since activity on console keyboard or
+ mouse"/>
<property name="Cpus"
- type="uint32"
- desc="Number of CPUs in slot"/>
+ type="uint32"
+ desc="Number of CPUs in slot"/>
<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"/>
+ 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"/>
+ type="uint32" unit="KiB"
+ desc="Amount of disk space in KiB available in the slot"/>
<property name="EnteredCurrentActivity"
- type="absTime" unit="nanosecond"
- desc="Time at which current Activity was entered,
- number of nanoseconds since Unix epoch"/>
+ type="absTime" unit="nanosecond"
+ desc="Time at which current Activity was entered,
+ number of nanoseconds since Unix epoch"/>
<property name="EnteredCurrentState"
- type="absTime" unit="nanosecond"
- desc="Time at which current State was entered,
- number of seconds since Unix epoch"/>
+ 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"/>
+ 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"/>
+ type="sstr"
+ optional="y"
+ desc="The running job's GlobalJobId, only present when
+ a job is executing"/>
<statistic name="ImageSize"
- type="uint32" unit="KiB"
- 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"/>
+ type="uint32" unit="KiB"
+ 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"/>
+ 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"/>
<property name="JobId"
- type="sstr"
- optional="y"
- desc="The running job's identifier,
- i.e. ClusterId.ProcId, only present when a job is
- executing"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ type="uint32"
+ desc="Relative floating point performance on a Linpack
+ benchmark"/>
<property name="LastBenchmark"
- type="absTime" unit="nanosecond"
- desc="Number of nanoseconds since epoch when the last
- benchmark was run"/>
+ type="absTime" unit="nanosecond"
+ desc="Number of nanoseconds since epoch when the last
+ benchmark was run"/>
+
<property name="LastFetchWorkCompleted"
- type="absTime" unit="nanosecond"
- desc="Number of nanoseconds since epoch when the
- FetchWork Hook returned"
- optional="y"/>
+ type="absTime" unit="nanosecond"
+ desc="Number of nanoseconds since epoch when the
+ FetchWork Hook returned"
+ optional="y"/>
<property name="LastFetchWorkSpawned"
- type="absTime" unit="nanosecond"
- desc="Number of nanoseconds since epoch when the
- FetchWork Hook was invoked"
- optional="y"/>
+ type="absTime" unit="nanosecond"
+ desc="Number of nanoseconds since epoch when the
+ FetchWork Hook was invoked"
+ optional="y"/>
<property 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"
- optional="y"/>
+ 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"
+ optional="y"/>
<statistic name="LoadAvg"
- type="double"
- desc="Load average of CPUs hosting the slot"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ type="absTime" unit="nanosecond"
+ desc="The number of nanoseconds since epoch that the
+ slot produced an updated ad"/>
<property name="Name"
- type="sstr"
- index="y"
- desc="Name of the slot, either the same as Machine,
- slot#@Machine, or a configured value"/>
+ type="sstr"
+ index="y"
+ desc="Name of the slot, either the same as Machine,
+ slot#@Machine, or a configured value"/>
<property name="NextFetchWorkDelay"
- type="int32" unit="second"
- desc="Number of seconds until the next FetchWork
- Hook will be invoked, -1 means never"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
<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"/>
+ 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"/>
<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"/>
+ 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"/>
+
<property name="RemoteOwner"
- type="sstr"
- optional="y"
- desc="The name of the user who originally claimed the
- slot, only present when slot is claimed"/>
+ type="sstr"
+ optional="y"
+ desc="The name of the user who originally claimed the
+ slot, only present when slot is claimed"/>
<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"/>
+ 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"/>
+ type="lstr"
+ desc="Expression evaluated in the context of a job ad
+ to determine if the slot will run a job"/>
<property name="Rank"
- type="lstr"
- desc="Configured expression representing how the slot
- prefers jobs"/>
+ 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'"/>
+ 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"/>
+ 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)"/>
+ type="lstr"
+ desc="StringList, comma separated, set of abilities the
+ slot has, i.e. HasFileTransfer,HasJava,HasVM,
+ query with stringListMember('Element',
+ StarterAbilityList)"/>
<property 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"/>
+ 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"/>
<property name="TimeToLive"
- type="uint32" unit="second"
- desc="Number of second until StartD managing the slot
- has until it will exit"/>
+ type="uint32" unit="second"
+ desc="Number of second until StartD managing the slot
+ has until it will exit"/>
+
<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"/>
+ type="uint32" unit="second"
+ optional="y"
+ desc="Number of seconds the current claim has spent
+ running jobs, only present when slot is
+ claimed"/>
<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"/>
+ 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)"/>
+ 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"/>
+ 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"/>
+ type="uint32" unit="KiB"
+ desc="Amount of disk space available on the slot's host
+ machine"/>
<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"/>
+ 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"/>
<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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
+ 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"/>
</class>
<class name="Scheduler">
@@ -490,6 +501,7 @@
<group name="GridMethods"/>
<property name="Pool" type="sstr" index="y"/>
+
<property name="System" type="sstr" index="y"/>
<property name="JobQueueBirthdate" type="absTime" optional="y"/>
@@ -499,6 +511,7 @@
<statistic name="NumUsers" type="uint32"/>
<property name="Name" type="sstr" index="y" desc=""/>
<statistic name="TotalHeldJobs" type="uint32"/>
+
<statistic name="TotalIdleJobs" type="uint32"/>
<statistic name="TotalJobAds" type="uint32"/>
<statistic name="TotalRemovedJobs" type="uint32"/>
@@ -510,49 +523,53 @@
</method>
<method name="SetJobAttribute">
+
<arg name="Id" dir="I" type="sstr"
- desc="Job's Id, the string ClusterId.ProcId"/>
+ desc="Job's Id, the string ClusterId.ProcId"/>
<arg name="Name" dir="I" type="sstr"/>
<arg name="Value" dir="I" type="lstr"/>
</method>
<method name="HoldJob">
<arg name="Id" dir="I" type="sstr"
- desc="Job's Id, the string ClusterId.ProcId"/>
+ desc="Job's Id, the string ClusterId.ProcId"/>
<arg name="Reason" dir="I" type="sstr"/>
</method>
<method name="ReleaseJob">
<arg name="Id" dir="I" type="sstr"
- desc="Job's Id, the string ClusterId.ProcId"/>
+ desc="Job's Id, the string ClusterId.ProcId"/>
<arg name="Reason" dir="I" type="sstr"/>
</method>
<method name="RemoveJob">
<arg name="Id" dir="I" type="sstr"
- desc="Job's Id, the string ClusterId.ProcId"/>
+ desc="Job's Id, the string ClusterId.ProcId"/>
<arg name="Reason" dir="I" type="sstr"/>
</method>
</class>
<class name="Submitter">
-
- <group name="GridMethods"/>
-
+
+ <group name="GridMethods"/>
+
<property name="schedulerRef" type="objId" parentRef="y" index="y" references="com.redhat.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"/>
+ <property name="Owner" type="sstr" desc="Match for same Submission field"/>
<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"/>
@@ -607,9 +624,12 @@
</class>
<class name="Collector">
- <group name="DaemonProperties"/>
- <group name="GridMethods"/>
-
+ <group name="DaemonProperties"/>
+ <!-- TODO: for now this doesn't seem to be worth the headache
+ of the query worker socket handler interaction & crashes
+ <group name="GridMethods"/>
+ -->
+
<property name="Pool" type="sstr" index="y"/>
<property name="System" type="sstr" index="y"/>
@@ -622,13 +642,14 @@
<statistic name="HostsClaimed" type="uint32"/>
<statistic name="HostsUnclaimed" type="uint32"/>
<statistic name="HostsOwner" type="uint32"/>
+
</class>
<class name="Master">
- <group name="DaemonProperties"/>
- <group name="DaemonStatistics"/>
- <group name="GridMethods"/>
+ <group name="DaemonProperties"/>
+ <group name="DaemonStatistics"/>
+ <group name="GridMethods"/>
<property name="Pool" type="sstr" index="y"/>
<property name="System" type="sstr" index="y"/>
@@ -640,45 +661,47 @@
<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"/>
+ 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"/>
+ dir="I" type="sstr"
+ desc="The component/subsystem to stop: one of STARTD,
+ SCHEDD, COLLECTOR, NEGOTIATOR, KBDD or QUILL"/>
</method>
</class>
<class name="Grid">
-
- <group name="GridMethods"/>
+
+ <group name="GridMethods"/>
<property name="Pool" type="sstr" index="y"/>
<property name="Name" type="sstr"/>
+
<property name="ScheddName" type="sstr"/>
<property name="Owner" type="sstr"/>
<property name="JobLimit"
- type="uint32"
- desc="Maximum number of jobs that can be in the process
- of being submitted at any time."/>
+ type="uint32"
+ desc="Maximum number of jobs that can be in the process
+ of being submitted at any time."/>
<property name="SubmitLimit"
- type="uint32"
- desc="Limit on the number of jobs that will be submitted
- to the grid resource at once."/>
+ type="uint32"
+ desc="Limit on the number of jobs that will be submitted
+ to the grid resource at once."/>
<property name="GridResourceUnavailableTime"
- type="absTime" unit="nanosecond"
- optional="y"
- desc="If present, the Grid is down for the specified
- amount of time."/>
+ type="absTime" unit="nanosecond"
+ optional="y"
+ desc="If present, the Grid is down for the specified
+ amount of time."/>
<statistic name="NumJobs" type="uint32"/>
<statistic name="SubmitsInProgress" type="uint32"/>
<statistic name="SubmitsQueued" type="uint32"/>
+
<statistic name="SubmitsAllowed" type="uint32"/>
<statistic name="SubmitsWanted" type="uint32"/>
<statistic name="RunningJobs" type="uint32"/>
@@ -688,45 +711,51 @@
<!-- NOTE: at deployment, only one daemon between the schedd and the job server will publish this interface -->
<class name="JobServer">
-
- <group name="DaemonProperties"/>
- <group name="DaemonStatistics"/>
- <group name="GridMethods"/>
-
- <property name="Pool" type="sstr" index="y"/>
- <property name="System" type="sstr" index="y"/>
-
- <property name="Machine" type="sstr" desc=""/>
- <property name="MyAddress" type="sstr" desc=""/>
- <property name="Name" type="sstr" index="y" desc=""/>
- <property name="PublicNetworkIpAddr" type="sstr" desc=""/>
-
- <method name="GetJobAd">
- <arg name="Id" dir="I" type="sstr"
- desc="Job's Id, the string ClusterId.ProcId"/>
- <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>
+
+ <group name="DaemonProperties"/>
- <method name="FetchJobData">
- <arg name="Id" dir="I" type="sstr"
- desc="Job's Id, the string ClusterId.ProcId"/>
- <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>
+ <group name="DaemonStatistics"/>
+ <group name="GridMethods"/>
+ <property name="schedulerRef" type="objId" parentRef="y" index="y" references="com.redhat.grid:Scheduler"/>
+
+ <property name="Pool" type="sstr" index="y"/>
+ <property name="System" type="sstr" index="y"/>
+
+ <property name="Machine" type="sstr" desc=""/>
+ <property name="MyAddress" type="sstr" desc=""/>
+ <property name="Name" type="sstr" index="y" desc=""/>
+
+ <property name="PublicNetworkIpAddr" type="sstr" desc=""/>
+
+ <method name="GetJobAd">
+ <arg name="Id" dir="I" type="sstr"
+ desc="Job's Id, the string ClusterId.ProcId"/>
+ <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="FetchJobData">
+ <arg name="Id" dir="I" type="sstr"
+ desc="Job's Id, the string ClusterId.ProcId"/>
+ <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="Submission">
-
- <group name="GridMethods"/>
-
- <!-- navigate from a submission to a job server to get its pool -->
+
+ <group name="GridMethods"/>
+
+
+ <!-- navigate from a submission to a job server to get its pool -->
<property name="jobserverRef" type="objId" parentRef="y" index="y" references="com.redhat.grid:JobServer"/>
<property name="Name" type="sstr" index="y"/>
@@ -736,11 +765,12 @@
<statistic name="Running" type="count32"/>
<statistic name="Removed" type="count32"/>
<statistic name="Completed" type="count32"/>
+
<statistic name="Held" type="count32"/>
<!-- summary info -->
<method name="GetJobSummaries">
- <arg name="Jobs" dir="O" type="map"/>
+ <arg name="Jobs" dir="O" type="map"/>
</method>
</class>
14 years, 4 months
rhmessaging commits: r4168 - mgmt/newdata/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-29 15:03:34 -0400 (Thu, 29 Jul 2010)
New Revision: 4168
Modified:
mgmt/newdata/mint/python/mint/update.py
Log:
Change referent object resolution to account for cross-agent references
Modified: mgmt/newdata/mint/python/mint/update.py
===================================================================
--- mgmt/newdata/mint/python/mint/update.py 2010-07-29 18:29:31 UTC (rev 4167)
+++ mgmt/newdata/mint/python/mint/update.py 2010-07-29 19:03:34 UTC (rev 4168)
@@ -389,12 +389,16 @@
if value:
try:
+ agent = self.model.agents_by_id[value.agentName]
+ except KeyError:
+ raise MappingException("Agent %s is unknown" % value.agentName)
+
+ try:
that_id = str(value.objectName)
except:
raise MappingException("Reference isn't an oid")
- # XXX obviously won't work across agents
- that = self.agent.get_object_by_id(that_id)
+ that = agent.get_object_by_id(that_id)
if not that:
try:
14 years, 4 months
rhmessaging commits: r4167 - in mgmt/newdata: mint/python/mint and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-29 14:29:31 -0400 (Thu, 29 Jul 2010)
New Revision: 4167
Modified:
mgmt/newdata/cumin/python/cumin/sqladapter.py
mgmt/newdata/mint/python/mint/expire.py
mgmt/newdata/rosemary/python/rosemary/model.py
mgmt/newdata/rosemary/python/rosemary/sqloperation.py
Log:
Don't require columns in sqlop execute calls
Modified: mgmt/newdata/cumin/python/cumin/sqladapter.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/sqladapter.py 2010-07-29 17:28:53 UTC (rev 4166)
+++ mgmt/newdata/cumin/python/cumin/sqladapter.py 2010-07-29 18:29:31 UTC (rev 4167)
@@ -20,7 +20,7 @@
cursor = conn.cursor()
try:
- self.query.execute(cursor, ("count(1)",), values)
+ self.query.execute(cursor, values, columns=("count(1)",))
return cursor.fetchone()[0]
finally:
@@ -45,7 +45,9 @@
cursor = conn.cursor()
try:
- self.query.execute(cursor, self.columns, values, sql_options)
+ self.query.execute(cursor, values,
+ columns=self.columns,
+ options=sql_options)
return cursor.fetchall()
finally:
Modified: mgmt/newdata/mint/python/mint/expire.py
===================================================================
--- mgmt/newdata/mint/python/mint/expire.py 2010-07-29 17:28:53 UTC (rev 4166)
+++ mgmt/newdata/mint/python/mint/expire.py 2010-07-29 18:29:31 UTC (rev 4167)
@@ -50,7 +50,7 @@
log.info("Expired %i samples", count)
def delete_samples(self, cursor, cls, seconds):
- cls.sql_samples_delete.execute(cursor, (), {"seconds": seconds})
+ cls.sql_samples_delete.execute(cursor, {"seconds": seconds})
log.debug("Deleted %i %s", cursor.rowcount, cls)
Modified: mgmt/newdata/rosemary/python/rosemary/model.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/model.py 2010-07-29 17:28:53 UTC (rev 4166)
+++ mgmt/newdata/rosemary/python/rosemary/model.py 2010-07-29 18:29:31 UTC (rev 4167)
@@ -344,7 +344,6 @@
self.sql_samples_delete = SqlDeleteObjectSamples(table)
def get_object(self, cursor, **criteria):
- columns = self.sql_table._columns
sql = SqlSelect(self.sql_table)
for name in criteria:
@@ -353,7 +352,7 @@
column = self.sql_table._columns_by_name[name]
sql.add_filter(SqlValueFilter(column))
- sql.execute(cursor, columns, criteria)
+ sql.execute(cursor, criteria)
record = cursor.fetchone()
@@ -362,14 +361,12 @@
obj = RosemaryObject(self, None)
- self.set_object_attributes(obj, columns, record)
+ self.set_object_attributes(obj, self.sql_table._columns, record)
return obj
def get_selection(self, cursor, **criteria):
selection = list()
-
- columns = self.sql_table._columns
sql = SqlSelect(self.sql_table)
for name in criteria:
@@ -378,12 +375,12 @@
column = self.sql_table._columns_by_name[name]
sql.add_filter(SqlValueFilter(column))
- sql.execute(cursor, columns, criteria)
+ sql.execute(cursor, criteria)
for record in cursor.fetchall():
obj = RosemaryObject(self, None)
- self.set_object_attributes(obj, columns, record)
+ self.set_object_attributes(obj, self.sql_table._columns, record)
selection.append(obj)
@@ -408,7 +405,7 @@
return obj
def get_new_id(self, cursor):
- self.sql_get_new_id.execute(cursor, ())
+ self.sql_get_new_id.execute(cursor)
values = cursor.fetchone()
@@ -425,31 +422,28 @@
assert isinstance(obj, RosemaryObject)
assert obj._id, obj
- columns = self.sql_table._columns
- self.sql_select_by_id.execute(cursor, columns, obj.__dict__)
+ self.sql_select_by_id.execute(cursor, obj.__dict__)
values = cursor.fetchone()
if not values:
raise RosemaryNotFound()
- self.set_object_attributes(obj, columns, values)
+ self.set_object_attributes(obj, self.sql_table._columns, values)
def load_object_by_qmf_id(self, cursor, obj):
assert isinstance(obj, RosemaryObject)
assert obj._qmf_agent_id, obj
assert obj._qmf_object_id, obj
- columns = self.sql_table._columns
+ self.sql_select_by_qmf_id.execute(cursor, obj.__dict__)
- self.sql_select_by_qmf_id.execute(cursor, columns, obj.__dict__)
-
values = cursor.fetchone()
if not values:
raise RosemaryNotFound()
- self.set_object_attributes(obj, columns, values)
+ self.set_object_attributes(obj, self.sql_table._columns, values)
def set_object_attributes(self, obj, columns, values):
assert isinstance(obj, RosemaryObject)
@@ -463,13 +457,15 @@
assert isinstance(obj, RosemaryObject)
assert obj._id, obj
+ if obj._sync_time:
+ sql = self.sql_update_object
+ else:
+ sql = self.sql_insert_object
+
if columns is None:
columns = self.sql_table._columns
- if obj._sync_time:
- self.sql_update_object.execute(cursor, columns, obj.__dict__)
- else:
- self.sql_insert_object.execute(cursor, columns, obj.__dict__)
+ sql.execute(cursor, obj.__dict__, columns=columns)
obj._sync_time = datetime.now()
@@ -480,13 +476,13 @@
if columns is None:
columns = self.sql_table._columns
- self.sql_samples_insert.execute(cursor, columns, obj.__dict__)
+ self.sql_samples_insert.execute(cursor, obj.__dict__, columns=columns)
def delete_object(self, cursor, obj):
assert isinstance(obj, RosemaryObject)
assert obj._id
- self.sql_delete_object.execute(cursor, (), obj.__dict__)
+ self.sql_delete_object.execute(cursor, obj.__dict__)
def delete_selection(self, cursor, **criteria):
sql = SqlDelete(self.sql_table)
@@ -495,7 +491,7 @@
column = self.sql_table._columns_by_name[name]
sql.add_filter(SqlValueFilter(column))
- sql.execute(cursor, (), criteria)
+ sql.execute(cursor, criteria)
return cursor.rowcount
Modified: mgmt/newdata/rosemary/python/rosemary/sqloperation.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/sqloperation.py 2010-07-29 17:28:53 UTC (rev 4166)
+++ mgmt/newdata/rosemary/python/rosemary/sqloperation.py 2010-07-29 18:29:31 UTC (rev 4167)
@@ -15,7 +15,10 @@
def get_filter_exprs(self):
return " and ".join([x.emit() for x in self.filters])
- def execute(self, cursor, columns, values=None, options=None):
+ def execute(self, cursor, values=None, columns=None, options=None):
+ if columns is None:
+ columns = self.table._columns
+
text = self.emit(columns, options)
if values is None:
14 years, 4 months