rhmessaging commits: r3987 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-05-25 12:44:22 -0400 (Tue, 25 May 2010)
New Revision: 3987
Modified:
mgmt/newdata/cumin/python/cumin/objecttask.py
mgmt/newdata/cumin/python/cumin/objecttask.strings
Log:
Display list of selected items in SelectionTaskForm
Modified: mgmt/newdata/cumin/python/cumin/objecttask.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objecttask.py 2010-05-25 16:41:40 UTC (rev 3986)
+++ mgmt/newdata/cumin/python/cumin/objecttask.py 2010-05-25 16:44:22 UTC (rev 3987)
@@ -1,3 +1,6 @@
+from qpid.connection import *
+from qpid.util import *
+
from rosemary.model import *
from wooly.forms import *
from wooly.resources import *
@@ -85,6 +88,26 @@
def do_invoke(self, invoc, obj, *args):
pass
+ def amqp_call(self, vhost, callback):
+ db_conn = self.app.database.get_connection()
+ cursor = db_conn.cursor()
+
+ cls = self.app.model.org_apache_qpid_broker.Broker
+ broker = cls.get_object_by_id(cursor, vhost._brokerRef_id)
+ port = broker.port
+
+ cls = self.app.model.org_apache_qpid_broker.System
+ system = cls.get_object_by_id(cursor, broker._systemRef_id)
+ host = system.nodeName
+
+ sock = connect(host, port)
+ conn = Connection(sock)
+ conn.start()
+ sess = conn.session()
+
+ callback(sess)
+ conn.close()
+
def qmf_call(self, invoc, obj, meth, *args):
def completion(status_code, output_args):
invoc.status_code = status_code
@@ -92,8 +115,8 @@
invoc.end()
- agent = self.app.model.agents[obj._qmf_agent_id]
- agent.call_method(completion, obj, meth, *args)
+ session = self.app.session
+ session.call_method(completion, obj, meth, args)
def exception(self, invoc, e):
now = datetime.now()
@@ -302,17 +325,20 @@
self.selection = SessionAttribute(self, "selection")
+ self.content = self.SelectionList(app, "fields")
+ self.replace_child(self.content)
+
def do_process(self, session):
selection = list()
-
+
self.selection.set(session, selection)
for id in self.ids.get(session):
- item = self.cls.get_object(session.cursor, id)
+ item = self.cls.get_object_by_id(session.cursor, id)
selection.append(item)
super(SelectionTaskForm, self).do_process(session)
-
+
def process_submit(self, session):
selection = self.selection.get(session)
@@ -322,6 +348,16 @@
def render_title(self, session):
return self.task.get_title(session)
+ class SelectionList(ItemSet):
+ def do_get_items(self, session):
+ return self.parent.selection.get(session)
+
+ def render_item_content(self, session, item):
+ return item.name
+
+ def render_item_class(self, session, item):
+ return "item"
+
class ObjectTaskLink(Link):
def __init__(self, app, name, task):
assert isinstance(task, ObjectTask), task
Modified: mgmt/newdata/cumin/python/cumin/objecttask.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/objecttask.strings 2010-05-25 16:41:40 UTC (rev 3986)
+++ mgmt/newdata/cumin/python/cumin/objecttask.strings 2010-05-25 16:44:22 UTC (rev 3987)
@@ -7,3 +7,8 @@
margin: 0.5em auto 1em auto;
width: 80%;
}
+
+[SelectionList.css]
+ul.SelectionList {
+ list-style: none;
+}
14 years, 7 months
rhmessaging commits: r3986 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-05-25 12:41:40 -0400 (Tue, 25 May 2010)
New Revision: 3986
Modified:
mgmt/newdata/cumin/python/cumin/model.py
Log:
Reuse the qmf broker's session for qmf calls
Modified: mgmt/newdata/cumin/python/cumin/model.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/model.py 2010-05-25 14:05:53 UTC (rev 3985)
+++ mgmt/newdata/cumin/python/cumin/model.py 2010-05-25 16:41:40 UTC (rev 3986)
@@ -62,12 +62,8 @@
return self.app.main_page.main.show(session)
def get_session_by_object(self, object):
- assert object
+ return self.app.session.qmf_brokers[0].getAmqpSession()
- agent = self.mint.model.agents[object._qmf_agent_id]
-
- return agent.qmf_agent.getBroker().getAmqpSession()
-
def get_negotiator_limits(self, negotiator):
assert negotiator
14 years, 7 months
rhmessaging commits: r3985 - mgmt/trunk/sesame/cpp/src.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2010-05-25 10:05:53 -0400 (Tue, 25 May 2010)
New Revision: 3985
Modified:
mgmt/trunk/sesame/cpp/src/SysAgent.cpp
Log:
Went back to the original ManagementAgent::init call (using ConnectionSettings).
Modified: mgmt/trunk/sesame/cpp/src/SysAgent.cpp
===================================================================
--- mgmt/trunk/sesame/cpp/src/SysAgent.cpp 2010-05-24 10:51:45 UTC (rev 3984)
+++ mgmt/trunk/sesame/cpp/src/SysAgent.cpp 2010-05-25 14:05:53 UTC (rev 3985)
@@ -1,4 +1,3 @@
-
#include <qpid/management/Manageable.h>
#include <qpid/management/ManagementObject.h>
#include <qpid/agent/ManagementAgent.h>
@@ -361,8 +360,7 @@
if (interval < 1)
interval = 10;
- /*
- qpid::client::ConnectionSettings settings;
+ qpid::management::ConnectionSettings settings;
settings.protocol = options["proto"].value;
settings.host = options["host"].value;
settings.port = ::atoi(options["port"].value.c_str());
@@ -372,21 +370,9 @@
settings.service = options["service"].value;
settings.minSsf = ::atoi(options["min-ssf"].value.c_str());
settings.maxSsf = ::atoi(options["max-ssf"].value.c_str());
- */
agent->setName("redhat.com", "sesame");
- agent->init(options["host"].value,
- ::atoi(options["port"].value.c_str()),
- interval,
- false,
- options["state-dir"].value + "/agentdata",
- options["uid"].value,
- options["pwd"].value,
- options["mech"].value,
- options["proto"].value);
- /*
agent->init(settings, interval, false, options["state-dir"].value + "/agentdata");
- */
::close(0);
::close(1);
14 years, 7 months
rhmessaging commits: r3984 - in store/trunk/java/bdbstore: test-profiles and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: rgemmell
Date: 2010-05-24 06:51:45 -0400 (Mon, 24 May 2010)
New Revision: 3984
Added:
store/trunk/java/bdbstore/test-profiles/
store/trunk/java/bdbstore/test-profiles/java-bdb.0.10.testprofile
store/trunk/java/bdbstore/test-profiles/java-bdb.testprofile
Log:
Add bdb profiles for use with the test framework
Added: store/trunk/java/bdbstore/test-profiles/java-bdb.0.10.testprofile
===================================================================
--- store/trunk/java/bdbstore/test-profiles/java-bdb.0.10.testprofile (rev 0)
+++ store/trunk/java/bdbstore/test-profiles/java-bdb.0.10.testprofile 2010-05-24 10:51:45 UTC (rev 3984)
@@ -0,0 +1,11 @@
+broker.version=0-10
+broker.language=java
+broker=${project.root}/build/bin/qpid-server -p @PORT -m @MPORT -c @CONFIG_FILE -l ${test.profiles}/log4j-test.xml
+broker.clean=${test.profiles}/clean-dir ${build.data} ${project.root}/build/work/*
+broker.ready=BRK-1004
+broker.stopped=Exception
+broker.config=${project.root}/build/etc/config-systests-bdb.xml
+profile.excludes=JavaStandaloneExcludes JavaPersistentExcludes CPPExcludes CPPTransientExcludes
+broker.clean.between.tests=true
+broker.persistent=true
+
Added: store/trunk/java/bdbstore/test-profiles/java-bdb.testprofile
===================================================================
--- store/trunk/java/bdbstore/test-profiles/java-bdb.testprofile (rev 0)
+++ store/trunk/java/bdbstore/test-profiles/java-bdb.testprofile 2010-05-24 10:51:45 UTC (rev 3984)
@@ -0,0 +1,14 @@
+broker.language=java
+broker=${project.root}/build/bin/qpid-server -p @PORT -m @MPORT --exclude-0-10 @PORT -c @CONFIG_FILE -l ${test.profiles}/log4j-test.xml
+broker.clean=${test.profiles}/clean-dir ${build.data} ${project.root}/build/work/*
+broker.ready=BRK-1004
+broker.stopped=Exception
+broker.config=${project.root}/build/etc/config-systests-bdb.xml
+profile.excludes=JavaStandaloneExcludes JavaPersistentExcludes 08StandaloneExcludes
+broker.clean.between.tests=true
+broker.persistent=true
+#
+# Do not enable. Allow client to attempt 0-10 and negotiate downwards
+#
+#qpid.amqp.version=0-91
+
14 years, 7 months
rhmessaging commits: r3983 - in mgmt/newdata/cumin: python/cumin and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-05-21 13:07:08 -0400 (Fri, 21 May 2010)
New Revision: 3983
Modified:
mgmt/newdata/cumin/model/Makefile
mgmt/newdata/cumin/model/condor.xml
mgmt/newdata/cumin/model/qpid.xml
mgmt/newdata/cumin/python/cumin/grid/collector.py
mgmt/newdata/cumin/python/cumin/grid/main.py
mgmt/newdata/cumin/python/cumin/grid/negotiator.py
mgmt/newdata/cumin/python/cumin/grid/pool.py
mgmt/newdata/cumin/python/cumin/grid/scheduler.py
mgmt/newdata/cumin/python/cumin/grid/slot.py
mgmt/newdata/cumin/python/cumin/grid/submission.py
mgmt/newdata/cumin/python/cumin/grid/submitter.py
mgmt/newdata/cumin/python/cumin/main.py
mgmt/newdata/cumin/python/cumin/model.py
mgmt/newdata/cumin/python/cumin/parameters.py
Log:
Changes to support going from mrg.grid to com.redhat.grid
Modified: mgmt/newdata/cumin/model/Makefile
===================================================================
--- mgmt/newdata/cumin/model/Makefile 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/model/Makefile 2010-05-21 17:07:08 UTC (rev 3983)
@@ -20,7 +20,7 @@
svn export http://svn.apache.org/repos/asf/qpid/trunk/qpid/cpp/src/qpid/cluster/mana... qpid-cluster.xml
condor.xml:
- wget "http://git.fedorahosted.org/git/grid.git?p=grid.git;a=blob_plain;f=src/ma..." -O condor.xml
+ wget "http://git.fedorahosted.org/git/?p=grid.git;a=blob_plain;f=src/management..." -O condor.xml
sesame.xml:
svn export http://anonsvn.jboss.org/repos/rhmessaging/mgmt/trunk/sesame/cpp/src/qmfg... sesame.xml
Modified: mgmt/newdata/cumin/model/condor.xml
===================================================================
--- mgmt/newdata/cumin/model/condor.xml 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/model/condor.xml 2010-05-21 17:07:08 UTC (rev 3983)
@@ -1,4 +1,4 @@
-<schema package="mrg.grid">
+<schema package="com.redhat.grid">
<!--
/*
@@ -18,7 +18,7 @@
*/
-->
-<group name="daemon-stats">
+<group name="DaemonProperties">
<property name="CondorPlatform"
type="sstr"
desc="The Condor platform string for the daemon's platform"/>
@@ -29,7 +29,9 @@
type="absTime" unit="nanosecond"
desc="Number of nanoseconds since epoch when the daemon
was started"/>
+</group>
+<group name="DaemonStatistics">
<statistic name="MonitorSelfAge" type="uint32"/>
<statistic name="MonitorSelfCPUUsage" type="double"/>
<statistic name="MonitorSelfImageSize" type="double"/>
@@ -38,6 +40,15 @@
<statistic name="MonitorSelfTime" type="absTime"/>
</group>
+<group name="GridMethods">
+ <!-- quick test method across agents/objects -->
+ <method name="echo">
+ <arg name="sequence" dir="IO" type="uint32"/>
+ <arg name="body" dir="IO" type="lstr"/>
+ </method>
+
+</group>
+
<!--
CpuBusy = ((LoadAvg - CondorLoadAvg) >= 0.500000)
CpuBusyTime = 0
@@ -73,7 +84,9 @@
<class name="Slot">
- <group name="daemon-stats"/>
+ <group name="DaemonProperties"/>
+ <group name="DaemonStatistics"/>
+ <group name="GridMethods"/>
<property name="Pool" type="sstr" index="y"/>
<property name="System" type="sstr" index="y"/>
@@ -210,14 +223,7 @@
desc="The number of nanoseconds since epoch when the
job last performed a periodic checkpoint, only
present when a job is executing"
- optional="y"/>
-<!--
- <statistic name="LastHeardFrom"
- type="absTime" unit="nanosecond"
- desc="Time when the Collector received an update from
- the slot, nanoseconds since epoch, inserted by
- Collector"/>
--->
+ optional="y"/>
<statistic name="LoadAvg"
type="double"
desc="Load average of CPUs hosting the slot"/>
@@ -245,11 +251,6 @@
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"
@@ -337,11 +338,6 @@
claimed and job likely running (see Activity);
Preempting, running job is being kicked off the
slot"/>
-<!--
- <statistic name="TargetType"
- type="sstr"
- desc="Always 'Job'"/>
--->
<property name="TimeToLive"
type="uint32" unit="second"
desc="Number of second until StartD managing the slot
@@ -486,126 +482,12 @@
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"/>
+ <group name="DaemonProperties"/>
+ <group name="DaemonStatistics"/>
+ <group name="GridMethods"/>
<property name="Pool" type="sstr" index="y"/>
<property name="System" type="sstr" index="y"/>
@@ -622,73 +504,43 @@
<statistic name="TotalRemovedJobs" type="uint32"/>
<statistic name="TotalRunningJobs" type="uint32"/>
- <method name="Submit">
+ <method name="SubmitJob">
<arg name="Ad" dir="I" type="map"/>
<arg name="Id" dir="O" type="sstr"/>
</method>
- <method name="GetAd">
+ <method name="SetJobAttribute">
<arg name="Id" dir="I" type="sstr"
desc="Job's Id, the string ClusterId.ProcId"/>
- <arg name="JobAd" dir="O" type="map"
- desc="(name,value,type) tuples; Values are INTEGER, FLOAT,
- STRING and EXPR. The EXPR value is not first class,
- it is an unquoted, with double quotes, string"/>
- </method>
-
- <method name="SetAttribute">
- <arg name="Id" dir="I" type="sstr"
- desc="Job's Id, the string ClusterId.ProcId"/>
<arg name="Name" dir="I" type="sstr"/>
<arg name="Value" dir="I" type="lstr"/>
</method>
- <method name="Hold">
+ <method name="HoldJob">
<arg name="Id" dir="I" type="sstr"
desc="Job's Id, the string ClusterId.ProcId"/>
<arg name="Reason" dir="I" type="sstr"/>
</method>
- <method name="Release">
+ <method name="ReleaseJob">
<arg name="Id" dir="I" type="sstr"
desc="Job's Id, the string ClusterId.ProcId"/>
<arg name="Reason" dir="I" type="sstr"/>
</method>
- <method name="Remove">
+ <method name="RemoveJob">
<arg name="Id" dir="I" type="sstr"
desc="Job's Id, the string ClusterId.ProcId"/>
<arg name="Reason" dir="I" type="sstr"/>
</method>
- <method name="Fetch">
- <arg name="Id" dir="I" type="sstr"
- desc="Job's Id, the string ClusterId.ProcId"/>
- <arg name="File" dir="I" type="sstr"/>
- <arg name="Start" dir="I" type="int32"/>
- <arg name="End" dir="I" type="int32"/>
- <arg name="Data" dir="O" type="lstr"/>
- </method>
-
- <method name="GetStates">
- <arg name="Submission" dir="I" type="sstr"/>
- <arg name="State" dir="I" type="uint32"/>
- <arg name="Count" dir="O" type="uint32"/>
- </method>
-
- <method name="GetJobs">
- <arg name="Submission" dir="I" type="sstr"/>
- <arg name="Jobs" dir="O" type="map"/>
- </method>
-
- <method name="echo">
- <arg name="sequence" dir="IO" type="uint32"/>
- <arg name="body" dir="IO" type="lstr"/>
- </method>
</class>
<class name="Submitter">
- <property name="schedulerRef" type="objId" parentRef="y" index="y" references="mrg.grid:Scheduler"/>
+
+ <group name="GridMethods"/>
+
+ <property name="schedulerRef" type="objId" parentRef="y" index="y" references="com.redhat.grid:Scheduler"/>
<statistic name="HeldJobs" type="uint32"/>
<statistic name="IdleJobs" type="uint32"/>
@@ -708,7 +560,9 @@
<property name="MyAddress" type="sstr" desc=""/>
<!-- NOTE: MonitorSelf* statistics are currently missing in 7.0.0 -->
- <group name="daemon-stats"/>
+ <group name="DaemonProperties"/>
+ <group name="DaemonStatistics"/>
+ <group name="GridMethods"/>
<method name="GetLimits">
<arg name="Limits" dir="O" type="map"/>
@@ -722,13 +576,6 @@
<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">
@@ -746,28 +593,6 @@
<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"/>
@@ -782,11 +607,12 @@
</class>
<class name="Collector">
+ <group name="DaemonProperties"/>
+ <group name="GridMethods"/>
+
<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="MyAddress" type="sstr"/>
@@ -800,7 +626,9 @@
<class name="Master">
- <group name="daemon-stats"/>
+ <group name="DaemonProperties"/>
+ <group name="DaemonStatistics"/>
+ <group name="GridMethods"/>
<property name="Pool" type="sstr" index="y"/>
<property name="System" type="sstr" index="y"/>
@@ -826,13 +654,14 @@
</class>
<class name="Grid">
- <property name="Pool" type="sstr" index="y"/>
+
+ <group name="GridMethods"/>
+ <property name="Pool" type="sstr" index="y"/>
<property name="Name" type="sstr"/>
<property name="ScheddName" type="sstr"/>
<property name="Owner" type="sstr"/>
- <statistic name="NumJobs" type="uint32"/>
<property name="JobLimit"
type="uint32"
desc="Maximum number of jobs that can be in the process
@@ -841,24 +670,64 @@
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."/>
+ amount of time."/>
+ <statistic name="NumJobs" type="uint32"/>
+ <statistic name="SubmitsInProgress" type="uint32"/>
+ <statistic name="SubmitsQueued" type="uint32"/>
+ <statistic name="SubmitsAllowed" type="uint32"/>
+ <statistic name="SubmitsWanted" type="uint32"/>
<statistic name="RunningJobs" type="uint32"/>
<statistic name="IdleJobs" type="uint32"/>
+
</class>
+
+ <!-- NOTE: at deployment, only one daemon between the schedd and the job server will publish this interface -->
+ <class name="JobServer">
+
+ <group name="DaemonProperties"/>
+ <group name="DaemonStatistics"/>
+ <group name="GridMethods"/>
+
+ <property name="Pool" type="sstr" index="y"/>
+ <property name="System" type="sstr" index="y"/>
+
+ <property name="Machine" type="sstr" desc=""/>
+ <property name="MyAddress" type="sstr" desc=""/>
+ <property name="Name" type="sstr" index="y" desc=""/>
+ <property name="PublicNetworkIpAddr" type="sstr" desc=""/>
+
+ <method name="GetJobAd">
+ <arg name="Id" dir="I" type="sstr"
+ desc="Job's Id, the string ClusterId.ProcId"/>
+ <arg name="JobAd" dir="O" type="map"
+ desc="(name,value,type) tuples; Values are INTEGER, FLOAT,
+ STRING and EXPR. The EXPR value is not first class,
+ it is an unquoted, with double quotes, string"/>
+ </method>
+ <method name="FetchJobData">
+ <arg name="Id" dir="I" type="sstr"
+ desc="Job's Id, the string ClusterId.ProcId"/>
+ <arg name="File" dir="I" type="sstr"/>
+ <arg name="Start" dir="I" type="int32"/>
+ <arg name="End" dir="I" type="int32"/>
+ <arg name="Data" dir="O" type="lstr"/>
+ </method>
+
+ </class>
+
+
<class name="Submission">
- <property name="schedulerRef" type="objId" parentRef="y" index="y" references="mrg.grid:Scheduler"/>
+
+ <group name="GridMethods"/>
+
+ <!-- navigate from a submission to a job server to get its pool -->
+ <property name="jobserverRef" type="objId" parentRef="y" index="y" references="com.redhat.grid:JobServer"/>
<property name="Name" type="sstr" index="y"/>
<property name="Owner" type="sstr" index="y"/>
@@ -868,6 +737,12 @@
<statistic name="Removed" type="count32"/>
<statistic name="Completed" type="count32"/>
<statistic name="Held" type="count32"/>
+
+ <!-- summary info -->
+ <method name="GetJobSummaries">
+ <arg name="Jobs" dir="O" type="map"/>
+ </method>
+
</class>
</schema>
Modified: mgmt/newdata/cumin/model/qpid.xml
===================================================================
--- mgmt/newdata/cumin/model/qpid.xml 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/model/qpid.xml 2010-05-21 17:07:08 UTC (rev 3983)
@@ -61,8 +61,9 @@
===============================================================
-->
<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="name" type="sstr" access="RC" index="y" desc="Index for the broker at this agent"/>
+ <property name="systemRef" type="objId" references="System" access="RO" desc="System ID" parentRef="y"/>
+ <property name="port" type="uint16" access="RO" 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"/>
Modified: mgmt/newdata/cumin/python/cumin/grid/collector.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/collector.py 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/python/cumin/grid/collector.py 2010-05-21 17:07:08 UTC (rev 3983)
@@ -21,7 +21,7 @@
class CollectorFrame(ObjectFrame):
def __init__(self, app, name):
- cls = app.model.mrg_grid.Collector
+ cls = app.model.com_redhat_grid.Collector
super(CollectorFrame, self).__init__(app, name, cls)
Modified: mgmt/newdata/cumin/python/cumin/grid/main.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/main.py 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/python/cumin/grid/main.py 2010-05-21 17:07:08 UTC (rev 3983)
@@ -16,14 +16,14 @@
def __init__(self, app, name):
super(Module, self).__init__(app, name)
- # cls = app.model.mrg_grid.Job
+ # cls = app.model.com_redhat_grid.Job
# JobHold(self, cls)
# JobRelease(self, cls)
# JobRemove(self, cls)
# JobSetAttribute(self, cls)
- # cls = app.model.mrg_grid.Negotiator
+ # cls = app.model.com_redhat_grid.Negotiator
# NegotiatorEditDynamicQuota(self, cls)
# NegotiatorEditStaticQuota(self, cls)
Modified: mgmt/newdata/cumin/python/cumin/grid/negotiator.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/negotiator.py 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/python/cumin/grid/negotiator.py 2010-05-21 17:07:08 UTC (rev 3983)
@@ -20,7 +20,7 @@
class NegotiatorFrame(ObjectFrame):
def __init__(self, app, name):
- cls = app.model.mrg_grid.Negotiator
+ cls = app.model.com_redhat_grid.Negotiator
super(NegotiatorFrame, self).__init__(app, name, cls)
@@ -41,7 +41,7 @@
class NegotiatorSelector(ObjectSelector):
def __init__(self, app, name, pool):
- cls = app.model.mrg_grid.Negotiator
+ cls = app.model.com_redhat_grid.Negotiator
super(NegotiatorSelector, self).__init__(app, name, cls)
@@ -279,8 +279,9 @@
groups = self.groups.get(session)
if len(groups) == 0:
negotiator = self.negotiator.get(session)
- action = FetchRawConfig(self.app)
- results = action.execute(negotiator, "GROUP_NAMES", timeout=10)
+
+ action = NewQmfCall(self.app, {'Value': None})
+ results = action.qmf_call(negotiator, "GetRawConfig", ("GROUP_NAMES",))
groups = results.data
try:
groups = self.split_group_names(groups['Value'])
@@ -426,14 +427,14 @@
ret = True
return ret
-class GroupForm(CuminTaskForm):
+class GroupForm(ObjectTaskForm):
def __init__(self, app, name, task):
super(GroupForm, self).__init__(app, name, task)
self.defer_enabled = True
- self.object = NegotiatorParameter(app, "negotiator")
- self.add_parameter(self.object)
+ #self.object = NegotiatorParameter(app, "negotiator")
+ #self.add_parameter(self.object)
self.group_helper = GroupHelper(app, "groups", self.object)
self.add_child(self.group_helper)
@@ -873,9 +874,10 @@
self.form = NegotiatorLimitSetForm(module.app, self.name, self)
- def do_enter(self, session, limit):
- self.form.negotiator.set(session, limit[0])
- self.form.limit_name.set(session, limit[1])
+ def do_enter(self, session):
+ pass
+ #self.form.negotiator.set(session, limit[0])
+ #self.form.limit_name.set(session, limit[1])
def get_title(self, session):
return "Set limit"
@@ -949,13 +951,13 @@
return "Edit static quota"
class NegotiatorUserTask(NegotiatorGroupTask):
- def do_enter(self, session, ng):
- try:
- negotiator, group = ng
- except:
- raise Exception("Must supply group for user forms")
- super(NegotiatorUserTask, self).do_enter(session, negotiator)
- self.form.group.set(session, group)
+ def do_enter(self, session):
+ #try:
+ # negotiator, group = ng
+ #except:
+ # raise Exception("Must supply group for user forms")
+ super(NegotiatorUserTask, self).do_enter(session)
+ #self.form.group.set(session, group)
class NegotiatorUserPrioFactor(NegotiatorUserTask):
def __init__(self, app, frame):
@@ -964,7 +966,7 @@
self.form = UserPrioFactorForm(app, self.name, self)
def get_title(self, session):
- return "Edit priority factor"
+ return "Edit user priority factor"
class NegotiatorUserRegroup(NegotiatorUserTask):
def __init__(self, app, frame):
@@ -973,4 +975,4 @@
self.form = UserRegroupForm(app, self.name, self)
def get_title(self, session):
- return "Edit autoregroup"
+ return "Edit user autoregroup"
Modified: mgmt/newdata/cumin/python/cumin/grid/pool.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/pool.py 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/python/cumin/grid/pool.py 2010-05-21 17:07:08 UTC (rev 3983)
@@ -34,7 +34,7 @@
class PoolSelector(ObjectSelector):
def __init__(self, app, name):
- cls = app.model.mrg_grid.Collector
+ cls = app.model.com_redhat_grid.Collector
super(PoolSelector, self).__init__(app, name, cls)
@@ -48,7 +48,7 @@
class PoolFrame(ObjectFrame):
def __init__(self, app, name):
- cls = app.model.mrg_grid.Collector
+ cls = app.model.com_redhat_grid.Collector
super(PoolFrame, self).__init__(app, name, cls)
@@ -229,7 +229,7 @@
class PoolSlotMapPage(SlotMapPage):
def __init__(self, app, name):
- cls = app.model.mrg_grid.Collector
+ cls = app.model.com_redhat_grid.Collector
self.collector = RosemaryObjectParameter(app, "id", cls)
super(PoolSlotMapPage, self).__init__(app, name, self.collector, "Pool")
@@ -330,7 +330,7 @@
def __init__(self, app, name):
super(PoolSlotFullPage, self).__init__(app, name)
- cls = app.model.mrg_grid.Collector
+ cls = app.model.com_redhat_grid.Collector
self.collector = RosemaryObjectParameter(app, "id", cls)
self.add_parameter(self.collector)
Modified: mgmt/newdata/cumin/python/cumin/grid/scheduler.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/scheduler.py 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/python/cumin/grid/scheduler.py 2010-05-21 17:07:08 UTC (rev 3983)
@@ -25,7 +25,7 @@
class SchedulerFrame(ObjectFrame):
def __init__(self, app, name, pool):
- cls = app.model.mrg_grid.Scheduler
+ cls = app.model.com_redhat_grid.Scheduler
super(SchedulerFrame, self).__init__(app, name, cls)
@@ -39,7 +39,7 @@
self.view.add_tab(submissions)
cls = submissions.cls
- submissions.add_reference_filter(self.object, cls.schedulerRef)
+ submissions.add_reference_filter(self.object, cls.jobserverRef)
submitters = SubmitterSelector(app, "submitters", self.object)
self.view.add_tab(submitters)
@@ -49,7 +49,7 @@
class SchedulerSelector(ObjectSelector):
def __init__(self, app, name, pool):
- cls = app.model.mrg_grid.Scheduler
+ cls = app.model.com_redhat_grid.Scheduler
super(SchedulerSelector, self).__init__(app, name, cls)
@@ -97,7 +97,7 @@
def do_get_items(self, session):
collector = self.form.object.get(session)
- cls = self.app.model.mrg_grid.Scheduler
+ cls = self.app.model.com_redhat_grid.Scheduler
if collector:
schedulers = cls.get_selection(session.cursor, Pool=collector.Pool)
else:
Modified: mgmt/newdata/cumin/python/cumin/grid/slot.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/slot.py 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/python/cumin/grid/slot.py 2010-05-21 17:07:08 UTC (rev 3983)
@@ -17,7 +17,7 @@
class SlotSelector(ObjectSelector):
def __init__(self, app, name, pool):
- cls = app.model.mrg_grid.Slot
+ cls = app.model.com_redhat_grid.Slot
super(SlotSelector, self).__init__(app, name, cls)
@@ -35,7 +35,7 @@
class SlotFrame(ObjectFrame):
def __init__(self, app, name):
- cls = app.model.mrg_grid.Slot
+ cls = app.model.com_redhat_grid.Slot
super(SlotFrame, self).__init__(app, name, cls)
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-05-21 17:07:08 UTC (rev 3983)
@@ -13,13 +13,13 @@
class SubmissionFrame(ObjectFrame):
def __init__(self, app, name):
- cls = app.model.mrg_grid.Submission
+ cls = app.model.com_redhat_grid.Submission
super(SubmissionFrame, self).__init__(app, name, cls)
class SubmissionSelector(ObjectSelector):
def __init__(self, app, name):
- cls = app.model.mrg_grid.Submission
+ cls = app.model.com_redhat_grid.Submission
super(SubmissionSelector, self).__init__(app, name, cls)
Modified: mgmt/newdata/cumin/python/cumin/grid/submitter.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submitter.py 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/python/cumin/grid/submitter.py 2010-05-21 17:07:08 UTC (rev 3983)
@@ -21,7 +21,7 @@
class SubmitterFrame(ObjectFrame):
def __init__(self, app, name):
- cls = app.model.mrg_grid.Submitter
+ cls = app.model.com_redhat_grid.Submitter
super(SubmitterFrame, self).__init__(app, name, cls)
@@ -32,7 +32,7 @@
class SubmitterSelector(ObjectSelector):
def __init__(self, app, name, scheduler):
- cls = app.model.mrg_grid.Submitter
+ cls = app.model.com_redhat_grid.Submitter
super(SubmitterSelector, self).__init__(app, name, cls)
Modified: mgmt/newdata/cumin/python/cumin/main.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/main.py 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/python/cumin/main.py 2010-05-21 17:07:08 UTC (rev 3983)
@@ -335,7 +335,7 @@
class TopSubmissionTable(TopObjectTable):
def __init__(self, app, name):
- cls = app.model.mrg_grid.Submission
+ cls = app.model.com_redhat_grid.Submission
super(TopSubmissionTable, self).__init__(app, name, cls)
Modified: mgmt/newdata/cumin/python/cumin/model.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/model.py 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/python/cumin/model.py 2010-05-21 17:07:08 UTC (rev 3983)
@@ -1614,6 +1614,36 @@
def done(self):
return self.got_data or self.error
+class NewQmfCall(object):
+ def __init__(self, app, default=None):
+ self.app = app
+ self.data = default
+ self.got_data = False
+ self.error = False
+ self.status = None
+ self.timeout = 5
+
+ def qmf_call(self, obj, meth, *args):
+ def completion(status_code, output_args):
+ self.status = status_code
+ if (status == 0) or (status == "OK"):
+ self.data = output_args
+ self.got_data = True
+ else:
+ self.data = self.default
+ self.error = True
+
+ session = self.app.session
+ session.call_method(completion, obj, meth, *args)
+ return self.do_wait(self.timeout)
+
+ def do_wait(self, timeout=5):
+ wait(self.done, timeout=timeout)
+ return self
+
+ def done(self):
+ return self.got_data or self.error
+
class QmfCallSet(object):
def __init__(self, app):
self.app = app
Modified: mgmt/newdata/cumin/python/cumin/parameters.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/parameters.py 2010-05-21 16:46:34 UTC (rev 3982)
+++ mgmt/newdata/cumin/python/cumin/parameters.py 2010-05-21 17:07:08 UTC (rev 3983)
@@ -169,13 +169,13 @@
class CollectorGridAttribute(ObjectAssociateAttribute):
def get_associate(self, session, collector):
- cls = self.app.model.mrg_grid.Grid
+ cls = self.app.model.com_redhat_grid.Grid
grid = cls.get_object(session.cursor, Pool=collector.Pool)
return grid
class CollectorNegotiatorAttribute(ObjectAssociateAttribute):
def get_associate(self, session, collector):
- cls = self.app.model.mrg_grid.Negotiator
+ cls = self.app.model.com_redhat_grid.Negotiator
negotiator = cls.get_object(session.cursor, Pool=collector.Pool)
return negotiator
14 years, 7 months
rhmessaging commits: r3982 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-05-21 12:46:34 -0400 (Fri, 21 May 2010)
New Revision: 3982
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.h
Log:
Removed redundant locks; the previous checkin installed the correct lock in JournalImpl::JournalImpl.
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-05-21 15:02:52 UTC (rev 3981)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-05-21 16:46:34 UTC (rev 3982)
@@ -410,12 +410,9 @@
{
// Don't take lock unless necessary
if (!tplStorePtr->is_ready()) {
- qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
- if (!tplStorePtr->is_ready()) {
- journal::jdir::create_dir(getTplBaseDir());
- tplStorePtr->initialize(tplNumJrnlFiles, false, 0, tplJrnlFsizeSblks, tplWCacheNumPages, tplWCachePgSizeSblks);
- if (mgmtObject != 0) mgmtObject->set_tplIsInitialized(true);
- }
+ journal::jdir::create_dir(getTplBaseDir());
+ tplStorePtr->initialize(tplNumJrnlFiles, false, 0, tplJrnlFsizeSblks, tplWCacheNumPages, tplWCachePgSizeSblks);
+ if (mgmtObject != 0) mgmtObject->set_tplIsInitialized(true);
}
}
@@ -481,14 +478,9 @@
return;
}
+ jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue), std::string("JournalData"),
+ defJournalGetEventsTimeout, defJournalFlushTimeout, agent);
{
- // TODO: Is this mutex necessary?
- qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
- jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue),
- std::string("JournalData"), defJournalGetEventsTimeout,
- defJournalFlushTimeout, agent);
- }
- {
qpid::sys::Mutex::ScopedLock sl(journalListLock);
journalList[queue.getName()]=jQueue;
}
@@ -769,11 +761,9 @@
QPID_LOG(error, "Cannot recover empty (null) queue name - ignoring and attempting to continue.");
break;
}
+ jQueue = new JournalImpl(queueName, getJrnlHashDir(queueName), std::string("JournalData"),
+ defJournalGetEventsTimeout, defJournalFlushTimeout, agent);
{
- qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
- jQueue = new JournalImpl(queueName, getJrnlHashDir(queueName), std::string("JournalData"), defJournalGetEventsTimeout, defJournalFlushTimeout, agent);
- }
- {
qpid::sys::Mutex::ScopedLock sl(journalListLock);
journalList[queueName] = jQueue;
}
Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h 2010-05-21 15:02:52 UTC (rev 3981)
+++ store/trunk/cpp/lib/MessageStoreImpl.h 2010-05-21 16:46:34 UTC (rev 3982)
@@ -93,7 +93,6 @@
typedef std::map<std::string, TplRecover> TplRecoverMap;
typedef TplRecoverMap::const_iterator TplRecoverMapCitr;
- typedef std::pair<std::string, JournalImpl*> JournalListPair;
typedef std::map<std::string, JournalImpl*> JournalListMap;
typedef JournalListMap::iterator JournalListMapItr;
@@ -149,7 +148,6 @@
const char* envPath;
qmf::com::redhat::rhm::store::Store* mgmtObject;
- qpid::sys::Mutex jrnlCreateLock;
qpid::management::ManagementAgent* agent;
// Parameter validation and calculation
14 years, 7 months
rhmessaging commits: r3981 - store/trunk/java/bdbstore/src/tools/java/org/apache/qpid/server/util.
by rhmessaging-commits@lists.jboss.org
Author: ritchiem
Date: 2010-05-21 11:02:52 -0400 (Fri, 21 May 2010)
New Revision: 3981
Modified:
store/trunk/java/bdbstore/src/tools/java/org/apache/qpid/server/util/NullApplicationRegistry.java
Log:
Update NAR to fit new interface. NAR should be removed and the dependency change to the qpid broker version
Modified: store/trunk/java/bdbstore/src/tools/java/org/apache/qpid/server/util/NullApplicationRegistry.java
===================================================================
--- store/trunk/java/bdbstore/src/tools/java/org/apache/qpid/server/util/NullApplicationRegistry.java 2010-05-21 12:49:22 UTC (rev 3980)
+++ store/trunk/java/bdbstore/src/tools/java/org/apache/qpid/server/util/NullApplicationRegistry.java 2010-05-21 15:02:52 UTC (rev 3981)
@@ -90,7 +90,7 @@
}
@Override
- public void close() throws Exception
+ public void close()
{
CurrentActor.set(new BrokerActor(_rootMessageLogger));
14 years, 7 months
rhmessaging commits: r3980 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-05-21 08:49:22 -0400 (Fri, 21 May 2010)
New Revision: 3980
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.h
Log:
Added a lock to protect MessageList in MessageStoreImpl and the static variables in JournalImpl; Switched all locks at this level to qpid::sys::Mutex and qpid::sys::ScopedLock for consistency.
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2010-05-20 15:22:29 UTC (rev 3979)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2010-05-21 12:49:22 UTC (rev 3980)
@@ -40,12 +40,13 @@
using qpid::management::ManagementAgent;
namespace _qmf = qmf::com::redhat::rhm::store;
+qpid::sys::Mutex JournalImpl::_static_lock;
qpid::sys::Timer* JournalImpl::journalTimerPtr = 0;
u_int32_t JournalImpl::cnt = 0;
-void InactivityFireEvent::fire() { slock s(_ife_mutex); if (_parent) _parent->flushFire(); }
+void InactivityFireEvent::fire() { qpid::sys::Mutex::ScopedLock sl(_ife_lock); if (_parent) _parent->flushFire(); }
-void GetEventsFireEvent::fire() { slock s(_gefe_mutex); if (_parent) _parent->getEventsFire(); }
+void GetEventsFireEvent::fire() { qpid::sys::Mutex::ScopedLock sl(_gefe_lock); if (_parent) _parent->getEventsFire(); }
JournalImpl::JournalImpl(const std::string& journalId,
const std::string& journalDirectory,
@@ -68,12 +69,15 @@
{
getEventsFireEventsPtr = new GetEventsFireEvent(this, getEventsTimeout);
inactivityFireEventPtr = new InactivityFireEvent(this, flushTimeout);
- if (journalTimerPtr == 0)
- journalTimerPtr = new qpid::sys::Timer;
- assert (journalTimerPtr != 0);
- cnt++;
- journalTimerPtr->start();
- journalTimerPtr->add(inactivityFireEventPtr);
+ {
+ qpid::sys::Mutex::ScopedLock sl(_static_lock);
+ if (journalTimerPtr == 0)
+ journalTimerPtr = new qpid::sys::Timer;
+ assert (journalTimerPtr != 0);
+ cnt++;
+ journalTimerPtr->start();
+ journalTimerPtr->add(inactivityFireEventPtr);
+ }
if (_agent != 0)
{
@@ -112,11 +116,13 @@
inactivityFireEventPtr->cancel();
free_read_buffers();
- // TODO: Make this if() thread-safe
- if (journalTimerPtr && --cnt == 0)
{
- delete journalTimerPtr;
- journalTimerPtr = 0;
+ qpid::sys::Mutex::ScopedLock sl(_static_lock);
+ if (journalTimerPtr && --cnt == 0)
+ {
+ delete journalTimerPtr;
+ journalTimerPtr = 0;
+ }
}
if (_mgmtObject != 0) {
@@ -503,7 +509,7 @@
{
const iores res = jcntl::flush(block_till_aio_cmpl);
{
- slock s(_getf_mutex);
+ qpid::sys::Mutex::ScopedLock sl(_getf_lock);
if (_wmgr.get_aio_evt_rem() && !getEventsTimerSetFlag) { setGetEventTimer(); }
}
return res;
@@ -533,7 +539,7 @@
void
JournalImpl::getEventsFire()
{
- slock s(_getf_mutex);
+ qpid::sys::Mutex::ScopedLock sl(_getf_lock);
getEventsTimerSetFlag = false;
if (_wmgr.get_aio_evt_rem()) { jcntl::get_wr_events(); }
if (_wmgr.get_aio_evt_rem()) { setGetEventTimer(); }
@@ -552,8 +558,11 @@
}
}
inactivityFireEventPtr->setupNextFire();
- assert(journalTimerPtr != 0);
- journalTimerPtr->add(inactivityFireEventPtr);
+ {
+ qpid::sys::Mutex::ScopedLock sl(_static_lock);
+ assert(journalTimerPtr != 0);
+ journalTimerPtr->add(inactivityFireEventPtr);
+ }
}
void
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2010-05-20 15:22:29 UTC (rev 3979)
+++ store/trunk/cpp/lib/JournalImpl.h 2010-05-21 12:49:22 UTC (rev 3980)
@@ -27,8 +27,6 @@
#include <set>
#include "jrnl/enums.hpp"
#include "jrnl/jcntl.hpp"
-#include "jrnl/slock.hpp"
-#include "jrnl/smutex.hpp"
#include "DataTokenImpl.h"
#include "PreparedTransaction.h"
#include <qpid/broker/PersistableQueue.h>
@@ -47,38 +45,39 @@
class InactivityFireEvent : public qpid::sys::TimerTask
{
JournalImpl* _parent;
- mrg::journal::smutex _ife_mutex;
+ qpid::sys::Mutex _ife_lock;
public:
InactivityFireEvent(JournalImpl* p, const qpid::sys::Duration timeout):
qpid::sys::TimerTask(timeout), _parent(p) {}
virtual ~InactivityFireEvent() {}
void fire();
- inline void cancel() { mrg::journal::slock s(_ife_mutex); _parent = 0; }
+ inline void cancel() { qpid::sys::Mutex::ScopedLock sl(_ife_lock); _parent = 0; }
};
class GetEventsFireEvent : public qpid::sys::TimerTask
{
JournalImpl* _parent;
- mrg::journal::smutex _gefe_mutex;
+ qpid::sys::Mutex _gefe_lock;
public:
GetEventsFireEvent(JournalImpl* p, const qpid::sys::Duration timeout):
qpid::sys::TimerTask(timeout), _parent(p) {}
virtual ~GetEventsFireEvent() {}
void fire();
- inline void cancel() { mrg::journal::slock s(_gefe_mutex); _parent = 0; }
+ inline void cancel() { qpid::sys::Mutex::ScopedLock sl(_gefe_lock); _parent = 0; }
};
class JournalImpl : public qpid::broker::ExternalQueueStore, public mrg::journal::jcntl, public mrg::journal::aio_callback
{
private:
+ static qpid::sys::Mutex _static_lock;
static qpid::sys::Timer* journalTimerPtr;
static u_int32_t cnt;
bool getEventsTimerSetFlag;
boost::intrusive_ptr<qpid::sys::TimerTask> getEventsFireEventsPtr;
- mrg::journal::smutex _getf_mutex;
+ qpid::sys::Mutex _getf_lock;
u_int64_t lastReadRid; // rid of last read msg for loadMsgContent() - detects out-of-order read requests
std::vector<u_int64_t> oooRidList; // list of out-of-order rids (greater than current rid) encountered during read sequence
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-05-20 15:22:29 UTC (rev 3979)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-05-21 12:49:22 UTC (rev 3980)
@@ -362,10 +362,13 @@
void MessageStoreImpl::finalize()
{
if (tplStorePtr->is_ready()) tplStorePtr->stop(true);
- for (JournalListMapItr i = journalList.begin(); i != journalList.end(); i++)
{
- JournalImpl* jQueue = i->second;
- if (jQueue->is_ready()) jQueue->stop(true);
+ qpid::sys::Mutex::ScopedLock sl(journalListLock);
+ for (JournalListMapItr i = journalList.begin(); i != journalList.end(); i++)
+ {
+ JournalImpl* jQueue = i->second;
+ if (jQueue->is_ready()) jQueue->stop(true);
+ }
}
if (mgmtObject != 0) {
@@ -377,10 +380,13 @@
void MessageStoreImpl::truncateInit(const bool pushDownStoreFiles)
{
if (isInit) {
- if (journalList.size()) { // check no queues exist
- std::ostringstream oss;
- oss << "truncateInit() called with " << journalList.size() << " queues still in existence";
- THROW_STORE_EXCEPTION(oss.str());
+ {
+ qpid::sys::Mutex::ScopedLock sl(journalListLock);
+ if (journalList.size()) { // check no queues exist
+ std::ostringstream oss;
+ oss << "truncateInit() called with " << journalList.size() << " queues still in existence";
+ THROW_STORE_EXCEPTION(oss.str());
+ }
}
for (std::list<db_ptr >::iterator i = dbs.begin(); i != dbs.end(); i++) {
(*i)->close(0);
@@ -402,6 +408,7 @@
void MessageStoreImpl::chkTplStoreInit()
{
+ // Don't take lock unless necessary
if (!tplStorePtr->is_ready()) {
qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
if (!tplStorePtr->is_ready()) {
@@ -480,6 +487,9 @@
jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue),
std::string("JournalData"), defJournalGetEventsTimeout,
defJournalFlushTimeout, agent);
+ }
+ {
+ qpid::sys::Mutex::ScopedLock sl(journalListLock);
journalList[queue.getName()]=jQueue;
}
@@ -517,7 +527,10 @@
JournalImpl* jQueue = static_cast<JournalImpl*>(eqs);
jQueue->delete_jrnl_files();
queue.setExternalQueueStore(0); // will delete the journal if exists
- journalList.erase(journalList.find(queue.getName()));
+ {
+ qpid::sys::Mutex::ScopedLock sl(journalListLock);
+ journalList.erase(journalList.find(queue.getName()));
+ }
}
}
@@ -759,6 +772,9 @@
{
qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
jQueue = new JournalImpl(queueName, getJrnlHashDir(queueName), std::string("JournalData"), defJournalGetEventsTimeout, defJournalFlushTimeout, agent);
+ }
+ {
+ qpid::sys::Mutex::ScopedLock sl(journalListLock);
journalList[queueName] = jQueue;
}
queue->setExternalQueueStore(dynamic_cast<ExternalQueueStore*>(jQueue));
Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h 2010-05-20 15:22:29 UTC (rev 3979)
+++ store/trunk/cpp/lib/MessageStoreImpl.h 2010-05-21 12:49:22 UTC (rev 3980)
@@ -126,6 +126,7 @@
boost::shared_ptr<TplJournalImpl> tplStorePtr;
TplRecoverMap tplRecoverMap;
JournalListMap journalList;
+ qpid::sys::Mutex journalListLock;
IdSequence queueIdSequence;
IdSequence exchangeIdSequence;
14 years, 7 months
rhmessaging commits: r3979 - in mgmt/newdata: cumin/python/cumin and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-05-20 11:22:29 -0400 (Thu, 20 May 2010)
New Revision: 3979
Modified:
mgmt/newdata/cumin/model/rosemary.xml
mgmt/newdata/cumin/python/cumin/model.py
mgmt/newdata/mint/python/mint/model.py
Log:
Move some metadata to rosemary.xml; remove the unused call_method on MintModel
Modified: mgmt/newdata/cumin/model/rosemary.xml
===================================================================
--- mgmt/newdata/cumin/model/rosemary.xml 2010-05-19 21:31:07 UTC (rev 3978)
+++ mgmt/newdata/cumin/model/rosemary.xml 2010-05-20 15:22:29 UTC (rev 3979)
@@ -26,6 +26,40 @@
<property name="port">
<title>Port</title>
</property>
+
+ <property name="workerThreads">
+ <title>Worker Threads</title>
+ </property>
+
+ <property name="maxConns">
+ <title>Max Connections</title>
+ </property>
+
+ <property name="connBacklog">
+ <title>Connection Backlog</title>
+ </property>
+
+ <property name="stagingThreshold">
+ <title>Staging Threshold</title>
+ </property>
+
+ <property name="mgmtPubInterval">
+ <title>QMF Publish Interval</title>
+ </property>
+
+ <!--
+ <property name="clusterName">
+ <title>Cluster Name</title>
+ </property>
+ -->
+
+ <property name="version">
+ <title>Version</title>
+ </property>
+
+ <property name="dataDir">
+ <title>Data Directory</title>
+ </property>
</class>
<class name="Connection">
@@ -83,11 +117,11 @@
</statistic>
<statistic name="msgPersistEnqueues">
- <title>Msgs. Enqueued</title>
+ <title>Messages Enqueued</title>
</statistic>
<statistic name="msgPersistDequeues">
- <title>Msgs. Dequeued</title>
+ <title>Messages Dequeued</title>
</statistic>
<statistic name="bytePersistEnqueues">
@@ -99,11 +133,11 @@
</statistic>
<statistic name="msgTotalEnqueues">
- <title>Msgs. Enqueued</title>
+ <title>Messages Enqueued</title>
</statistic>
<statistic name="msgTotalDequeues">
- <title>Msgs. Dequeued</title>
+ <title>Messages Dequeued</title>
</statistic>
<statistic name="byteTotalEnqueues">
@@ -115,19 +149,13 @@
</statistic>
<statistic name="unackedMessages">
- <title>Msgs. Unacked</title>
+ <title>Messages Unacked</title>
</statistic>
<statistic name="messageLatency">
- <title>Msg. Latency</title>
+ <title>Message Latency</title>
</statistic>
</class>
-
- <class name="System">
- <property name="nodeName">
- <title>Host</title>
- </property>
- </class>
</package>
<package name="org.apache.qpid.cluster">
@@ -154,12 +182,107 @@
<package name="com.redhat.sesame">
<class name="Sysimage">
+ <property name="uuid">
+ <title>System ID</title>
+ </property>
+
<property name="nodeName">
<title>Host</title>
</property>
+
+ <property name="osName">
+ <title>Kernel</title>
+ </property>
+
+ <property name="release">
+ <title>Kernel Release</title>
+ </property>
+
+ <property name="version">
+ <title>Kernel Version</title>
+ </property>
+
+ <property name="machine">
+ <title>Architecture</title>
+ </property>
+
+ <property name="distro">
+ <title>Distribution</title>
+ </property>
+
+ <statistic name="memFree">
+ <title>Free Memory</title>
+ </statistic>
+
+ <statistic name="swapFree">
+ <title>Free Swap</title>
+ </statistic>
+
<statistic name="loadAverage1Min">
- <title>Load Average 1 Minute</title>
+ <title>1-Minute Load Average</title>
</statistic>
+
+ <statistic name="loadAverage5Min">
+ <title>5-Minute Load Average</title>
+ </statistic>
+
+ <statistic name="loadAverage10Min">
+ <title>10-Minute Load Average</title>
+ </statistic>
+
+ <statistic name="procTotal">
+ <title>Processes</title>
+ </statistic>
+
+ <statistic name="procRunning">
+ <title>Running Processes</title>
+ </statistic>
</class>
</package>
+
+ <package name="mrg.grid">
+ <class name="Slot">
+ <property name="JobId">
+ <title>Job ID</title>
+ </property>
+
+ <property name="GlobalJobId">
+ <title>Global Job ID</title>
+ </property>
+
+ <property name="AccountingGroup">
+ <title>Accounting Group</title>
+ </property>
+
+ <property name="Arch">
+ <title>Architecture</title>
+ </property>
+
+ <property name="OpSys">
+ <title>Operating System</title>
+ </property>
+
+ <property name="ConcurrencyLimits">
+ <title>Concurrency Limits</title>
+ </property>
+
+ <property name="Cpus">
+ <title>CPUs</title>
+ </property>
+
+ <property name="Mips">
+ <title>MIPS</title>
+ </property>
+
+ <statistic name="CondorLoadAvg">
+ <title>Condor Load Average</title>
+ <!-- "%2.02f" -->
+ </statistic>
+
+ <statistic name="LoadAvg">
+ <title>Load Average</title>
+ <!-- "%2.02f" -->
+ </statistic>
+ </class>
+ </package>
</model>
Modified: mgmt/newdata/cumin/python/cumin/model.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/model.py 2010-05-19 21:31:07 UTC (rev 3978)
+++ mgmt/newdata/cumin/python/cumin/model.py 2010-05-20 15:22:29 UTC (rev 3979)
@@ -31,43 +31,6 @@
self.limits_by_negotiator = dict()
self.jobs_by_submission = dict()
- # # Messaging
-
- # CuminBroker(self)
- # CuminQueue(self)
- # CuminExchange(self)
- # CuminBinding(self)
- # CuminConnection(self)
- # CuminSession(self)
- # CuminLink(self)
- # CuminRoute(self)
- # CuminBrokerStoreModule(self)
- # CuminJournal(self)
- # CuminBrokerAclModule(self)
- # CuminBrokerClusterModule(self)
-
- # # Grid
-
- # CuminScheduler(self)
- # CuminSubmission(self)
- # CuminSubmitter(self)
- # CuminJob(self)
- # CuminJobGroup(self)
- # CuminLimit(self)
-
- # CuminCollector(self)
- # CuminNegotiator(self)
-
- # # Systems
-
- # CuminSystem(self)
- # CuminSlot(self)
- # CuminGrid(self)
-
- # # Other
-
- # CuminSubject(self)
-
def check(self):
log.info("Checking %s", self)
@@ -765,195 +728,6 @@
def get_icon_href(self, session):
return "resource?name=pool-36.png"
-class CuminSlot(RemoteClass):
- def __init__(self, model):
- super(CuminSlot, self).__init__(model, "slot", Slot, SlotStats)
-
- prop = CuminProperty(self, "Name")
- prop.title = "Name"
-
- prop = CuminProperty(self, "Machine")
- prop.title = "Machine"
-
- prop = CuminProperty(self, "JobId")
- prop.title = "Current Job Id"
- prop.category = "JobInfo"
-
- prop = CuminProperty(self, "GlobalJobId")
- prop.title = "Global Job Id"
- prop.category = "JobInfo"
-
- prop = CuminProperty(self, "AccountingGroup")
- prop.title = "Accounting Group"
-
- prop = CuminProperty(self, "Arch")
- prop.title = "Architecture"
-
- prop = CuminProperty(self, "OpSys")
- prop.title = "Operating System"
-
- prop = CuminProperty(self, "ConcurrencyLimits")
- prop.title = "Concurrency Limits"
-
- prop = CuminProperty(self, "Cpus")
- prop.title = "CPUs"
-
- prop = CuminProperty(self, "Disk")
- prop.title = "Disk"
-
- prop = CuminProperty(self, "Memory")
- prop.title = "Memory"
-
- prop = CuminProperty(self, "Mips")
- prop.title = "MIPS"
-
- prop = CuminProperty(self, "JobStart")
- prop.title = "JobStart"
- prop.category = "JobInfo"
-
- """
- prop = CuminProperty(self, "Activity")
- prop.title = "Activity"
- prop.category = "JobInfo"
-
- prop = CuminProperty(self, "State")
- prop.title = "State"
- prop.category = "JobInfo"
- """
-
- stat = CuminStat(self, "CondorLoadAvg")
- stat.title = "Condor Load Avg"
- stat.format = "%2.02f"
- stat.category = "load"
-
- stat = CuminStat(self, "LoadAvg")
- stat.title = "Load Avg"
- stat.format = "%2.02f"
- stat.category = "load"
-
- def get_title(self, session):
- return "Slot"
-
- def get_object_name(self, slot):
- return slot.Name
-
-class CuminSystem(RemoteClass):
- def __init__(self, model):
- super(CuminSystem, self).__init__(model, "system", Sysimage, SysimageStats)
-
- prop = CuminProperty(self, "uuid")
- prop.title = "System ID"
-
- prop = CuminProperty(self, "nodeName")
- prop.title = "Address"
- prop.summary = True
-
- prop = CuminProperty(self, "osName")
- prop.title = "Kernel"
-
- prop = CuminProperty(self, "release")
- prop.title = "Kernel Release"
-
- prop = CuminProperty(self, "version")
- prop.title = "Kernel Version"
-
- prop = CuminProperty(self, "machine")
- prop.title = "Architecture"
-
- prop = CuminProperty(self, "distro")
- prop.title = "Distribution"
-
- stat = CuminStat(self, "memFree")
- stat.title = "Memory Free"
- stat.highlow = True
-
- stat = CuminStat(self, "swapFree")
- stat.title = "Swap Free"
-
- stat = self.LoadStat(self, "loadAverage1Min")
- stat.title = "1 Minute Load Average"
- stat.highlow = True
-
- stat = self.LoadStat(self, "loadAverage5Min")
- stat.title = "5 Minute Load Average"
-
- stat = self.LoadStat(self, "loadAverage10Min")
- stat.title = "10 Minute Load Average"
-
- stat = CuminStat(self, "procTotal")
- stat.title = "Total processes"
-
- stat = CuminStat(self, "procRunning")
- stat.title = "Running processes"
-
- def init(self):
- super(CuminSystem, self).init()
-
- def get_title(self, session):
- return "System"
-
- def get_icon_href(self, session):
- return "resource?name=system-36.png"
-
- def get_object_name(self, object):
- return object.nodeName
-
- class LoadStat(CuminStat):
- def value_text(self, object):
- value = self.value(object)
- text = value and "%0.2f" % value or ""
- return text
-
-class CuminBroker(RemoteClass):
- def __init__(self, model):
- super(CuminBroker, self).__init__(model, "broker", Broker, BrokerStats)
-
- prop = CuminProperty(self, "port")
- prop.title = "Port"
-
- prop = CuminProperty(self, "workerThreads")
- prop.title = "Worker Threads"
-
- prop = CuminProperty(self, "maxConns")
- prop.title = "Max Connections"
-
- prop = CuminProperty(self, "connBacklog")
- prop.title = "Connection Backlog"
-
- prop = CuminProperty(self, "stagingThreshold")
- prop.title = "Staging Threshold"
-
- prop = CuminProperty(self, "mgmtPubInterval")
- prop.title = "Mgmt. Publish Interval"
-
- prop = CuminProperty(self, "clusterName")
- prop.title = "Cluster Name"
-
- prop = CuminProperty(self, "version")
- prop.title = "Version"
- prop.summary = True
-
- prop = CuminProperty(self, "dataDir")
- prop.title = "Data Directory"
-
- def init(self):
- super(CuminBroker, self).init()
-
- self.frame = self.model.frame.messaging.broker
-
- def get_icon_href(self, session):
- return "resource?name=broker-36.png"
-
- def get_title(self, session):
- return "Broker"
-
- def get_object_name(self, broker):
- try:
- host, port = broker.system.nodeName, broker.port
- return "%s:%i" % (host, port)
- except:
- return broker.name
-
# XXX "do_" on this doesn't make sense
def do_bind(session, queue_name, binding_info):
for exchange in binding_info:
Modified: mgmt/newdata/mint/python/mint/model.py
===================================================================
--- mgmt/newdata/mint/python/mint/model.py 2010-05-19 21:31:07 UTC (rev 3978)
+++ mgmt/newdata/mint/python/mint/model.py 2010-05-20 15:22:29 UTC (rev 3979)
@@ -63,30 +63,6 @@
finally:
self.model.lock.release()
- def call_method(self, callback, obj, name, *args):
- assert isinstance(obj, RosemaryObject)
-
- class_key = ClassKey(obj._qmf_class_key)
-
- oid_args = {"_agent_name": obj._qmf_agent_id,
- "_object_name": obj._qmf_object_id}
-
- oid = ObjectId(oid_args)
-
- self.model.lock.acquire()
- try:
- broker = self.qmf_agent.getBroker()
-
- seq = self.model.qmf_session._sendMethodRequest \
- (broker, class_key, oid, name, args)
-
- if seq is not None:
- self.model.outstanding_method_calls[seq] = callback
-
- return seq
- finally:
- self.model.lock.release()
-
def delete(self):
self.model.lock.acquire()
try:
14 years, 7 months