rhmessaging commits: r3370 - in mgmt/trunk/cumin/python/cumin: grid and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-05-08 11:02:55 -0400 (Fri, 08 May 2009)
New Revision: 3370
Modified:
mgmt/trunk/cumin/python/cumin/grid/job.py
mgmt/trunk/cumin/python/cumin/util.py
Log:
Moved strip_string_quotes to util.
Get job Output and UserLog from job properties.
Get job Error output from job.Ad (if it exists).
Modified: mgmt/trunk/cumin/python/cumin/grid/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/job.py 2009-05-08 14:33:27 UTC (rev 3369)
+++ mgmt/trunk/cumin/python/cumin/grid/job.py 2009-05-08 15:02:55 UTC (rev 3370)
@@ -655,7 +655,7 @@
idict["orig"] = value
idict["type"] = dtype
if dtype == "string":
- idict["value"] = self.strip_string_quotes(value)
+ idict["value"] = strip_string_quotes(value)
if orig:
idict["orig"] = orig
if error:
@@ -668,13 +668,6 @@
idict["path"] = path
return idict
- def strip_string_quotes(self, value):
- dvalue = value
- if value:
- if value[:1] == "\"" and value[-1:] == "\"":
- dvalue = value[1:-1]
- return dvalue
-
class JobPropertyRenderer(TemplateRenderer):
def render_title(self, session, item):
title = item["name"]
@@ -872,18 +865,6 @@
self.__fetch = self.FetchButton(app, "refresh")
self.add_child(self.__fetch)
- self.ads = JobAdsSet(app, "ads")
- self.add_child(self.ads)
-
- self.out_file = Parameter(app, "out")
- self.add_parameter(self.out_file)
-
- self.err_file = Parameter(app, "err")
- self.add_parameter(self.err_file)
-
- self.user_file = Parameter(app, "user")
- self.add_parameter(self.user_file)
-
self.output = self.OutputFile(app, "job_output")
self.add_child(self.output)
@@ -893,31 +874,20 @@
def render_title(self, session, *args):
return "Output"
- def render(self, session, *args):
- out_file = self.out_file.get(session)
- err_file = self.err_file.get(session)
- user_file = self.user_file.get(session)
- if not out_file:
- job = self.frame.get_args(session)[0]
- items = self.ads.get_raw_ads(session, job)
- out_file = err_file = user_file = None
- if "Out" in items:
- out_file = items["Out"]["VALUE"]
- if "Err" in items:
- err_file = items["Err"]["VALUE"]
- if "UserLog" in items:
- user_file = items["UserLog"]["VALUE"]
+ def do_render(self, session, *args):
+ job = args[0]
+ out_file = job.Out
+ user_file = job.UserLog
+ # get err_file from JobAd
+ err_file = None
+ if job.Ad:
+ try:
+ if "Err" in job.Ad:
+ err_file = job.Ad["Err"]["VALUE"]
+ err_file = strip_string_quotes(err_file)
+ except Exception, e:
+ pass
- # strip any double quotes surrounding file names
- out_file = self.ads.strip_string_quotes(out_file)
- err_file = self.ads.strip_string_quotes(err_file)
- user_file = self.ads.strip_string_quotes(user_file)
-
- # remember the file names so we don't need to reget them
- self.out_file.set(session, out_file)
- self.err_file.set(session, err_file)
- self.user_file.set(session, user_file)
-
# set title for radiotab so mouseover will display file name
self.which_file.set_file_name(session, "o", out_file)
self.which_file.set_file_name(session,"e", err_file)
@@ -930,7 +900,7 @@
if self.which_file.is_bad(user_file):
self.which_file.disable(session, "u")
- return super(JobOutput, self).render(session, *args)
+ return super(JobOutput, self).do_render(session, *args)
def render_loading(self, session, *args):
file = self.which_file.get_current_file_name(session)
Modified: mgmt/trunk/cumin/python/cumin/util.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/util.py 2009-05-08 14:33:27 UTC (rev 3369)
+++ mgmt/trunk/cumin/python/cumin/util.py 2009-05-08 15:02:55 UTC (rev 3370)
@@ -120,3 +120,10 @@
end = ocurly
return strings
+
+def strip_string_quotes(value):
+ dvalue = value
+ if value:
+ if value[:1] == "\"" and value[-1:] == "\"":
+ dvalue = value[1:-1]
+ return dvalue
15 years, 8 months
rhmessaging commits: r3369 - in mgmt/trunk: etc and 7 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-05-08 10:33:27 -0400 (Fri, 08 May 2009)
New Revision: 3369
Added:
mgmt/trunk/rosemary/
mgmt/trunk/rosemary/COPYING
mgmt/trunk/rosemary/LICENSE
mgmt/trunk/rosemary/Makefile
mgmt/trunk/rosemary/bin/
mgmt/trunk/rosemary/bin/rosemary-test
mgmt/trunk/rosemary/etc/
mgmt/trunk/rosemary/etc/module.profile
mgmt/trunk/rosemary/instance/
mgmt/trunk/rosemary/instance/xml
mgmt/trunk/rosemary/python/
mgmt/trunk/rosemary/python/rosemary/
mgmt/trunk/rosemary/python/rosemary/__init__.py
mgmt/trunk/rosemary/python/rosemary/model.py
mgmt/trunk/rosemary/python/rosemary/sql.py
mgmt/trunk/rosemary/python/rosemary/util.py
mgmt/trunk/rosemary/xml/
mgmt/trunk/rosemary/xml/Makefile
mgmt/trunk/rosemary/xml/condor.xml
mgmt/trunk/rosemary/xml/qpid-acl.xml
mgmt/trunk/rosemary/xml/qpid-cluster.xml
mgmt/trunk/rosemary/xml/qpid-store.xml
mgmt/trunk/rosemary/xml/qpid.xml
mgmt/trunk/rosemary/xml/sesame.xml
Modified:
mgmt/trunk/etc/devel.profile
Log:
Initial check in of rosemary, a 'mini mint' for cumin's use
Modified: mgmt/trunk/etc/devel.profile
===================================================================
--- mgmt/trunk/etc/devel.profile 2009-05-08 14:27:05 UTC (rev 3368)
+++ mgmt/trunk/etc/devel.profile 2009-05-08 14:33:27 UTC (rev 3369)
@@ -1,5 +1,5 @@
export DEVEL_HOME="$PWD"
-export DEVEL_MODULES="mint cumin basil parsley wooly"
+export DEVEL_MODULES="mint cumin basil parsley wooly rosemary"
if [[ -z "$DEVEL_ORIGINAL_PATH" ]]; then
export DEVEL_ORIGINAL_PATH="$PATH"
Added: mgmt/trunk/rosemary/COPYING
===================================================================
--- mgmt/trunk/rosemary/COPYING (rev 0)
+++ mgmt/trunk/rosemary/COPYING 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,15 @@
+Copyright (C) 2007 Red Hat Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Added: mgmt/trunk/rosemary/LICENSE
===================================================================
--- mgmt/trunk/rosemary/LICENSE (rev 0)
+++ mgmt/trunk/rosemary/LICENSE 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
Added: mgmt/trunk/rosemary/Makefile
===================================================================
--- mgmt/trunk/rosemary/Makefile (rev 0)
+++ mgmt/trunk/rosemary/Makefile 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,35 @@
+.PHONY: build install schema clean
+
+include ../etc/Makefile.common
+
+name := rosemary
+
+lib := ${PYTHON_LIB_DIR}/${name}
+etc := ${ETC_DIR}/${name}
+doc := ${DOC_DIR}/${name}
+share := ${SHARE_DIR}/${name}
+
+build:
+ ../bin/python-compile python
+
+install: build
+ install -d ${lib}
+ install python/rosemary/*.py python/rosemary/*.pyc ${lib}
+ install -d ${BIN_DIR}
+ install bin/* ${BIN_DIR}
+ install -d ${doc}
+ install LICENSE COPYING ${doc}
+ install -d ${share}/sql
+ install sql/* ${share}/sql
+ install -d ${etc}
+ install -pm 0644 etc/* ${etc}
+
+schema:
+ $(MAKE) schema -C xml
+ $(MAKE) schema -C python/rosemary
+ $(MAKE) schema -C sql
+
+clean:
+ $(MAKE) clean -C xml
+ $(MAKE) clean -C python/rosemary
+ $(MAKE) clean -C sql
Added: mgmt/trunk/rosemary/bin/rosemary-test
===================================================================
--- mgmt/trunk/rosemary/bin/rosemary-test (rev 0)
+++ mgmt/trunk/rosemary/bin/rosemary-test 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,35 @@
+#!/usr/bin/python
+
+import sys, os, logging
+from rosemary.model import *
+from rosemary.sql import *
+
+if __name__ == "__main__":
+ model = RosemaryModel()
+ model.load_qmf_dir(os.path.join(os.environ["ROSEMARY_HOME"], "xml"))
+
+ for package in model.packages:
+ print "package %s" % package.name
+
+ for cls in package.classes:
+ print " class %s" % cls.name
+
+ select = SelectObject(cls)
+ print select.emit()
+
+ update = UpdateObject(cls)
+ print update.emit()
+
+ continue
+
+ for prop in cls.properties:
+ print " prop %s %s" % (prop.name, prop.title or "")
+
+ for stat in cls.statistics:
+ print " stat %s" % stat.name
+
+ for meth in cls.methods:
+ print " meth %s" % meth.name
+
+ for arg in meth.arguments:
+ print " arg %s" % arg.name
Property changes on: mgmt/trunk/rosemary/bin/rosemary-test
___________________________________________________________________
Name: svn:executable
+ *
Added: mgmt/trunk/rosemary/etc/module.profile
===================================================================
--- mgmt/trunk/rosemary/etc/module.profile (rev 0)
+++ mgmt/trunk/rosemary/etc/module.profile 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,3 @@
+export PYTHONPATH="${PWD}/python:${PYTHONPATH}"
+export PATH="${PWD}/bin:${PATH}"
+export ROSEMARY_HOME="${PWD}/instance"
Added: mgmt/trunk/rosemary/instance/xml
===================================================================
--- mgmt/trunk/rosemary/instance/xml (rev 0)
+++ mgmt/trunk/rosemary/instance/xml 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1 @@
+link ../xml
\ No newline at end of file
Property changes on: mgmt/trunk/rosemary/instance/xml
___________________________________________________________________
Name: svn:special
+ *
Added: mgmt/trunk/rosemary/python/rosemary/__init__.py
===================================================================
Added: mgmt/trunk/rosemary/python/rosemary/model.py
===================================================================
--- mgmt/trunk/rosemary/python/rosemary/model.py (rev 0)
+++ mgmt/trunk/rosemary/python/rosemary/model.py 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,194 @@
+import sys
+import os
+
+from string import Template
+
+try:
+ from xml.etree.ElementTree import *
+except ImportError:
+ from elementtree.ElementTree import *
+
+from sql import *
+
+class RosemaryModel(object):
+ def __init__(self):
+ self.packages = list()
+ self.packages_by_name = dict()
+
+ def load_qmf_dir(self, dir):
+ assert os.path.isdir(dir)
+
+ for name in os.listdir(dir):
+ path = os.path.join(dir, name)
+
+ if path.endswith(".xml") and os.path.isfile(path):
+ self.load_qmf_metadata(path)
+
+ def load_qmf_metadata(self, path):
+ tree = ElementTree()
+ file = open(path, "r")
+
+ try:
+ tree.parse(file)
+ self.load(tree.getroot())
+ finally:
+ file.close()
+
+ def load(self, elem):
+ pkg = RosemaryPackage(self, elem.get("package"))
+ pkg.load(elem)
+
+class RosemaryPackage(object):
+ def __init__(self, model, name):
+ self.model = model
+
+ self.name = name
+
+ self.classes = list()
+ self.classes_by_name = dict()
+
+ self.model.packages.append(self)
+ self.model.packages_by_name[self.name] = self
+
+ def load(self, elem):
+ for child in elem.findall("class"):
+ cls = RosemaryClass(self, child.get("name"))
+ cls.load(child)
+
+class RosemaryClass(object):
+ def __init__(self, package, name):
+ self.package = package
+
+ self.name = name
+
+ self.properties = list()
+ self.properties_by_name = dict()
+
+ self.statistics = list()
+ self.statistics_by_name = dict()
+
+ self.methods = list()
+ self.methods_by_name = dict()
+
+ self.package.classes.append(self)
+ self.package.classes_by_name[self.name] = self
+
+ def load(self, elem):
+ for child in elem.findall("property"):
+ prop = RosemaryProperty(self, child.get("name"))
+ prop.load(child)
+
+ for child in elem.findall("statistic"):
+ stat = RosemaryStatistic(self, child.get("name"))
+ stat.load(child)
+
+ for child in elem.findall("method"):
+ meth = RosemaryMethod(self, child.get("name"))
+ meth.load(child)
+
+class RosemaryProperty(object):
+ def __init__(self, cls, name):
+ self.cls = cls
+
+ self.name = name
+ self.title = None
+ self.type = None
+ self.references = None
+ self.access = None
+ self.unit = None
+ self.is_index = None
+ self.is_optional = None
+ self.description = None
+
+ self.cls.properties.append(self)
+ self.cls.properties_by_name[self.name] = self
+
+ def load(self, elem):
+ self.type = elem.get("type")
+ self.references = elem.get("references")
+ self.access = elem.get("access")
+ self.unit = elem.get("unit")
+ self.is_index = elem.get("index", "n") == "y" and True
+ self.is_optional = elem.get("optional", "n") == "y" and True
+ self.description = elem.get("desc")
+
+class RosemaryStatistic(object):
+ def __init__(self, cls, name):
+ self.cls = cls
+
+ self.name = name
+ self.type = None
+ self.unit = None
+ self.description = None
+
+ self.cls.statistics.append(self)
+ self.cls.statistics_by_name[self.name] = self
+
+ def load(self, elem):
+ self.type = elem.get("type")
+ self.unit = elem.get("unit")
+ self.description = elem.get("desc")
+
+ def extend(self, elem):
+ pass
+
+class RosemaryMethod(object):
+ def __init__(self, cls, name):
+ self.cls = cls
+
+ self.name = name
+ self.description = None
+
+ self.arguments = list()
+ self.arguments_by_name = dict()
+
+ self.cls.methods.append(self)
+ self.cls.methods_by_name[self.name] = self
+
+ def load(self, elem):
+ self.description = elem.get("desc")
+
+ for child in elem.findall("arg"):
+ arg = RosemaryArgument(self, child.get("name"))
+ arg.load(child)
+
+ def call(self, console, object, callback, **kwargs):
+ pass
+
+class RosemaryArgument(object):
+ def __init__(self, meth, name):
+ self.meth = meth
+
+ self.name = name
+ self.type = None
+ self.direction = None
+ self.description = None
+
+ self.meth.arguments.append(self)
+ self.meth.arguments_by_name[self.name] = self
+
+ def load(self, elem):
+ self.type = elem.get("type")
+ self.direction = elem.get("dir")
+ self.description = elem.get("desc")
+
+class RosemaryObject(object):
+ def __init__(self, cls):
+ self.cls = cls
+
+ self.id = None
+ self.qmf_broker_id = None
+ self.qmf_object_id = None
+
+ for name in self.cls.properties:
+ setattr(name, None)
+
+ self.__select = SelectObject(self.cls)
+ self.__update = UpdateObject(self.cls)
+ self.__insert = InsertObject(self.cls)
+
+ def load(self, cursor, id):
+ self.__select.execute(cursor, {"id": id})
+
+ def save(self, cursor):
+ assert self.id is not None
Added: mgmt/trunk/rosemary/python/rosemary/sql.py
===================================================================
--- mgmt/trunk/rosemary/python/rosemary/sql.py (rev 0)
+++ mgmt/trunk/rosemary/python/rosemary/sql.py 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,50 @@
+from model import *
+from util import *
+
+class Operation(object):
+ def __init__(self, cls):
+ self.cls = cls
+
+ def execute(self, cursor, args):
+ text = self.emit()
+ results = cursor.execute(text, args)
+ return results
+
+class SelectOperation(Operation):
+ def emit_columns(self):
+ names = [x.name for x in self.cls.properties]
+ cols = map(translate_column, names)
+ return ", ".join(cols)
+
+class SelectObject(SelectOperation):
+ def emit(self):
+ cols = self.emit_columns()
+ table = translate_table(self.cls.name)
+ return "select %s from %s where id = %%(id)" % (cols, table)
+
+class UpdateOperation(Operation):
+ def emit_exprs(self):
+ names = [x.name for x in self.cls.properties]
+ exprs = list()
+
+ for name in names:
+ exprs.append("%s = %%(%s)" % (translate_column(name), name))
+
+ return ", ".join(exprs)
+
+class UpdateObject(UpdateOperation):
+ def emit(self):
+ exprs = self.emit_exprs()
+ table = translate_table(self.cls.name)
+ return "update %s set %s where id = %%(id)" % (table, exprs)
+
+def translate_column(name):
+ name = unstudly(name)
+
+ if name.endswith("_ref"):
+ name = "%s_id" % name[:-4]
+
+ return name
+
+def translate_table(name):
+ return unstudly(name)
Added: mgmt/trunk/rosemary/python/rosemary/util.py
===================================================================
--- mgmt/trunk/rosemary/python/rosemary/util.py (rev 0)
+++ mgmt/trunk/rosemary/python/rosemary/util.py 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,18 @@
+def unstudly(name):
+ chars = list()
+
+ curr = name[0]
+ prev = None
+
+ chars.append(curr.lower())
+
+ for i in range(1, len(name)):
+ prev = curr
+ curr = name[i]
+
+ if curr.isupper() and not prev.isupper():
+ chars.append("_")
+
+ chars.append(curr.lower())
+
+ return "".join(chars)
Added: mgmt/trunk/rosemary/xml/Makefile
===================================================================
--- mgmt/trunk/rosemary/xml/Makefile (rev 0)
+++ mgmt/trunk/rosemary/xml/Makefile 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,26 @@
+.PHONY: schema clean
+
+FILES := qpid.xml qpid-store.xml qpid-acl.xml qpid-cluster.xml condor.xml sesame.xml
+
+schema: ${FILES}
+
+clean:
+ rm -f ${FILES}
+
+qpid.xml:
+ svn export http://svn.apache.org/repos/asf/qpid/trunk/qpid/specs/management-schema.xml qpid.xml
+
+qpid-store.xml:
+ svn export http://anonsvn.jboss.org/repos/rhmessaging/store/trunk/cpp/lib/qmf-schema... qpid-store.xml
+
+qpid-acl.xml:
+ svn export http://svn.apache.org/repos/asf/qpid/trunk/qpid/cpp/src/qpid/acl/manageme... qpid-acl.xml
+
+qpid-cluster.xml:
+ svn export http://svn.apache.org/repos/asf/qpid/trunk/qpid/cpp/src/qpid/cluster/mana... qpid-cluster.xml
+
+condor.xml:
+ wget "http://git.et.redhat.com/?p=mrg-grid.git;a=blob_plain;f=src/management/co..." -O condor.xml
+
+sesame.xml:
+ svn export http://anonsvn.jboss.org/repos/rhmessaging/mgmt/trunk/sesame/cpp/src/qmfg... sesame.xml
Added: mgmt/trunk/rosemary/xml/condor.xml
===================================================================
--- mgmt/trunk/rosemary/xml/condor.xml (rev 0)
+++ mgmt/trunk/rosemary/xml/condor.xml 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,816 @@
+<schema package="mrg.grid">
+
+<!--
+/*
+ * Copyright 2008 Red Hat, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<group name="daemon-stats">
+ <property name="CondorPlatform"
+ type="sstr"
+ desc="The Condor platform string for the daemon's platform"/>
+ <property name="CondorVersion"
+ type="sstr"
+ desc="The Condor version string for the daemon's version"/>
+ <property name="DaemonStartTime"
+ type="absTime" unit="nanosecond"
+ desc="Number of nanoseconds since epoch when the daemon
+ was started"/>
+
+ <statistic name="MonitorSelfAge" type="uint32"/>
+ <statistic name="MonitorSelfCPUUsage" type="double"/>
+ <statistic name="MonitorSelfImageSize" type="double"/>
+ <statistic name="MonitorSelfRegisteredSocketCount" type="uint32"/>
+ <statistic name="MonitorSelfResidentSetSize" type="uint32"/>
+ <statistic name="MonitorSelfTime" type="absTime"/>
+</group>
+
+<!--
+CpuBusy = ((LoadAvg - CondorLoadAvg) >= 0.500000)
+CpuBusyTime = 0
+CpuIsBusy = FALSE
+
+HasCheckpointing = TRUE
+HasFileTransfer = TRUE
+HasIOProxy = TRUE
+HasJava = TRUE
+HasJICLocalConfig = TRUE
+HasJICLocalStdin = TRUE
+HasJobDeferral = TRUE
+HasMPI = TRUE
+HasPerFileEncryption = TRUE
+HasReconnect = TRUE
+HasRemoteSyscalls = TRUE
+HasTDP = TRUE
+HasVM = FALSE
+
+JavaMFlops = 8.156164
+JavaVendor = "Free Software Foundation, Inc."
+JavaVersion = "1.4.2"
+
+Subnet = "10.16.43"
+
+Set by Collector:
+ UpdateSequenceNumber = 627
+ UpdatesHistory = "0x00000000000000000000000000000000"
+ UpdatesLost = 0
+ UpdatesSequenced = 58
+ UpdatesTotal = 59
+-->
+
+ <class name="Slot">
+
+ <group name="daemon-stats"/>
+
+ <property name="Pool" type="sstr" index="y"/>
+ <property name="System" type="sstr" index="y"/>
+
+ <property name="AccountingGroup"
+ type="sstr"
+ optional="y"
+ desc="AccountingGroup of the running job, fully
+ qualified with a UidDomain, UidDomain taken from
+ RemoteUser, only present when a job is
+ executing"/>
+ <statistic name="Activity"
+ type="sstr"
+ desc="One of: Idle, No job activity; Busy, Job is
+ running; Suspended, Job is suspended; Vacating,
+ Job is being removed; Killing, Job is being
+ killed; Benchmarking, Benchmarks being run"/>
+ <property name="Arch"
+ type="sstr"
+ desc="Slot's architecture, e.g.: ALPHA, Diginal Alpha;
+ HPPA1, HP PA-RISC 1.x (7000 series); HPPA2, HP
+ PA-RISC 2.x (8000 series); IA64, Intel Itanium;
+ INTEL, Intel x86 (Pentium, Xeon, etc); SGI, SGI
+ MIPS; SUN4u, Sun UltraSparc; SUN4x, Sun Sparc
+ (not UltraSparc); PPC, Power Macintosh; PPC64,
+ 64-bit Power Macintosh; X86_64, AMD/Intel 64-bit
+ x86"/>
+ <property name="CheckpointPlatform"
+ type="sstr"
+ desc="Opaque string encoding OS, hardware and kernel
+ attributes"/>
+ <property name="ClientMachine"
+ type="sstr"
+ optional="y"
+ desc="The hostname of the machine that has claimed the
+ slot, only present when slot is claimed"/>
+ <statistic name="ClockDay"
+ type="uint32"
+ desc="Day of the week: 0 = Sunday, 1 = Monday, ..., 6 =
+ Saturaday"/>
+ <statistic name="ClockMin"
+ type="uint32" unit="minute"
+ desc="Number of elapsed minutes since midnight"/>
+ <property name="ConcurrencyLimits"
+ type="sstr"
+ optional="y"
+ desc="Set of concurrency limits associated with the
+ current job"/>
+ <statistic name="CondorLoadAvg"
+ type="double"
+ desc="Portion of LoadAvg generated by Condor (job or
+ benchmark)"/>
+ <statistic name="ConsoleIdle"
+ type="uint32" unit="second"
+ desc="Seconds since activity on console keyboard or
+ mouse"/>
+ <property name="Cpus"
+ type="uint32"
+ desc="Number of CPUs in slot"/>
+ <!-- XXX: CurrentRank could quite possibly be a statistic -->
+ <property name="CurrentRank"
+ type="double"
+ optional="y"
+ desc="Slots' affinity for running the job it is
+ currently hosting, calculated as Rank expression
+ evaluated in context of the running job's ad"/>
+ <property name="Disk"
+ type="uint32" unit="KiB"
+ desc="Amount of disk space in KiB available in the slot"/>
+ <statistic name="EnteredCurrentActivity"
+ type="absTime" unit="nanosecond"
+ desc="Time at which current Activity was entered,
+ number of nanoseconds since Unix epoch"/>
+ <statistic name="EnteredCurrentState"
+ type="absTime" unit="nanosecond"
+ desc="Time at which current State was entered,
+ number of seconds since Unix epoch"/>
+ <property name="FileSystemDomain"
+ type="sstr"
+ desc="Configured namespace shared by slots with
+ uniformly mounted shared storage"/>
+ <property name="GlobalJobId"
+ type="sstr"
+ optional="y"
+ desc="The running job's GlobalJobId, only present when
+ a job is executing"/>
+ <!-- XXX: ImageSize could quite possibly be a statistic -->
+ <property name="ImageSize"
+ type="uint32" unit="KiB"
+ optional="y"
+ desc="Estimate of the memory image size, in KiB, of the
+ running job, only present when a job is
+ executing, pulled by STARTD_JOB_EXPRS"/>
+ <property name="IsValidCheckpointPlatform"
+ type="lstr"
+ desc="A configurable expression representing if a
+ checkpointed job can run on the slot, part of the
+ slot's Requirements along with the Start
+ expression"/>
+ <!-- XXX: JobId could quite possibly be a statistic, snapshots
+ would show use over time -->
+ <property name="JobId"
+ type="sstr"
+ optional="y"
+ desc="The running job's identifier,
+ i.e. ClusterId.ProcId, only present when a job is
+ executing"/>
+ <property name="JobStart"
+ type="absTime" unit="nanosecond"
+ optional="y"
+ desc="The number of nanosecond since epoch when the job
+ began executing, only present when a job is
+ executing"/>
+ <statistic name="KeyboardIdle"
+ type="uint32" unit="second"
+ desc="Number of seconds since any activity on any
+ keyboard or mouse associated with the machine,
+ including pseudo-terminals"/>
+ <property name="KFlops"
+ type="uint32"
+ desc="Relative floating point performance on a Linpack
+ benchmark"/>
+ <statistic name="LastBenchmark"
+ type="absTime" unit="nanosecond"
+ desc="Number of nanoseconds since epoch when the last
+ benchmark was run"/>
+ <statistic name="LastFetchWorkCompleted"
+ type="absTime" unit="nanosecond"
+ desc="Number of nanoseconds since epoch when the
+ FetchWork Hook returned"/>
+
+ <statistic name="LastFetchWorkSpawned"
+ type="absTime" unit="nanosecond"
+ desc="Number of nanoseconds since epoch when the
+ FetchWork Hook was invoked"/>
+ <statistic name="LastPeriodicCheckpoint"
+ type="absTime" unit="nanosecond"
+ desc="The number of nanoseconds since epoch when the
+ job last performed a periodic checkpoint, only
+ present when a job is executing"/>
+<!--
+ <statistic name="LastHeardFrom"
+ type="absTime" unit="nanosecond"
+ desc="Time when the Collector received an update from
+ the slot, nanoseconds since epoch, inserted by
+ Collector"/>
+-->
+ <statistic name="LoadAvg"
+ type="double"
+ desc="Load average of CPUs hosting the slot"/>
+ <property name="Machine"
+ type="sstr"
+ desc="The fully qualified hostname of slot's host
+ machine"/>
+ <property name="MaxJobRetirementTime"
+ type="lstr" unit="second"
+ desc="Expression evaluated in context of job ad
+ producing the number of seconds a job is allowed
+ to finish before being killed, relevant when job
+ is being kicked out of the slot"/>
+ <property name="Memory"
+ type="uint32" unit="MiB"
+ desc="Amount of RAM available in the slot, in MiB"/>
+ <property name="Mips"
+ type="uint32"
+ desc="Relative integer performance on a Dhrystone
+ benchmark"/>
+ <property name="MyAddress"
+ type="sstr"
+ desc="IP:Port of StartD in charge of the slot"/>
+ <statistic name="MyCurrentTime"
+ type="absTime" unit="nanosecond"
+ desc="The number of nanoseconds since epoch that the
+ slot produced an updated ad"/>
+<!--
+ <property name="MyType"
+ type="sstr"
+ desc="Always 'Machine'"\>
+-->
+ <property name="Name"
+ type="sstr"
+ index="y"
+ desc="Name of the slot, either the same as Machine,
+ slot#@Machine, or a configured value"/>
+ <statistic name="NextFetchWorkDelay"
+ type="int32" unit="second"
+ desc="Number of seconds until the next FetchWork
+ Hook will be invoked, -1 means never"/>
+ <property name="OpSys"
+ type="sstr"
+ desc="Slot's operating system, e.g.: HPUX10, HPUX
+ 10.20; HPUX11, HPUX B.11.00; LINUX, Linux
+ 2.[0,2,4,6].x kernels; OSF1, Diginal Unix 4.x;
+ OSX, Darwin; OSX10_2, Darwin 6.4; SOLARIS25,
+ Solaris 2.4 or 5.5; SOLARIS251, Solaris 2.5.1 or
+ 5.5.1; SOLARIS26, Solaris 2.6 or 5.6; SOLARIS27,
+ Solaris 2.7 or 5.7; SOLARIS28, Solaris 2.8 or
+ 5.8; SOLARIS29, Solaris 2.9 or 5.9; WINNT50,
+ Windows 2000; WINNT51, Windows XP; WINNT52,
+ Windows Server 2003; WINNT60, Windows Vista"/>
+ <property name="PreemptingConcurrencyLimits"
+ type="sstr"
+ optional="y"
+ desc="Set of concurrency limits associated with the
+ preempting job"/>
+ <property name="PreemptingOwner"
+ type="sstr"
+ optional="y"
+ desc="The name of the user originally preempting the
+ current job, i.e. the incoming user, only present
+ when slot is claimed"/>
+ <!-- XXX: PreemptingUser could quite possibly be a statistic -->
+ <property name="PreemptingUser"
+ type="sstr"
+ optional="y"
+ desc="The name of the user preempting the current job,
+ different from PreemptingOwner only if the claim
+ was given to another user who is using it to
+ preempt, only present when slot is claimed"/>
+ <!-- XXX: PreemptingRank could quite possibly be a statistic -->
+ <property name="PreemptingRank"
+ type="double"
+ optional="y"
+ desc="Slots' affinity for running the incoming,
+ preempting, job, calculated as Rank expression
+ evaluated in context of the incoming job's ad,
+ only present when slot is claimed"/>
+ <!-- XXX: RemoteOwner could quite possibly be a statistic, showing
+ use over time -->
+ <property name="RemoteOwner"
+ type="sstr"
+ optional="y"
+ desc="The name of the user who originally claimed the
+ slot, only present when slot is claimed"/>
+ <!-- XXX: RemoteUser could quite possibly be a statistic, showing
+ use over time -->
+ <property name="RemoteUser"
+ type="sstr"
+ optional="y"
+ desc="The name of the user who is currently using the
+ slot, different from RemoteOwner only if the
+ claim was given to another user who is using the
+ slot, only present when slot is claimed"/>
+ <property name="Requirements"
+ type="lstr"
+ desc="Expression evaluated in the context of a job ad
+ to determine if the slot will run a job"/>
+ <property name="PublicNetworkIpAddr"
+ type="sstr"
+ desc="IP:Port used to communicate with the slot"/>
+ <property name="Rank"
+ type="lstr"
+ desc="Configured expression representing how the slot
+ prefers jobs"/>
+ <property name="SlotID"
+ type="uint32"
+ desc="The # in the slot's Name, i.e. Name='slot#@Machine'"/>
+ <property name="Start"
+ type="lstr"
+ desc="Expression evaluated to determine if a slot is
+ willing to start running a job"/>
+ <property name="StarterAbilityList"
+ type="lstr"
+ desc="StringList, comma separated, set of abilities the
+ slot has, i.e. HasFileTransfer,HasJava,HasVM,
+ query with stringListMember('Element',
+ StarterAbilityList)"/>
+ <statistic name="State"
+ type="sstr"
+ desc="One of: Owner, unavailable to Condor; Unclaimed,
+ available to Condor, but no job match yet;
+ Matched, job found, but not yet claimed; Claimed,
+ claimed and job likely running (see Activity);
+ Preempting, running job is being kicked off the
+ slot"/>
+<!--
+ <statistic name="TargetType"
+ type="sstr"
+ desc="Always 'Job'"/>
+-->
+ <statistic name="TimeToLive"
+ type="uint32" unit="second"
+ desc="Number of second until StartD managing the slot
+ has until it will exit"/>
+ <!-- XXX: TotalClaimRunTime is a statistic -->
+ <property name="TotalClaimRunTime"
+ type="uint32" unit="second"
+ optional="y"
+ desc="Number of seconds the current claim has spent
+ running jobs, only present when slot is
+ claimed"/>
+ <!-- XXX: TotalClaimSuspendTime is a statistic -->
+ <property name="TotalClaimSuspendTime"
+ type="uint32" unit="second"
+ optional="y"
+ desc="Number of seconds the current claim has spent
+ with suspended jobs, only present when slot is
+ claimed"/>
+ <statistic name="TotalCondorLoadAvg"
+ type="double"
+ desc="Portion of TotalLoadAvg generated by Condor (jobs
+ or benchmarks)"/>
+ <property name="TotalCpus"
+ type="uint32"
+ desc="Total number of CPUs on slot's host machine, or
+ NUM_CPUS configuration option"/>
+ <property name="TotalDisk"
+ type="uint32" unit="KiB"
+ desc="Amount of disk space available on the slot's host
+ machine"/>
+ <!-- XXX: TotalJobRunTime is a statistic -->
+ <property name="TotalJobRunTime"
+ type="uint32" unit="second"
+ optional="y"
+ desc="Number of seconds the current job has spent
+ running, i.e. Claimed/Busy, only present when
+ slot is claimed"/>
+ <!-- XXX: TotalJobSuspendTime is a statistic -->
+ <property name="TotalJobSuspendTime"
+ type="uint32" unit="second"
+ optional="y"
+ desc="Number of seconds the current job has spent
+ suspended, i.e. Claimed/Suspended, only present
+ when slot is claimed"/>
+ <statistic name="TotalLoadAvg"
+ type="double"
+ desc="Total load average of the slot's host machine"/>
+ <property name="TotalMemory"
+ type="uint32" unit="MiB"
+ desc="Total RAM available on slot's machine, in MiB"/>
+ <property name="TotalSlots"
+ type="uint32"
+ desc="Total number of slots sharing the Machine"/>
+ <statistic name="TotalTimeBackfillBusy"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Backfill and Activity=Busy since the
+ Startd started"/>
+ <statistic name="TotalTimeBackfillIdle"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Backfill and Activity=Idle since the
+ Startd started"/>
+ <statistic name="TotalTimeBackfillKilling"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Backfill and Activity=Killing since the
+ Startd started"/>
+ <statistic name="TotalTimeClaimedBusy"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Claimed and Activity=Busy since the
+ Startd started"/>
+ <statistic name="TotalTimeClaimedIdle"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Claimed and Activity=Idle since the
+ Startd started"/>
+ <statistic name="TotalTimeClaimedRetiring"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Claimed and Activity=Retiring since the
+ Startd started"/>
+ <statistic name="TotalTimeClaimedSuspended"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Claimed and Activity=Suspended since the
+ Startd started"/>
+ <statistic name="TotalTimeMatchedIdle"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Matched and Activity=Idle since the
+ Startd started"/>
+ <statistic name="TotalTimeOwnerIdle"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Owner and Activity=Idle since the
+ Startd started"/>
+ <statistic name="TotalTimePreemptingKilling"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Preempting and Activity=Killing since the
+ Startd started"/>
+ <statistic name="TotalTimePreemptingVacating"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Preempting and Activity=Vacating since the
+ Startd started"/>
+ <statistic name="TotalTimeUnclaimedBenchmarking"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Unclaimed and Activity=Benchmarking since
+ the Startd started"/>
+ <statistic name="TotalTimeUnclaimedIdle"
+ type="uint32" unit="second"
+ desc="Accumulated number of seconds the slot has been
+ in State=Unclaimed and Activity=Idle since the
+ Startd started"/>
+ <property name="TotalVirtualMemory"
+ type="uint32" unit="KiB"
+ desc="Amount of swap space available on slot"/>
+ <property name="UidDomain"
+ type="sstr"
+ desc="Configured namespace shared by slots with
+ uniform uid/gid entries, i.e. same logins and
+ groups"/>
+ <property name="VirtualMemory"
+ type="uint32" unit="KiB"
+ desc="Amount of currently available virtual memory
+ (swap space) in KiB"/>
+ <property name="WindowsBuildNumber"
+ type="uint32"
+ desc="Integer extracted from the platform type,
+ representing a build number for a Windows
+ operating system, only present on Windows
+ slots"/>
+ <property name="WindowsMajorVersion"
+ type="uint32"
+ desc="Integer extracted from the platform type,
+ representing a major version number for a Windows
+ operating system, only present on Windows
+ slots, e.g. 5 for OpSys=WINNT50"/>
+ <property name="WindowsMinorVersion"
+ type="uint32"
+ desc="Integer extected from the platform type,
+ representing a minor version numer for a Windows
+ operating system, only present on Windows
+ slots, e.g. 2 for OpSys=WINNT52"/>
+
+<!--
+ <property name="AdditionalAttributes" type="map"/>
+-->
+ </class>
+
+<!--
+Exec Host, Order(Rank?), StartTime, TotalTime (Sys, User), Project, AccountingGroup
+-->
+ <class name="Job">
+ <property name="schedulerRef" type="objId" parentRef="y" index="y" references="mrg.grid.Scheduler"/>
+ <property name="submitterRef" type="objId" references="mrg.grid.Submitter"/>
+
+ <property name="AccountingGroup" type="sstr" optional="y" desc=""/>
+ <property name="Args" type="lstr" optional="y" desc=""/>
+ <property name="ClusterId"
+ type="uint32" index="y"
+ desc="The id of the cluster the job belongs
+ to. ClusterIds are unique within a SchedD."/>
+ <property name="Cmd" type="lstr" desc=""/>
+ <property name="ConcurrencyLimits" type="lstr" optional="y" desc=""/>
+ <property name="CustomGroup" type="sstr" optional="y" desc=""/>
+ <property name="CustomId" type="sstr" optional="y" desc=""/>
+ <property name="CustomPriority" type="uint32" optional="y" desc=""/>
+ <property name="GlobalJobId" type="sstr" desc=""/>
+ <property name="In"
+ type="lstr"
+ desc="The file where the job's standard input is read
+ from."/>
+ <property name="Iwd" type="lstr" desc=""/>
+ <property name="JobStatus"
+ type="uint32"
+ desc="One of: 0, unexpanded; 1, idle; 2, running; 3,
+ removed; 4, completed; 5, held; or, 6, submission
+ error"/>
+ <property name="Note"
+ type="lstr" optional="y"
+ desc="An arbitrary note attached to the job."/>
+ <property name="Out"
+ type="lstr"
+ desc="The file where the job's standard output is
+ written."/>
+ <property name="Owner"
+ type="sstr"
+ desc="The submitter of the job."/>
+ <property name="User"
+ type="sstr"
+ desc="The Owner '@' the configured UidDomain namespace"/>
+ <property name="ProcId"
+ type="uint32" index="y"
+ desc="The id of the job within its cluster. ProcIds re
+ unique within a cluster."/>
+ <property name="QDate"
+ type="absTime" unit="nanoseconds"
+ desc="The number of nanoseconds since epoch when the
+ job was submitted."/>
+
+<!--
+ <property name="Requirements" type="lstr" desc=""/>
+ <property name="Scheduler" type="sstr" desc=""/>
+-->
+
+ <property name="JobUniverse"
+ type="uint32"
+ desc=""/>
+
+ <property name="Title" type="sstr" optional="y" desc=""/>
+ <property name="UserLog" type="lstr" optional="y" desc=""/>
+
+ <property name="HoldReason" type="lstr" optional="y" desc=""/>
+
+ <property name="DAGNodeName"
+ type="sstr" optional="y" desc=""/>
+ <property name="DAGParentNodeNames"
+ type="lstr" optional="y"
+ desc="Comma separated list of the job's parent's node
+ names"/>
+ <property name="DAGManJobId"
+ type="uint32" optional="y"
+ desc="The ClusterId of the DAGMan job who spawned the
+ job"/>
+
+ <property name="Ad" type="map" optional="y" desc=""/>
+
+ <method name="GetAd">
+ <arg name="JobAd" dir="O" type="map"
+ desc="(name,value,type) tuples; Values are INTEGER, FLOAT,
+ STRING and EXPR. The EXPR value is not first class,
+ it is an unquoted, with double quotes, string"/>
+ </method>
+
+ <method name="SetAttribute">
+ <arg name="Name" dir="I" type="sstr"/>
+ <arg name="Value" dir="I" type="lstr"/>
+ </method>
+
+ <method name="Hold">
+ <arg name="Reason" dir="I" type="sstr"/>
+ </method>
+
+ <method name="Release">
+ <arg name="Reason" dir="I" type="sstr"/>
+ </method>
+
+ <method name="Remove">
+ <arg name="Reason" dir="I" type="sstr"/>
+ </method>
+
+ <method name="Fetch">
+ <arg name="File" dir="I" type="sstr"/>
+ <arg name="Start" dir="I" type="int32"/>
+ <arg name="End" dir="I" type="int32"/>
+ <arg name="Data" dir="O" type="lstr"/>
+ </method>
+ </class>
+
+ <class name="Scheduler">
+ <group name="daemon-stats"/>
+
+ <property name="Pool" type="sstr" index="y"/>
+ <property name="System" type="sstr" index="y"/>
+
+ <property name="JobQueueBirthdate" type="absTime"/>
+ <property name="MaxJobsRunning" type="uint32" desc=""/>
+ <property name="Machine" type="sstr" desc=""/>
+ <property name="MyAddress" type="sstr" desc=""/>
+ <statistic name="NumUsers" type="uint32"/>
+ <property name="Name" type="sstr" index="y" desc=""/>
+ <property name="PublicNetworkIpAddr" type="sstr" desc=""/>
+ <statistic name="TotalHeldJobs" type="uint32"/>
+ <statistic name="TotalIdleJobs" type="uint32"/>
+ <statistic name="TotalJobAds" type="uint32"/>
+ <statistic name="TotalRemovedJobs" type="uint32"/>
+ <statistic name="TotalRunningJobs" type="uint32"/>
+
+ <method name="Submit">
+ <arg name="Ad" dir="I" type="map"/>
+ <arg name="Id" dir="O" type="sstr"/>
+ </method>
+ </class>
+
+ <class name="Submitter">
+ <property name="schedulerRef" type="objId" parentRef="y" index="y" references="mrg.grid.Scheduler"/>
+
+ <statistic name="HeldJobs" type="uint32"/>
+ <statistic name="IdleJobs" type="uint32"/>
+ <property name="JobQueueBirthdate" type="absTime"/>
+ <property name="Machine" type="sstr"/>
+ <property name="Name" type="sstr" index="y"/>
+ <statistic name="RunningJobs" type="uint32"/>
+ <property name="ScheddName" type="sstr"/>
+ </class>
+
+ <class name="Negotiator">
+ <property name="Pool" type="sstr" index="y"/>
+ <property name="System" type="sstr" index="y"/>
+
+ <property name="Name" type="sstr" index="y"/>
+ <property name="Machine" type="sstr"/>
+ <property name="MyAddress" type="sstr" desc=""/>
+
+ <!-- NOTE: MonitorSelf* statistics are currently missing in 7.0.0 -->
+ <group name="daemon-stats"/>
+
+ <method name="GetLimits">
+ <arg name="Limits" dir="O" type="map"/>
+ </method>
+
+ <method name="SetLimit">
+ <arg name="Name" dir="I" type="sstr"/>
+ <arg name="Max" dir="I" type="double"/>
+ </method>
+
+ <method name="GetStats">
+ <arg name="Name" dir="I" type="sstr" desc="User or group name"/>
+ <arg name="Ad" dir="O" type="map"/>
+<!--
+ <arg name="Effective" dir="O" type="double"/>
+ <arg name="Real" dir="O" type="double"/>
+ <arg name="Factor" dir="O" type="double"/>
+ <arg name="Resources" dir="O" type="unit32"/>
+ <arg name="Usage" dir="O" type="double" units="hours"/>
+-->
+ </method>
+
+ <method name="SetPriority">
+ <arg name="Name" dir="I" type="sstr" desc="User or group name"/>
+ <arg name="Priority" dir="I" type="double"/>
+ </method>
+
+ <method name="SetPriorityFactor">
+ <arg name="Name" dir="I" type="sstr" desc="User or group name"/>
+ <arg name="PriorityFactor" dir="I" type="double"/>
+ </method>
+
+ <method name="SetUsage">
+ <arg name="Name" dir="I" type="sstr" desc="User or group name"/>
+ <arg name="Usage" dir="I" type="double"/>
+ </method>
+
+ <!--
+ <method name="GetStaticQuota">
+ <arg name="Name" dir="I" type="sstr" desc="Group name"/>
+ <arg name="Quota" dir="O" type="uint32"/>
+ </method>
+
+ <method name="GetDynamicQuota">
+ <arg name="Name" dir="I" type="sstr" desc="Group name"/>
+ <arg name="Quota" dir="O" type="double"/>
+ </method>
+
+ <method name="SetStaticQuota">
+ <arg name="Name" dir="I" type="sstr" desc="Group name"/>
+ <arg name="Quota" dir="I" type="uint32"/>
+ </method>
+
+ <method name="SetDynamicQuota">
+ <arg name="Name" dir="I" type="sstr" desc="Group name"/>
+ <arg name="Quota" dir="I" type="double"/>
+ </method>
+-->
+
+ <method name="GetRawConfig">
+ <arg name="Name" dir="I" type="sstr" desc="Config param name"/>
+ <arg name="Value" dir="O" type="lstr"/>
+ </method>
+
+ <method name="SetRawConfig">
+ <arg name="Name" dir="I" type="sstr" desc="Config param name"/>
+ <arg name="Value" dir="I" type="lstr"/>
+ </method>
+
+ <method name="Reconfig"/>
+ </class>
+
+ <class name="Collector">
+ <property name="Pool" type="sstr" index="y"/>
+ <property name="System" type="sstr" index="y"/>
+
+ <property name="CondorPlatform" type="sstr"/>
+ <property name="CondorVersion" type="sstr"/>
+ <property name="Name" type="sstr" index="y"/>
+ <property name="PublicNetworkIpAddr" type="sstr"/>
+
+ <statistic name="RunningJobs" type="uint32"/>
+ <statistic name="IdleJobs" type="uint32"/>
+ <statistic name="HostsTotal" type="uint32"/>
+ <statistic name="HostsClaimed" type="uint32"/>
+ <statistic name="HostsUnclaimed" type="uint32"/>
+ <statistic name="HostsOwner" type="uint32"/>
+ </class>
+
+ <class name="Master">
+
+ <group name="daemon-stats"/>
+
+ <property name="Pool" type="sstr" index="y"/>
+ <property name="System" type="sstr" index="y"/>
+
+ <property name="Name" type="sstr" index="y"/>
+ <property name="Machine" type="sstr"/>
+ <property name="PublicNetworkIpAddr" type="sstr"/>
+ <property name="MyAddress" type="sstr"/>
+ <property name="RealUid" type="int32"/>
+
+ <method name="Start">
+ <arg name="Subsystem"
+ dir="I" type="sstr"
+ desc="The component/subsystem to start: one of STARTD,
+ SCHEDD, COLLECTOR, NEGOTIATOR, KBDD or QUILL"/>
+ </method>
+
+ <method name="Stop">
+ <arg name="Subsystem"
+ dir="I" type="sstr"
+ desc="The component/subsystem to stop: one of STARTD,
+ SCHEDD, COLLECTOR, NEGOTIATOR, KBDD or QUILL"/>
+ </method>
+ </class>
+
+ <class name="Grid">
+ <property name="Pool" type="sstr" index="y"/>
+
+ <property name="Name" type="sstr"/>
+ <property name="ScheddName" type="sstr"/>
+ <property name="Owner" type="sstr"/>
+
+ <statistic name="NumJobs" type="uint32"/>
+ <property name="JobLimit"
+ 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."/>
+
+ <statistic name="SubmitsInProgress" type="uint32"/>
+ <statistic name="SubmitsQueued" type="uint32"/>
+ <statistic name="SubmitsAllowed" type="uint32"/>
+ <statistic name="SubmitsWanted" type="uint32"/>
+
+ <property name="GridResourceUnavailableTime"
+ type="absTime" unit="nanosecond"
+ optional="y"
+ desc="If present, the Grid is down for the specified
+ amount of time."/>
+
+ <statistic name="RunningJobs" type="uint32"/>
+ <statistic name="IdleJobs" type="uint32"/>
+ </class>
+</schema>
Added: mgmt/trunk/rosemary/xml/qpid-acl.xml
===================================================================
--- mgmt/trunk/rosemary/xml/qpid-acl.xml (rev 0)
+++ mgmt/trunk/rosemary/xml/qpid-acl.xml 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,44 @@
+<schema package="org.apache.qpid.acl">
+
+<!--
+ * Copyright (c) 2008 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+ <class name="Acl">
+ <property name="brokerRef" type="objId" references="org.apache.qpid.broker:Broker" access="RO" index="y" parentRef="y"/>
+ <property name="policyFile" type="sstr" access="RO" desc="Name of the policy file"/>
+ <property name="enforcingAcl" type="bool" access="RO" desc="Currently Enforcing ACL"/>
+ <property name="transferAcl" type="bool" access="RO" desc="Any transfer ACL rules in force"/>
+ <property name="lastAclLoad" type="absTime" access="RO" desc="Timestamp of last successful load of ACL"/>
+ <statistic name="aclDenyCount" type="count64" unit="request" desc="Number of ACL requests denied"/>
+
+ <method name="reloadACLFile" desc="Reload the ACL file"/>
+ </class>
+
+ <eventArguments>
+ <arg name="action" type="sstr"/>
+ <arg name="arguments" type="map"/>
+ <arg name="objectName" type="sstr"/>
+ <arg name="objectType" type="sstr"/>
+ <arg name="reason" type="sstr"/>
+ <arg name="userId" type="sstr"/>
+ </eventArguments>
+
+ <event name="allow" sev="inform" args="userId, action, objectType, objectName, arguments"/>
+ <event name="deny" sev="notice" args="userId, action, objectType, objectName, arguments"/>
+ <event name="fileLoaded" sev="inform" args="userId"/>
+ <event name="fileLoadFailed" sev="error" args="userId, reason"/>
+
+</schema>
Added: mgmt/trunk/rosemary/xml/qpid-cluster.xml
===================================================================
--- mgmt/trunk/rosemary/xml/qpid-cluster.xml (rev 0)
+++ mgmt/trunk/rosemary/xml/qpid-cluster.xml 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,61 @@
+<schema package="org.apache.qpid.cluster">
+
+ <!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+ <!-- Type information:
+
+Numeric types with "_wm" suffix are watermarked numbers. These are compound
+values containing a current value, and a low and high water mark for the reporting
+interval. The low and high water marks are set to the current value at the
+beginning of each interval and track the minimum and maximum values of the statistic
+over the interval respectively.
+
+Access rights for configuration elements:
+
+RO => Read Only
+RC => Read/Create, can be set at create time only, read-only thereafter
+RW => Read/Write
+
+If access rights are omitted for a property, they are assumed to be RO.
+
+ -->
+
+ <class name="Cluster">
+ <property name="brokerRef" type="objId" references="Broker" access="RC" index="y" parentRef="y"/>
+ <property name="clusterName" type="sstr" access="RC" desc="Name of cluster this server is a member of"/>
+ <property name="clusterID" type="sstr" access="RO" desc="Globally unique ID (UUID) for this cluster instance"/>
+ <property name="memberID" type="sstr" access="RO" desc="ID of this member of the cluster"/>
+ <property name="publishedURL" type="sstr" access="RC" desc="URL this node advertizes itself as"/>
+ <property name="clusterSize" type="uint16" access="RO" desc="Number of brokers currently in the cluster"/>
+ <property name="status" type="sstr" access="RO" desc="Cluster node status (STALLED,ACTIVE,JOINING)"/>
+ <property name="members" type="lstr" access="RO" desc="List of member URLs delimited by ';'"/>
+ <property name="memberIDs" type="lstr" access="RO" desc="List of member IDs delimited by ';'"/>
+
+ <method name="stopClusterNode">
+ <arg name="brokerId" type="sstr" dir="I"/>
+ </method>
+ <method name="stopFullCluster"/>
+
+ </class>
+
+
+
+</schema>
+
Added: mgmt/trunk/rosemary/xml/qpid-store.xml
===================================================================
--- mgmt/trunk/rosemary/xml/qpid-store.xml (rev 0)
+++ mgmt/trunk/rosemary/xml/qpid-store.xml 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,103 @@
+<schema package="com.redhat.rhm.store">
+
+<!--
+ Copyright (c) 2007, 2008 Red Hat, Inc.
+
+ This file is part of the Qpid async store library msgstore.so.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ USA
+
+ The GNU Lesser General Public License is available in the file COPYING.
+ -->
+
+ <class name="Store">
+ <property name="brokerRef" type="objId" access="RO" references="qpid.Broker" index="y" parentRef="y"/>
+ <property name="location" type="sstr" access="RO" desc="Logical directory on disk"/>
+ <property name="defaultInitialFileCount" type="uint16" access="RO" unit="file" desc="Default number of files initially allocated to each journal"/>
+ <property name="defaultDataFileSize" type="uint32" access="RO" unit="RdPg" desc="Default size of each journal data file"/>
+ <property name="tplIsInitialized" type="bool" access="RO" desc="Transaction prepared list has been initialized by a transactional prepare"/>
+ <property name="tplDirectory" type="sstr" access="RO" desc="Transaction prepared list directory"/>
+ <property name="tplWritePageSize" type="uint32" access="RO" unit="byte" desc="Page size in transaction prepared list write-page-cache"/>
+ <property name="tplWritePages" type="uint32" access="RO" unit="wpage" desc="Number of pages in transaction prepared list write-page-cache"/>
+ <property name="tplInitialFileCount" type="uint16" access="RO" unit="file" desc="Number of files initially allocated to transaction prepared list journal"/>
+ <property name="tplDataFileSize" type="uint32" access="RO" unit="byte" desc="Size of each journal data file in transaction prepared list journal"/>
+ <property name="tplCurrentFileCount" type="uint32" access="RO" unit="file" desc="Number of files currently allocated to transaction prepared list journal"/>
+
+ <statistic name="tplTransactionDepth" type="hilo32" unit="txn" desc="Number of currently enqueued prepared transactions"/>
+ <statistic name="tplTxnPrepares" type="count64" unit="record" desc="Total transaction prepares on transaction prepared list"/>
+ <statistic name="tplTxnCommits" type="count64" unit="record" desc="Total transaction commits on transaction prepared list"/>
+ <statistic name="tplTxnAborts" type="count64" unit="record" desc="Total transaction aborts on transaction prepared list"/>
+ <statistic name="tplOutstandingAIOs" type="hilo32" unit="aio_op" desc="Number of currently outstanding AIO requests in Async IO system"/>
+ </class>
+
+ <class name="Journal">
+ <property name="queueRef" type="objId" access="RO" references="qpid.Queue" isGeneralReference="y"/>
+ <property name="name" type="sstr" access="RO" index="y"/>
+ <property name="directory" type="sstr" access="RO" desc="Directory containing journal files"/>
+ <property name="baseFileName" type="sstr" access="RO" desc="Base filename prefix for journal"/>
+ <property name="writePageSize" type="uint32" access="RO" unit="byte" desc="Page size in write-page-cache"/>
+ <property name="writePages" type="uint32" access="RO" unit="wpage" desc="Number of pages in write-page-cache"/>
+ <property name="readPageSize" type="uint32" access="RO" unit="byte" desc="Page size in read-page-cache"/>
+ <property name="readPages" type="uint32" access="RO" unit="rpage" desc="Number of pages in read-page-cache"/>
+ <property name="initialFileCount" type="uint16" access="RO" unit="file" desc="Number of files initially allocated to this journal"/>
+ <property name="autoExpand" type="bool" access="RO" desc="Auto-expand enabled"/>
+ <property name="currentFileCount" type="uint16" access="RO" unit="file" desc="Number of files currently allocated to this journal"/>
+ <property name="maxFileCount" type="uint16" access="RO" unit="file" desc="Max number of files allowed for this journal"/>
+ <property name="dataFileSize" type="uint32" access="RO" unit="byte" desc="Size of each journal data file"/>
+
+ <statistic name="recordDepth" type="hilo32" unit="record" desc="Number of currently enqueued records (durable messages)"/>
+ <statistic name="enqueues" type="count64" unit="record" desc="Total enqueued records on journal"/>
+ <statistic name="dequeues" type="count64" unit="record" desc="Total dequeued records on journal"/>
+ <statistic name="txn" type="count32" unit="record" desc="Total open transactions (xids) on journal"/>
+ <statistic name="txnEnqueues" type="count64" unit="record" desc="Total transactional enqueued records on journal"/>
+ <statistic name="txnDequeues" type="count64" unit="record" desc="Total transactional dequeued records on journal"/>
+ <statistic name="txnCommits" type="count64" unit="record" desc="Total transactional commit records on journal"/>
+ <statistic name="txnAborts" type="count64" unit="record" desc="Total transactional abort records on journal"/>
+ <statistic name="outstandingAIOs" type="hilo32" unit="aio_op" desc="Number of currently outstanding AIO requests in Async IO system"/>
+
+<!--
+ The following are not yet "wired up" in JournalImpl.cpp
+-->
+ <statistic name="freeFileCount" type="hilo32" unit="file" desc="Number of files free on this journal. Includes free files trapped in holes."/>
+ <statistic name="availableFileCount" type="hilo32" unit="file" desc="Number of files available to be written. Excluding holes"/>
+ <statistic name="writeWaitFailures" type="count64" unit="record" desc="AIO Wait failures on write"/>
+ <statistic name="writeBusyFailures" type="count64" unit="record" desc="AIO Busy failures on write"/>
+ <statistic name="readRecordCount" type="count64" unit="record" desc="Records read from the journal"/>
+ <statistic name="readBusyFailures" type="count64" unit="record" desc="AIO Busy failures on read"/>
+ <statistic name="writePageCacheDepth" type="hilo32" unit="wpage" desc="Current depth of write-page-cache"/>
+ <statistic name="readPageCacheDepth" type="hilo32" unit="rpage" desc="Current depth of read-page-cache"/>
+
+ <method name="expand" desc="Increase number of files allocated for this journal">
+ <arg name="by" type="uint32" dir="I" desc="Number of files to increase journal size by"/>
+ </method>
+ </class>
+
+ <eventArguments>
+ <arg name="autoExpand" type="bool" desc="Journal auto-expand enabled"/>
+ <arg name="fileSize" type="uint32" desc="Journal file size in bytes"/>
+ <arg name="jrnlId" type="sstr" desc="Journal Id"/>
+ <arg name="numEnq" type="uint32" desc="Number of recovered enqueues"/>
+ <arg name="numFiles" type="uint16" desc="Number of journal files"/>
+ <arg name="numTxn" type="uint32" desc="Number of recovered transactions"/>
+ <arg name="numTxnDeq" type="uint32" desc="Number of recovered transactional dequeues"/>
+ <arg name="numTxnEnq" type="uint32" desc="Number of recovered transactional enqueues"/>
+ <arg name="what" type="sstr" desc="Description of event"/>
+ </eventArguments>
+ <event name="enqThresholdExceeded" sev="warn" args="jrnlId, what"/>
+ <event name="created" sev="notice" args="jrnlId, fileSize, numFiles"/>
+ <event name="full" sev="error" args="jrnlId, what"/>
+ <event name="recovered" sev="notice" args="jrnlId, fileSize, numFiles, numEnq, numTxn, numTxnEnq, numTxnDeq"/>
+</schema>
Added: mgmt/trunk/rosemary/xml/qpid.xml
===================================================================
--- mgmt/trunk/rosemary/xml/qpid.xml (rev 0)
+++ mgmt/trunk/rosemary/xml/qpid.xml 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,340 @@
+<schema package="org.apache.qpid.broker">
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+ <!-- Type information:
+
+ Numeric types with "_wm" suffix are watermarked numbers. These are compound
+ values containing a current value, and a low and high water mark for the reporting
+ interval. The low and high water marks are set to the current value at the
+ beginning of each interval and track the minimum and maximum values of the statistic
+ over the interval respectively.
+
+ Access rights for configuration elements:
+
+ RO => Read Only
+ RC => Read/Create, can be set at create time only, read-only thereafter
+ RW => Read/Write
+
+ If access rights are omitted for a property, they are assumed to be RO.
+
+ -->
+
+ <!-- Questions: Does C++ broker round-robin dests on queues? -->
+
+ <!--
+ ===============================================================
+ System
+ ===============================================================
+ -->
+ <class name="System">
+ <property name="systemId" index="y" type="uuid" access="RC"/>
+
+ <property name="osName" type="sstr" access="RO" desc="Operating System Name"/>
+ <property name="nodeName" type="sstr" access="RO" desc="Node Name"/>
+ <property name="release" type="sstr" access="RO"/>
+ <property name="version" type="sstr" access="RO"/>
+ <property name="machine" type="sstr" access="RO"/>
+
+ </class>
+
+ <!--
+ ===============================================================
+ Broker
+ ===============================================================
+ -->
+ <class name="Broker">
+ <property name="systemRef" type="objId" references="System" access="RC" index="y" desc="System ID" parentRef="y"/>
+ <property name="port" type="uint16" access="RC" index="y" desc="TCP Port for AMQP Service"/>
+ <property name="workerThreads" type="uint16" access="RO" desc="Thread pool size"/>
+ <property name="maxConns" type="uint16" access="RO" desc="Maximum allowed connections"/>
+ <property name="connBacklog" type="uint16" access="RO" desc="Connection backlog limit for listening socket"/>
+ <property name="stagingThreshold" type="uint32" access="RO" desc="Broker stages messages over this size to disk"/>
+ <property name="mgmtPubInterval" type="uint16" access="RW" unit="second" min="1" desc="Interval for management broadcasts"/>
+ <property name="version" type="sstr" access="RO" desc="Running software version"/>
+ <property name="dataDir" type="sstr" access="RO" optional="y" desc="Persistent configuration storage location"/>
+ <statistic name="uptime" type="deltaTime"/>
+
+ <method name="echo" desc="Request a response to test the path to the management broker">
+ <arg name="sequence" dir="IO" type="uint32" default="0"/>
+ <arg name="body" dir="IO" type="lstr" default=""/>
+ </method>
+
+ <method name="connect" desc="Establish a connection to another broker">
+ <arg name="host" dir="I" type="sstr"/>
+ <arg name="port" dir="I" type="uint32"/>
+ <arg name="durable" dir="I" type="bool"/>
+ <arg name="authMechanism" dir="I" type="sstr"/>
+ <arg name="username" dir="I" type="sstr"/>
+ <arg name="password" dir="I" type="sstr"/>
+ <arg name="transport" dir="I" type="sstr"/>
+ </method>
+
+ <method name="queueMoveMessages" desc="Move messages from one queue to another">
+ <arg name="srcQueue" dir="I" type="sstr" desc="Source queue"/>
+ <arg name="destQueue" dir="I" type="sstr" desc="Destination queue"/>
+ <arg name="qty" dir="I" type="uint32" desc="# of messages to move. 0 means all messages"/>
+ </method>
+
+ </class>
+
+ <!--
+ ===============================================================
+ Management Agent
+ ===============================================================
+ -->
+ <class name="Agent">
+ <property name="connectionRef" type="objId" references="Connection" access="RO" index="y"/>
+ <property name="label" type="sstr" access="RO" desc="Label for agent"/>
+ <property name="registeredTo" type="objId" references="Broker" access="RO" desc="Broker agent is registered to"/>
+ <property name="systemId" type="uuid" access="RO" desc="Identifier of system where agent resides"/>
+ <property name="brokerBank" type="uint32" access="RO" desc="Assigned object-id broker bank"/>
+ <property name="agentBank" type="uint32" access="RO" desc="Assigned object-id agent bank"/>
+ </class>
+
+ <!--
+ ===============================================================
+ Virtual Host
+ ===============================================================
+ -->
+ <class name="Vhost">
+ <property name="brokerRef" type="objId" references="Broker" access="RC" index="y" parentRef="y"/>
+ <property name="name" type="sstr" access="RC" index="y"/>
+ <property name="federationTag" type="sstr" access="RO"/>
+ </class>
+
+ <!--
+ ===============================================================
+ Queue
+ ===============================================================
+ -->
+ <class name="Queue">
+ <property name="vhostRef" type="objId" references="Vhost" access="RC" index="y" parentRef="y"/>
+ <property name="name" type="sstr" access="RC" index="y"/>
+
+ <property name="durable" type="bool" access="RC"/>
+ <property name="autoDelete" type="bool" access="RC"/>
+ <property name="exclusive" type="bool" access="RC"/>
+ <property name="arguments" type="map" access="RO" desc="Arguments supplied in queue.declare"/>
+
+ <statistic name="msgTotalEnqueues" type="count64" unit="message" desc="Total messages enqueued"/>
+ <statistic name="msgTotalDequeues" type="count64" unit="message" desc="Total messages dequeued"/>
+ <statistic name="msgTxnEnqueues" type="count64" unit="message" desc="Transactional messages enqueued"/>
+ <statistic name="msgTxnDequeues" type="count64" unit="message" desc="Transactional messages dequeued"/>
+ <statistic name="msgPersistEnqueues" type="count64" unit="message" desc="Persistent messages enqueued"/>
+ <statistic name="msgPersistDequeues" type="count64" unit="message" desc="Persistent messages dequeued"/>
+ <statistic name="msgDepth" type="count32" unit="message" desc="Current size of queue in messages" assign="msgTotalEnqueues - msgTotalDequeues"/>
+ <statistic name="byteDepth" type="count32" unit="octet" desc="Current size of queue in bytes" assign="byteTotalEnqueues - byteTotalDequeues"/>
+ <statistic name="byteTotalEnqueues" type="count64" unit="octet" desc="Total messages enqueued"/>
+ <statistic name="byteTotalDequeues" type="count64" unit="octet" desc="Total messages dequeued"/>
+ <statistic name="byteTxnEnqueues" type="count64" unit="octet" desc="Transactional messages enqueued"/>
+ <statistic name="byteTxnDequeues" type="count64" unit="octet" desc="Transactional messages dequeued"/>
+ <statistic name="bytePersistEnqueues" type="count64" unit="octet" desc="Persistent messages enqueued"/>
+ <statistic name="bytePersistDequeues" type="count64" unit="octet" desc="Persistent messages dequeued"/>
+ <statistic name="consumerCount" type="hilo32" unit="consumer" desc="Current consumers on queue"/>
+ <statistic name="bindingCount" type="hilo32" unit="binding" desc="Current bindings"/>
+ <statistic name="unackedMessages" type="hilo32" unit="message" desc="Messages consumed but not yet acked"/>
+ <statistic name="messageLatency" type="mmaTime" unit="nanosecond" desc="Broker latency through this queue"/>
+
+ <method name="purge" desc="Discard all or some messages on a queue">
+ <arg name="request" dir="I" type="uint32" desc="0 for all messages or n>0 for n messages"/>
+ </method>
+ </class>
+
+ <!--
+ ===============================================================
+ Exchange
+ ===============================================================
+ -->
+ <class name="Exchange">
+ <property name="vhostRef" type="objId" references="Vhost" access="RC" index="y" parentRef="y"/>
+ <property name="name" type="sstr" access="RC" index="y"/>
+ <property name="type" type="sstr" access="RO"/>
+ <property name="durable" type="bool" access="RC"/>
+ <property name="arguments" type="map" access="RO" desc="Arguments supplied in exchange.declare"/>
+
+ <statistic name="producerCount" type="hilo32" desc="Current producers on exchange"/>
+ <statistic name="bindingCount" type="hilo32" desc="Current bindings"/>
+ <statistic name="msgReceives" type="count64" desc="Total messages received"/>
+ <statistic name="msgDrops" type="count64" desc="Total messages dropped (no matching key)"/>
+ <statistic name="msgRoutes" type="count64" desc="Total routed messages"/>
+ <statistic name="byteReceives" type="count64" desc="Total bytes received"/>
+ <statistic name="byteDrops" type="count64" desc="Total bytes dropped (no matching key)"/>
+ <statistic name="byteRoutes" type="count64" desc="Total routed bytes"/>
+ </class>
+
+ <!--
+ ===============================================================
+ Binding
+ ===============================================================
+ -->
+ <class name="Binding">
+ <property name="exchangeRef" type="objId" references="Exchange" access="RC" index="y" parentRef="y"/>
+ <property name="queueRef" type="objId" references="Queue" access="RC" index="y"/>
+ <property name="bindingKey" type="sstr" access="RC" index="y"/>
+ <property name="arguments" type="map" access="RC"/>
+ <property name="origin" type="sstr" access="RO" optional="y"/>
+
+ <statistic name="msgMatched" type="count64"/>
+ </class>
+
+ <!--
+ ===============================================================
+ Connection
+ ===============================================================
+ -->
+ <class name="Connection">
+ <property name="vhostRef" type="objId" references="Vhost" access="RC" index="y" parentRef="y"/>
+ <property name="address" type="sstr" access="RC" index="y"/>
+ <property name="incoming" type="bool" access="RC"/>
+ <property name="SystemConnection" type="bool" access="RC" desc="Infrastucture/ Inter-system connection (Cluster, Federation, ...)"/>
+ <property name="federationLink" type="bool" access="RO" desc="Is this a federation link"/>
+ <property name="authIdentity" type="sstr" access="RO" desc="authId of connection if authentication enabled"/>
+ <property name="remoteProcessName" type="sstr" access="RO" optional="y" desc="Name of executable running as remote client"/>
+ <property name="remotePid" type="uint32" access="RO" optional="y" desc="Process ID of remote client"/>
+ <property name="remoteParentPid" type="uint32" access="RO" optional="y" desc="Parent Process ID of remote client"/>
+ <statistic name="closing" type="bool" desc="This client is closing by management request"/>
+ <statistic name="framesFromClient" type="count64"/>
+ <statistic name="framesToClient" type="count64"/>
+ <statistic name="bytesFromClient" type="count64"/>
+ <statistic name="bytesToClient" type="count64"/>
+
+ <method name="close"/>
+ </class>
+
+ <!--
+ ===============================================================
+ Link
+ ===============================================================
+ -->
+ <class name="Link">
+
+ This class represents an inter-broker connection.
+
+ <property name="vhostRef" type="objId" references="Vhost" access="RC" index="y" parentRef="y"/>
+ <property name="host" type="sstr" access="RC" index="y"/>
+ <property name="port" type="uint16" access="RC" index="y"/>
+ <property name="transport" type="sstr" access="RC"/>
+ <property name="durable" type="bool" access="RC"/>
+
+ <statistic name="state" type="sstr" desc="Operational state of the link"/>
+ <statistic name="lastError" type="sstr" desc="Reason link is not operational"/>
+
+ <method name="close"/>
+
+ <method name="bridge" desc="Bridge messages over the link">
+ <arg name="durable" dir="I" type="bool"/>
+ <arg name="src" dir="I" type="sstr"/>
+ <arg name="dest" dir="I" type="sstr"/>
+ <arg name="key" dir="I" type="sstr"/>
+ <arg name="tag" dir="I" type="sstr"/>
+ <arg name="excludes" dir="I" type="sstr"/>
+ <arg name="srcIsQueue" dir="I" type="bool"/>
+ <arg name="srcIsLocal" dir="I" type="bool"/>
+ <arg name="dynamic" dir="I" type="bool"/>
+ <arg name="sync" dir="I" type="uint16"/>
+ </method>
+ </class>
+
+
+ <!--
+ ===============================================================
+ Bridge
+ ===============================================================
+ -->
+ <class name="Bridge">
+ <property name="linkRef" type="objId" references="Link" access="RC" index="y" parentRef="y"/>
+ <property name="channelId" type="uint16" access="RC" index="y"/>
+ <property name="durable" type="bool" access="RC"/>
+ <property name="src" type="sstr" access="RC"/>
+ <property name="dest" type="sstr" access="RC"/>
+ <property name="key" type="sstr" access="RC"/>
+ <property name="srcIsQueue" type="bool" access="RC"/>
+ <property name="srcIsLocal" type="bool" access="RC"/>
+ <property name="tag" type="sstr" access="RC"/>
+ <property name="excludes" type="sstr" access="RC"/>
+ <property name="dynamic" type="bool" access="RC"/>
+ <property name="sync" type="uint16" access="RC"/>
+ <method name="close"/>
+ </class>
+
+
+ <!--
+ ===============================================================
+ Session
+ ===============================================================
+ -->
+ <class name="Session">
+ <property name="vhostRef" type="objId" references="Vhost" access="RC" index="y" parentRef="y"/>
+ <property name="name" type="sstr" access="RC" index="y"/>
+ <property name="channelId" type="uint16" access="RO"/>
+ <property name="connectionRef" type="objId" references="Connection" access="RO"/>
+ <property name="detachedLifespan" type="uint32" access="RO" unit="second"/>
+ <property name="attached" type="bool" access="RO"/>
+ <property name="expireTime" type="absTime" access="RO" optional="y"/>
+ <property name="maxClientRate" type="uint32" access="RO" unit="msgs/sec" optional="y"/>
+
+ <statistic name="framesOutstanding" type="count32"/>
+
+ <statistic name="TxnStarts" type="count64" unit="transaction" desc="Total transactions started "/>
+ <statistic name="TxnCommits" type="count64" unit="transaction" desc="Total transactions committed"/>
+ <statistic name="TxnRejects" type="count64" unit="transaction" desc="Total transactions rejected"/>
+ <statistic name="TxnCount" type="count32" unit="transaction" desc="Current pending transactions"/>
+
+ <statistic name="clientCredit" type="count32" unit="message" desc="Client message credit"/>
+
+ <method name="solicitAck"/>
+ <method name="detach"/>
+ <method name="resetLifespan"/>
+ <method name="close"/>
+ </class>
+
+ <eventArguments>
+ <arg name="altEx" type="sstr" desc="Name of the alternate exchange"/>
+ <arg name="args" type="map" desc="Supplemental arguments or parameters supplied"/>
+ <arg name="autoDel" type="bool" desc="Created object is automatically deleted when no longer in use"/>
+ <arg name="dest" type="sstr" desc="Destination tag for a subscription"/>
+ <arg name="disp" type="sstr" desc="Disposition of a declaration: 'created' if object was created, 'existing' if object already existed"/>
+ <arg name="durable" type="bool" desc="Created object is durable"/>
+ <arg name="exName" type="sstr" desc="Name of an exchange"/>
+ <arg name="exType" type="sstr" desc="Type of an exchange"/>
+ <arg name="excl" type="bool" desc="Created object is exclusive for the use of the owner only"/>
+ <arg name="key" type="lstr" desc="Key text used for routing or binding"/>
+ <arg name="qName" type="sstr" desc="Name of a queue"/>
+ <arg name="reason" type="lstr" desc="Reason for a failure"/>
+ <arg name="rhost" type="sstr" desc="Address (i.e. DNS name, IP address, etc.) of a remotely connected host"/>
+ <arg name="user" type="sstr" desc="Authentication identity"/>
+ </eventArguments>
+
+ <event name="clientConnect" sev="inform" args="rhost, user"/>
+ <event name="clientConnectFail" sev="warn" args="rhost, user, reason"/>
+ <event name="clientDisconnect" sev="inform" args="rhost, user"/>
+ <event name="brokerLinkUp" sev="inform" args="rhost"/>
+ <event name="brokerLinkDown" sev="warn" args="rhost"/>
+ <event name="queueDeclare" sev="inform" args="rhost, user, qName, durable, excl, autoDel, args, disp"/>
+ <event name="queueDelete" sev="inform" args="rhost, user, qName"/>
+ <event name="exchangeDeclare" sev="inform" args="rhost, user, exName, exType, altEx, durable, autoDel, args, disp"/>
+ <event name="exchangeDelete" sev="inform" args="rhost, user, exName"/>
+ <event name="bind" sev="inform" args="rhost, user, exName, qName, key, args"/>
+ <event name="unbind" sev="inform" args="rhost, user, exName, qName, key"/>
+ <event name="subscribe" sev="inform" args="rhost, user, qName, dest, excl, args"/>
+ <event name="unsubscribe" sev="inform" args="rhost, user, dest"/>
+</schema>
+
Added: mgmt/trunk/rosemary/xml/sesame.xml
===================================================================
--- mgmt/trunk/rosemary/xml/sesame.xml (rev 0)
+++ mgmt/trunk/rosemary/xml/sesame.xml 2009-05-08 14:33:27 UTC (rev 3369)
@@ -0,0 +1,31 @@
+<schema package="com.redhat.sesame">
+
+ <class name="Sysimage">
+ <property name="uuid" index="y" type="uuid" access="RC" desc="UUID of System Image"/>
+
+ <property name="osName" type="sstr" access="RO" desc="Operating System Name"/>
+ <property name="nodeName" type="sstr" access="RO" desc="Node Name"/>
+ <property name="release" type="sstr" access="RO"/>
+ <property name="version" type="sstr" access="RO"/>
+ <property name="machine" type="sstr" access="RO"/>
+ <property name="distro" type="sstr" access="RO" optional="y"/>
+
+ <property name="memTotal" type="uint32" access="RO" unit="kByte"/>
+ <property name="swapTotal" type="uint32" access="RO" unit="kByte"/>
+
+ The following statistics are gathered from /proc/meminfo
+
+ <statistic name="memFree" type="uint32" unit="kByte"/>
+ <statistic name="swapFree" type="uint32" unit="kByte"/>
+
+ The following statistics are gathered from /proc/loadavg
+
+ <statistic name="loadAverage1Min" type="float"/>
+ <statistic name="loadAverage5Min" type="float"/>
+ <statistic name="loadAverage10Min" type="float"/>
+ <statistic name="procTotal" type="uint32"/>
+ <statistic name="procRunning" type="uint32"/>
+ </class>
+
+</schema>
+
15 years, 8 months
rhmessaging commits: r3368 - in store/trunk/cpp: lib/jrnl and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-05-08 10:27:05 -0400 (Fri, 08 May 2009)
New Revision: 3368
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.h
store/trunk/cpp/lib/TxnCtxt.cpp
store/trunk/cpp/lib/TxnCtxt.h
store/trunk/cpp/lib/jrnl/jdir.cpp
store/trunk/cpp/tests/python_tests/cluster_basic.py
store/trunk/cpp/tests/run_python_tests
Log:
Fix for BZ 483807 - "resolve join state for store recover in cluster for joining nodes" and its dups. This checkin syncs with qpid checkin 773004.
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-05-08 13:26:35 UTC (rev 3367)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-05-08 14:27:05 UTC (rev 3368)
@@ -30,6 +30,7 @@
#include "qpid/log/Statement.h"
#include "qmf/com/redhat/rhm/store/Package.h"
#include "StoreException.h"
+#include <dirent.h>
#define MAX_AIO_SLEEPS 1000 // ~1 second
#define AIO_SLEEP_TIME 1000 // 1 milisecond
@@ -63,7 +64,6 @@
{}
MessageStoreImpl::MessageStoreImpl(const char* envpath) :
- env(0),
numJrnlFiles(0),
autoJrnlExpand(false),
autoJrnlExpandMaxFiles(0),
@@ -273,15 +273,35 @@
tplWCacheNumPages = getJrnlWrNumPages(tplWCachePageSizeKib);
autoJrnlExpand = autoJExpand;
autoJrnlExpandMaxFiles = autoJExpandMaxFiles;
-
if (dir.size()>0) storeDir = dir;
+ init();
+
+ QPID_LOG(notice, "Store module initialized; dir=" << dir);
+ QPID_LOG(info, "> Default files per journal: " << jfiles);
+// TODO: Uncomment these lines when auto-expand is enabled.
+// QPID_LOG(info, "> Auto-expand " << (autoJrnlExpand ? "enabled" : "disabled"));
+// if (autoJrnlExpand) QPID_LOG(info, "> Max auto-expand journal files: " << autoJrnlExpandMaxFiles);
+ QPID_LOG(info, "> Default journal file size: " << jfileSizePgs << " (wpgs)");
+ QPID_LOG(info, "> Default write cache page size: " << wCachePageSizeKib << " (Kib)");
+ QPID_LOG(info, "> Default number of write cache pages: " << wCacheNumPages);
+ QPID_LOG(info, "> TPL files per journal: " << tplNumJrnlFiles);
+ QPID_LOG(info, "> TPL journal file size: " << tplJfileSizePgs << " (wpgs)");
+ QPID_LOG(info, "> TPL write cache page size: " << tplWCachePageSizeKib << " (Kib)");
+ QPID_LOG(info, "> TPL number of write cache pages: " << tplWCacheNumPages);
+
+ return isInit;
+}
+
+void MessageStoreImpl::init()
+{
journal::jdir::create_dir(getBdbBaseDir());
try {
- env.set_errpfx("msgstore");
- env.set_lg_regionmax(256000); // default = 65000
- env.open(getBdbBaseDir().c_str(), DB_THREAD | DB_CREATE | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_USE_ENVIRON | DB_RECOVER, 0);
+ dbenv.reset(new DbEnv(0));
+ dbenv->set_errpfx("msgstore");
+ dbenv->set_lg_regionmax(256000); // default = 65000
+ dbenv->open(getBdbBaseDir().c_str(), DB_THREAD | DB_CREATE | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_USE_ENVIRON | DB_RECOVER, 0);
} catch (const DbException& e) {
if (e.get_errno() == DB_VERSION_MISMATCH)
THROW_STORE_EXCEPTION_2("Database environment mismatch: This version of bd4 does not match that which created the store database. "
@@ -295,15 +315,15 @@
// Databases are constructed here instead of the constructor so that the DB_RECOVER flag can be used
// against the database environment. Recover can only be performed if no databases have been created
// against the environment at the time of recovery, as recovery invalidates the environment.
- queueDb.reset(new Db(&env, 0));
- configDb.reset(new Db(&env, 0));
- exchangeDb.reset(new Db(&env, 0));
- messageDb.reset(new Db(&env, 0));
- mappingDb.reset(new Db(&env, 0));
- bindingDb.reset(new Db(&env, 0));
- generalDb.reset(new Db(&env, 0));
+ queueDb.reset(new Db(dbenv.get(), 0));
+ configDb.reset(new Db(dbenv.get(), 0));
+ exchangeDb.reset(new Db(dbenv.get(), 0));
+ messageDb.reset(new Db(dbenv.get(), 0));
+ mappingDb.reset(new Db(dbenv.get(), 0));
+ bindingDb.reset(new Db(dbenv.get(), 0));
+ generalDb.reset(new Db(dbenv.get(), 0));
- txn.begin(env, false);
+ txn.begin(dbenv.get(), false);
open(queueDb, txn.get(), "queues.db", false);
open(configDb, txn.get(), "config.db", false);
open(exchangeDb, txn.get(), "exchanges.db", false);
@@ -325,21 +345,52 @@
}
isInit = true;
- QPID_LOG(notice, "Store module initialized; dir=" << dir);
- QPID_LOG(info, "> Default files per journal: " << jfiles);
-// TODO: Uncomment these lines when auto-expand is enabled.
-// QPID_LOG(info, "> Auto-expand " << (autoJrnlExpand ? "enabled" : "disabled"));
-// if (autoJrnlExpand) QPID_LOG(info, "> Max auto-expand journal files: " << autoJrnlExpandMaxFiles);
- QPID_LOG(info, "> Default journal file size: " << jfileSizePgs << " (wpgs)");
- QPID_LOG(info, "> Default write cache page size: " << wCachePageSizeKib << " (Kib)");
- QPID_LOG(info, "> Default number of write cache pages: " << wCacheNumPages);
- QPID_LOG(info, "> TPL files per journal: " << tplNumJrnlFiles);
- QPID_LOG(info, "> TPL journal file size: " << tplJfileSizePgs << " (wpgs)");
- QPID_LOG(info, "> TPL write cache page size: " << tplWCachePageSizeKib << " (Kib)");
- QPID_LOG(info, "> TPL number of write cache pages: " << tplWCacheNumPages);
- return true;
}
+void MessageStoreImpl::pushDown(const char* dirName, const char* bakDirName)
+{
+ DIR* dir = ::opendir(dirName);
+ if (dir)
+ {
+ std::ostringstream oss;
+ oss << dirName << "/" << bakDirName;
+ // Delete bak dir if it exists
+ mrg::journal::jdir::delete_dir(oss.str());
+ // Create new bak dir
+ mrg::journal::jdir::create_dir(oss.str());
+
+ // Copy contents of current dir into bak dir
+ struct dirent* entry;
+ while ((entry = ::readdir(dir)) != 0) {
+ // Ignore . and .. and backup dir
+ if (std::strcmp(entry->d_name, ".") != 0 && std::strcmp(entry->d_name, "..") != 0 && std::strcmp(entry->d_name, bakDirName)) {
+ std::ostringstream oldname;
+ oldname << dirName << "/" << entry->d_name;
+ std::ostringstream newname;
+ newname << oss.str() << "/" << entry->d_name;
+ ::rename(oldname.str().c_str(), newname.str().c_str());
+ }
+ }
+ }
+}
+
+void MessageStoreImpl::discardInit(const bool pushDownStoreFiles)
+{
+ if (isInit) {
+ for (std::list<db_ptr >::iterator i = dbs.begin(); i != dbs.end(); i++) {
+ (*i)->close(0);
+ }
+ dbs.clear();
+ if (tplStorePtr->is_ready()) tplStorePtr->stop(true);
+ dbenv->close(0);
+ if (pushDownStoreFiles)
+ pushDown(storeDir.c_str(), "cluster_bak");
+ else
+ mrg::journal::jdir::delete_dir(storeDir.c_str());
+ init();
+ }
+}
+
void MessageStoreImpl::chkTplStoreInit()
{
if (!tplStorePtr->is_ready()) {
@@ -386,7 +437,7 @@
void MessageStoreImpl::truncate()
{
DbTxn* txn;
- env.txn_begin(0, &txn, 0);
+ dbenv->txn_begin(0, &txn, 0);
u_int32_t count;
for (std::list<db_ptr >::iterator i = dbs.begin(); i != dbs.end(); i++) {
@@ -533,7 +584,7 @@
int status;
TxnCtxt txn;
- txn.begin(env, true);
+ txn.begin(dbenv.get(), true);
try {
status = db->put(txn.get(), &key, &value, DB_NOOVERWRITE);
txn.commit();
@@ -565,7 +616,7 @@
IdDbt key(e.getPersistenceId());
BindingDbt value(e, q, k, a);
TxnCtxt txn;
- txn.begin(env, true);
+ txn.begin(dbenv.get(), true);
try {
put(bindingDb, txn.get(), key, value);
txn.commit();
@@ -595,7 +646,7 @@
message_index messages;//id->message
TxnCtxt txn;
- txn.begin(env, false);
+ txn.begin(dbenv.get(), false);
try {
//read all queues, calls recoversMessages
recoverQueues(txn, registry, queues, prepared, messages);
@@ -969,7 +1020,7 @@
value.buffer.record();
TxnCtxt txn;
- txn.begin(env, true);
+ txn.begin(dbenv.get(), true);
try {
if (messageDb->get(txn.get(), &key, &value, 0) == DB_NOTFOUND) {
txn.abort();
@@ -1159,7 +1210,7 @@
{
checkInit();
TxnCtxt txn;
- txn.begin(env, true);
+ txn.begin(dbenv.get(), true);
u_int64_t messageId (msg->getPersistenceId());
if (messageId == 0 || !msg->isContentReleased()) {
@@ -1183,7 +1234,7 @@
if (messageId) {
Dbt key (&messageId, sizeof(messageId));
TxnCtxt txn;
- txn.begin(env, true);
+ txn.begin(dbenv.get(), true);
try {
deleteIfUnused(txn.get(), key);
txn.commit();
@@ -1202,7 +1253,7 @@
{
u_int64_t ret = 0;
TxnCtxt txn;
- txn.begin(env, true);
+ txn.begin(dbenv.get(), true);
try {
ret = getRecordSize(txn.get(), db, key);
txn.commit();
@@ -1238,7 +1289,7 @@
u_int64_t messageId (msg->getPersistenceId());
if (messageId != 0) {
TxnCtxt txn;
- txn.begin(env, true);
+ txn.begin(dbenv.get(), true);
try {
Dbt key (&messageId, sizeof(messageId));
u_int64_t offset = getRecordSize(messageDb, key);
@@ -1289,7 +1340,7 @@
THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() + ": loadContent() failed: " + e.what());
}
TxnCtxt txn;
- txn.begin(env, true);
+ txn.begin(dbenv.get(), true);
try {
Dbt key (&messageId, sizeof(messageId));
char *buffer = new char[length];
@@ -1674,7 +1725,7 @@
void MessageStoreImpl::deleteBindingsForQueue(const PersistableQueue& queue)
{
TxnCtxt txn;
- txn.begin(env, true);
+ txn.begin(dbenv.get(), true);
try {
{
Cursor bindings;
@@ -1710,7 +1761,7 @@
const std::string& bkey)
{
TxnCtxt txn;
- txn.begin(env, true);
+ txn.begin(dbenv.get(), true);
try {
{
Cursor bindings;
Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h 2009-05-08 13:26:35 UTC (rev 3367)
+++ store/trunk/cpp/lib/MessageStoreImpl.h 2009-05-08 14:27:05 UTC (rev 3368)
@@ -55,6 +55,8 @@
{
public:
typedef boost::shared_ptr<Db> db_ptr;
+ typedef boost::shared_ptr<DbEnv> dbEnv_ptr;
+
struct StoreOptions : public qpid::Options {
StoreOptions(const std::string& name="Store Options");
std::string clusterName;
@@ -101,7 +103,7 @@
static const u_int16_t defAutoJrnlExpandMaxFiles = 16;
std::list<db_ptr> dbs;
- DbEnv env;
+ dbEnv_ptr dbenv;
db_ptr queueDb;
db_ptr configDb;
db_ptr exchangeDb;
@@ -152,6 +154,10 @@
const u_int16_t numJrnlFiles,
const std::string& numJrnlFilesParamName);
+ void init();
+
+ void pushDown(const char* dir, const char* bakDirName = "bak");
+
void recoverQueues(TxnCtxt& txn,
qpid::broker::RecoveryManager& recovery,
queue_index& index,
@@ -249,7 +255,7 @@
std::string getTplBaseDir();
inline void checkInit() {
// TODO: change the default dir to ~/.qpidd
- if (!isInit) init("/tmp", defNumJrnlFiles, defJrnlFileSizePgs, defWCachePageSize); isInit = true;
+ if (!isInit) { init("/tmp"); isInit = true; }
}
void chkTplStoreInit();
@@ -285,6 +291,8 @@
bool autoJExpand = defAutoJrnlExpand,
u_int16_t autoJExpandMaxFiles = defAutoJrnlExpandMaxFiles);
+ void discardInit(const bool pushDownStoreFiles = false);
+
void initManagement (qpid::broker::Broker* broker);
void truncate();
Modified: store/trunk/cpp/lib/TxnCtxt.cpp
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.cpp 2009-05-08 13:26:35 UTC (rev 3367)
+++ store/trunk/cpp/lib/TxnCtxt.cpp 2009-05-08 14:27:05 UTC (rev 3368)
@@ -112,8 +112,8 @@
}
}
-void TxnCtxt::begin(DbEnv& env, bool sync) {
- env.txn_begin(0, &txn, 0);
+void TxnCtxt::begin(DbEnv* env, bool sync) {
+ env->txn_begin(0, &txn, 0);
if (sync)
globalHolder = AutoScopedLock(new qpid::sys::Mutex::ScopedLock(globalSerialiser));
}
Modified: store/trunk/cpp/lib/TxnCtxt.h
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.h 2009-05-08 13:26:35 UTC (rev 3367)
+++ store/trunk/cpp/lib/TxnCtxt.h 2009-05-08 14:27:05 UTC (rev 3368)
@@ -29,7 +29,7 @@
#include <memory>
#include <set>
#include <string>
-
+
#include "DataTokenImpl.h"
#include "IdSequence.h"
#include "JournalImpl.h"
@@ -83,7 +83,7 @@
*/
void sync();
void sync_jrnl(JournalImpl* jc, bool firstloop, bool& allWritten);
- void begin(DbEnv& env, bool sync = false);
+ void begin(DbEnv* env, bool sync = false);
void commit();
void abort();
DbTxn* get();
Modified: store/trunk/cpp/lib/jrnl/jdir.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jdir.cpp 2009-05-08 13:26:35 UTC (rev 3367)
+++ store/trunk/cpp/lib/jrnl/jdir.cpp 2009-05-08 14:27:05 UTC (rev 3368)
@@ -242,12 +242,12 @@
DIR* dir = ::opendir(dirname.c_str());
if (!dir)
{
- if (errno == ENOENT) // dir does not exist.
- return;
+ if (errno == ENOENT) // dir does not exist.
+ return;
- std::ostringstream oss;
- oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
- throw jexception(jerrno::JERR_JDIR_OPENDIR, oss.str(), "jdir", "delete_dir");
+ std::ostringstream oss;
+ oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
+ throw jexception(jerrno::JERR_JDIR_OPENDIR, oss.str(), "jdir", "delete_dir");
}
else
{
Modified: store/trunk/cpp/tests/python_tests/cluster_basic.py
===================================================================
--- store/trunk/cpp/tests/python_tests/cluster_basic.py 2009-05-08 13:26:35 UTC (rev 3367)
+++ store/trunk/cpp/tests/python_tests/cluster_basic.py 2009-05-08 14:27:05 UTC (rev 3368)
@@ -79,33 +79,32 @@
self.killAllClusters()
raise
-# TODO: Un-comment this when the "Exchange already exists: amq.direct" error is fixed
-# def test_Cluster_04_SingleClusterRemoveRestoreNodes(self):
-# if self._runClusterTests == None:
-# print "skipped"
-# return
-# try:
-# clusterName = "test_Cluster_04_SingleClusterRemoveRestoreNodes"
-# self.createCheckCluster(clusterName, 6)
-# self.checkNumBrokers(6)
-# self.killNode(1, clusterName)
-# self.killNode(3, clusterName)
-# self.killNode(4, clusterName)
-# self.checkNumBrokers(3)
-# self.createClusterNode(1, clusterName)
-# self.createClusterNode(3, clusterName)
-# self.createClusterNode(4, clusterName)
-# self.checkNumClusterBrokers(clusterName, 6)
-# self.killNode(2, clusterName)
-# self.killNode(3, clusterName)
-# self.killNode(4, clusterName)
-# self.checkNumBrokers(3)
-# self.createClusterNode(2, clusterName)
-# self.createClusterNode(3, clusterName)
-# self.createClusterNode(4, clusterName)
-# self.checkNumClusterBrokers(clusterName, 6)
-# self.stopCheckAll()
-# except:
-# self.killAllClusters()
-# raise
+ def test_Cluster_04_SingleClusterRemoveRestoreNodes(self):
+ if self._runClusterTests == None:
+ print "skipped"
+ return
+ try:
+ clusterName = "test_Cluster_04_SingleClusterRemoveRestoreNodes"
+ self.createCheckCluster(clusterName, 6)
+ self.checkNumBrokers(6)
+ self.killNode(1, clusterName)
+ self.killNode(3, clusterName)
+ self.killNode(4, clusterName)
+ self.checkNumBrokers(3)
+ self.createClusterNode(1, clusterName)
+ self.createClusterNode(3, clusterName)
+ self.createClusterNode(4, clusterName)
+ self.checkNumClusterBrokers(clusterName, 6)
+ self.killNode(2, clusterName)
+ self.killNode(3, clusterName)
+ self.killNode(4, clusterName)
+ self.checkNumBrokers(3)
+ self.createClusterNode(2, clusterName)
+ self.createClusterNode(3, clusterName)
+ self.createClusterNode(4, clusterName)
+ self.checkNumClusterBrokers(clusterName, 6)
+ self.stopCheckAll()
+ except:
+ self.killAllClusters()
+ raise
Modified: store/trunk/cpp/tests/run_python_tests
===================================================================
--- store/trunk/cpp/tests/run_python_tests 2009-05-08 13:26:35 UTC (rev 3367)
+++ store/trunk/cpp/tests/run_python_tests 2009-05-08 14:27:05 UTC (rev 3368)
@@ -22,7 +22,15 @@
# The GNU Lesser General Public License is available in the file COPYING.
if test -z ${QPID_DIR} ; then
- echo "WARNING: QPID_DIR not set, skipping python tests."
+ cat <<EOF
+
+ =========== WARNING: PYTHON TESTS DISABLED ==============
+
+ QPID_DIR not set.
+
+ ===========================================================
+
+EOF
exit
fi
@@ -33,9 +41,18 @@
PYTHON_TESTS=python_tests
FAILING_PYTHON_TESTS=${abs_srcdir}/failing_python_tests.txt
else
- echo "WARNING: Unable to load python qpid module - skipping python tests."
- echo " QPID_DIR=${QPID_DIR}"
- echo " PYTHONPATH=${PYTHONPATH}"
+ cat <<EOF
+
+ =========== WARNING: PYTHON TESTS DISABLED ==============
+
+ Unable to load python qpid module - skipping python tests.
+
+ QPID_DIR=${QPID_DIR}"
+ PYTHONPATH=${PYTHONPATH}"
+
+ ===========================================================
+
+EOF
exit
fi
@@ -66,7 +83,7 @@
$NOAISEXEC
===========================================================
-
+
EOF
else
export RUN_CLUSTER_TESTS=1
15 years, 8 months
rhmessaging commits: r3367 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-05-08 09:26:35 -0400 (Fri, 08 May 2009)
New Revision: 3367
Modified:
mgmt/trunk/cumin/python/cumin/visualizations.py
mgmt/trunk/cumin/python/cumin/visualizations.strings
Log:
Removed the Please wait popup dialog since displaying the job page will happen immediately and show it's own Please wait animation.
Modified: mgmt/trunk/cumin/python/cumin/visualizations.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/visualizations.py 2009-05-08 12:29:50 UTC (rev 3366)
+++ mgmt/trunk/cumin/python/cumin/visualizations.py 2009-05-08 13:26:35 UTC (rev 3367)
@@ -24,9 +24,6 @@
self.slot_legend = self.SlotLegend(app, "slot_legend")
self.add_child(self.slot_legend)
- self.wait = self.PleaseWait(app, "please_wait")
- self.add_child(self.wait)
-
def get_args(self, session):
return self.frame.get_args(session)
@@ -57,27 +54,6 @@
def render_slot_clip_size(self, session, *args):
return 400
- class PleaseWait(CuminForm):
- def __init__(self, app, name):
- super(SlotMap.PleaseWait, self).__init__(app, name)
-
- self.__cancel = self.Cancel(app, "cancel")
- self.__cancel.set_tab_index(201)
- self.add_child(self.__cancel)
-
- def get_modal(self, session):
- return False
-
- class Cancel(FormButton):
- def render_class(self, session, *args):
- return "cancel"
-
- def render_content(self, session, *args):
- return "Cancel"
-
- def render_onclick(self, session, *args):
- return "cancel_wait"
-
class SlotLegend(Widget):
def __init__(self, app, name):
super(SlotMap.SlotLegend, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/visualizations.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/visualizations.strings 2009-05-08 12:29:50 UTC (rev 3366)
+++ mgmt/trunk/cumin/python/cumin/visualizations.strings 2009-05-08 13:26:35 UTC (rev 3367)
@@ -693,7 +693,6 @@
function go_to_job(jid) {
var url = show_slot_job_url.replace("XXX", jid+"");
window.location.href = url;
- show_wait();
}
}
}
@@ -1017,7 +1016,6 @@
{slot_legend}
</div>
{slot_info}
-{please_wait}
<script type="text/javascript">
var slot_current_id = "{id}";
var show_slot_job_url = "{slot_job_url}";
@@ -1040,100 +1038,6 @@
}
</script>
-[PleaseWait.javascript]
-function cancel_wait() {
- var oGlass = document.getElementById("modal_glass");
- var oWait = document.getElementById("please_wait");
- if (oGlass && oGlass) {
- oGlass.style.display = "none";
- oWait.style.display = "none";
- }
- window.location.href = window.location.href;
- return false;
-}
-
-function show_wait() {
- var oGlass = document.getElementById("modal_glass");
- var oWait = document.getElementById("please_wait");
-
- if (oWait && oGlass) {
- oGlass.style.width = document.body.offsetWidth + "px";
- oGlass.style.height = document.body.offsetHeight + "px";
- oGlass.style.display = "block";
- oWait.style.visibility = "hidden";
- oWait.style.display = "block";
-
- document.body.appendChild(oGlass); // so it covers the entire page
- document.body.appendChild(oWait); // so it can be centered on the page
-
- var cp = get_center_point();
- oWait.style.left = (cp.x - (oWait.offsetWidth / 2)) + "px";
- oWait.style.top = (cp.y - (oWait.offsetHeight / 2)) + "px";
- oWait.style.visibility = "visible";
- }
-}
-
-function get_center_point() {
- var x = 0;
- var y = 0;
-
- var scrollx = (document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
- var scrolly = (document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
-
- var width = document.body.offsetWidth;
- var height = document.body.offsetHeight;
-
- return { x: (width + scrollx) / 2, y: (height + scrolly) / 2 };
-}
-
-
-[PleaseWait.css]
-div#modal_glass {
- background-color: black;
- opacity: .2;
- -moz-opacity:.2;
- position: absolute;
- width: 1px;
- height: 1px;
- left: 0;
- top: 0;
- display: none;
- z-index: 200;
-}
-
-div#please_wait {
- position: absolute;
- display: none;
- z-index: 201;
- left: 100px;
- top: 100px;
-}
-
-div#please_wait form.mform {
- width: 20em;
-}
-
-div#please_wait form.mform div.body, div#please_wait form.mform div.foot {
- text-align: center;
-}
-
-[PleaseWait.html]
-<div id="modal_glass" onclick="cancel_wait()"><!-- --></div>
-<div id="please_wait">
- <form class="mform">
- <div class="head">
- <h1>Loading Job</h1>
- </div>
- <div class="body">
- Loading Job. Please wait...
- </div>
- <div class="foot">
- {cancel}
- </div>
- </form>
-</div>
-
-
[SlotInfo.css]
div.slot_info {
position: absolute;
15 years, 8 months
rhmessaging commits: r3366 - mgmt/trunk/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-05-08 08:29:50 -0400 (Fri, 08 May 2009)
New Revision: 3366
Modified:
mgmt/trunk/cumin/python/cumin/grid/slot.py
Log:
Fix job column in slotset.
Modified: mgmt/trunk/cumin/python/cumin/grid/slot.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/slot.py 2009-05-07 19:02:42 UTC (rev 3365)
+++ mgmt/trunk/cumin/python/cumin/grid/slot.py 2009-05-08 12:29:50 UTC (rev 3366)
@@ -79,7 +79,7 @@
def render_content(self, session, data):
if data["jid"]:
job = Identifiable(data["jid"])
- href = self.page.main.grid.job.get_href(session, job)
+ href = self.page.main.grid.pool.job.get_href(session, job)
return fmt_link(href, data["job_id"])
def render_items(self, session, *args):
15 years, 8 months
rhmessaging commits: r3365 - in store/trunk/cpp/tests: cluster and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-05-07 15:02:42 -0400 (Thu, 07 May 2009)
New Revision: 3365
Modified:
store/trunk/cpp/tests/Makefile.am
store/trunk/cpp/tests/OrderingTest.cpp
store/trunk/cpp/tests/SimpleTest.cpp
store/trunk/cpp/tests/TransactionalTest.cpp
store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
store/trunk/cpp/tests/clean.sh
store/trunk/cpp/tests/cluster/Makefile.am
store/trunk/cpp/tests/jrnl/Makefile.am
store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
store/trunk/cpp/tests/jrnl/_ut_jdir.cpp
store/trunk/cpp/tests/jrnl/jtt/Makefile.am
store/trunk/cpp/tests/jrnl/jtt/_ut_jrnl_instance.cpp
store/trunk/cpp/tests/jrnl/run-journal-tests
store/trunk/cpp/tests/run_python_tests
store/trunk/cpp/tests/system_test.sh
Log:
Changed environment var TMPDIR to TMP_STORE_DIR to avoid sg/newgrp problems. Added "sg ais" to python tests so clustering can be tested.
Modified: store/trunk/cpp/tests/Makefile.am
===================================================================
--- store/trunk/cpp/tests/Makefile.am 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/Makefile.am 2009-05-07 19:02:42 UTC (rev 3365)
@@ -26,7 +26,7 @@
INCLUDES=-I$(top_srcdir)/lib -I$(top_srcdir)/lib/gen
-TMPDIR=$(abs_srcdir)/test_tmp
+TMP_STORE_DIR=$(abs_srcdir)/test_tmp
SUBDIRS = jrnl cluster .
@@ -81,5 +81,5 @@
VALGRIND=$(VALGRIND) \
abs_srcdir=$(abs_srcdir) \
LIBSTORE=$(abs_builddir)/../lib/.libs/msgstore.so \
- TMPDIR=$(TMPDIR) \
+ TMP_STORE_DIR=$(TMP_STORE_DIR) \
$(srcdir)/run_test
Modified: store/trunk/cpp/tests/OrderingTest.cpp
===================================================================
--- store/trunk/cpp/tests/OrderingTest.cpp 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/OrderingTest.cpp 2009-05-07 19:02:42 UTC (rev 3365)
@@ -44,7 +44,7 @@
QPID_AUTO_TEST_SUITE(OrderingTest)
const std::string test_filename("OrderingTest");
-const char* tdp = getenv("TMPDIR");
+const char* tdp = getenv("TMP_STORE_DIR");
const std::string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/OrderingTest");
// === Helper fns ===
Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/SimpleTest.cpp 2009-05-07 19:02:42 UTC (rev 3365)
@@ -51,7 +51,7 @@
QPID_AUTO_TEST_SUITE(SimpleTest)
const string test_filename("SimpleTest");
-const char* tdp = getenv("TMPDIR");
+const char* tdp = getenv("TMP_STORE_DIR");
const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/SimpleTest");
// === Helper fns ===
Modified: store/trunk/cpp/tests/TransactionalTest.cpp
===================================================================
--- store/trunk/cpp/tests/TransactionalTest.cpp 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/TransactionalTest.cpp 2009-05-07 19:02:42 UTC (rev 3365)
@@ -46,7 +46,7 @@
QPID_AUTO_TEST_SUITE(TransactionalTest)
const string test_filename("TransactionalTest");
-const char* tdp = getenv("TMPDIR");
+const char* tdp = getenv("TMP_STORE_DIR");
const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/TransactionalTest");
// Test txn context which has special setCompleteFailure() method which prevents entire "txn complete" process from hapenning
Modified: store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
===================================================================
--- store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2009-05-07 19:02:42 UTC (rev 3365)
@@ -47,7 +47,7 @@
QPID_AUTO_TEST_SUITE(TwoPhaseCommitTest)
const string test_filename("TwoPhaseCommitTest");
-const char* tdp = getenv("TMPDIR");
+const char* tdp = getenv("TMP_STORE_DIR");
string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/TwoPhaseCommitTest");
// === Helper fns ===
Modified: store/trunk/cpp/tests/clean.sh
===================================================================
--- store/trunk/cpp/tests/clean.sh 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/clean.sh 2009-05-07 19:02:42 UTC (rev 3365)
@@ -26,7 +26,7 @@
# be run prior to the store system tests, as these are prone to crashing or
# hanging under some circumstances if the database is old or inconsistent.
-if [ -d ${TMPDIR} ]; then
- rm -rf ${TMPDIR}
+if [ -d ${TMP_STORE_DIR} ]; then
+ rm -rf ${TMP_STORE_DIR}
fi
rm -f ${abs_srcdir}/*.vglog*
Modified: store/trunk/cpp/tests/cluster/Makefile.am
===================================================================
--- store/trunk/cpp/tests/cluster/Makefile.am 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/cluster/Makefile.am 2009-05-07 19:02:42 UTC (rev 3365)
@@ -30,7 +30,7 @@
INCLUDES=-I$(top_srcdir)/lib $(QPID_CXXFLAGS)
-TMPDIR=$(abs_srcdir)/test_tmp
+TMP_STORE_DIR=$(abs_srcdir)/test_tmp
QPID_TEST_DIR = $(QPID_DIR)/cpp/src/tests
@@ -48,7 +48,7 @@
QPID_DIR=$(QPID_DIR) \
VALGRIND=$(VALGRIND) \
LIBSTORE=$(abs_builddir)/../../lib/.libs/msgstore.so \
- TMPDIR=$(TMPDIR) \
+ TMP_STORE_DIR=$(TMP_STORE_DIR) \
abs_srcdir=$(abs_srcdir)
EXTRA_DIST = \
Modified: store/trunk/cpp/tests/jrnl/Makefile.am
===================================================================
--- store/trunk/cpp/tests/jrnl/Makefile.am 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/jrnl/Makefile.am 2009-05-07 19:02:42 UTC (rev 3365)
@@ -26,13 +26,13 @@
INCLUDES=-I$(top_srcdir)/lib
-TMPDIR=$(abs_srcdir)/test_tmp
+TMP_STORE_DIR=$(abs_srcdir)/test_tmp
SUBDIRS = jtt .
TESTS_ENVIRONMENT = \
VALGRIND=$(VALGRIND) \
- TMPDIR=$(TMPDIR) \
+ TMP_STORE_DIR=$(TMP_STORE_DIR) \
$(srcdir)/../run_test
all-local: .valgrindrc .valgrind.supp
Modified: store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2009-05-07 19:02:42 UTC (rev 3365)
@@ -44,7 +44,7 @@
#define NUM_JFILES 4
#define JFSIZE_SBLKS 128
-const char* tdp = getenv("TMPDIR");
+const char* tdp = getenv("TMP_STORE_DIR");
const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/jrnl_test");
class test_dtok : public data_tok
Modified: store/trunk/cpp/tests/jrnl/_ut_jdir.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_jdir.cpp 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/jrnl/_ut_jdir.cpp 2009-05-07 19:02:42 UTC (rev 3365)
@@ -49,7 +49,7 @@
QPID_AUTO_TEST_SUITE(jdir_suite)
const string test_filename("_ut_jdir");
-const char* tdp = getenv("TMPDIR");
+const char* tdp = getenv("TMP_STORE_DIR");
const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/_ut_jdir");
// === Helper functions ===
Modified: store/trunk/cpp/tests/jrnl/jtt/Makefile.am
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/Makefile.am 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/jrnl/jtt/Makefile.am 2009-05-07 19:02:42 UTC (rev 3365)
@@ -24,14 +24,14 @@
AM_CXXFLAGS = $(WARNING_CFLAGS) -I${top_srcdir}/lib -pthread -DBOOST_TEST_DYN_LINK
-TMPDIR=$(abs_srcdir)/test_tmp
+TMP_STORE_DIR=$(abs_srcdir)/test_tmp
LINK_BDB = ${top_builddir}/lib/msgstore.la
TESTS_ENVIRONMENT = \
VALGRIND=$(VALGRIND) \
abs_srcdir=$(abs_srcdir) \
- TMPDIR=$(TMPDIR) \
+ TMP_STORE_DIR=$(TMP_STORE_DIR) \
$(srcdir)/../../run_test
all-local: .valgrindrc .valgrind.supp
Modified: store/trunk/cpp/tests/jrnl/jtt/_ut_jrnl_instance.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/_ut_jrnl_instance.cpp 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/jrnl/jtt/_ut_jrnl_instance.cpp 2009-05-07 19:02:42 UTC (rev 3365)
@@ -37,7 +37,7 @@
QPID_AUTO_TEST_SUITE(jtt_jrnl_instance)
const string test_filename("_ut_jrnl_instance");
-const char* tdp = getenv("TMPDIR");
+const char* tdp = getenv("TMP_STORE_DIR");
const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/JttTest");
QPID_AUTO_TEST_CASE(constructor_1)
Modified: store/trunk/cpp/tests/jrnl/run-journal-tests
===================================================================
--- store/trunk/cpp/tests/jrnl/run-journal-tests 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/jrnl/run-journal-tests 2009-05-07 19:02:42 UTC (rev 3365)
@@ -27,20 +27,20 @@
# Run jtt using default test set
echo
echo "===== Mode 1: New journal instance, no recover ====="
-jtt/jtt --ja-path jtt --jrnl-dir ${TMPDIR} --csv jtt/jtt.csv --format-chk --num-jrnls ${num_jrnls} || fail=1
-rm -rf ${TMPDIR}/test_0*
+jtt/jtt --ja-path jtt --jrnl-dir ${TMP_STORE_DIR} --csv jtt/jtt.csv --format-chk --num-jrnls ${num_jrnls} || fail=1
+rm -rf ${TMP_STORE_DIR}/test_0*
echo
echo "===== Mode 2: Re-use journal instance, no recover ====="
-jtt/jtt --ja-path jtt --jrnl-dir ${TMPDIR} --csv jtt/jtt.csv --reuse-instance --format-chk --num-jrnls ${num_jrnls} || fail=1
-rm -rf ${TMPDIR}/test_0*
+jtt/jtt --ja-path jtt --jrnl-dir ${TMP_STORE_DIR} --csv jtt/jtt.csv --reuse-instance --format-chk --num-jrnls ${num_jrnls} || fail=1
+rm -rf ${TMP_STORE_DIR}/test_0*
echo
echo "===== Mode 3: New journal instance, recover previous test journal ====="
-jtt/jtt --ja-path jtt --jrnl-dir ${TMPDIR} --csv jtt/jtt.csv --recover-mode --format-chk --num-jrnls ${num_jrnls} || fail=1
-rm -rf ${TMPDIR}/test_0*
+jtt/jtt --ja-path jtt --jrnl-dir ${TMP_STORE_DIR} --csv jtt/jtt.csv --recover-mode --format-chk --num-jrnls ${num_jrnls} || fail=1
+rm -rf ${TMP_STORE_DIR}/test_0*
echo
echo "===== Mode 4: Re-use journal instance, recover previous test journal ====="
-jtt/jtt --ja-path jtt --jrnl-dir ${TMPDIR} --csv jtt/jtt.csv --reuse-instance --recover-mode --format-chk --num-jrnls ${num_jrnls} || fail=1
-rm -rf ${TMPDIR}/test_0*
+jtt/jtt --ja-path jtt --jrnl-dir ${TMP_STORE_DIR} --csv jtt/jtt.csv --reuse-instance --recover-mode --format-chk --num-jrnls ${num_jrnls} || fail=1
+rm -rf ${TMP_STORE_DIR}/test_0*
echo
exit $fail
Modified: store/trunk/cpp/tests/run_python_tests
===================================================================
--- store/trunk/cpp/tests/run_python_tests 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/run_python_tests 2009-05-07 19:02:42 UTC (rev 3365)
@@ -39,15 +39,15 @@
exit
fi
-BROKER_OPTS="--no-module-dir --load-module=${LIBSTORE} --data-dir=${TMPDIR} --auth=no"
+BROKER_OPTS="--no-module-dir --load-module=${LIBSTORE} --data-dir=${TMP_STORE_DIR} --auth=no"
AMQP_SPEC=0-10-errata
#Make sure temp dir exists if this is the first to use it
-if ! test -d ${TMPDIR} ; then
- mkdir -p ${TMPDIR}
- mkdir -p ${TMPDIR}/cluster
-elif ! test -d "${TMPDIR}/cluster" ; then
- mkdir -p "${TMPDIR}/cluster"
+if ! test -d ${TMP_STORE_DIR} ; then
+ mkdir -p ${TMP_STORE_DIR}
+ mkdir -p ${TMP_STORE_DIR}/cluster
+elif ! test -d "${TMP_STORE_DIR}/cluster" ; then
+ mkdir -p "${TMP_STORE_DIR}/cluster"
fi
# Check AIS requirements
@@ -84,7 +84,7 @@
# Run all python tests
pwdir=$(pwd)
cd ${QPID_PYTHON_DIR}
-./run-tests --skip-self-test -v -s ${AMQP_SPEC} -I ${FAILING_PYTHON_TESTS} -B "${BROKER_OPTS}" ${PYTHON_TESTS} || { echo "FAIL python tests for ${AMQP_SPEC}"; fail=1; }
+sg ais -c "./run-tests --skip-self-test -v -s ${AMQP_SPEC} -I ${FAILING_PYTHON_TESTS} -B \"${BROKER_OPTS}\" ${PYTHON_TESTS}" || { echo "FAIL python tests for ${AMQP_SPEC}"; fail=1; }
cd ${pwdir}
exit ${fail}
Modified: store/trunk/cpp/tests/system_test.sh
===================================================================
--- store/trunk/cpp/tests/system_test.sh 2009-05-07 11:00:44 UTC (rev 3364)
+++ store/trunk/cpp/tests/system_test.sh 2009-05-07 19:02:42 UTC (rev 3365)
@@ -35,17 +35,17 @@
export PYTHONPATH=$QPID_DIR/python
# Create a temporary directory for store data.
-#if test $TESTDIRx == x ; then
-# export TMPDIR=`mktemp -d` || error "Can't create temporary directory."
+#if test $TMP_STORE_DIRx == x ; then
+# export TMP_STORE_DIR=`mktemp -d` || error "Can't create temporary directory."
#else
-# export TMPDIR=$TESTDIR
+# export TMP_STORE_DIR=$TESTDIR
#fi
-echo "Using directory $TMPDIR"
+echo "Using directory $TMP_STORE_DIR"
fail=0
# Run the tests with a given set of flags
-BROKER_OPTS="--no-module-dir --load-module=$LIBSTORE --data-dir=$TMPDIR --auth=no --wcache-page-size 16"
+BROKER_OPTS="--no-module-dir --load-module=$LIBSTORE --data-dir=$TMP_STORE_DIR --auth=no --wcache-page-size 16"
run_tests() {
for p in `seq 1 8`; do
$abs_srcdir/start_broker "$@" ${BROKER_OPTS} || { echo "FAIL broker start"; return 1; }
15 years, 8 months
rhmessaging commits: r3364 - store/trunk/cpp/tests.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-05-07 07:00:44 -0400 (Thu, 07 May 2009)
New Revision: 3364
Modified:
store/trunk/cpp/tests/run_python_tests
Log:
Added additional test to run_python_tests to make sure QPID_DIR is set
Modified: store/trunk/cpp/tests/run_python_tests
===================================================================
--- store/trunk/cpp/tests/run_python_tests 2009-05-06 19:22:51 UTC (rev 3363)
+++ store/trunk/cpp/tests/run_python_tests 2009-05-07 11:00:44 UTC (rev 3364)
@@ -21,6 +21,11 @@
#
# The GNU Lesser General Public License is available in the file COPYING.
+if test -z ${QPID_DIR} ; then
+ echo "WARNING: QPID_DIR not set, skipping python tests."
+ exit
+fi
+
QPID_PYTHON_DIR=${QPID_DIR}/python
export PYTHONPATH=${QPID_PYTHON_DIR}:${abs_srcdir}
15 years, 8 months
rhmessaging commits: r3363 - in store/trunk/cpp/tests: python_tests and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-05-06 15:22:51 -0400 (Wed, 06 May 2009)
New Revision: 3363
Added:
store/trunk/cpp/tests/python_tests/cluster_basic.py
Modified:
store/trunk/cpp/tests/Makefile.am
store/trunk/cpp/tests/python_tests/__init__.py
store/trunk/cpp/tests/python_tests/flow_to_disk.py
store/trunk/cpp/tests/run_python_tests
store/trunk/cpp/tests/system_test.sh
Log:
Added some initial python cluster tests with persistence
Modified: store/trunk/cpp/tests/Makefile.am
===================================================================
--- store/trunk/cpp/tests/Makefile.am 2009-05-06 19:07:31 UTC (rev 3362)
+++ store/trunk/cpp/tests/Makefile.am 2009-05-06 19:22:51 UTC (rev 3363)
@@ -78,9 +78,8 @@
TESTS_ENVIRONMENT = \
QPID_DIR=$(QPID_DIR) \
- QPIDD=$(QPID_DIR)/cpp/src/qpidd \
VALGRIND=$(VALGRIND) \
abs_srcdir=$(abs_srcdir) \
- LIBBDBSTORE=$(abs_builddir)/../lib/.libs/msgstore.so \
+ LIBSTORE=$(abs_builddir)/../lib/.libs/msgstore.so \
TMPDIR=$(TMPDIR) \
$(srcdir)/run_test
Modified: store/trunk/cpp/tests/python_tests/__init__.py
===================================================================
--- store/trunk/cpp/tests/python_tests/__init__.py 2009-05-06 19:07:31 UTC (rev 3362)
+++ store/trunk/cpp/tests/python_tests/__init__.py 2009-05-06 19:22:51 UTC (rev 3363)
@@ -1,6 +1,6 @@
# Do not delete - marks this directory as a python package.
-# Copyright (c) 2008 Red Hat, Inc.
+# Copyright (c) 2008, 2009 Red Hat, Inc.
#
# This file is part of the Qpid async store library msgstore.so.
#
@@ -21,4 +21,5 @@
#
# The GNU Lesser General Public License is available in the file COPYING.
+from cluster_basic import *
from flow_to_disk import *
Added: store/trunk/cpp/tests/python_tests/cluster_basic.py
===================================================================
--- store/trunk/cpp/tests/python_tests/cluster_basic.py (rev 0)
+++ store/trunk/cpp/tests/python_tests/cluster_basic.py 2009-05-06 19:22:51 UTC (rev 3363)
@@ -0,0 +1,111 @@
+# Copyright (c) 2009 Red Hat, Inc.
+#
+# This file is part of the Qpid async store library msgstore.so.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+#
+# The GNU Lesser General Public License is available in the file COPYING.
+
+import os
+import signal
+from qpid.testlib import TestBaseCluster
+
+class BasicClusterTests(TestBaseCluster):
+ """Basic cluster with async store tests"""
+
+ _runClusterTests = os.getenv("RUN_CLUSTER_TESTS")
+
+ def test_Cluster_01_SingleClusterInitialization(self):
+ if self._runClusterTests == None:
+ print "skipped"
+ return
+ try:
+ clusterName = "test_Cluster_01_SingleClusterInitialization"
+ self.createCheckCluster(clusterName, 5)
+ self.checkNumBrokers(5)
+ self.stopCheckCluster(clusterName)
+ except:
+ self.killAllClusters()
+ raise
+
+ def test_Cluster_02_MultipleClusterInitialization(self):
+ if self._runClusterTests == None:
+ print "skipped"
+ return
+ try:
+ for i in range(0, 5):
+ clusterName = "test_Cluster_02_MultipleClusterInitialization.%d" % i
+ self.createCluster(clusterName, 5)
+ self.checkNumBrokers(25)
+ self.killCluster("test_Cluster_02_MultipleClusterInitialization.2")
+ self.checkNumBrokers(20)
+ self.stopCheckAll()
+ except:
+ self.killAllClusters()
+ raise
+
+ def test_Cluster_03_SingleClusterAddRemoveNodes(self):
+ if self._runClusterTests == None:
+ print "skipped"
+ return
+ try:
+ clusterName = "test_Cluster_03_SingleClusterAddRemoveNodes"
+ self.createCheckCluster(clusterName, 3)
+ for i in range(4,9):
+ self.createClusterNode(i, clusterName)
+ self.checkNumClusterBrokers(clusterName, 8)
+ self.killNode(2, clusterName)
+ self.killNode(5, clusterName)
+ self.killNode(6, clusterName)
+ self.checkNumClusterBrokers(clusterName, 5)
+ self.createClusterNode(9, clusterName)
+ self.createClusterNode(10, clusterName)
+ self.checkNumClusterBrokers(clusterName, 7)
+ self.stopCheckAll()
+ except:
+ self.killAllClusters()
+ raise
+
+# TODO: Un-comment this when the "Exchange already exists: amq.direct" error is fixed
+# def test_Cluster_04_SingleClusterRemoveRestoreNodes(self):
+# if self._runClusterTests == None:
+# print "skipped"
+# return
+# try:
+# clusterName = "test_Cluster_04_SingleClusterRemoveRestoreNodes"
+# self.createCheckCluster(clusterName, 6)
+# self.checkNumBrokers(6)
+# self.killNode(1, clusterName)
+# self.killNode(3, clusterName)
+# self.killNode(4, clusterName)
+# self.checkNumBrokers(3)
+# self.createClusterNode(1, clusterName)
+# self.createClusterNode(3, clusterName)
+# self.createClusterNode(4, clusterName)
+# self.checkNumClusterBrokers(clusterName, 6)
+# self.killNode(2, clusterName)
+# self.killNode(3, clusterName)
+# self.killNode(4, clusterName)
+# self.checkNumBrokers(3)
+# self.createClusterNode(2, clusterName)
+# self.createClusterNode(3, clusterName)
+# self.createClusterNode(4, clusterName)
+# self.checkNumClusterBrokers(clusterName, 6)
+# self.stopCheckAll()
+# except:
+# self.killAllClusters()
+# raise
+
Modified: store/trunk/cpp/tests/python_tests/flow_to_disk.py
===================================================================
--- store/trunk/cpp/tests/python_tests/flow_to_disk.py 2009-05-06 19:07:31 UTC (rev 3362)
+++ store/trunk/cpp/tests/python_tests/flow_to_disk.py 2009-05-06 19:22:51 UTC (rev 3363)
@@ -28,37 +28,37 @@
class FlowToDiskTests(TestBase010):
"""Tests for async store flow-to-disk"""
- def test_01_simple_max_count_transient(self):
+ def test_FlowToDisk_01_SimpleMaxCountTransient(self):
queue_args = {'qpid.policy_type':'flow_to_disk', 'qpid.max_count': 10}
- self.simple_limit("test_simple_max_count_transient", queue_args, self.session.delivery_mode.non_persistent, self.session.acquire_mode.pre_acquired)
+ self.simple_limit("test_FlowToDisk_01_SimpleMaxCountTransient", queue_args, self.session.delivery_mode.non_persistent, self.session.acquire_mode.pre_acquired)
- def test_02_simple_max_count_persistent(self):
+ def test_FlowToDisk_02_SimpleMaxCountPersistent(self):
queue_args = {'qpid.policy_type':'flow_to_disk', 'qpid.max_count': 10}
- self.simple_limit("test_simple_max_count_persistent", queue_args, self.session.delivery_mode.persistent, self.session.acquire_mode.pre_acquired)
+ self.simple_limit("test_FlowToDisk_02_SimpleMaxCountPersistent", queue_args, self.session.delivery_mode.persistent, self.session.acquire_mode.pre_acquired)
- def test_03_simple_max_size_transient(self):
+ def test_FlowToDisk_03_SimpleMaxSizeTransient(self):
queue_args = {'qpid.policy_type':'flow_to_disk', 'qpid.max_size': 100}
- self.simple_limit("test_simple_max_size_transient", queue_args, self.session.delivery_mode.non_persistent, self.session.acquire_mode.pre_acquired)
+ self.simple_limit("test_FlowToDisk_03_SimpleMaxSizeTransient", queue_args, self.session.delivery_mode.non_persistent, self.session.acquire_mode.pre_acquired)
- def test_04_simple_max_size_persistent(self):
+ def test_FlowToDisk_04_SimpleMaxSizePersistent(self):
queue_args = {'qpid.policy_type':'flow_to_disk', 'qpid.max_size': 100}
- self.simple_limit("test_simple_max_size_persistent", queue_args, self.session.delivery_mode.persistent, self.session.acquire_mode.pre_acquired)
+ self.simple_limit("test_FlowToDisk_04_SimpleMaxSizePersistent", queue_args, self.session.delivery_mode.persistent, self.session.acquire_mode.pre_acquired)
- def test_05_simple_max_count_transient_not_acquired(self):
+ def test_FlowToDisk_05_SimpleMaxCountTransientNotAcquired(self):
queue_args = {'qpid.policy_type':'flow_to_disk', 'qpid.max_count': 10}
- self.simple_limit("test_simple_max_count_transient_not_acquired", queue_args, self.session.delivery_mode.non_persistent, self.session.acquire_mode.not_acquired)
+ self.simple_limit("test_FlowToDisk_05_SimpleMaxCountTransientNotAcquired", queue_args, self.session.delivery_mode.non_persistent, self.session.acquire_mode.not_acquired)
- def test_06_simple_max_count_persistent_not_acquired(self):
+ def test_FlowToDisk_06_SimpleMaxCountPersistentNotAcquired(self):
queue_args = {'qpid.policy_type':'flow_to_disk', 'qpid.max_count': 10}
- self.simple_limit("test_simple_max_count_persistent_not_acquired", queue_args, self.session.delivery_mode.persistent, self.session.acquire_mode.not_acquired)
+ self.simple_limit("test_FlowToDisk_06_SimpleMaxCountPersistentNotAcquired", queue_args, self.session.delivery_mode.persistent, self.session.acquire_mode.not_acquired)
- def test_07_simple_max_size_transient_not_acquired(self):
+ def test_FlowToDisk_07_SimpleMaxSizeTransientNotAcquired(self):
queue_args = {'qpid.policy_type':'flow_to_disk', 'qpid.max_size': 100}
- self.simple_limit("test_simple_max_size_transient_not_acquired", queue_args, self.session.delivery_mode.non_persistent, self.session.acquire_mode.not_acquired)
+ self.simple_limit("test_FlowToDisk_07_SimpleMaxSizeTransientNotAcquired", queue_args, self.session.delivery_mode.non_persistent, self.session.acquire_mode.not_acquired)
- def test_08_simple_max_size_persistent_not_acquired(self):
+ def test_FlowToDisk_08_SimpleMaxSizePersistentNotAcquired(self):
queue_args = {'qpid.policy_type':'flow_to_disk', 'qpid.max_size': 100}
- self.simple_limit("test_simple_max_size_persistent_not_acquired", queue_args, self.session.delivery_mode.persistent, self.session.acquire_mode.not_acquired)
+ self.simple_limit("test_FlowToDisk_08_SimpleMaxSizePersistentNotAcquired", queue_args, self.session.delivery_mode.persistent, self.session.acquire_mode.not_acquired)
def simple_limit(self, queue_name, queue_args, delivery_mode, acquire_mode):
"""
@@ -104,21 +104,21 @@
self.assertEqual(0, session.queue_query(queue=queue_name).message_count)
- def test_09_max_count_browse_consume_transient(self):
+ def test_FlowToDisk_09_MaxCountBrowseConsumeTransient(self):
queue_args = {'qpid.policy_type':'flow_to_disk', 'qpid.max_count': 10}
- self.not_acquired_browse_consume_limit("test_max_count_browse_consume_transient", queue_args, self.session.delivery_mode.non_persistent)
+ self.not_acquired_browse_consume_limit("test_FlowToDisk_09_MaxCountBrowseConsumeTransient", queue_args, self.session.delivery_mode.non_persistent)
- def test_10_max_count_browse_consume_persistent(self):
+ def test_FlowToDisk_10_MaxCountBrowseConsumePersistent(self):
queue_args = {'qpid.policy_type':'flow_to_disk', 'qpid.max_count': 10}
- self.not_acquired_browse_consume_limit("test_max_count_browse_consume_persistent", queue_args, self.session.delivery_mode.persistent)
+ self.not_acquired_browse_consume_limit("test_FlowToDisk_10_MaxCountBrowseConsumePersistent", queue_args, self.session.delivery_mode.persistent)
- def test_11_max_size_browse_consume_transient(self):
+ def test_FlowToDisk_11_MaxSizeBrowseConsumeTransient(self):
queue_args = {'qpid.policy_type':'flow_to_disk', 'qpid.max_size': 100}
- self.not_acquired_browse_consume_limit("test_max_size_browse_consume_transient", queue_args, self.session.delivery_mode.non_persistent)
+ self.not_acquired_browse_consume_limit("test_FlowToDisk_11_MaxSizeBrowseConsumeTransient", queue_args, self.session.delivery_mode.non_persistent)
- def test_12_max_size_browse_consume_persistent(self):
+ def test_FlowToDisk_12_MaxSizeBrowseConsumePersistent(self):
queue_args = {'qpid.policy_type':'flow_to_disk', 'qpid.max_size': 100}
- self.not_acquired_browse_consume_limit("test_max_size_browse_consume_persistent", queue_args, self.session.delivery_mode.persistent)
+ self.not_acquired_browse_consume_limit("test_FlowToDisk_12_MaxSizeBrowseConsumePersistent", queue_args, self.session.delivery_mode.persistent)
def not_acquired_browse_consume_limit(self, queue_name, queue_args, delivery_mode):
Modified: store/trunk/cpp/tests/run_python_tests
===================================================================
--- store/trunk/cpp/tests/run_python_tests 2009-05-06 19:07:31 UTC (rev 3362)
+++ store/trunk/cpp/tests/run_python_tests 2009-05-06 19:22:51 UTC (rev 3363)
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (c) 2008 Red Hat, Inc.
+# Copyright (c) 2008, 2009 Red Hat, Inc.
#
# This file is part of the Qpid async store library msgstore.so.
#
@@ -21,46 +21,65 @@
#
# The GNU Lesser General Public License is available in the file COPYING.
-QPID_PYTHON_DIR=$QPID_DIR/python
+QPID_PYTHON_DIR=${QPID_DIR}/python
export PYTHONPATH=${QPID_PYTHON_DIR}:${abs_srcdir}
-BROKER_OPTS="--no-module-dir --load-module=${LIBBDBSTORE} --data-dir=${TMPDIR} --auth=no"
-PYTHON_TESTS=python_tests
-AMQP_SPEC=0-10-errata
-FAILING_PYTHON_TESTS=${abs_srcdir}/failing_python_tests.txt
-# Make sure ${QPID_DIR} contains what we need.
-if ! test -d "${QPID_DIR}" ; then
- echo "WARNING: QPID_DIR is not set - skipping python tests."
+if python -c "import qpid" ; then
+ PYTHON_TESTS=python_tests
+ FAILING_PYTHON_TESTS=${abs_srcdir}/failing_python_tests.txt
+else
+ echo "WARNING: Unable to load python qpid module - skipping python tests."
+ echo " QPID_DIR=${QPID_DIR}"
+ echo " PYTHONPATH=${PYTHONPATH}"
exit
fi
+BROKER_OPTS="--no-module-dir --load-module=${LIBSTORE} --data-dir=${TMPDIR} --auth=no"
+AMQP_SPEC=0-10-errata
+
#Make sure temp dir exists if this is the first to use it
if ! test -d ${TMPDIR} ; then
mkdir -p ${TMPDIR}
+ mkdir -p ${TMPDIR}/cluster
+elif ! test -d "${TMPDIR}/cluster" ; then
+ mkdir -p "${TMPDIR}/cluster"
fi
-#Split PYTHONPATH at ':' and check each path exists
-old_ifs=${IFS}
-IFS=':'
-missing=0
-for path in ${PYTHONPATH} ; do
- if ! test -d ${path} ; then
- echo "WARNING: ${path} not found."
- missing=1
- fi
-done
-IFS=${old_ifs}
+# Check AIS requirements
+id -nG | grep '\<ais\>' >/dev/null || NOGROUP="You are not a member of the ais group."
+ps -u root | grep 'aisexec\|corosync' >/dev/null || NOAISEXEC="The aisexec or corosync daemon is not running as root"
-fail=0
-if test ${missing} != 0 ; then
- echo "WARNING: Path(s) in ${PYTHONPATH} not found - skipping python tests."
- exit 1
+if test -n "$NOGROUP" -o -n "$NOAISEXEC"; then
+ cat <<EOF
+
+ ========= WARNING: CLUSTERING TESTS DISABLED ==============
+
+ Tests that depend on the openais library (used for clustering)
+ will not be run because:
+
+ $NOGROUP
+ $NOAISEXEC
+
+ ===========================================================
+
+EOF
else
- # Run all python tests
- pwdir=$(pwd)
- cd ${QPID_PYTHON_DIR}
- ./run-tests --skip-self-test -v -s ${AMQP_SPEC} -I ${FAILING_PYTHON_TESTS} -B "${BROKER_OPTS}" ${PYTHON_TESTS} || { echo "FAIL python tests for ${AMQP_SPEC}"; fail=1; }
- cd ${pwdir}
+ export RUN_CLUSTER_TESTS=1
+ if test -z ${LIBCLUSTER} ; then
+ export LIBCLUSTER=${QPID_DIR}/cpp/src/.libs/cluster.so
+ fi
+fi
- exit ${fail}
+if test -z ${QPIDD} ; then
+ export QPIDD=${QPID_DIR}/cpp/src/qpidd
fi
+
+fail=0
+
+# Run all python tests
+pwdir=$(pwd)
+cd ${QPID_PYTHON_DIR}
+./run-tests --skip-self-test -v -s ${AMQP_SPEC} -I ${FAILING_PYTHON_TESTS} -B "${BROKER_OPTS}" ${PYTHON_TESTS} || { echo "FAIL python tests for ${AMQP_SPEC}"; fail=1; }
+cd ${pwdir}
+
+exit ${fail}
Modified: store/trunk/cpp/tests/system_test.sh
===================================================================
--- store/trunk/cpp/tests/system_test.sh 2009-05-06 19:07:31 UTC (rev 3362)
+++ store/trunk/cpp/tests/system_test.sh 2009-05-06 19:22:51 UTC (rev 3363)
@@ -45,7 +45,7 @@
fail=0
# Run the tests with a given set of flags
-BROKER_OPTS="--no-module-dir --load-module=$LIBBDBSTORE --data-dir=$TMPDIR --auth=no --wcache-page-size 16"
+BROKER_OPTS="--no-module-dir --load-module=$LIBSTORE --data-dir=$TMPDIR --auth=no --wcache-page-size 16"
run_tests() {
for p in `seq 1 8`; do
$abs_srcdir/start_broker "$@" ${BROKER_OPTS} || { echo "FAIL broker start"; return 1; }
15 years, 8 months
rhmessaging commits: r3362 - mgmt/trunk/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-05-06 15:07:31 -0400 (Wed, 06 May 2009)
New Revision: 3362
Modified:
mgmt/trunk/cumin/python/cumin/grid/job.py
mgmt/trunk/cumin/python/cumin/grid/job.strings
mgmt/trunk/cumin/python/cumin/grid/limit.py
mgmt/trunk/cumin/python/cumin/grid/limit.strings
mgmt/trunk/cumin/python/cumin/grid/pool.py
Log:
Defer the rendering of JobAds and the Limit Count since they are lengthy method calls.
Modified: mgmt/trunk/cumin/python/cumin/grid/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/job.py 2009-05-06 19:06:45 UTC (rev 3361)
+++ mgmt/trunk/cumin/python/cumin/grid/job.py 2009-05-06 19:07:31 UTC (rev 3362)
@@ -709,19 +709,57 @@
property = item["property"]
return property.description
+class JobAdsGroups(Widget):
+ def __init__(self, app, name):
+ super(JobAdsGroups, self).__init__(app, name)
+
+ self.group_tmpl = Template(self, "group_html")
+
+ def render_groups(self, session):
+ job = self.frame.get_args(session)[0]
+ groups = self.app.model.get_ad_groups()
+ writer = Writer()
+ for group in groups:
+ self.group_tmpl.render(writer, session, (job, group,))
+ return writer.to_string()
+
+ def render_group_name(self, session, args):
+ return args[1]
+
+ def render_properties(self, session, *args):
+ items = self.parent.do_get_items(session, *args)
+ writer = Writer()
+
+ for item in items:
+ self.parent.item_renderer.render(writer, session, item)
+
+ return writer.to_string()
+
class JobAdsViewer(JobAdsSet):
def __init__(self, app, name):
super(JobAdsViewer, self).__init__(app, name)
- self.group_tmpl = Template(self, "group_html")
self.item_renderer = JobPropertyRenderer(self, "property_html")
+ self.groups = JobAdsGroups(app, "groups");
+ self.add_child(self.groups)
+
+ self.wait = Wait(app, "wait")
+ self.add_child(self.wait)
+
+ self.defer_enabled = True
+
def get_args(self, session):
return self.frame.get_args(session)
def render_title(self, session, job):
return "Attributes"
+ def render_edit_ads_url(self, session, job):
+ branch = session.branch()
+ self.frame.show_ads_edit(branch)
+ return branch.marshal()
+
def do_get_items(self, session, args):
job = args[0]
group = args[1]
@@ -739,30 +777,6 @@
return group_items
- def render_properties(self, session, *args):
- items = self.do_get_items(session, *args)
- writer = Writer()
-
- for item in items:
- self.item_renderer.render(writer, session, item)
-
- return writer.to_string()
-
- def render_edit_ads_url(self, session, job):
- branch = session.branch()
- self.frame.show_ads_edit(branch)
- return branch.marshal()
-
- def render_groups(self, session, job):
- groups = self.app.model.get_ad_groups()
- writer = Writer()
- for group in groups:
- self.group_tmpl.render(writer, session, (job, group,))
- return writer.to_string()
-
- def render_group_name(self, session, args):
- return args[1]
-
class JobAdsEditor(CuminForm, JobAdsViewer):
def __init__(self, app, name):
super(JobAdsEditor, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/grid/job.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/job.strings 2009-05-06 19:06:45 UTC (rev 3361)
+++ mgmt/trunk/cumin/python/cumin/grid/job.strings 2009-05-06 19:07:31 UTC (rev 3362)
@@ -229,6 +229,7 @@
[JobAdsViewer.html]
+<div id="{id}">
<ul class="actions">
<li><a class="nav" href="{edit_ads_url}">Edit Attributes</a></li>
</ul>
@@ -244,8 +245,19 @@
<ul class="actions">
<li><a class="nav" href="{edit_ads_url}">Edit Attributes</a></li>
</ul>
+</div>
-[JobAdsViewer.group_html]
+[JobAdsViewer.deferred_html]
+<div id="{id}">
+ {wait}
+</div>
+
+[JobAdsGroups.html]
+<div id="{id}" style="position:relative;">
+ {groups}
+</div>
+
+[JobAdsGroups.group_html]
<div class="sactions">
<h2>{group_name}</h2>
</div>
Modified: mgmt/trunk/cumin/python/cumin/grid/limit.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/limit.py 2009-05-06 19:06:45 UTC (rev 3361)
+++ mgmt/trunk/cumin/python/cumin/grid/limit.py 2009-05-06 19:07:31 UTC (rev 3362)
@@ -90,20 +90,23 @@
return [{"name":x, "curr":limits[x]["CURRENT"], "max":limits[x]["MAX"]} for x in keys]
def render_title(self, session):
- return self.limit_count.get_title(session, "Limits")
+ return self.limit_count.render(session)
- class LimitCount(AjaxField):
- def get_url(self, session):
+ class LimitCount(Widget):
+ def __init__(self, app, name):
+ super(LimitsSet.LimitCount, self).__init__(app, name)
+ self.defer_enabled = True
+
+ def render_count(self, session):
negotiator = self.parent.get_negotiator(session)
- return negotiator and \
- "call.xml?class=negotiator;id=%i;method=GetLimitCount" % negotiator.id
+ action = self.app.model.negotiator.GetLimits
+ limits = action.do_invoke(negotiator)
+ if "timeout" in limits:
+ val = 0
+ else:
+ val = len(limits)
+ return str(val)
- def get_title(self, session, title):
- script = self.render_script(session)
- count = script and "?" or "0"
- return "%s <span id=\"%s\"><span class='count'>(%s)</span>%s</span>" % \
- (title, self.name, count, script)
-
class NameColumn(ItemTableColumn):
def render_title(self, session, data):
return "Name"
Modified: mgmt/trunk/cumin/python/cumin/grid/limit.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/limit.strings 2009-05-06 19:06:45 UTC (rev 3361)
+++ mgmt/trunk/cumin/python/cumin/grid/limit.strings 2009-05-06 19:07:31 UTC (rev 3362)
@@ -12,15 +12,11 @@
</table>
-[LimitCount.javascript]
-function got_limit_count(obj, id) {
- var elem = document.getElementById(id);
+[LimitCount.html]
+<span id="{id}">Limits <span class="count">({count})</span></span>
- if (elem) {
- var str = "<span class='count'>(" + obj.count.value + ")</span>";
- elem.innerHTML = str;
- }
-}
+[LimitCount.deferred_html]
+<span id="{id}">Limits <span class="count">(?)</span></span>
[LimitEdit.css]
form.limitform {
Modified: mgmt/trunk/cumin/python/cumin/grid/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/pool.py 2009-05-06 19:06:45 UTC (rev 3361)
+++ mgmt/trunk/cumin/python/cumin/grid/pool.py 2009-05-06 19:07:31 UTC (rev 3362)
@@ -196,12 +196,9 @@
self.negs = PoolNegotiatorSet(app, "negs")
self.__tabs.add_tab(self.negs)
- limits = self.LimitsTab(app, "limits")
+ limits = LimitsSet(app, "limits")
self.__tabs.add_tab(limits)
- class LimitsTab(LimitsSet):
- pass
-
def set_collector_tab(self, session):
self.colls.show(session)
15 years, 8 months
rhmessaging commits: r3361 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-05-06 15:06:45 -0400 (Wed, 06 May 2009)
New Revision: 3361
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Removed GetLimitCount action on Negotiator since the limit count is now a deferred rendered widget
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2009-05-06 19:04:57 UTC (rev 3360)
+++ mgmt/trunk/cumin/python/cumin/model.py 2009-05-06 19:06:45 UTC (rev 3361)
@@ -2871,9 +2871,6 @@
action = self.GetLimits(self, "GetLimits")
action.navigable = False
- action = self.GetLimitCount(self, "GetLimitCount")
- action.navigable = False
-
action = GetStartedAction(self, "GetStarted")
action.navigable = False
@@ -2904,20 +2901,6 @@
def get_title(self, session):
return "Stop"
- class GetLimitCount(CuminAction):
- def get_xml_response(self, session, negotiator, *args):
- action = self.model.negotiator.GetLimits
- limits = action.do_invoke(negotiator)
- error = "False"
- if "timeout" in limits:
- val = 0
- error = "True"
- else:
- val = len(limits)
- err = "<error value=\"%s\" />" % error
- count = "<count value=\"%i\" />" % val
- return "%s%s" % (count, err)
-
class GetLimits(CuminAction):
def do_invoke(self, negotiator):
self.lim = dict()
15 years, 8 months