rhmessaging commits: r4075 - mgmt/newdata/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-06 14:08:09 -0400 (Tue, 06 Jul 2010)
New Revision: 4075
Modified:
mgmt/newdata/wooly/python/wooly/tables.py
Log:
Column headers are now children of columns, so fixup the way we get the header's container
Modified: mgmt/newdata/wooly/python/wooly/tables.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/tables.py 2010-07-06 17:46:40 UTC (rev 4074)
+++ mgmt/newdata/wooly/python/wooly/tables.py 2010-07-06 18:08:09 UTC (rev 4075)
@@ -167,13 +167,14 @@
def render_href(self, session):
branch = session.branch()
- sel = self.parent.get_selected_column(session)
+ container = self.parent.parent
+ sel = container.get_selected_column(session)
if sel is self.column:
- self.parent.reversed.set \
- (branch, not self.parent.reversed.get(session))
+ container.reversed.set \
+ (branch, not container.reversed.get(session))
- self.parent.scolumn.set(branch, self.column.name)
+ container.scolumn.set(branch, self.column.name)
return branch.marshal()
@@ -181,14 +182,15 @@
return self.column.render_title(session)
def render_sorted_dir(self, session):
- sel = self.parent.get_selected_column(session)
+ container = self.parent.parent
+ sel = container.get_selected_column(session)
if sel is self.column:
- if self.parent.reversed.get(session):
+ if container.reversed.get(session):
return "up"
else:
return "down"
- elif self.parent.reversed.get(session):
+ elif container.reversed.get(session):
return "unsorted_up"
else:
return "unsorted_down"
14 years, 8 months
rhmessaging commits: r4074 - mgmt/newdata/cumin/model.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-06 13:46:40 -0400 (Tue, 06 Jul 2010)
New Revision: 4074
Modified:
mgmt/newdata/cumin/model/rosemary.xml
Log:
Call collectors 'pools'
Modified: mgmt/newdata/cumin/model/rosemary.xml
===================================================================
--- mgmt/newdata/cumin/model/rosemary.xml 2010-07-06 17:38:51 UTC (rev 4073)
+++ mgmt/newdata/cumin/model/rosemary.xml 2010-07-06 17:46:40 UTC (rev 4074)
@@ -264,6 +264,14 @@
</package>
<package name="com.redhat.grid">
+ <class name="Collector">
+ <title>Pool</title>
+
+ <object>
+ <title>%(Pool)s</title>
+ </object>
+ </class>
+
<class name="Slot">
<property name="JobId">
<title>Job ID</title>
14 years, 8 months
rhmessaging commits: r4073 - in mgmt/newdata: rosemary/bin and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-06 13:38:51 -0400 (Tue, 06 Jul 2010)
New Revision: 4073
Modified:
mgmt/newdata/cumin/model/rosemary.xml
mgmt/newdata/rosemary/bin/rosemary-model
mgmt/newdata/rosemary/python/rosemary/model.py
Log:
* Set system titles correctly
* Fix metadata loader to pick up class/title element text
* Improve rosemary-model output
Modified: mgmt/newdata/cumin/model/rosemary.xml
===================================================================
--- mgmt/newdata/cumin/model/rosemary.xml 2010-07-06 15:30:41 UTC (rev 4072)
+++ mgmt/newdata/cumin/model/rosemary.xml 2010-07-06 17:38:51 UTC (rev 4073)
@@ -199,6 +199,12 @@
<package name="com.redhat.sesame">
<class name="Sysimage">
+ <title>System</title>
+
+ <object>
+ <title>%(nodeName)s</title>
+ </object>
+
<property name="uuid">
<title>System ID</title>
</property>
Modified: mgmt/newdata/rosemary/bin/rosemary-model
===================================================================
--- mgmt/newdata/rosemary/bin/rosemary-model 2010-07-06 15:30:41 UTC (rev 4072)
+++ mgmt/newdata/rosemary/bin/rosemary-model 2010-07-06 17:38:51 UTC (rev 4073)
@@ -8,20 +8,20 @@
print "package %s" % pkg._name
for cls in pkg._classes:
- print " class %s" % cls._name
+ print " class %s \"%s\"" % (cls._name, cls._title)
for hdr in cls._headers:
- print " hdr %s %s" % (hdr.name, hdr.title or "")
+ print " hdr %s \"%s\"" % (hdr.name, hdr.title)
for ref in cls._references:
- print " ref %s %s" % (ref.name, ref.title or "")
+ print " ref %s \"%s\"" % (ref.name, ref.title)
for prop in cls._properties:
- print " prop %s %s" % (prop.name, prop.title or "")
+ print " prop %s \"%s\"" % (prop.name, prop.title)
for stat in cls._statistics:
- print " stat %s %s" % (stat.name, stat.title or "")
-
+ print " stat %s \"%s\"" % (stat.name, stat.title)
+
for meth in cls._methods:
print " meth %s" % meth.name
Modified: mgmt/newdata/rosemary/python/rosemary/model.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/model.py 2010-07-06 15:30:41 UTC (rev 4072)
+++ mgmt/newdata/rosemary/python/rosemary/model.py 2010-07-06 17:38:51 UTC (rev 4073)
@@ -273,7 +273,8 @@
def extend(self, elem):
log.debug("Extending %s", self)
- self._title = elem.find("title")
+ self._title = elem.findtext("title")
+
self._object_title = elem.findtext("object/title")
for child in elem.findall("property"):
14 years, 8 months
rhmessaging commits: r4072 - in mgmt/newdata: cumin/python/cumin/grid and 3 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-06 11:30:41 -0400 (Tue, 06 Jul 2010)
New Revision: 4072
Modified:
mgmt/newdata/cumin/python/cumin/grid/pool.py
mgmt/newdata/cumin/python/cumin/main.py
mgmt/newdata/cumin/python/cumin/messaging/binding.py
mgmt/newdata/cumin/python/cumin/objectframe.py
mgmt/newdata/cumin/python/cumin/objecttask.py
mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
mgmt/newdata/wooly/python/wooly/__init__.py
mgmt/newdata/wooly/python/wooly/tables.py
Log:
Fix init problems by changing task naming; remove user grid workaround
Modified: mgmt/newdata/cumin/python/cumin/grid/pool.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/pool.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/cumin/python/cumin/grid/pool.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -336,7 +336,7 @@
self.flash_chart = PoolSlotFlashVis(app, "chart", self.collector)
self.flash_chart.fullpageable = False
- self.add_child(self.flash_chart)
+ self.replace_child(self.flash_chart)
def render_content(self, session):
return self.flash_chart.render(session)
Modified: mgmt/newdata/cumin/python/cumin/main.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/main.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/cumin/python/cumin/main.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -148,7 +148,7 @@
return self.get_title(session)
def get_title(self, session):
- return "MRG Administration"
+ return "Administrator"
class MainView(CuminMainView):
def __init__(self, app, name):
Modified: mgmt/newdata/cumin/python/cumin/messaging/binding.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/binding.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/cumin/python/cumin/messaging/binding.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -15,7 +15,7 @@
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.messaging.exchange")
-class BindingSelectionRemove(ObjectTask):
+class BindingSelectionRemove(SelectionTask):
def get_title(self, session):
return "Remove"
@@ -108,7 +108,7 @@
self.add_attribute_column(binding.origin)
self.add_attribute_column(binding.msgMatched)
-
+
self.remove = BindingSelectionRemove(app, self)
class Exchange(ObjectLinkColumn):
Modified: mgmt/newdata/cumin/python/cumin/objectframe.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objectframe.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/cumin/python/cumin/objectframe.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -30,7 +30,6 @@
self.tasks = list()
self.summary_attributes = list()
- self.summary_tasks = list() # XXX
self.add_summary_attribute(cls._qmf_update_time)
Modified: mgmt/newdata/cumin/python/cumin/objecttask.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objecttask.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/cumin/python/cumin/objecttask.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -18,18 +18,16 @@
class Task(object):
def __init__(self, app):
self.app = app
- self.name = self.__class__.__name__
+ # XXX This is an unfortunate workaround for some broken
+ # modeling of tasks (my work!)
+ self.name = "%s_%i" % (self.__class__.__name__, id(self))
+
self.form = None
def init(self):
log.info("Initializing %s", self)
- assert self.form, self.form
-
- # XXX make this idempotent
- self.app.form_page.modes.add_mode(self.form)
-
def get_title(self, session):
pass
@@ -119,8 +117,13 @@
self.frame = frame
self.frame.tasks.append(self)
- self.form = ObjectTaskForm(app, self.name, self)
+ def init(self):
+ super(ObjectTask, self).init()
+ if not self.form:
+ self.form = ObjectTaskForm(self.app, self.name, self)
+ self.form.init()
+
def enter(self, session):
id = self.frame.id.get(session)
@@ -241,8 +244,15 @@
self.selector = selector
self.selector.tasks.append(self)
- self.form = SelectionTaskForm(app, self.name, self)
+ self.form = None
+ def init(self):
+ super(SelectionTask, self).init()
+
+ if not self.form:
+ self.form = SelectionTaskForm(self.app, self.name, self)
+ self.form.init()
+
def get_title(self, session):
pass
@@ -295,6 +305,8 @@
self.object = SessionAttribute(self, "object")
+ self.app.form_page.modes.add_mode(self)
+
def do_process(self, session):
id = self.id.get(session)
@@ -337,6 +349,8 @@
self.content = self.SelectionList(app, "fields")
self.replace_child(self.content)
+ self.app.form_page.modes.add_mode(self)
+
def do_process(self, session):
self.get_selection(session)
super(SelectionTaskForm, self).do_process(session)
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -32,7 +32,7 @@
return self.get_title(session)
def get_title(self, session):
- return "User Grid"
+ return "Grid User"
class MainView(CuminMainView):
def __init__(self, app, name, user):
@@ -68,8 +68,8 @@
#self.view = UserSubmissionSet(app, "view", user)
#self.add_mode(self.view)
- #self.submission = SubmissionFrame(app, "submission")
- #self.add_mode(self.submission)
+ self.submission = SubmissionFrame(app, "submission")
+ self.add_mode(self.submission)
def render_title(self, session):
return "Submissions"
Modified: mgmt/newdata/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/__init__.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/wooly/python/wooly/__init__.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -208,11 +208,8 @@
assert isinstance(child, Widget), (self, child)
assert child is not self, self
assert child not in self.children, (self, child, self.children)
+ assert child.name not in self.children_by_name, child.name
- # XXX assert child.name not in self.children_by_name
- if child.name in self.children_by_name:
- log.error("%s is already in %s", child.name, self)
-
self.children.append(child)
self.children_by_name[child.name] = child
child.parent = self
@@ -505,6 +502,8 @@
def init(self):
for page in self.pages:
page.init()
+
+ for page in self.pages:
page.seal()
def add_page(self, page):
Modified: mgmt/newdata/wooly/python/wooly/tables.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/tables.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/wooly/python/wooly/tables.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -55,8 +55,9 @@
self.add_child(column)
header = column.header_class(self.app, "head", column)
+
self.set_header(column, header)
- self.add_child(header)
+ column.add_child(header)
if self.scolumn.default is None:
self.scolumn.default = column.name
14 years, 8 months
rhmessaging commits: r4071 - mgmt/newdata/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-06 10:17:52 -0400 (Tue, 06 Jul 2010)
New Revision: 4071
Modified:
mgmt/newdata/mint/python/mint/update.py
Log:
Tweak to event output
Modified: mgmt/newdata/mint/python/mint/update.py
===================================================================
--- mgmt/newdata/mint/python/mint/update.py 2010-07-05 14:06:58 UTC (rev 4070)
+++ mgmt/newdata/mint/python/mint/update.py 2010-07-06 14:17:52 UTC (rev 4071)
@@ -481,11 +481,9 @@
for pkg in self.model._packages:
for cls in pkg._classes:
for obj in cls.get_selection(cursor, _qmf_agent_id=id):
- message = "Deleting %s, from %s"
- self.model.print_event(3, message, obj, self.agent)
-
obj.delete(cursor)
+ self.model.print_event(3, "Deleted %s", obj)
stats.deleted += 1
class UpdateDropped(Exception):
14 years, 8 months
rhmessaging commits: r4070 - store/trunk/java/bdbstore/src/tools/java/org/apache/qpid/server/store/berkeleydb.
by rhmessaging-commits@lists.jboss.org
Author: rgemmell
Date: 2010-07-05 10:06:58 -0400 (Mon, 05 Jul 2010)
New Revision: 4070
Modified:
store/trunk/java/bdbstore/src/tools/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgrade.java
Log:
The upgrade tool must now also manually transition the new store into the STARTED state
Modified: store/trunk/java/bdbstore/src/tools/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgrade.java
===================================================================
--- store/trunk/java/bdbstore/src/tools/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgrade.java 2010-07-02 19:58:53 UTC (rev 4069)
+++ store/trunk/java/bdbstore/src/tools/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgrade.java 2010-07-05 14:06:58 UTC (rev 4070)
@@ -338,6 +338,7 @@
//Create a new messageStore
_newMessageStore = new BDBMessageStore();
_newMessageStore.configure(toDir, false);
+ _newMessageStore.start();
try
{
14 years, 8 months
rhmessaging commits: r4069 - in mgmt/newdata: rosemary/python/rosemary and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-02 15:58:53 -0400 (Fri, 02 Jul 2010)
New Revision: 4069
Modified:
mgmt/newdata/mint/python/mint/model.py
mgmt/newdata/mint/python/mint/session.py
mgmt/newdata/mint/python/mint/update.py
mgmt/newdata/rosemary/python/rosemary/model.py
Log:
* Remove _qmf_class_key from the schema; the new qmf call
implementation doesn't need it
* Handle deletes as a type of update
* Reorganize object update into three distinct cases: create, update,
and delete; this fell out from the data corruption fix
* Be more aggressive about dropping too-old or too-recent samples
* Use an exception to signal a dropped update; this avoids any extra
communication with the database in this case
* Fix get_object_by_qmf_id in rosemary, and use it in update.py
* Remove sampled from the stats; they are always accounted for in
created or updated
Modified: mgmt/newdata/mint/python/mint/model.py
===================================================================
--- mgmt/newdata/mint/python/mint/model.py 2010-07-02 19:37:43 UTC (rev 4068)
+++ mgmt/newdata/mint/python/mint/model.py 2010-07-02 19:58:53 UTC (rev 4069)
@@ -80,27 +80,18 @@
self.model = None
- def get_object(self, cursor, cls, object_id):
+ def get_object_by_id(self, object_id):
try:
return self.objects_by_id[object_id]
except KeyError:
- obj = RosemaryObject(cls, None)
- obj._qmf_agent_id = self.id
- obj._qmf_object_id = object_id
+ pass
- try:
- cls.load_object_by_qmf_id(cursor, obj)
- except RosemaryNotFound:
- obj._id = cls.get_new_id(cursor)
-
- return obj
-
def add_object(self, obj):
self.objects_by_id[obj._qmf_object_id] = obj
- def delete_object(self, object_id):
+ def delete_object(self, obj):
try:
- del self.objects_by_id[object_id]
+ del self.objects_by_id[obj._qmf_object_id]
except KeyError:
pass
Modified: mgmt/newdata/mint/python/mint/session.py
===================================================================
--- mgmt/newdata/mint/python/mint/session.py 2010-07-02 19:37:43 UTC (rev 4068)
+++ mgmt/newdata/mint/python/mint/session.py 2010-07-02 19:58:53 UTC (rev 4069)
@@ -111,11 +111,7 @@
if not self.model.app.update_thread.isAlive():
return
- if obj.getTimestamps()[2]:
- up = ObjectDelete(self.model, agent, obj)
- else:
- up = ObjectUpdate(self.model, agent, obj)
-
+ up = ObjectUpdate(self.model, agent, obj)
self.model.app.update_thread.enqueue(up)
def objectStats(self, broker, obj):
Modified: mgmt/newdata/mint/python/mint/update.py
===================================================================
--- mgmt/newdata/mint/python/mint/update.py 2010-07-02 19:37:43 UTC (rev 4068)
+++ mgmt/newdata/mint/python/mint/update.py 2010-07-02 19:58:53 UTC (rev 4069)
@@ -51,10 +51,10 @@
class UpdateStats(object):
names = ("*Enqueued", "*Dequeued", "Depth", "*Created", "*Updated",
- "*Sampled", "*Deleted", "*Dropped", "*Sql Ops",
- "Errors", "Cpu (%)", "Mem (M)")
- headings = ("%10s " * 12) % names
- values_fmt = "%10.1f %10.1f %10i %10.1f %10.1f %10.1f %10.1f " + \
+ "*Deleted", "*Dropped", "*Sql Ops", "Errors", "Cpu (%)",
+ "Mem (M)")
+ headings = ("%10s " * 11) % names
+ values_fmt = "%10.1f %10.1f %10i %10.1f %10.1f %10.1f " + \
"%10.1f %10.1f %10i %10i %10.1f"
then = None
@@ -66,7 +66,6 @@
self.created = 0
self.updated = 0
- self.sampled = 0
self.deleted = 0
self.dropped = 0
@@ -112,7 +111,6 @@
self.now.dequeued - self.then.dequeued,
self.now.created - self.then.created,
self.now.updated - self.then.updated,
- self.now.sampled - self.then.sampled,
self.now.deleted - self.then.deleted,
self.now.dropped - self.then.dropped,
self.now.sql_ops - self.then.sql_ops]
@@ -145,8 +143,10 @@
self.do_process(thread.cursor, thread.stats)
thread.conn.commit()
+ except UpdateDropped:
+ thread.stats.dropped += 1
except UpdateException, e:
- log.info("Update could not be completed; %s", e)
+ log.exception("Update could not be completed")
thread.conn.rollback()
except:
@@ -168,171 +168,180 @@
return self.__class__.__name__
class ObjectUpdate(Update):
- def __init__(self, model, agent, obj):
+ def __init__(self, model, agent, object):
super(ObjectUpdate, self).__init__(model)
self.agent = agent
- self.object = obj
+ self.object = object
def do_process(self, cursor, stats):
- cls, obj = self.get_object(cursor)
+ cls = self.get_class()
+ obj_id = self.get_object_id()
+ obj = self.agent.get_object_by_id(obj_id)
+ if not obj:
+ try:
+ obj = cls.get_object_by_qmf_id(cursor, self.agent.id, obj_id)
+ except RosemaryNotFound:
+ pass
+
update_time, create_time, delete_time = self.object.getTimestamps()
- update_time = datetime.fromtimestamp(update_time / 1000000000)
- now = datetime.now()
+ if obj:
+ if delete_time != 0:
+ self.delete_object(cursor, stats, obj)
+ return
- if self.object.getStatistics() and not self.object.getProperties():
- # Just stats; do we want it?
+ if not self.object.getProperties() and self.object.getStatistics():
+ # Just stats; do we want it?
+ # if stats.enqueued - stats.dequeued > 500:
- if not obj._sync_time:
- # We don't have this object yet
- stats.dropped += 1; return
+ now = datetime.now()
+ update = datetime.fromtimestamp(update_time / 1000000000)
+ sample = obj._sample_time
- if stats.enqueued - stats.dequeued > 500:
- if update_time < now - minutes_ago:
+ if update < now - minutes_ago:
# The sample is too old
- stats.dropped += 1; return
+ raise UpdateDropped()
- if obj._sample_time and obj._sample_time > now - seconds_ago:
+ if sample and sample > now - seconds_ago:
# The samples are too fidelitous
- stats.dropped += 1; return
+ raise UpdateDropped()
- obj._qmf_update_time = update_time
+ self.update_object(cursor, stats, obj)
+ else:
+ if not self.object.getProperties():
+ raise UpdateDropped()
- object_columns = list()
- sample_columns = list()
+ if delete_time != 0:
+ raise UpdateDropped()
- self.process_headers(obj, object_columns)
- self.process_properties(obj, object_columns, cursor)
- self.process_statistics(obj, object_columns, sample_columns)
+ obj = self.create_object(cursor, stats, cls)
- statements = list()
+ assert obj
- if object_columns:
- object_columns.append(cls.sql_table._qmf_update_time)
+ self.agent.add_object(obj)
- if obj._sync_time:
- sql = cls.sql_update.emit(object_columns)
- stats.updated += 1
+ def get_class(self):
+ class_key = self.object.getClassKey()
+ name = class_key.getPackageName()
- self.model.print_event(4, "Updating %s", obj)
- else:
- sql = cls.sql_insert.emit(object_columns)
- stats.created += 1
+ try:
+ pkg = self.model._packages_by_name[name]
+ except KeyError:
+ raise PackageUnknown(name)
- message = "Creating %s, from %s"
- self.model.print_event(3, message, obj, self.agent)
+ name = class_key.getClassName()
- statements.append(sql)
+ try:
+ cls = pkg._classes_by_lowercase_name[name.lower()]
+ except KeyError:
+ raise ClassUnknown(name)
+
+ return cls
- if sample_columns:
- sample_columns.append(cls.sql_samples_table._qmf_update_time)
+ def get_object_id(self):
+ return self.object.getObjectId().objectName
- sql = cls.sql_samples_insert.emit(sample_columns)
- statements.append(sql)
+ def create_object(self, cursor, stats, cls):
+ update_time, create_time, delete_time = self.object.getTimestamps()
+ create_time = datetime.fromtimestamp(create_time / 1000000000)
+ update_time = datetime.fromtimestamp(update_time / 1000000000)
- stats.sampled += 1
- obj._sample_time = update_time
+ obj = cls.create_object(cursor)
+ obj._qmf_agent_id = self.agent.id
+ obj._qmf_object_id = self.get_object_id()
+ obj._qmf_session_id = str(self.object.getObjectId().getSequence())
+ obj._qmf_create_time = create_time
+ obj._qmf_update_time = update_time
+
+ object_columns = list()
+ sample_columns = list()
- if statements:
- text = "; ".join(statements)
+ table = cls.sql_table
- try:
- cursor.execute(text, obj.__dict__)
- except:
- log.exception("%s failed", self)
+ object_columns.append(table._id)
+ object_columns.append(table._qmf_agent_id)
+ object_columns.append(table._qmf_object_id)
+ object_columns.append(table._qmf_session_id)
+ object_columns.append(table._qmf_create_time)
+ object_columns.append(table._qmf_update_time)
- log.error("Sql text: %s", text)
- log.error("Sql values:")
+ self.process_properties(obj, object_columns, cursor)
+ self.process_statistics(obj, object_columns, sample_columns)
- for item in sorted(obj.__dict__.items()):
- log.error(" %-34s %r", *item)
+ statements = list()
- log.error("Sql object columns:")
+ sql = cls.sql_insert.emit(object_columns)
+ statements.append(sql)
- for item in sorted(object_columns):
- log.error(" %-34s", item)
+ if sample_columns:
+ sample_columns.append(cls.sql_samples_table._qmf_update_time)
- log.error("Sql sample columns:")
+ sql = cls.sql_samples_insert.emit(sample_columns)
+ statements.append(sql)
- for item in sorted(sample_columns):
- log.error(" %-34s", item)
+ obj._sample_time = datetime.now()
- log.error("Sql row count: %i", cursor.rowcount)
+ sql = "; ".join(statements)
+ self.execute_sql(cursor, sql, obj.__dict__)
- log.error("Qmf properties:")
+ obj._sync_time = datetime.now()
- for item in sorted(self.object.getProperties()):
- log.error(" %-34s %r", *item)
+ self.model.print_event(3, "Created %s", obj)
+ stats.created += 1
- log.error("Qmf statistics:")
+ return obj
- for item in sorted(self.object.getStatistics()):
- log.error(" %-34s %r", *item)
+ def update_object(self, cursor, stats, obj):
+ update_time, create_time, delete_time = self.object.getTimestamps()
+ update_time = datetime.fromtimestamp(update_time / 1000000000)
- raise
+ obj._qmf_update_time = update_time
- obj._sync_time = now
+ object_columns = list()
+ sample_columns = list()
- self.add_object(obj)
- else:
- stats.dropped += 1
+ cls = obj._class
- def get_object(self, cursor):
- class_key = self.object.getClassKey()
+ self.process_properties(obj, object_columns, cursor)
+ self.process_statistics(obj, object_columns, sample_columns)
- name = class_key.getPackageName()
+ statements = list()
- try:
- pkg = self.model._packages_by_name[name]
- except KeyError:
- raise PackageUnknown(name)
+ if object_columns:
+ object_columns.append(cls.sql_table._qmf_update_time)
- name = class_key.getClassName()
+ sql = cls.sql_update.emit(object_columns)
+ statements.append(sql)
- try:
- cls = pkg._classes_by_lowercase_name[name.lower()]
- except KeyError:
- raise ClassUnknown(name)
+ if sample_columns:
+ sample_columns.append(cls.sql_samples_table._qmf_update_time)
- object_id = self.object.getObjectId().objectName
+ sql = cls.sql_samples_insert.emit(sample_columns)
+ statements.append(sql)
- obj = self.agent.get_object(cursor, cls, object_id)
-
- return cls, obj
+ obj._sample_time = datetime.now()
- def add_object(self, obj):
- self.agent.add_object(obj)
+ if not statements:
+ raise UpdateDropped()
- def process_headers(self, obj, columns):
- table = obj._class.sql_table
+ sql = "; ".join(statements)
+ self.execute_sql(cursor, sql, obj.__dict__)
- update_time, create_time, delete_time = self.object.getTimestamps()
- create_time = datetime.fromtimestamp(create_time / 1000000000)
+ obj._sync_time = datetime.now()
- if delete_time:
- delete_time = datetime.fromtimestamp(delete_time / 1000000000)
+ self.model.print_event(4, "Updated %s", obj)
+ stats.updated += 1
- obj._qmf_delete_time = delete_time
- columns.append(table._qmf_delete_time)
+ def delete_object(self, cursor, stats, obj):
+ obj.delete(cursor)
- if not obj._sync_time:
- # The object hasn't been written to the database yet
+ self.agent.delete_object(obj)
- obj._qmf_agent_id = self.agent.id
- obj._qmf_object_id = self.object.getObjectId().objectName
- obj._qmf_session_id = str(self.object.getObjectId().getSequence())
- obj._qmf_class_key = str(self.object.getClassKey())
- obj._qmf_create_time = create_time
+ self.model.print_event(3, "Deleted %s", obj)
+ stats.deleted += 1
- columns.append(table._id)
- columns.append(table._qmf_agent_id)
- columns.append(table._qmf_object_id)
- columns.append(table._qmf_session_id)
- columns.append(table._qmf_class_key)
- columns.append(table._qmf_create_time)
-
def process_properties(self, obj, columns, cursor):
cls = obj._class
@@ -373,11 +382,16 @@
except:
raise MappingException("Reference isn't an oid")
- that = self.agent.get_object(cursor, ref.that_cls, that_id)
+ # XXX obviously won't work across agents
+ that = self.agent.get_object_by_id(that_id)
- if not that._sync_time:
- msg = "Referenced object %s hasn't appeared yet"
- raise MappingException(msg % that)
+ if not that:
+ try:
+ that = ref.that_cls.get_object_by_qmf_id \
+ (cursor, self.agent.id, that_id)
+ except RosemaryNotFound:
+ msg = "Referenced object %s hasn't appeared yet"
+ raise MappingException(msg % that)
value = that._id
@@ -422,6 +436,32 @@
setattr(obj, col.name, value)
+ def execute_sql(self, cursor, text, args):
+ try:
+ cursor.execute(text, args)
+ except:
+ log.exception("%s failed", self)
+
+ log.error("Sql text: %s", text)
+ log.error("Sql values:")
+
+ for item in sorted(args.items()):
+ log.error(" %-34s %r", *item)
+
+ log.error("Sql row count: %i", cursor.rowcount)
+
+ log.error("Qmf properties:")
+
+ for item in sorted(self.object.getProperties()):
+ log.error(" %-34s %r", *item)
+
+ log.error("Qmf statistics:")
+
+ for item in sorted(self.object.getStatistics()):
+ log.error(" %-34s %r", *item)
+
+ raise
+
def __repr__(self):
name = self.__class__.__name__
cls = self.object.getClassKey().getClassName()
@@ -429,18 +469,6 @@
return "%s(%s,%s,%s)" % (name, self.agent.id, cls, id)
-class ObjectDelete(ObjectUpdate):
- def do_process(self, cursor, stats):
- cls, obj = self.get_object(cursor)
-
- self.model.print_event(3, "Deleting %s, from %s", obj, self.agent)
-
- obj.delete(cursor)
-
- self.agent.delete_object(obj._qmf_object_id)
-
- stats.deleted += 1
-
class AgentDelete(Update):
def __init__(self, model, agent):
super(AgentDelete, self).__init__(model)
@@ -460,6 +488,9 @@
stats.deleted += 1
+class UpdateDropped(Exception):
+ pass
+
class UpdateException(Exception):
def __init__(self, name):
self.name = name
Modified: mgmt/newdata/rosemary/python/rosemary/model.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/model.py 2010-07-02 19:37:43 UTC (rev 4068)
+++ mgmt/newdata/rosemary/python/rosemary/model.py 2010-07-02 19:58:53 UTC (rev 4069)
@@ -213,10 +213,6 @@
self._qmf_session_id = RosemaryHeader(self, name, sql_text)
self._qmf_session_id.title = "Session ID"
- name = "_qmf_class_key"
- self._qmf_class_key = RosemaryHeader(self, name, sql_text)
- self._qmf_class_key.title = "Class Key"
-
name = "_qmf_create_time"
self._qmf_create_time = RosemaryHeader(self, name, sql_timestamp)
self._qmf_create_time.title = "Create Time"
@@ -377,13 +373,11 @@
return obj
def get_object_by_qmf_id(self, cursor, agent_id, object_id):
- assert isinstance(obj, RosemaryObject)
-
obj = RosemaryObject(self, None)
obj._qmf_agent_id = agent_id
obj._qmf_object_id = object_id
- self.load_object_qmf_id(cursor, obj)
+ self.load_object_by_qmf_id(cursor, obj)
return obj
@@ -692,7 +686,6 @@
self._qmf_object_id = str(datetime.now())
self._qmf_create_time = datetime.now()
self._qmf_update_time = datetime.now()
- self._qmf_class_key = "__rosemary__"
def get_title(self):
if self._class._object_title:
14 years, 8 months
rhmessaging commits: r4068 - mgmt/newdata/cumin/python/cumin/usergrid.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-07-02 15:37:43 -0400 (Fri, 02 Jul 2010)
New Revision: 4068
Modified:
mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
Log:
Temporarily disable this until task initialization is repaired
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-07-02 13:55:36 UTC (rev 4067)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-07-02 19:37:43 UTC (rev 4068)
@@ -68,8 +68,8 @@
#self.view = UserSubmissionSet(app, "view", user)
#self.add_mode(self.view)
- self.submission = SubmissionFrame(app, "submission")
- self.add_mode(self.submission)
+ #self.submission = SubmissionFrame(app, "submission")
+ #self.add_mode(self.submission)
def render_title(self, session):
return "Submissions"
14 years, 8 months
rhmessaging commits: r4067 - in store/trunk/cpp/lib: jrnl and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-07-02 09:55:36 -0400 (Fri, 02 Jul 2010)
New Revision: 4067
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/TxnCtxt.cpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
Log:
Reduced store sleep times when waiting for synchronous libaio operations; this improves throughput at the expense of efficiency, but I think the change is worth it judging by initial performance checks.
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2010-07-02 13:39:56 UTC (rev 4066)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2010-07-02 13:55:36 UTC (rev 4067)
@@ -237,8 +237,8 @@
_emap.size(), _tmap.size(), _tmap.enq_cnt(), _tmap.deq_cnt()), qpid::management::ManagementAgent::SEV_NOTE);
}
-#define MAX_AIO_SLEEPS 1000 // 10 sec
-#define AIO_SLEEP_TIME 10000 // 10 ms
+#define MAX_AIO_SLEEPS 1000000 // tot: ~10 sec
+#define AIO_SLEEP_TIME_US 10 // 0.01 ms
// Return true if content is recovered from store; false if content is external and must be recovered from an external store.
// Throw exception for all errors.
bool
@@ -297,7 +297,7 @@
case mrg::journal::RHM_IORES_PAGE_AIOWAIT:
if (++aio_sleep_cnt <= MAX_AIO_SLEEPS) {
get_wr_events();
- usleep(AIO_SLEEP_TIME);
+ usleep(AIO_SLEEP_TIME_US);
} else {
std::stringstream ss;
ss << "read_data_record() returned " << mrg::journal::iores_str(res);
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-07-02 13:39:56 UTC (rev 4066)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-07-02 13:55:36 UTC (rev 4067)
@@ -32,8 +32,8 @@
#include "StoreException.h"
#include <dirent.h>
-#define MAX_AIO_SLEEPS 1000 // ~1 second
-#define AIO_SLEEP_TIME 1000 // 1 Millisecond
+#define MAX_AIO_SLEEPS 100000 // tot: ~1 sec
+#define AIO_SLEEP_TIME_US 10 // 0.01 ms
using namespace mrg::msgstore;
using namespace qpid::broker;
@@ -1003,7 +1003,7 @@
case mrg::journal::RHM_IORES_PAGE_AIOWAIT:
if (++aio_sleep_cnt > MAX_AIO_SLEEPS)
THROW_STORE_EXCEPTION("Timeout waiting for AIO in MessageStoreImpl::recoverMessages()");
- ::usleep(AIO_SLEEP_TIME);
+ ::usleep(AIO_SLEEP_TIME_US);
break;
case mrg::journal::RHM_IORES_EMPTY:
read = false;
@@ -1113,7 +1113,7 @@
case mrg::journal::RHM_IORES_PAGE_AIOWAIT:
if (++aio_sleep_cnt > MAX_AIO_SLEEPS)
THROW_STORE_EXCEPTION("Timeout waiting for AIO in MessageStoreImpl::recoverTplStore()");
- ::usleep(AIO_SLEEP_TIME);
+ ::usleep(AIO_SLEEP_TIME_US);
break;
case mrg::journal::RHM_IORES_EMPTY:
done = true;
Modified: store/trunk/cpp/lib/TxnCtxt.cpp
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.cpp 2010-07-02 13:39:56 UTC (rev 4066)
+++ store/trunk/cpp/lib/TxnCtxt.cpp 2010-07-02 13:55:36 UTC (rev 4067)
@@ -76,8 +76,8 @@
TxnCtxt::~TxnCtxt() { if(txn) abort(); }
-#define MAX_SYNC_SLEEPS 5000 // ~1 second
-#define SYNC_SLEEP_TIME 200 // 0.2 ms
+#define MAX_SYNC_SLEEPS 100000 // tot: ~1 sec
+#define SYNC_SLEEP_TIME_US 10 // 0.01 ms
void TxnCtxt::sync() {
bool allWritten = false;
@@ -86,7 +86,7 @@
while (loggedtx && !allWritten) {
if (sleep_cnt > MAX_SYNC_SLEEPS) THROW_STORE_EXCEPTION(std::string("Error: timeout waiting for TxnCtxt::sync()"));
if (!firstloop) {
- ::usleep(SYNC_SLEEP_TIME);
+ ::usleep(SYNC_SLEEP_TIME_US);
sleep_cnt++;
} // move this into the get events call aiolib..
allWritten = true;
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2010-07-02 13:39:56 UTC (rev 4066)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2010-07-02 13:55:36 UTC (rev 4067)
@@ -264,8 +264,8 @@
} */
// These two combined make a wait time of approx. 2 sec.
-#define MAX_RCINVALID_CNT 400
-#define RCINVALID_SLEEP_TIME_MS 5
+#define MAX_RCINVALID_CNT 20000 // tot: ~ 2 sec
+#define RCINVALID_SLEEP_TIME_US 100 // 0.1 ms
iores
jcntl::read_data_record(void** const datapp, std::size_t& dsize, void** const xidpp, std::size_t& xidsize,
bool& transient, bool& external, data_tok* const dtokp, bool ignore_pending_txns)
@@ -283,7 +283,7 @@
if (sres != RHM_IORES_SUCCESS)
return sres;
if (cnt > 0)
- ::usleep(RCINVALID_SLEEP_TIME_MS * 1000);
+ ::usleep(RCINVALID_SLEEP_TIME_US);
}
cnt++;
}
@@ -429,8 +429,8 @@
_rmgr.invalidate();
}
-#define AIO_CMPL_SLEEP 200 // 0.2 ms
-#define MAX_AIO_CMPL_SLEEPS 50000 // Total: 10 sec
+#define MAX_AIO_CMPL_SLEEPS 1000000 // tot: ~10 sec
+#define AIO_CMPL_SLEEP_US 10 // 0.01 ms
void
jcntl::fhdr_wr_sync(const u_int16_t lid)
@@ -442,7 +442,7 @@
{
if (++cnt > MAX_AIO_CMPL_SLEEPS)
throw jexception(jerrno::JERR_JCNTL_AIOCMPLWAIT, "jcntl", "fhdr_wr_sync");
- ::usleep(AIO_CMPL_SLEEP);
+ ::usleep(AIO_CMPL_SLEEP_US);
get_wr_events();
}
}
@@ -502,7 +502,7 @@
get_wr_events();
if (cnt++ > MAX_AIO_CMPL_SLEEPS)
throw jexception(jerrno::JERR_JCNTL_AIOCMPLWAIT, "jcntl", "aio_cmpl_wait");
- ::usleep(AIO_CMPL_SLEEP);
+ ::usleep(AIO_CMPL_SLEEP_US);
}
}
@@ -525,7 +525,7 @@
this->log(LOG_CRITICAL, oss.str());
throw jexception(jerrno::JERR_JCNTL_AIOCMPLWAIT, "jcntl", "handle_aio_wait");
}
- ::usleep(AIO_CMPL_SLEEP);
+ ::usleep(AIO_CMPL_SLEEP_US);
}
return true;
}
@@ -542,7 +542,7 @@
this->log(LOG_CRITICAL, oss.str());
throw jexception(jerrno::JERR_JCNTL_AIOCMPLWAIT, "jcntl", "handle_aio_wait");
}
- ::usleep(AIO_CMPL_SLEEP);
+ ::usleep(AIO_CMPL_SLEEP_US);
}
_wrfc.wr_reset();
resout = RHM_IORES_SUCCESS;
14 years, 8 months
rhmessaging commits: r4066 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-07-02 09:39:56 -0400 (Fri, 02 Jul 2010)
New Revision: 4066
Modified:
mgmt/newdata/cumin/python/cumin/objecttask.py
Log:
Fix call to undefined unset() method on dismiss IntegerParameter
Modified: mgmt/newdata/cumin/python/cumin/objecttask.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objecttask.py 2010-07-02 13:14:36 UTC (rev 4065)
+++ mgmt/newdata/cumin/python/cumin/objecttask.py 2010-07-02 13:39:56 UTC (rev 4066)
@@ -206,7 +206,8 @@
invoc.dismissed = True
break
- self.dismiss.unset(session)
+ self.dismiss.set(session, self.dismiss.default)
+ #self.dismiss.unset(session)
def do_render(self, session):
items = self.get_items(session)
14 years, 8 months