rhmessaging commits: r2395 - mgmt/trunk/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-09-03 15:17:41 -0400 (Wed, 03 Sep 2008)
New Revision: 2395
Modified:
mgmt/trunk/cumin/python/wooly/parameters.py
Log:
Override get_default to return a new empty dictionary for DictParameter so multiple browsers don't share the same values.
Modified: mgmt/trunk/cumin/python/wooly/parameters.py
===================================================================
--- mgmt/trunk/cumin/python/wooly/parameters.py 2008-09-03 19:06:59 UTC (rev 2394)
+++ mgmt/trunk/cumin/python/wooly/parameters.py 2008-09-03 19:17:41 UTC (rev 2395)
@@ -44,6 +44,9 @@
def get_instance_key(self, key):
return DictParameter.sep().join((self.path, key))
+ def get_default(self, session):
+ return copy(self.default)
+
def clear(self):
self.default = dict()
16 years, 6 months
rhmessaging commits: r2394 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-09-03 15:06:59 -0400 (Wed, 03 Sep 2008)
New Revision: 2394
Modified:
mgmt/trunk/cumin/python/cumin/brokerlink.py
Log:
Fix error handling so multiple browsers don't share error info.
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-09-03 18:37:39 UTC (rev 2393)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-09-03 19:06:59 UTC (rev 2394)
@@ -503,7 +503,8 @@
self.durable = SavedField(app, "saved", self)
self.add_field(self.durable)
- self.errors = dict()
+ self.errors = self.Errors(self, "errors")
+ self.add_attribute(self.errors)
def render_title(self, session, *args):
reg = self.frame.get_object(session)
@@ -542,14 +543,16 @@
return host["password"]
def render_broker_name_error(self, session, *args):
- if "name" in self.errors:
+ errors = self.errors.get(session)
+ if "name" in errors:
return "<ul class=\"errors\" style=\"float:left;\"><li>%s</li></ul>" % \
- self.errors["name"]
+ errors["name"]
def render_broker_port_error(self, session, *args):
- if "port" in self.errors:
+ errors = self.errors.get(session)
+ if "port" in errors:
return "<ul class=\"errors\" style=\"float:left;\"><li>%s</li></ul>" % \
- self.errors["port"]
+ errors["port"]
def render_optional_prompt(self, session, *args):
return "Optional"
@@ -561,21 +564,24 @@
self.page.set_redirect_url(session, branch.marshal())
def validate(self, session):
- self.errors = dict()
+ errors = self.errors.get(session)
host = self.host.get(session)
if not "name" in host:
- self.errors["name"] = "Host name is required"
+ errors["name"] = "Host name is required"
if "port" in host:
port = host["port"]
try:
# ensure a number and remove surrounding spaces
port = str(int(port))
except:
- self.errors["port"] = "Port must be a number"
+ errors["port"] = "Port must be a number"
- return not len(self.errors)
+ return not len(errors)
+ def post_process(self, session):
+ self.host.clear()
+
def process_submit(self, session):
super_error = super(BrokerLinkAdd, self).validate(session)
@@ -613,6 +619,10 @@
# navigate back to main queue frame
self.process_cancel(session)
+ class Errors(Attribute):
+ def get_default(self, session):
+ return dict()
+
class BrokerSetClose(CuminBulkActionForm):
def process_return(self, session):
branch = session.branch()
16 years, 6 months
rhmessaging commits: r2393 - store/trunk.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2008-09-03 14:37:39 -0400 (Wed, 03 Sep 2008)
New Revision: 2393
Removed:
store/trunk/specs/
Log:
Removed empty directory
16 years, 6 months
rhmessaging commits: r2392 - in store/trunk: cpp/lib/gen and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2008-09-03 14:32:51 -0400 (Wed, 03 Sep 2008)
New Revision: 2392
Added:
store/trunk/cpp/lib/gen/ArgsJournalExpand.h
store/trunk/cpp/lib/gen/Journal.cpp
store/trunk/cpp/lib/gen/Journal.h
store/trunk/cpp/lib/gen/PackageMrgstore.cpp
store/trunk/cpp/lib/gen/PackageMrgstore.h
store/trunk/cpp/lib/gen/Store.cpp
store/trunk/cpp/lib/gen/Store.h
store/trunk/cpp/lib/qmf-schema.xml
Removed:
store/trunk/cpp/lib/gen/qpid/
store/trunk/specs/management-schema.xml
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/BdbMessageStore.h
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/Makefile.am
Log:
Updated to match qpid management changes
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2008-09-03 16:31:20 UTC (rev 2391)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2008-09-03 18:32:51 UTC (rev 2392)
@@ -28,7 +28,7 @@
#include "IdPairDbt.h"
#include "jrnl/txn_map.hpp"
#include "qpid/log/Statement.h"
-#include "qpid/management/PackageMrgstore.h"
+#include "PackageMrgstore.h"
#define MAX_AIO_SLEEPS 1000 // ~1 second
#define AIO_SLEEP_TIME 1000 // 1 milisecond
@@ -184,7 +184,7 @@
mgmtObject->set_tplDataFileSize(tplJrnlFsizeSblks * JRNL_SBLK_SIZE * JRNL_DBLK_SIZE);
mgmtObject->set_tplCurrentFileCount(tplNumJrnlFiles);
- agent->addObject(mgmtObject, 50, 1);
+ agent->addObject(mgmtObject, 0x1000000000000050LL);
}
}
}
Modified: store/trunk/cpp/lib/BdbMessageStore.h
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.h 2008-09-03 16:31:20 UTC (rev 2391)
+++ store/trunk/cpp/lib/BdbMessageStore.h 2008-09-03 18:32:51 UTC (rev 2392)
@@ -36,7 +36,7 @@
#include "qpid/broker/Broker.h"
#include "qpid/broker/MessageStore.h"
#include "qpid/management/Manageable.h"
-#include "qpid/management/Store.h"
+#include "Store.h"
#include "TxnCtxt.h"
// Assume DB_VERSION_MAJOR == 4
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2008-09-03 16:31:20 UTC (rev 2391)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2008-09-03 18:32:51 UTC (rev 2392)
@@ -28,8 +28,7 @@
#include "jrnl/slock.hpp"
#include "qpid/log/Statement.h"
#include "qpid/agent/ManagementAgent.h"
-#include "qpid/management/ArgsJournalExpand.h"
-#include "qpid/management/ArgsJournalReconfigure.h"
+#include "ArgsJournalExpand.h"
#include "qpid/sys/Monitor.h"
#include "StoreException.h"
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2008-09-03 16:31:20 UTC (rev 2391)
+++ store/trunk/cpp/lib/JournalImpl.h 2008-09-03 18:32:51 UTC (rev 2392)
@@ -34,7 +34,7 @@
#include <boost/ptr_container/ptr_list.hpp>
#include <boost/intrusive_ptr.hpp>
#include "qpid/management/Manageable.h"
-#include "qpid/management/Journal.h"
+#include "Journal.h"
namespace rhm {
namespace bdbstore {
Modified: store/trunk/cpp/lib/Makefile.am
===================================================================
--- store/trunk/cpp/lib/Makefile.am 2008-09-03 16:31:20 UTC (rev 2391)
+++ store/trunk/cpp/lib/Makefile.am 2008-09-03 18:32:51 UTC (rev 2392)
@@ -95,14 +95,14 @@
jrnl/txn_rec.hpp \
jrnl/wmgr.hpp \
jrnl/wrfc.hpp \
- gen/qpid/management/PackageMrgstore.cpp \
- gen/qpid/management/PackageMrgstore.h \
- gen/qpid/management/Journal.cpp \
- gen/qpid/management/Journal.h \
- gen/qpid/management/Store.cpp \
- gen/qpid/management/Store.h \
- gen/qpid/management/ArgsJournalExpand.h \
- gen/qpid/management/ArgsJournalReconfigure.h
+ gen/PackageMrgstore.cpp \
+ gen/PackageMrgstore.h \
+ gen/Journal.cpp \
+ gen/Journal.h \
+ gen/Store.cpp \
+ gen/Store.h \
+ gen/ArgsJournalExpand.h \
+ gen/ArgsJournalReconfigure.h
BUILT_SOURCES = db-inc.h
Added: store/trunk/cpp/lib/gen/ArgsJournalExpand.h
===================================================================
--- store/trunk/cpp/lib/gen/ArgsJournalExpand.h (rev 0)
+++ store/trunk/cpp/lib/gen/ArgsJournalExpand.h 2008-09-03 18:32:51 UTC (rev 2392)
@@ -0,0 +1,42 @@
+
+#ifndef _ARGS_JOURNALEXPAND_
+#define _ARGS_JOURNALEXPAND_
+
+//
+// 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.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/management/Args.h"
+#include <string>
+
+namespace qpid {
+namespace management {
+
+class ArgsJournalExpand : public Args
+{
+ public:
+ uint32_t i_by;
+
+};
+
+}}
+
+#endif /*!_ARGS_JOURNALEXPAND_*/
Added: store/trunk/cpp/lib/gen/Journal.cpp
===================================================================
--- store/trunk/cpp/lib/gen/Journal.cpp (rev 0)
+++ store/trunk/cpp/lib/gen/Journal.cpp 2008-09-03 18:32:51 UTC (rev 2392)
@@ -0,0 +1,572 @@
+
+//
+// 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.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/log/Statement.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/management/Manageable.h"
+#include "qpid/agent/ManagementAgent.h"
+#include "Journal.h"
+#include "ArgsJournalExpand.h"
+
+
+using namespace qpid::management;
+using namespace qpid::sys;
+using namespace qpid::framing;
+using std::string;
+
+string Journal::packageName = string ("mrgstore");
+string Journal::className = string ("journal");
+uint8_t Journal::md5Sum[16] =
+ {0x1e,0x63,0xa4,0x3d,0xa3,0x1b,0xc0,0x1,0x1,0x70,0x5a,0x2a,0xb4,0xa,0x1b,0x4e};
+
+Journal::Journal (ManagementAgent* _agent, Manageable* _core) :
+ ManagementObject(_agent, _core)
+{
+
+ recordDepth = 0;
+ recordDepthHigh = 0;
+ recordDepthLow = 0;
+ outstandingAIOs = 0;
+ outstandingAIOsHigh = 0;
+ outstandingAIOsLow = 0;
+ freeFileCount = 0;
+ freeFileCountHigh = 0;
+ freeFileCountLow = 0;
+ availableFileCount = 0;
+ availableFileCountHigh = 0;
+ availableFileCountLow = 0;
+ writePageCacheDepth = 0;
+ writePageCacheDepthHigh = 0;
+ writePageCacheDepthLow = 0;
+ readPageCacheDepth = 0;
+ readPageCacheDepthHigh = 0;
+ readPageCacheDepthLow = 0;
+
+
+
+ maxThreads = agent->getMaxThreads();
+ perThreadStatsArray = new struct PerThreadStats*[maxThreads];
+ for (int idx = 0; idx < maxThreads; idx++)
+ perThreadStatsArray[idx] = 0;
+
+}
+
+Journal::~Journal ()
+{
+
+ for (int idx = 0; idx < maxThreads; idx++)
+ if (perThreadStatsArray[idx] != 0)
+ delete perThreadStatsArray[idx];
+ delete[] perThreadStatsArray;
+
+}
+
+namespace {
+ const string NAME("name");
+ const string TYPE("type");
+ const string ACCESS("access");
+ const string INDEX("index");
+ const string OPTIONAL("optional");
+ const string UNIT("unit");
+ const string MIN("min");
+ const string MAX("max");
+ const string MAXLEN("maxlen");
+ const string DESC("desc");
+ const string ARGCOUNT("argCount");
+ const string ARGS("args");
+ const string DIR("dir");
+ const string DEFAULT("default");
+}
+
+void Journal::registerClass(ManagementAgent* agent)
+{
+ agent->RegisterClass(packageName, className, md5Sum, writeSchema);
+}
+
+void Journal::writeSchema (Buffer& buf)
+{
+ FieldTable ft;
+
+ // Schema class header:
+ buf.putShortString (packageName); // Package Name
+ buf.putShortString (className); // Class Name
+ buf.putBin128 (md5Sum); // Schema Hash
+ buf.putShort (11); // Config Element Count
+ buf.putShort (28); // Inst Element Count
+ buf.putShort (1); // Method Count
+ buf.putShort (0); // Event Count
+
+ // Properties
+ ft = FieldTable ();
+ ft.setString (NAME, "queueRef");
+ ft.setInt (TYPE, TYPE_REF);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "name");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 1);
+ ft.setInt (OPTIONAL, 0);
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "directory");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (DESC, "Directory containing journal files");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "baseFileName");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (DESC, "Base filename prefix for journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "writePageSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "byte");
+ ft.setString (DESC, "Page size in write-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "writePages");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "wpage");
+ ft.setString (DESC, "Number of pages in write-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "readPageSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "byte");
+ ft.setString (DESC, "Page size in read-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "readPages");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "rpage");
+ ft.setString (DESC, "Number of pages in read-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "initialFileCount");
+ ft.setInt (TYPE, TYPE_U16);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files initially allocated to this journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "dataFileSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "byte");
+ ft.setString (DESC, "Size of each journal data file");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "currentFileCount");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files currently allocated to this journal");
+ buf.put (ft);
+
+
+ // Statistics
+ ft = FieldTable ();
+ ft.setString (NAME, "recordDepth");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Number of currently enqueued records (durable messages)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "recordDepthHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Number of currently enqueued records (durable messages) (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "recordDepthLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Number of currently enqueued records (durable messages) (Low)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "enqueues");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Total enqueued records on journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "dequeues");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Total dequeued records on journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "txnEnqueues");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Total transactional enqueued records on journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "txnDequeues");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Total transactional dequeued records on journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "txnCommits");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Total transactional commit records on journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "txnAborts");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Total transactional abort records on journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "outstandingAIOs");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "aio_op");
+ ft.setString (DESC, "Number of currently outstanding AIO requests in Async IO system");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "outstandingAIOsHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "aio_op");
+ ft.setString (DESC, "Number of currently outstanding AIO requests in Async IO system (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "outstandingAIOsLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "aio_op");
+ ft.setString (DESC, "Number of currently outstanding AIO requests in Async IO system (Low)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "freeFileCount");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files free on this journal. Includes free files trapped in holes.");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "freeFileCountHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files free on this journal. Includes free files trapped in holes. (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "freeFileCountLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files free on this journal. Includes free files trapped in holes. (Low)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "availableFileCount");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files available to be written. Excluding holes");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "availableFileCountHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files available to be written. Excluding holes (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "availableFileCountLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files available to be written. Excluding holes (Low)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "writeWaitFailures");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "AIO Wait failures on write");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "writeBusyFailures");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "AIO Busy failures on write");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "readRecordCount");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Records read from the journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "readBusyFailures");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "AIO Busy failures on read");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "writePageCacheDepth");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "wpage");
+ ft.setString (DESC, "Current depth of write-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "writePageCacheDepthHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "wpage");
+ ft.setString (DESC, "Current depth of write-page-cache (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "writePageCacheDepthLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "wpage");
+ ft.setString (DESC, "Current depth of write-page-cache (Low)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "readPageCacheDepth");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "rpage");
+ ft.setString (DESC, "Current depth of read-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "readPageCacheDepthHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "rpage");
+ ft.setString (DESC, "Current depth of read-page-cache (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "readPageCacheDepthLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "rpage");
+ ft.setString (DESC, "Current depth of read-page-cache (Low)");
+ buf.put (ft);
+
+
+ // Methods
+ ft = FieldTable ();
+ ft.setString (NAME, "expand");
+ ft.setInt (ARGCOUNT, 1);
+ ft.setString (DESC, "Increase number of files allocated for this journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "by");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (DIR, "I");
+ ft.setString (DESC, "Number of files to increase journal size by");
+ buf.put (ft);
+
+
+ // Events
+
+}
+
+
+void Journal::aggregatePerThreadStats(struct PerThreadStats* totals)
+{
+ totals->enqueues = 0;
+ totals->dequeues = 0;
+ totals->txnEnqueues = 0;
+ totals->txnDequeues = 0;
+ totals->txnCommits = 0;
+ totals->txnAborts = 0;
+ totals->writeWaitFailures = 0;
+ totals->writeBusyFailures = 0;
+ totals->readRecordCount = 0;
+ totals->readBusyFailures = 0;
+
+ for (int idx = 0; idx < maxThreads; idx++) {
+ struct PerThreadStats* threadStats = perThreadStatsArray[idx];
+ if (threadStats != 0) {
+ totals->enqueues += threadStats->enqueues;
+ totals->dequeues += threadStats->dequeues;
+ totals->txnEnqueues += threadStats->txnEnqueues;
+ totals->txnDequeues += threadStats->txnDequeues;
+ totals->txnCommits += threadStats->txnCommits;
+ totals->txnAborts += threadStats->txnAborts;
+ totals->writeWaitFailures += threadStats->writeWaitFailures;
+ totals->writeBusyFailures += threadStats->writeBusyFailures;
+ totals->readRecordCount += threadStats->readRecordCount;
+ totals->readBusyFailures += threadStats->readBusyFailures;
+
+ }
+ }
+}
+
+
+void Journal::writeProperties (Buffer& buf)
+{
+ sys::Mutex::ScopedLock mutex(accessLock);
+ configChanged = false;
+
+ writeTimestamps (buf);
+
+ queueRef.encode(buf);
+ buf.putShortString(name);
+ buf.putShortString(directory);
+ buf.putShortString(baseFileName);
+ buf.putLong(writePageSize);
+ buf.putLong(writePages);
+ buf.putLong(readPageSize);
+ buf.putLong(readPages);
+ buf.putShort(initialFileCount);
+ buf.putLong(dataFileSize);
+ buf.putLong(currentFileCount);
+
+}
+
+void Journal::writeStatistics (Buffer& buf, bool skipHeaders)
+{
+ sys::Mutex::ScopedLock mutex(accessLock);
+ instChanged = false;
+
+
+ struct PerThreadStats totals;
+ aggregatePerThreadStats(&totals);
+
+
+ if (!skipHeaders)
+ writeTimestamps (buf);
+ buf.putLong(recordDepth);
+ buf.putLong(recordDepthHigh);
+ buf.putLong(recordDepthLow);
+ buf.putLongLong(totals.enqueues);
+ buf.putLongLong(totals.dequeues);
+ buf.putLongLong(totals.txnEnqueues);
+ buf.putLongLong(totals.txnDequeues);
+ buf.putLongLong(totals.txnCommits);
+ buf.putLongLong(totals.txnAborts);
+ buf.putLong(outstandingAIOs);
+ buf.putLong(outstandingAIOsHigh);
+ buf.putLong(outstandingAIOsLow);
+ buf.putLong(freeFileCount);
+ buf.putLong(freeFileCountHigh);
+ buf.putLong(freeFileCountLow);
+ buf.putLong(availableFileCount);
+ buf.putLong(availableFileCountHigh);
+ buf.putLong(availableFileCountLow);
+ buf.putLongLong(totals.writeWaitFailures);
+ buf.putLongLong(totals.writeBusyFailures);
+ buf.putLongLong(totals.readRecordCount);
+ buf.putLongLong(totals.readBusyFailures);
+ buf.putLong(writePageCacheDepth);
+ buf.putLong(writePageCacheDepthHigh);
+ buf.putLong(writePageCacheDepthLow);
+ buf.putLong(readPageCacheDepth);
+ buf.putLong(readPageCacheDepthHigh);
+ buf.putLong(readPageCacheDepthLow);
+
+
+ // Maintenance of hi-lo statistics
+ recordDepthHigh = recordDepth;
+ recordDepthLow = recordDepth;
+ outstandingAIOsHigh = outstandingAIOs;
+ outstandingAIOsLow = outstandingAIOs;
+ freeFileCountHigh = freeFileCount;
+ freeFileCountLow = freeFileCount;
+ availableFileCountHigh = availableFileCount;
+ availableFileCountLow = availableFileCount;
+ writePageCacheDepthHigh = writePageCacheDepth;
+ writePageCacheDepthLow = writePageCacheDepth;
+ readPageCacheDepthHigh = readPageCacheDepth;
+ readPageCacheDepthLow = readPageCacheDepth;
+
+
+}
+
+void Journal::doMethod (string methodName, Buffer& inBuf, Buffer& outBuf)
+{
+ Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
+
+ if (methodName == "expand") {
+ ArgsJournalExpand ioArgs;
+ ioArgs.i_by = inBuf.getLong();
+ status = coreObject->ManagementMethod (METHOD_EXPAND, ioArgs);
+ outBuf.putLong (status);
+ outBuf.putShortString (Manageable::StatusText (status));
+ return;
+ }
+
+ outBuf.putLong (status);
+ outBuf.putShortString (Manageable::StatusText (status));
+}
+
+
Added: store/trunk/cpp/lib/gen/Journal.h
===================================================================
--- store/trunk/cpp/lib/gen/Journal.h (rev 0)
+++ store/trunk/cpp/lib/gen/Journal.h 2008-09-03 18:32:51 UTC (rev 2392)
@@ -0,0 +1,415 @@
+
+#ifndef _MANAGEMENT_JOURNAL_
+#define _MANAGEMENT_JOURNAL_
+
+//
+// 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.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/management/ManagementObject.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/framing/Uuid.h"
+
+namespace qpid {
+namespace management {
+
+class Journal : public ManagementObject
+{
+ private:
+
+ static std::string packageName;
+ static std::string className;
+ static uint8_t md5Sum[16];
+
+
+ // Properties
+ ObjectId queueRef;
+ std::string name;
+ std::string directory;
+ std::string baseFileName;
+ uint32_t writePageSize;
+ uint32_t writePages;
+ uint32_t readPageSize;
+ uint32_t readPages;
+ uint16_t initialFileCount;
+ uint32_t dataFileSize;
+ uint32_t currentFileCount;
+
+ // Statistics
+ uint32_t recordDepth;
+ uint32_t recordDepthHigh;
+ uint32_t recordDepthLow;
+ uint32_t outstandingAIOs;
+ uint32_t outstandingAIOsHigh;
+ uint32_t outstandingAIOsLow;
+ uint32_t freeFileCount;
+ uint32_t freeFileCountHigh;
+ uint32_t freeFileCountLow;
+ uint32_t availableFileCount;
+ uint32_t availableFileCountHigh;
+ uint32_t availableFileCountLow;
+ uint32_t writePageCacheDepth;
+ uint32_t writePageCacheDepthHigh;
+ uint32_t writePageCacheDepthLow;
+ uint32_t readPageCacheDepth;
+ uint32_t readPageCacheDepthHigh;
+ uint32_t readPageCacheDepthLow;
+
+
+ // Per-Thread Statistics
+ struct PerThreadStats {
+ uint64_t enqueues;
+ uint64_t dequeues;
+ uint64_t txnEnqueues;
+ uint64_t txnDequeues;
+ uint64_t txnCommits;
+ uint64_t txnAborts;
+ uint64_t writeWaitFailures;
+ uint64_t writeBusyFailures;
+ uint64_t readRecordCount;
+ uint64_t readBusyFailures;
+
+ };
+
+ struct PerThreadStats** perThreadStatsArray;
+
+ inline struct PerThreadStats* getThreadStats() {
+ int index = getThreadIndex();
+ struct PerThreadStats* threadStats = perThreadStatsArray[index];
+ if (threadStats == 0) {
+ threadStats = new(PerThreadStats);
+ perThreadStatsArray[index] = threadStats;
+ threadStats->enqueues = 0;
+ threadStats->dequeues = 0;
+ threadStats->txnEnqueues = 0;
+ threadStats->txnDequeues = 0;
+ threadStats->txnCommits = 0;
+ threadStats->txnAborts = 0;
+ threadStats->writeWaitFailures = 0;
+ threadStats->writeBusyFailures = 0;
+ threadStats->readRecordCount = 0;
+ threadStats->readBusyFailures = 0;
+
+ }
+ return threadStats;
+ }
+
+ void aggregatePerThreadStats(struct PerThreadStats*);
+
+ // Private Methods
+ static void writeSchema (qpid::framing::Buffer& buf);
+ void writeProperties (qpid::framing::Buffer& buf);
+ void writeStatistics (qpid::framing::Buffer& buf,
+ bool skipHeaders = false);
+ void doMethod (std::string methodName,
+ qpid::framing::Buffer& inBuf,
+ qpid::framing::Buffer& outBuf);
+ writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; }
+
+ public:
+
+ Journal (ManagementAgent* agent,
+ Manageable* coreObject);
+ ~Journal (void);
+
+ void setReference(ObjectId objectId) { queueRef = objectId; }
+
+
+ static void registerClass (ManagementAgent* agent);
+ std::string& getPackageName (void) { return packageName; }
+ std::string& getClassName (void) { return className; }
+ uint8_t* getMd5Sum (void) { return md5Sum; }
+
+ // Method IDs
+ static const uint32_t METHOD_EXPAND = 1;
+
+ // Accessor Methods
+ inline void set_queueRef (ObjectId val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ queueRef = val;
+ configChanged = true;
+ }
+ inline ObjectId& get_queueRef() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return queueRef;
+ }
+ inline void set_name (std::string val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ name = val;
+ configChanged = true;
+ }
+ inline std::string& get_name() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return name;
+ }
+ inline void set_directory (std::string val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ directory = val;
+ configChanged = true;
+ }
+ inline std::string& get_directory() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return directory;
+ }
+ inline void set_baseFileName (std::string val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ baseFileName = val;
+ configChanged = true;
+ }
+ inline std::string& get_baseFileName() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return baseFileName;
+ }
+ inline void set_writePageSize (uint32_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ writePageSize = val;
+ configChanged = true;
+ }
+ inline uint32_t& get_writePageSize() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return writePageSize;
+ }
+ inline void set_writePages (uint32_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ writePages = val;
+ configChanged = true;
+ }
+ inline uint32_t& get_writePages() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return writePages;
+ }
+ inline void set_readPageSize (uint32_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ readPageSize = val;
+ configChanged = true;
+ }
+ inline uint32_t& get_readPageSize() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return readPageSize;
+ }
+ inline void set_readPages (uint32_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ readPages = val;
+ configChanged = true;
+ }
+ inline uint32_t& get_readPages() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return readPages;
+ }
+ inline void set_initialFileCount (uint16_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ initialFileCount = val;
+ configChanged = true;
+ }
+ inline uint16_t& get_initialFileCount() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return initialFileCount;
+ }
+ inline void set_dataFileSize (uint32_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ dataFileSize = val;
+ configChanged = true;
+ }
+ inline uint32_t& get_dataFileSize() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return dataFileSize;
+ }
+ inline void set_currentFileCount (uint32_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ currentFileCount = val;
+ configChanged = true;
+ }
+ inline uint32_t& get_currentFileCount() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return currentFileCount;
+ }
+ inline void inc_recordDepth (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ recordDepth += by;
+ if (recordDepthHigh < recordDepth)
+ recordDepthHigh = recordDepth;
+ instChanged = true;
+ }
+ inline void dec_recordDepth (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ recordDepth -= by;
+ if (recordDepthLow > recordDepth)
+ recordDepthLow = recordDepth;
+ instChanged = true;
+ }
+ inline void inc_enqueues (uint64_t by = 1) {
+ getThreadStats()->enqueues += by;
+ instChanged = true;
+ }
+ inline void dec_enqueues (uint64_t by = 1) {
+ getThreadStats()->enqueues -= by;
+ instChanged = true;
+ }
+ inline void inc_dequeues (uint64_t by = 1) {
+ getThreadStats()->dequeues += by;
+ instChanged = true;
+ }
+ inline void dec_dequeues (uint64_t by = 1) {
+ getThreadStats()->dequeues -= by;
+ instChanged = true;
+ }
+ inline void inc_txnEnqueues (uint64_t by = 1) {
+ getThreadStats()->txnEnqueues += by;
+ instChanged = true;
+ }
+ inline void dec_txnEnqueues (uint64_t by = 1) {
+ getThreadStats()->txnEnqueues -= by;
+ instChanged = true;
+ }
+ inline void inc_txnDequeues (uint64_t by = 1) {
+ getThreadStats()->txnDequeues += by;
+ instChanged = true;
+ }
+ inline void dec_txnDequeues (uint64_t by = 1) {
+ getThreadStats()->txnDequeues -= by;
+ instChanged = true;
+ }
+ inline void inc_txnCommits (uint64_t by = 1) {
+ getThreadStats()->txnCommits += by;
+ instChanged = true;
+ }
+ inline void dec_txnCommits (uint64_t by = 1) {
+ getThreadStats()->txnCommits -= by;
+ instChanged = true;
+ }
+ inline void inc_txnAborts (uint64_t by = 1) {
+ getThreadStats()->txnAborts += by;
+ instChanged = true;
+ }
+ inline void dec_txnAborts (uint64_t by = 1) {
+ getThreadStats()->txnAborts -= by;
+ instChanged = true;
+ }
+ inline void inc_outstandingAIOs (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ outstandingAIOs += by;
+ if (outstandingAIOsHigh < outstandingAIOs)
+ outstandingAIOsHigh = outstandingAIOs;
+ instChanged = true;
+ }
+ inline void dec_outstandingAIOs (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ outstandingAIOs -= by;
+ if (outstandingAIOsLow > outstandingAIOs)
+ outstandingAIOsLow = outstandingAIOs;
+ instChanged = true;
+ }
+ inline void inc_freeFileCount (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ freeFileCount += by;
+ if (freeFileCountHigh < freeFileCount)
+ freeFileCountHigh = freeFileCount;
+ instChanged = true;
+ }
+ inline void dec_freeFileCount (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ freeFileCount -= by;
+ if (freeFileCountLow > freeFileCount)
+ freeFileCountLow = freeFileCount;
+ instChanged = true;
+ }
+ inline void inc_availableFileCount (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ availableFileCount += by;
+ if (availableFileCountHigh < availableFileCount)
+ availableFileCountHigh = availableFileCount;
+ instChanged = true;
+ }
+ inline void dec_availableFileCount (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ availableFileCount -= by;
+ if (availableFileCountLow > availableFileCount)
+ availableFileCountLow = availableFileCount;
+ instChanged = true;
+ }
+ inline void inc_writeWaitFailures (uint64_t by = 1) {
+ getThreadStats()->writeWaitFailures += by;
+ instChanged = true;
+ }
+ inline void dec_writeWaitFailures (uint64_t by = 1) {
+ getThreadStats()->writeWaitFailures -= by;
+ instChanged = true;
+ }
+ inline void inc_writeBusyFailures (uint64_t by = 1) {
+ getThreadStats()->writeBusyFailures += by;
+ instChanged = true;
+ }
+ inline void dec_writeBusyFailures (uint64_t by = 1) {
+ getThreadStats()->writeBusyFailures -= by;
+ instChanged = true;
+ }
+ inline void inc_readRecordCount (uint64_t by = 1) {
+ getThreadStats()->readRecordCount += by;
+ instChanged = true;
+ }
+ inline void dec_readRecordCount (uint64_t by = 1) {
+ getThreadStats()->readRecordCount -= by;
+ instChanged = true;
+ }
+ inline void inc_readBusyFailures (uint64_t by = 1) {
+ getThreadStats()->readBusyFailures += by;
+ instChanged = true;
+ }
+ inline void dec_readBusyFailures (uint64_t by = 1) {
+ getThreadStats()->readBusyFailures -= by;
+ instChanged = true;
+ }
+ inline void inc_writePageCacheDepth (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ writePageCacheDepth += by;
+ if (writePageCacheDepthHigh < writePageCacheDepth)
+ writePageCacheDepthHigh = writePageCacheDepth;
+ instChanged = true;
+ }
+ inline void dec_writePageCacheDepth (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ writePageCacheDepth -= by;
+ if (writePageCacheDepthLow > writePageCacheDepth)
+ writePageCacheDepthLow = writePageCacheDepth;
+ instChanged = true;
+ }
+ inline void inc_readPageCacheDepth (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ readPageCacheDepth += by;
+ if (readPageCacheDepthHigh < readPageCacheDepth)
+ readPageCacheDepthHigh = readPageCacheDepth;
+ instChanged = true;
+ }
+ inline void dec_readPageCacheDepth (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ readPageCacheDepth -= by;
+ if (readPageCacheDepthLow > readPageCacheDepth)
+ readPageCacheDepthLow = readPageCacheDepth;
+ instChanged = true;
+ }
+
+ // Event Methods
+
+};
+
+}}
+
+#endif /*!_MANAGEMENT_JOURNAL_*/
Added: store/trunk/cpp/lib/gen/PackageMrgstore.cpp
===================================================================
--- store/trunk/cpp/lib/gen/PackageMrgstore.cpp (rev 0)
+++ store/trunk/cpp/lib/gen/PackageMrgstore.cpp 2008-09-03 18:32:51 UTC (rev 2392)
@@ -0,0 +1,37 @@
+
+//
+// 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.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "PackageMrgstore.h"
+#include "Store.h"
+#include "Journal.h"
+
+
+using namespace qpid::management;
+
+PackageMrgstore::PackageMrgstore (ManagementAgent* agent)
+{
+ Store::registerClass(agent);
+ Journal::registerClass(agent);
+
+}
+
Added: store/trunk/cpp/lib/gen/PackageMrgstore.h
===================================================================
--- store/trunk/cpp/lib/gen/PackageMrgstore.h (rev 0)
+++ store/trunk/cpp/lib/gen/PackageMrgstore.h 2008-09-03 18:32:51 UTC (rev 2392)
@@ -0,0 +1,42 @@
+
+#ifndef _MANAGEMENT_PACKAGE_MRGSTORE_
+#define _MANAGEMENT_PACKAGE_MRGSTORE_
+
+//
+// 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.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/agent/ManagementAgent.h"
+
+namespace qpid {
+namespace management {
+
+class PackageMrgstore
+{
+ public:
+ PackageMrgstore (ManagementAgent* agent);
+ ~PackageMrgstore () {}
+};
+
+}}
+
+
+#endif /*!_MANAGEMENT_PACKAGE_MRGSTORE_*/
Added: store/trunk/cpp/lib/gen/Store.cpp
===================================================================
--- store/trunk/cpp/lib/gen/Store.cpp (rev 0)
+++ store/trunk/cpp/lib/gen/Store.cpp 2008-09-03 18:32:51 UTC (rev 2392)
@@ -0,0 +1,364 @@
+
+//
+// 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.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/log/Statement.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/management/Manageable.h"
+#include "qpid/agent/ManagementAgent.h"
+#include "Store.h"
+
+
+using namespace qpid::management;
+using namespace qpid::sys;
+using namespace qpid::framing;
+using std::string;
+
+string Store::packageName = string ("mrgstore");
+string Store::className = string ("store");
+uint8_t Store::md5Sum[16] =
+ {0x18,0xd,0xd4,0x15,0xd3,0x9a,0xf,0xbe,0x3a,0x40,0xe1,0x1b,0x9e,0x5b,0x7e,0x86};
+
+Store::Store (ManagementAgent* _agent, Manageable* _core, Manageable* _parent) :
+ ManagementObject(_agent, _core)
+{
+ brokerRef = _parent->GetManagementObject ()->getObjectId ();
+ tplTransactionDepth = 0;
+ tplTransactionDepthHigh = 0;
+ tplTransactionDepthLow = 0;
+ tplOutstandingAIOs = 0;
+ tplOutstandingAIOsHigh = 0;
+ tplOutstandingAIOsLow = 0;
+
+
+
+ maxThreads = agent->getMaxThreads();
+ perThreadStatsArray = new struct PerThreadStats*[maxThreads];
+ for (int idx = 0; idx < maxThreads; idx++)
+ perThreadStatsArray[idx] = 0;
+
+}
+
+Store::~Store ()
+{
+
+ for (int idx = 0; idx < maxThreads; idx++)
+ if (perThreadStatsArray[idx] != 0)
+ delete perThreadStatsArray[idx];
+ delete[] perThreadStatsArray;
+
+}
+
+namespace {
+ const string NAME("name");
+ const string TYPE("type");
+ const string ACCESS("access");
+ const string INDEX("index");
+ const string OPTIONAL("optional");
+ const string UNIT("unit");
+ const string MIN("min");
+ const string MAX("max");
+ const string MAXLEN("maxlen");
+ const string DESC("desc");
+ const string ARGCOUNT("argCount");
+ const string ARGS("args");
+ const string DIR("dir");
+ const string DEFAULT("default");
+}
+
+void Store::registerClass(ManagementAgent* agent)
+{
+ agent->RegisterClass(packageName, className, md5Sum, writeSchema);
+}
+
+void Store::writeSchema (Buffer& buf)
+{
+ FieldTable ft;
+
+ // Schema class header:
+ buf.putShortString (packageName); // Package Name
+ buf.putShortString (className); // Class Name
+ buf.putBin128 (md5Sum); // Schema Hash
+ buf.putShort (11); // Config Element Count
+ buf.putShort (9); // Inst Element Count
+ buf.putShort (0); // Method Count
+ buf.putShort (0); // Event Count
+
+ // Properties
+ ft = FieldTable ();
+ ft.setString (NAME, "brokerRef");
+ ft.setInt (TYPE, TYPE_REF);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 1);
+ ft.setInt (OPTIONAL, 0);
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "location");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (DESC, "Logical directory on disk");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "defaultInitialFileCount");
+ ft.setInt (TYPE, TYPE_U16);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Default number of files initially allocated to each journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "defaultDataFileSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "RdPg");
+ ft.setString (DESC, "Default size of each journal data file");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplIsInitialized");
+ ft.setInt (TYPE, TYPE_BOOL);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (DESC, "Transaction prepared list has been initialized by a transactional prepare");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplDirectory");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (DESC, "Transaction prepared list directory");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplWritePageSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "byte");
+ ft.setString (DESC, "Page size in transaction prepared list write-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplWritePages");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "wpage");
+ ft.setString (DESC, "Number of pages in transaction prepared list write-page-cache");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplInitialFileCount");
+ ft.setInt (TYPE, TYPE_U16);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files initially allocated to transaction prepared list journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplDataFileSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "byte");
+ ft.setString (DESC, "Size of each journal data file in transaction prepared list journal");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplCurrentFileCount");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (INDEX, 0);
+ ft.setInt (OPTIONAL, 0);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Number of files currently allocated to transaction prepared list journal");
+ buf.put (ft);
+
+
+ // Statistics
+ ft = FieldTable ();
+ ft.setString (NAME, "tplTransactionDepth");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "txn");
+ ft.setString (DESC, "Number of currently enqueued prepared transactions");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplTransactionDepthHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "txn");
+ ft.setString (DESC, "Number of currently enqueued prepared transactions (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplTransactionDepthLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "txn");
+ ft.setString (DESC, "Number of currently enqueued prepared transactions (Low)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplTxnPrepares");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Total transaction prepares on transaction prepared list");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplTxnCommits");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Total transaction commits on transaction prepared list");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplTxnAborts");
+ ft.setInt (TYPE, TYPE_U64);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Total transaction aborts on transaction prepared list");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplOutstandingAIOs");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "aio_op");
+ ft.setString (DESC, "Number of currently outstanding AIO requests in Async IO system");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplOutstandingAIOsHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "aio_op");
+ ft.setString (DESC, "Number of currently outstanding AIO requests in Async IO system (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "tplOutstandingAIOsLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "aio_op");
+ ft.setString (DESC, "Number of currently outstanding AIO requests in Async IO system (Low)");
+ buf.put (ft);
+
+
+ // Methods
+
+ // Events
+
+}
+
+
+void Store::aggregatePerThreadStats(struct PerThreadStats* totals)
+{
+ totals->tplTxnPrepares = 0;
+ totals->tplTxnCommits = 0;
+ totals->tplTxnAborts = 0;
+
+ for (int idx = 0; idx < maxThreads; idx++) {
+ struct PerThreadStats* threadStats = perThreadStatsArray[idx];
+ if (threadStats != 0) {
+ totals->tplTxnPrepares += threadStats->tplTxnPrepares;
+ totals->tplTxnCommits += threadStats->tplTxnCommits;
+ totals->tplTxnAborts += threadStats->tplTxnAborts;
+
+ }
+ }
+}
+
+
+void Store::writeProperties (Buffer& buf)
+{
+ sys::Mutex::ScopedLock mutex(accessLock);
+ configChanged = false;
+
+ writeTimestamps (buf);
+
+ brokerRef.encode(buf);
+ buf.putShortString(location);
+ buf.putShort(defaultInitialFileCount);
+ buf.putLong(defaultDataFileSize);
+ buf.putOctet(tplIsInitialized?1:0);
+ buf.putShortString(tplDirectory);
+ buf.putLong(tplWritePageSize);
+ buf.putLong(tplWritePages);
+ buf.putShort(tplInitialFileCount);
+ buf.putLong(tplDataFileSize);
+ buf.putLong(tplCurrentFileCount);
+
+}
+
+void Store::writeStatistics (Buffer& buf, bool skipHeaders)
+{
+ sys::Mutex::ScopedLock mutex(accessLock);
+ instChanged = false;
+
+
+ struct PerThreadStats totals;
+ aggregatePerThreadStats(&totals);
+
+
+ if (!skipHeaders)
+ writeTimestamps (buf);
+ buf.putLong(tplTransactionDepth);
+ buf.putLong(tplTransactionDepthHigh);
+ buf.putLong(tplTransactionDepthLow);
+ buf.putLongLong(totals.tplTxnPrepares);
+ buf.putLongLong(totals.tplTxnCommits);
+ buf.putLongLong(totals.tplTxnAborts);
+ buf.putLong(tplOutstandingAIOs);
+ buf.putLong(tplOutstandingAIOsHigh);
+ buf.putLong(tplOutstandingAIOsLow);
+
+
+ // Maintenance of hi-lo statistics
+ tplTransactionDepthHigh = tplTransactionDepth;
+ tplTransactionDepthLow = tplTransactionDepth;
+ tplOutstandingAIOsHigh = tplOutstandingAIOs;
+ tplOutstandingAIOsLow = tplOutstandingAIOs;
+
+
+}
+
+void Store::doMethod (string, Buffer&, Buffer& outBuf)
+{
+ Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
+
+ outBuf.putLong (status);
+ outBuf.putShortString (Manageable::StatusText (status));
+}
+
+
Added: store/trunk/cpp/lib/gen/Store.h
===================================================================
--- store/trunk/cpp/lib/gen/Store.h (rev 0)
+++ store/trunk/cpp/lib/gen/Store.h 2008-09-03 18:32:51 UTC (rev 2392)
@@ -0,0 +1,275 @@
+
+#ifndef _MANAGEMENT_STORE_
+#define _MANAGEMENT_STORE_
+
+//
+// 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.
+//
+
+// This source file was created by a code generator.
+// Please do not edit.
+
+#include "qpid/management/ManagementObject.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/framing/Uuid.h"
+
+namespace qpid {
+namespace management {
+
+class Store : public ManagementObject
+{
+ private:
+
+ static std::string packageName;
+ static std::string className;
+ static uint8_t md5Sum[16];
+
+
+ // Properties
+ ObjectId brokerRef;
+ std::string location;
+ uint16_t defaultInitialFileCount;
+ uint32_t defaultDataFileSize;
+ uint8_t tplIsInitialized;
+ std::string tplDirectory;
+ uint32_t tplWritePageSize;
+ uint32_t tplWritePages;
+ uint16_t tplInitialFileCount;
+ uint32_t tplDataFileSize;
+ uint32_t tplCurrentFileCount;
+
+ // Statistics
+ uint32_t tplTransactionDepth;
+ uint32_t tplTransactionDepthHigh;
+ uint32_t tplTransactionDepthLow;
+ uint32_t tplOutstandingAIOs;
+ uint32_t tplOutstandingAIOsHigh;
+ uint32_t tplOutstandingAIOsLow;
+
+
+ // Per-Thread Statistics
+ struct PerThreadStats {
+ uint64_t tplTxnPrepares;
+ uint64_t tplTxnCommits;
+ uint64_t tplTxnAborts;
+
+ };
+
+ struct PerThreadStats** perThreadStatsArray;
+
+ inline struct PerThreadStats* getThreadStats() {
+ int index = getThreadIndex();
+ struct PerThreadStats* threadStats = perThreadStatsArray[index];
+ if (threadStats == 0) {
+ threadStats = new(PerThreadStats);
+ perThreadStatsArray[index] = threadStats;
+ threadStats->tplTxnPrepares = 0;
+ threadStats->tplTxnCommits = 0;
+ threadStats->tplTxnAborts = 0;
+
+ }
+ return threadStats;
+ }
+
+ void aggregatePerThreadStats(struct PerThreadStats*);
+
+ // Private Methods
+ static void writeSchema (qpid::framing::Buffer& buf);
+ void writeProperties (qpid::framing::Buffer& buf);
+ void writeStatistics (qpid::framing::Buffer& buf,
+ bool skipHeaders = false);
+ void doMethod (std::string methodName,
+ qpid::framing::Buffer& inBuf,
+ qpid::framing::Buffer& outBuf);
+ writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; }
+
+ public:
+
+ Store (ManagementAgent* agent,
+ Manageable* coreObject, Manageable* _parent);
+ ~Store (void);
+
+
+
+ static void registerClass (ManagementAgent* agent);
+ std::string& getPackageName (void) { return packageName; }
+ std::string& getClassName (void) { return className; }
+ uint8_t* getMd5Sum (void) { return md5Sum; }
+
+ // Method IDs
+
+ // Accessor Methods
+ inline void set_brokerRef (ObjectId val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ brokerRef = val;
+ configChanged = true;
+ }
+ inline ObjectId& get_brokerRef() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return brokerRef;
+ }
+ inline void set_location (std::string val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ location = val;
+ configChanged = true;
+ }
+ inline std::string& get_location() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return location;
+ }
+ inline void set_defaultInitialFileCount (uint16_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ defaultInitialFileCount = val;
+ configChanged = true;
+ }
+ inline uint16_t& get_defaultInitialFileCount() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return defaultInitialFileCount;
+ }
+ inline void set_defaultDataFileSize (uint32_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ defaultDataFileSize = val;
+ configChanged = true;
+ }
+ inline uint32_t& get_defaultDataFileSize() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return defaultDataFileSize;
+ }
+ inline void set_tplIsInitialized (uint8_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ tplIsInitialized = val;
+ configChanged = true;
+ }
+ inline uint8_t& get_tplIsInitialized() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return tplIsInitialized;
+ }
+ inline void set_tplDirectory (std::string val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ tplDirectory = val;
+ configChanged = true;
+ }
+ inline std::string& get_tplDirectory() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return tplDirectory;
+ }
+ inline void set_tplWritePageSize (uint32_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ tplWritePageSize = val;
+ configChanged = true;
+ }
+ inline uint32_t& get_tplWritePageSize() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return tplWritePageSize;
+ }
+ inline void set_tplWritePages (uint32_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ tplWritePages = val;
+ configChanged = true;
+ }
+ inline uint32_t& get_tplWritePages() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return tplWritePages;
+ }
+ inline void set_tplInitialFileCount (uint16_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ tplInitialFileCount = val;
+ configChanged = true;
+ }
+ inline uint16_t& get_tplInitialFileCount() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return tplInitialFileCount;
+ }
+ inline void set_tplDataFileSize (uint32_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ tplDataFileSize = val;
+ configChanged = true;
+ }
+ inline uint32_t& get_tplDataFileSize() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return tplDataFileSize;
+ }
+ inline void set_tplCurrentFileCount (uint32_t val) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ tplCurrentFileCount = val;
+ configChanged = true;
+ }
+ inline uint32_t& get_tplCurrentFileCount() {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ return tplCurrentFileCount;
+ }
+ inline void inc_tplTransactionDepth (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ tplTransactionDepth += by;
+ if (tplTransactionDepthHigh < tplTransactionDepth)
+ tplTransactionDepthHigh = tplTransactionDepth;
+ instChanged = true;
+ }
+ inline void dec_tplTransactionDepth (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ tplTransactionDepth -= by;
+ if (tplTransactionDepthLow > tplTransactionDepth)
+ tplTransactionDepthLow = tplTransactionDepth;
+ instChanged = true;
+ }
+ inline void inc_tplTxnPrepares (uint64_t by = 1) {
+ getThreadStats()->tplTxnPrepares += by;
+ instChanged = true;
+ }
+ inline void dec_tplTxnPrepares (uint64_t by = 1) {
+ getThreadStats()->tplTxnPrepares -= by;
+ instChanged = true;
+ }
+ inline void inc_tplTxnCommits (uint64_t by = 1) {
+ getThreadStats()->tplTxnCommits += by;
+ instChanged = true;
+ }
+ inline void dec_tplTxnCommits (uint64_t by = 1) {
+ getThreadStats()->tplTxnCommits -= by;
+ instChanged = true;
+ }
+ inline void inc_tplTxnAborts (uint64_t by = 1) {
+ getThreadStats()->tplTxnAborts += by;
+ instChanged = true;
+ }
+ inline void dec_tplTxnAborts (uint64_t by = 1) {
+ getThreadStats()->tplTxnAborts -= by;
+ instChanged = true;
+ }
+ inline void inc_tplOutstandingAIOs (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ tplOutstandingAIOs += by;
+ if (tplOutstandingAIOsHigh < tplOutstandingAIOs)
+ tplOutstandingAIOsHigh = tplOutstandingAIOs;
+ instChanged = true;
+ }
+ inline void dec_tplOutstandingAIOs (uint32_t by = 1) {
+ sys::Mutex::ScopedLock mutex(accessLock);
+ tplOutstandingAIOs -= by;
+ if (tplOutstandingAIOsLow > tplOutstandingAIOs)
+ tplOutstandingAIOsLow = tplOutstandingAIOs;
+ instChanged = true;
+ }
+
+ // Event Methods
+
+};
+
+}}
+
+#endif /*!_MANAGEMENT_STORE_*/
Added: store/trunk/cpp/lib/qmf-schema.xml
===================================================================
--- store/trunk/cpp/lib/qmf-schema.xml (rev 0)
+++ store/trunk/cpp/lib/qmf-schema.xml 2008-09-03 18:32:51 UTC (rev 2392)
@@ -0,0 +1,64 @@
+<schema package="mrgstore">
+
+<!--
+ License Text
+-->
+ <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="dataFileSize" type="uint32" access="RO" unit="byte" desc="Size of each journal data file"/>
+ <property name="currentFileCount" type="uint32" access="RO" unit="file" desc="Number of files currently allocated to this journal"/>
+
+ <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="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>
+</schema>
Deleted: store/trunk/specs/management-schema.xml
===================================================================
--- store/trunk/specs/management-schema.xml 2008-09-03 16:31:20 UTC (rev 2391)
+++ store/trunk/specs/management-schema.xml 2008-09-03 18:32:51 UTC (rev 2392)
@@ -1,64 +0,0 @@
-<schema package="mrgstore">
-
-<!--
- License Text
--->
- <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="dataFileSize" type="uint32" access="RO" unit="byte" desc="Size of each journal data file"/>
- <property name="currentFileCount" type="uint32" access="RO" unit="file" desc="Number of files currently allocated to this journal"/>
-
- <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="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>
-</schema>
16 years, 6 months
rhmessaging commits: r2391 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-09-03 12:31:20 -0400 (Wed, 03 Sep 2008)
New Revision: 2391
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Removed duplicate AdProperty class
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-09-03 16:15:10 UTC (rev 2390)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-09-03 16:31:20 UTC (rev 2391)
@@ -105,11 +105,11 @@
self.cumin_model = cls.cumin_model
self.cumin_class = cls
- self.name = name
- self.writable = True
+ self.description = None
self.example = None
+ self.name = name
self.renderer = None
- self.description = None
+ self.writable = True
self.cumin_class.add_ad_property(self)
@@ -139,16 +139,6 @@
return value
-class AdProperty(object):
- def __init__(self, cls, name):
- self.cumin_model = cls.cumin_model
- self.cumin_class = cls
-
- self.name = name
- self.writable = True
-
- self.cumin_class.add_ad_property(self)
-
class CuminAction(object):
def __init__(self, cls, name):
self.cumin_model = cls.cumin_model
16 years, 6 months
rhmessaging commits: r2390 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-09-03 12:15:10 -0400 (Wed, 03 Sep 2008)
New Revision: 2390
Modified:
mgmt/trunk/cumin/python/cumin/job.py
mgmt/trunk/cumin/python/cumin/job.strings
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Modified the way job ads are viewed and edited.
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-09-03 16:13:28 UTC (rev 2389)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-09-03 16:15:10 UTC (rev 2390)
@@ -296,10 +296,10 @@
return self.frame.get_args(session)
def render_title(self, session, job):
- return "Ads"
+ return "Ad"
-class JobEditAds(CuminForm):
+class JobEditAds(CuminForm, CuminEditableProperties):
def __init__(self, app, name):
super(JobEditAds, self).__init__(app, name)
@@ -308,16 +308,55 @@
self.add_parameter(self.ads)
self.add_form_parameter(self.ads)
- # the widget that gets/saves the data and draws the form
- self.props = JobAdsEditor(app, "properties", self.ads)
- self.add_child(self.props)
+ self.__items = JobAdsSet(app, name)
+ self.add_child(self.__items)
+ self.props = CuminProperties(app, "properties")
+ #self.add_child(props)
+
def get_args(self, session):
return self.frame.get_args(session)
def render_title(self, session, job):
- return "Ads"
+ return "Ad"
+ def do_get_items(self, session, job):
+ cls = self.app.model.get_class_by_object(job)
+ ads = self.ads.get(session)
+ if len(ads):
+ keys = ads.keys()
+ keys.sort()
+ return [self.gen_item(x, ads[x]["value"], cls, dtype=ads[x]["type"], error=ads[x]) for x in keys]
+ else:
+ items = self.__items.do_get_items(session, job)
+ return [self.gen_item(x[0], x[1], cls) for x in items]
+
+ def gen_item(self, name, value, cls, dtype=None, error=None):
+ idict = dict()
+ ilist = list()
+ idict["name"] = name
+ idict["value"] = value
+ if dtype:
+ idict["type"] = dtype
+ if dtype == "number":
+ nval = convertStr(value)
+ if nval:
+ idict["value"] = nval
+ else:
+ idict["type"] = self.get_type(value)
+ if error:
+ if "error" in error:
+ idict["error"] = error["error"]
+
+ if name in cls.ad_properties_by_name:
+ idict["property"] = cls.ad_properties_by_name[name]
+ ilist.append(idict)
+ ilist.append(self.ads.path)
+ return ilist
+
+ def get_type(self, value):
+ return isinstance(value, int) and "number" or "string"
+
def process_submit(self, session, job):
ads = self.ads.get(session)
errors = False
@@ -346,10 +385,36 @@
self.ads.clear()
super(JobEditAds, self).process_cancel(session, job)
+class JobPropertyRenderer(TemplateRenderer):
+ def render_ad_title(self, session, prop):
+ return escape_amp(prop[0])
+
+ def render_ad_value(self, session, prop):
+ name, value, props = self.decode_props(prop)
+ if props and props.renderer:
+ value = props.renderer(session, value)
+ return escape_amp(value)
+
+ def render_ad_help(self, session, prop):
+ name, value, props = self.decode_props(prop)
+ if props and props.description:
+ return props.description
+
+ def decode_props(self, prop):
+ name = prop[0]
+ value = prop[1]
+ cls = prop[2]
+ if name in cls.ad_properties_by_name:
+ props = cls.ad_properties_by_name[name]
+ else:
+ props = None
+ return name, value, props
+
class JobAdsSet(PropertySet):
def __init__(self, app, name):
- super(JobAdsSet, self).__init__(app, name)
+ super(JobAdsSet, self).__init__(app, name, )
# self.got_data = False
+ self.item_renderer = JobPropertyRenderer(self, "ad_html")
def get_args(self, session):
return self.frame.get_args(session)
@@ -443,14 +508,11 @@
u'NumJobStarts': 0,
u'Out': u'/dev/null'}
+ cls = self.app.model.get_class_by_object(job)
keys = ads.keys()
keys.sort()
- return [[x, {"value":str(ads[x]),
- "type":self.get_type(ads[x])}] for x in keys]
+ return [[x, ads[x], cls] for x in keys]
- def get_type(self, value):
- return isinstance(value, int) and "number" or "string"
-
class JobAdsViewer(JobAdsSet):
def __init__(self, app, name):
super(JobAdsViewer, self).__init__(app, name)
@@ -459,35 +521,13 @@
return self.frame.get_args(session)
def do_get_items(self, session, job):
- items = super(JobAdsViewer, self).do_get_items(session, job)
- return [[item[0], item[1]["value"]] for item in items]
+ return super(JobAdsViewer, self).do_get_items(session, job)
- def render_edit_ads_link(self, session, job):
+ def render_edit_ads_url(self, session, job):
branch = session.branch()
self.frame.show_ads_edit(branch)
- return fmt_olink(branch, job, name="Edit Ads")
+ return branch.marshal()
-class JobAdsEditor(CuminEditableProperties):
- def __init__(self, app, name, params):
- super(JobAdsEditor, self).__init__(app, name, params)
-
- self.__items = JobAdsSet(app, name)
- self.add_child(self.__items)
-
- self.params = params
-
- def get_args(self, session):
- return self.frame.get_args(session)
-
- def do_get_items(self, session, job):
- ads = self.params.get(session)
- if len(ads):
- keys = ads.keys()
- keys.sort()
- return [[x, ads[x]] for x in keys]
- else:
- return self.__items.do_get_items(session, job)
-
class JobOutput(TabbedModeSet):
def __init__(self, app, name):
super(JobOutput, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/job.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.strings 2008-09-03 16:13:28 UTC (rev 2389)
+++ mgmt/trunk/cumin/python/cumin/job.strings 2008-09-03 16:15:10 UTC (rev 2390)
@@ -107,34 +107,35 @@
[JobAdsViewer.html]
+<ul class="actions">
+ <li><a class="nav" href="{edit_ads_url}">Edit Job Ad</a></li>
+</ul>
<table class="CuminDetails">
<tbody>
<tr>
<td>
- <h2>Ads</h2>
+ <h2>Ad</h2>
<table class="PropertySet">
<thead>
<tr>
- <th style="width: 50%;">Name</th>
- <th style="width: 50%;">Value</th>
+ <th style="width: 33%;">Name</th>
+ <th style="width: 33%;">Value</th>
+ <th style="width: 33%;"> </th>
</tr>
</thead>
<tbody>{items}</tbody>
</table>
</td>
- <td>
- <h2>Actions</h2>
- <ul class="ActionSet">
- <li>{edit_ads_link}</li>
- </ul>
- </td>
</tr>
</tbody>
</table>
+<ul class="actions">
+ <li><a class="nav" href="{edit_ads_url}">Edit Job Ad</a></li>
+</ul>
[JobAdsViewer.ad_html]
<tr>
- <th>{ad_title}</th><td>{ad_value}</td>
+ <th>{ad_title}</th><td>{ad_value}</td><td>{ad_help}</td>
</tr>
@@ -150,28 +151,27 @@
[JobEditAds.html]
<form id="{id}" class="mform editform" method="post" action="?">
+{help} {submit} {cancel}
+
<table class="CuminDetails">
<tbody>
<tr>
<td>
- <h2>Edit Job Ads</h2>
- {properties}
+ <h2>Edit Job Ad</h2>
+ <table class="PropertySet Editable">
+ <thead>
+ <tr>
+ <th style="width: 33%;">Name</th>
+ <th style="width: 33%;">Value</th>
+ <th style="width: 33%;"> </th>
+ </tr>
+ </thead>
+ <tbody>{items}</tbody>
+ </table>
</td>
- <td>
- <div class="inline_help">
- <h2>Actions</h2>
- {help}
- {submit}
- {cancel}
- <h2 class="legend">Legend</h2>
- <ul class="legend">
- <li><span class="edit_string">String input expected</span></li>
- <li><span class="edit_number">Numeric input expected</span></li>
- </ul>
- </div>
- </td>
</tr>
</tbody>
</table>
+{help} {submit} {cancel}
<div>{hidden_inputs}</div>
</form>
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-09-03 16:13:28 UTC (rev 2389)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-09-03 16:15:10 UTC (rev 2390)
@@ -274,44 +274,49 @@
class CuminEditableProperties(PropertySet):
+ def __init__(self, app, name):
+ self.item_renderer=EditablePropertyRenderer(self, "property_html")
+ super(CuminEditableProperties, self).__init__(app, name, item_renderer=self.item_renderer)
+
+class EditablePropertyRenderer(TemplateRenderer, Widget):
"""Display input fields for editing properties
Parent class needs to override do_get_items() and return a list of items.
Each item should be another list.
- item[0] should be the property name
- item[1] should be the a dict:
- item[1]["value"] is required and should be the value to edit
- item[1]["type"] is required and should be an input type <"number" | "string">
- item[1]["error"] is optional and should be the error text to display for that item
-
- The dict_param that is passed in should be a object derived from DictParameter.
- dict_param.path will be used to generate the input field name
+ item[0] should be the a dict:
+ item[0]["name"] is required and should be the display label
+ item[0]["value"] is required and should be the value to edit
+ item[0]["type"] is required and should be an input type <"number" | "string">
+ item[0]["error"] is optional and should be the error text to display for that item
+ item[0]["help"] is optional help to be displayed for the item
+ item[0]["writable"] is optional and assumed to be True if missing
+ item[1] should be a the path that will be prepended to the file names
"""
-
- def __init__(self, app, name, dict_param):
- self.item_renderer=EditablePropertyRenderer(self, "property_html", dict_param)
- super(CuminEditableProperties, self).__init__(app, name, item_renderer=self.item_renderer)
-
-class EditablePropertyRenderer(TemplateRenderer, Widget):
- def __init__(self, widget, template_key, dict_param):
+ def __init__(self, widget, template_key):
super(EditablePropertyRenderer, self).__init__(widget, template_key)
self.__bool_template = Template(self, "bool_html")
self.__string_template = Template(self, "string_html")
self.__bigstring_template = Template(self, "bigstring_html")
self.__number_template = Template(self, "number_html")
+ self.__readonly_template = Template(self, "readonly_html")
- self.dict_param = dict_param
-
def render_title(self, session, propval):
- title = propval[0]
+ title = propval[0]["name"]
return escape_amp(title)
def render_value(self, session, propval):
- value = propval[1]["value"]
- type = propval[1]["type"]
+ value = propval[0]["value"]
+ type = propval[0]["type"]
+ writable = True
+ property = "property" in propval[0] and propval[0]["property"] or None
+ if property:
+ writable = property.writable
+
writer = Writer()
- if type == "number":
+ if not writable:
+ self.__readonly_template.render(writer, session, propval)
+ elif type == "number":
self.__number_template.render(writer, session, propval)
else:
uvalue = value.upper()
@@ -327,34 +332,55 @@
def render_pname(self, session, propval):
return DictParameter.sep().join(
- (self.dict_param.path, escape_entity(propval[0]), "value"))
+ (propval[1], escape_entity(propval[0]["name"]), "value"))
def render_ptype_name(self, session, propval):
return DictParameter.sep().join(
- (self.dict_param.path, escape_entity(propval[0]), "type"))
+ (propval[1], escape_entity(propval[0]["name"]), "type"))
def render_ptype_value(self, session, propval):
- return propval[1]["type"]
+ return propval[0]["type"]
def render_val(self, session, propval):
+ value = self.get_val(session, propval)
+ return escape_entity(str(value))
+
+ def render_display_val(self, session, propval):
+ value = self.get_val(session, propval)
+ property = "property" in propval[0] and propval[0]["property"] or None
+ if property:
+ renderer = property.renderer
+ if renderer:
+ value = renderer(session, value)
+
+ return escape_amp(str(value))
+
+ def get_val(self, session, propval):
try:
- value = propval[1]["value"]
+ value = propval[0]["value"]
except KeyError:
value = ""
- return escape_entity(str(value))
-
+ return value
+
def render_error(self, session, propval):
- if "error" in propval[1]:
- return "<div class=\"error\">%s</div>" % propval[1]["error"]
+ if "error" in propval[0]:
+ return "<div class=\"error\">%s</div>" % propval[0]["error"]
+
+ def render_inline_help(self, session, propval):
+ property = "property" in propval[0] and propval[0]["property"] or None
+ if property:
+ example = property.example or ""
+ description = property.description or ""
+ return " ".join((example, description))
def render_false_selected(self, session, propval):
- return propval[1]["value"].upper() == "FALSE" and "checked=\"checked\"" or ""
+ return propval[0]["value"].upper() == "FALSE" and "checked=\"checked\"" or ""
def render_true_selected(self, session, propval):
- return propval[1]["value"].upper() == "TRUE" and "checked=\"checked\"" or ""
+ return propval[0]["value"].upper() == "TRUE" and "checked=\"checked\"" or ""
def render_edit_number_class(self, session, propval):
- return "error" in propval[1] and "numeric_error" or "edit_number"
+ return "error" in propval[0] and "numeric_error" or "edit_number"
class CuminProperties(PropertySet):
def get_args(self, session):
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2008-09-03 16:13:28 UTC (rev 2389)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2008-09-03 16:15:10 UTC (rev 2390)
@@ -317,6 +317,10 @@
div.inline_help span.numeric_error {
border: 1px dashed #FF0000;
}
+table.Editable span.edit_readonly {
+ background-color: #FFFFFF;
+ color: #444444;
+}
table.Editable input.edit_string,
table.Editable input.edit_number,
@@ -349,6 +353,13 @@
div.inline_help ul.legend li {
line-height: 1.75em;
}
+span.prop_example {
+ font-size: 0.9em;
+}
+span.prop_example:before {
+ content: "Example:";
+ padding-right: 0.25em;
+}
[CuminEditableProperties.html]
<table class="PropertySet Editable">
@@ -363,7 +374,7 @@
[CuminEditableProperties.property_html]
<tr>
- <th>{title}</th><td>{value}</td>
+ <th>{title}</th><td>{value}</td><td>{inline_help}</td>
</tr>
[EditablePropertyRenderer.bool_html]
@@ -383,6 +394,9 @@
<input class="{edit_number_class}" type="text" name="{pname}" value="{val}" />{error}
<input type="hidden" name="{ptype_name}" value="{ptype_value}"/>
+[EditablePropertyRenderer.readonly_html]
+<span class="edit_readonly">{display_val}</span><input type="hidden" name="{ptype_name}" value="{ptype_value}"/><input type="hidden" name="{pname}" value="{val}"/>
+
[StateSwitch.item_html]
<li>{item_link}</li>
16 years, 6 months
rhmessaging commits: r2389 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-09-03 12:13:28 -0400 (Wed, 03 Sep 2008)
New Revision: 2389
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Implemented Justin's suggestion for AdProperties
Added a few ad properties
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-09-03 13:27:06 UTC (rev 2388)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-09-03 16:13:28 UTC (rev 2389)
@@ -10,8 +10,8 @@
from util import *
from formats import *
from parameters import *
+from job import *
-
log = getLogger("cumin.model")
class CuminModel(object):
@@ -100,6 +100,19 @@
def show_main(self, session):
return self.app.main_page.show_main(session)
+class AdProperty(object):
+ def __init__(self, cls, name):
+ self.cumin_model = cls.cumin_model
+ self.cumin_class = cls
+
+ self.name = name
+ self.writable = True
+ self.example = None
+ self.renderer = None
+ self.description = None
+
+ self.cumin_class.add_ad_property(self)
+
class CuminProperty(object):
def __init__(self, cls, name):
self.cumin_model = cls.cumin_model
@@ -350,6 +363,8 @@
self.ad_properties_by_name = dict()
self.stats = list()
self.actions = list()
+ self.ad_properties = list()
+ self.ad_properties_by_name = dict()
self.cumin_model.add_class(self)
@@ -361,6 +376,10 @@
self.ad_properties.append(prop)
self.ad_properties_by_name[prop.name] = prop
+ def add_ad_property(self, prop):
+ self.ad_properties.append(prop)
+ self.ad_properties_by_name[prop.name] = prop
+
def add_stat(self, stat):
self.stats.append(stat)
setattr(self, stat.name, stat)
@@ -1458,6 +1477,20 @@
prop = AdProperty(self, "CondorVersion")
prop.writable = False
+ prop = AdProperty(self, "Owner")
+ prop.writable = False
+
+ prop = AdProperty(self, "Args")
+ prop.description = "Arguments passed to job Cmd"
+
+ prop = AdProperty(self, "BufferBlockSize")
+ prop.example = "<span class=\"prop_example\">32768</span>"
+
+ prop = self.JobStatusProperty(self, "JobStatus")
+ prop.writable = False
+ prop.renderer = prop.render_status
+ prop.description = "The current job status"
+
#prop = self.SchedulerProperty(self, "Scheduler")
#prop.title = "Scheduler"
#prop.summary = True
@@ -1532,6 +1565,10 @@
def show_object(self, session, job):
return self.cumin_model.show_main(session).show_job(session, job)
+ class JobStatusProperty(AdProperty):
+ def render_status(self, session, status):
+ return JobStatusInfo.get_status_string(status)
+
class SubmitterProperty(CuminProperty):
def value(self, session, job):
value = super(CuminJob.SubmitterProperty, self).value(session, job)
16 years, 6 months
rhmessaging commits: r2388 - in mgmt/trunk/mint: sql and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-09-03 09:27:06 -0400 (Wed, 03 Sep 2008)
New Revision: 2388
Modified:
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/sql/schema.sql
Log:
Schema updated from mattf's changes
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2008-09-02 21:51:55 UTC (rev 2387)
+++ mgmt/trunk/mint/python/mint/schema.py 2008-09-03 13:27:06 UTC (rev 2388)
@@ -13,6 +13,7 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('SystemStats', cascade='null', default=None)
statsPrev = ForeignKey('SystemStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
systemId = BLOBCol(default=None)
osName = StringCol(length=1000, default=None)
nodeName = StringCol(length=1000, default=None)
@@ -20,7 +21,6 @@
version = StringCol(length=1000, default=None)
machine = StringCol(length=1000, default=None)
- classInfos = dict() # brokerId => classInfo
class SystemStats(SQLObject):
class sqlmeta:
@@ -29,11 +29,11 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
system = ForeignKey('System', cascade='null', default=None)
-
classInfos = dict() # brokerId => classInfo
+
class Broker(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -45,6 +45,7 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('BrokerStats', cascade='null', default=None)
statsPrev = ForeignKey('BrokerStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
system = ForeignKey('System', cascade='null', default=None)
port = IntCol(default=None)
workerThreads = SmallIntCol(default=None)
@@ -56,7 +57,6 @@
version = StringCol(length=1000, default=None)
dataDir = StringCol(length=1000, default=None)
- classInfos = dict() # brokerId => classInfo
def joinCluster(self, model, callback, clusterName):
actualArgs = dict()
@@ -105,11 +105,11 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
broker = ForeignKey('Broker', cascade='null', default=None)
-
classInfos = dict() # brokerId => classInfo
+
class Agent(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -121,13 +121,13 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('AgentStats', cascade='null', default=None)
statsPrev = ForeignKey('AgentStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
clientConnection = ForeignKey('ClientConnection', cascade='null', default=None)
label = StringCol(length=1000, default=None)
registeredTo = BigIntCol(default=None)
systemId = BLOBCol(default=None)
objectIdBank = IntCol(default=None)
- classInfos = dict() # brokerId => classInfo
class AgentStats(SQLObject):
class sqlmeta:
@@ -136,11 +136,11 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
agent = ForeignKey('Agent', cascade='null', default=None)
-
classInfos = dict() # brokerId => classInfo
+
class Vhost(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -152,10 +152,10 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('VhostStats', cascade='null', default=None)
statsPrev = ForeignKey('VhostStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
broker = ForeignKey('Broker', cascade='null', default=None)
name = StringCol(length=1000, default=None)
- classInfos = dict() # brokerId => classInfo
class VhostStats(SQLObject):
class sqlmeta:
@@ -164,11 +164,11 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
vhost = ForeignKey('Vhost', cascade='null', default=None)
-
classInfos = dict() # brokerId => classInfo
+
class Queue(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -180,6 +180,7 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('QueueStats', cascade='null', default=None)
statsPrev = ForeignKey('QueueStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
vhost = ForeignKey('Vhost', cascade='null', default=None)
name = StringCol(length=1000, default=None)
durable = BoolCol(default=None)
@@ -187,7 +188,6 @@
exclusive = BoolCol(default=None)
arguments = StringCol(default=None)
- classInfos = dict() # brokerId => classInfo
def purge(self, model, callback, request):
"""Discard all or some messages on a queue"""
@@ -205,6 +205,7 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
queue = ForeignKey('Queue', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
msgTotalEnqueues = BigIntCol(default=None)
msgTotalDequeues = BigIntCol(default=None)
msgTxnEnqueues = BigIntCol(default=None)
@@ -241,7 +242,6 @@
messageLatencyAverage = BigIntCol(default=None)
messageLatencySamples = BigIntCol(default=None)
- classInfos = dict() # brokerId => classInfo
@@ -256,12 +256,12 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('ExchangeStats', cascade='null', default=None)
statsPrev = ForeignKey('ExchangeStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
vhost = ForeignKey('Vhost', cascade='null', default=None)
name = StringCol(length=1000, default=None)
type = StringCol(length=1000, default=None)
durable = BoolCol(default=None)
- classInfos = dict() # brokerId => classInfo
class ExchangeStats(SQLObject):
class sqlmeta:
@@ -270,6 +270,7 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
exchange = ForeignKey('Exchange', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
producerCount = IntCol(default=None)
producerCountLow = IntCol(default=None)
producerCountHigh = IntCol(default=None)
@@ -283,7 +284,6 @@
byteDrops = BigIntCol(default=None)
byteRoutes = BigIntCol(default=None)
- classInfos = dict() # brokerId => classInfo
@@ -298,12 +298,12 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('BindingStats', cascade='null', default=None)
statsPrev = ForeignKey('BindingStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
exchange = ForeignKey('Exchange', cascade='null', default=None)
queue = ForeignKey('Queue', cascade='null', default=None)
bindingKey = StringCol(length=1000, default=None)
arguments = StringCol(default=None)
- classInfos = dict() # brokerId => classInfo
class BindingStats(SQLObject):
class sqlmeta:
@@ -312,9 +312,9 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
binding = ForeignKey('Binding', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
msgMatched = BigIntCol(default=None)
- classInfos = dict() # brokerId => classInfo
@@ -329,11 +329,11 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('ClientConnectionStats', cascade='null', default=None)
statsPrev = ForeignKey('ClientConnectionStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
vhost = ForeignKey('Vhost', cascade='null', default=None)
address = StringCol(length=1000, default=None)
incoming = BoolCol(default=None)
- classInfos = dict() # brokerId => classInfo
def close(self, model, callback):
actualArgs = dict()
@@ -349,6 +349,7 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
clientConnection = ForeignKey('ClientConnection', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
closing = BoolCol(default=None)
authIdentity = StringCol(length=1000, default=None)
framesFromClient = BigIntCol(default=None)
@@ -356,7 +357,6 @@
bytesFromClient = BigIntCol(default=None)
bytesToClient = BigIntCol(default=None)
- classInfos = dict() # brokerId => classInfo
@@ -371,13 +371,13 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('LinkStats', cascade='null', default=None)
statsPrev = ForeignKey('LinkStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
vhost = ForeignKey('Vhost', cascade='null', default=None)
host = StringCol(length=1000, default=None)
port = IntCol(default=None)
useSsl = BoolCol(default=None)
durable = BoolCol(default=None)
- classInfos = dict() # brokerId => classInfo
def close(self, model, callback):
actualArgs = dict()
@@ -409,10 +409,10 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
link = ForeignKey('Link', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
state = StringCol(length=1000, default=None)
lastError = StringCol(length=1000, default=None)
- classInfos = dict() # brokerId => classInfo
@@ -427,6 +427,7 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('BridgeStats', cascade='null', default=None)
statsPrev = ForeignKey('BridgeStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
link = ForeignKey('Link', cascade='null', default=None)
channelId = SmallIntCol(default=None)
durable = BoolCol(default=None)
@@ -438,7 +439,6 @@
tag = StringCol(length=1000, default=None)
excludes = StringCol(length=1000, default=None)
- classInfos = dict() # brokerId => classInfo
def close(self, model, callback):
actualArgs = dict()
@@ -454,11 +454,11 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
bridge = ForeignKey('Bridge', cascade='null', default=None)
-
classInfos = dict() # brokerId => classInfo
+
class Session(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -470,13 +470,13 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('SessionStats', cascade='null', default=None)
statsPrev = ForeignKey('SessionStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
vhost = ForeignKey('Vhost', cascade='null', default=None)
name = StringCol(length=1000, default=None)
channelId = SmallIntCol(default=None)
clientConnection = ForeignKey('ClientConnection', cascade='null', default=None)
detachedLifespan = IntCol(default=None)
- classInfos = dict() # brokerId => classInfo
def solicitAck(self, model, callback):
actualArgs = dict()
@@ -513,11 +513,11 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
session = ForeignKey('Session', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
attached = BoolCol(default=None)
expireTime = BigIntCol(default=None)
framesOutstanding = IntCol(default=None)
- classInfos = dict() # brokerId => classInfo
@@ -532,6 +532,7 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('StoreStats', cascade='null', default=None)
statsPrev = ForeignKey('StoreStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
broker = ForeignKey('Broker', cascade='null', default=None)
location = StringCol(length=1000, default=None)
defaultInitialFileCount = SmallIntCol(default=None)
@@ -544,7 +545,6 @@
tplDataFileSize = IntCol(default=None)
tplCurrentFileCount = IntCol(default=None)
- classInfos = dict() # brokerId => classInfo
class StoreStats(SQLObject):
class sqlmeta:
@@ -553,6 +553,7 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
store = ForeignKey('Store', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
tplTransactionDepth = IntCol(default=None)
tplTransactionDepthLow = IntCol(default=None)
tplTransactionDepthHigh = IntCol(default=None)
@@ -563,7 +564,6 @@
tplOutstandingAIOsLow = IntCol(default=None)
tplOutstandingAIOsHigh = IntCol(default=None)
- classInfos = dict() # brokerId => classInfo
@@ -578,6 +578,7 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('JournalStats', cascade='null', default=None)
statsPrev = ForeignKey('JournalStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
queue = ForeignKey('Queue', cascade='null', default=None)
name = StringCol(length=1000, default=None)
directory = StringCol(length=1000, default=None)
@@ -590,7 +591,6 @@
dataFileSize = IntCol(default=None)
currentFileCount = IntCol(default=None)
- classInfos = dict() # brokerId => classInfo
def expand(self, model, callback, by):
"""Increase number of files allocated for this journal"""
@@ -608,6 +608,7 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
journal = ForeignKey('Journal', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
recordDepth = IntCol(default=None)
recordDepthLow = IntCol(default=None)
recordDepthHigh = IntCol(default=None)
@@ -637,7 +638,6 @@
readPageCacheDepthLow = IntCol(default=None)
readPageCacheDepthHigh = IntCol(default=None)
- classInfos = dict() # brokerId => classInfo
@@ -652,6 +652,7 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('SlotStats', cascade='null', default=None)
statsPrev = ForeignKey('SlotStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
AccountingGroup = StringCol(length=1000, default=None)
Arch = StringCol(length=1000, default=None)
CheckpointPlatform = StringCol(length=1000, default=None)
@@ -699,8 +700,11 @@
WindowsMajorVersion = IntCol(default=None)
WindowsMinorVersion = IntCol(default=None)
- classInfos = dict() # brokerId => classInfo
+ CondorPlatform = StringCol(length=1000, default=None)
+ CondorVersion = StringCol(length=1000, default=None)
+ DaemonStartTime = BigIntCol(default=None)
+
class SlotStats(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -708,6 +712,7 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
slot = ForeignKey('Slot', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
Activity = StringCol(length=1000, default=None)
ClockDay = IntCol(default=None)
ClockMin = IntCol(default=None)
@@ -741,10 +746,16 @@
TotalTimeUnclaimedBenchmarking = IntCol(default=None)
TotalTimeUnclaimedIdle = IntCol(default=None)
- classInfos = dict() # brokerId => classInfo
+ MonitorSelfAge = IntCol(default=None)
+ MonitorSelfCPUUsage = FloatCol(default=None)
+ MonitorSelfImageSize = FloatCol(default=None)
+ MonitorSelfRegisteredSocketCount = IntCol(default=None)
+ MonitorSelfResidentSetSize = IntCol(default=None)
+ MonitorSelfTime = BigIntCol(default=None)
+
class Job(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -756,6 +767,7 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('JobStats', cascade='null', default=None)
statsPrev = ForeignKey('JobStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
scheduler = ForeignKey('Scheduler', cascade='null', default=None)
AccountingGroup = StringCol(length=1000, default=None)
Args = StringCol(length=4000, default=None)
@@ -779,7 +791,6 @@
UserLog = StringCol(length=4000, default=None)
HoldReason = StringCol(length=4000, default=None)
- classInfos = dict() # brokerId => classInfo
def GetAd(self, model, callback, JobAd):
actualArgs = dict()
@@ -796,11 +807,11 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
job = ForeignKey('Job', cascade='null', default=None)
-
classInfos = dict() # brokerId => classInfo
+
class Scheduler(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -812,6 +823,7 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('SchedulerStats', cascade='null', default=None)
statsPrev = ForeignKey('SchedulerStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
JobQueueBirthdate = BigIntCol(default=None)
MaxJobsRunning = IntCol(default=None)
Machine = StringCol(length=1000, default=None)
@@ -819,8 +831,11 @@
Name = StringCol(length=1000, default=None)
PublicNetworkIpAddr = StringCol(length=1000, default=None)
- classInfos = dict() # brokerId => classInfo
+ CondorPlatform = StringCol(length=1000, default=None)
+ CondorVersion = StringCol(length=1000, default=None)
+ DaemonStartTime = BigIntCol(default=None)
+
class SchedulerStats(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -828,6 +843,7 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
scheduler = ForeignKey('Scheduler', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
NumUsers = IntCol(default=None)
TotalHeldJobs = IntCol(default=None)
TotalIdleJobs = IntCol(default=None)
@@ -835,10 +851,16 @@
TotalRemovedJobs = IntCol(default=None)
TotalRunningJobs = IntCol(default=None)
- classInfos = dict() # brokerId => classInfo
+ MonitorSelfAge = IntCol(default=None)
+ MonitorSelfCPUUsage = FloatCol(default=None)
+ MonitorSelfImageSize = FloatCol(default=None)
+ MonitorSelfRegisteredSocketCount = IntCol(default=None)
+ MonitorSelfResidentSetSize = IntCol(default=None)
+ MonitorSelfTime = BigIntCol(default=None)
+
class Submitter(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -850,13 +872,13 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('SubmitterStats', cascade='null', default=None)
statsPrev = ForeignKey('SubmitterStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
scheduler = ForeignKey('Scheduler', cascade='null', default=None)
JobQueueBirthdate = IntCol(default=None)
Machine = StringCol(length=1000, default=None)
Name = StringCol(length=1000, default=None)
ScheddName = StringCol(length=1000, default=None)
- classInfos = dict() # brokerId => classInfo
class SubmitterStats(SQLObject):
class sqlmeta:
@@ -865,11 +887,11 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
submitter = ForeignKey('Submitter', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
HeldJobs = IntCol(default=None)
IdleJobs = IntCol(default=None)
RunningJobs = IntCol(default=None)
- classInfos = dict() # brokerId => classInfo
Modified: mgmt/trunk/mint/sql/schema.sql
===================================================================
--- mgmt/trunk/mint/sql/schema.sql 2008-09-02 21:51:55 UTC (rev 2387)
+++ mgmt/trunk/mint/sql/schema.sql 2008-09-03 13:27:06 UTC (rev 2388)
@@ -415,7 +415,10 @@
machine VARCHAR(1000),
my_address VARCHAR(1000),
name VARCHAR(1000),
- public_network_ip_addr VARCHAR(1000)
+ public_network_ip_addr VARCHAR(1000),
+ condor_platform VARCHAR(1000),
+ condor_version VARCHAR(1000),
+ daemon_start_time BIGINT
);
CREATE TABLE scheduler_stats (
@@ -428,7 +431,13 @@
total_idle_jobs INT,
total_job_ads INT,
total_removed_jobs INT,
- total_running_jobs INT
+ total_running_jobs INT,
+ monitor_self_age INT,
+ monitor_self_cpu_usage FLOAT,
+ monitor_self_image_size FLOAT,
+ monitor_self_registered_socket_count INT,
+ monitor_self_resident_set_size INT,
+ monitor_self_time BIGINT
);
CREATE TABLE session (
@@ -511,7 +520,10 @@
virtual_memory INT,
windows_build_number INT,
windows_major_version INT,
- windows_minor_version INT
+ windows_minor_version INT,
+ condor_platform VARCHAR(1000),
+ condor_version VARCHAR(1000),
+ daemon_start_time BIGINT
);
CREATE TABLE slot_stats (
@@ -550,7 +562,13 @@
total_time_preempting_killing INT,
total_time_preempting_vacating INT,
total_time_unclaimed_benchmarking INT,
- total_time_unclaimed_idle INT
+ total_time_unclaimed_idle INT,
+ monitor_self_age INT,
+ monitor_self_cpu_usage FLOAT,
+ monitor_self_image_size FLOAT,
+ monitor_self_registered_socket_count INT,
+ monitor_self_resident_set_size INT,
+ monitor_self_time BIGINT
);
CREATE TABLE store (
16 years, 6 months
rhmessaging commits: r2387 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-09-02 17:51:55 -0400 (Tue, 02 Sep 2008)
New Revision: 2387
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Add an AdProperty model object for describing condor ad props
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-09-02 21:14:21 UTC (rev 2386)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-09-02 21:51:55 UTC (rev 2387)
@@ -42,9 +42,9 @@
CuminScheduler(self)
CuminSubmitter(self)
+ CuminJob(self)
CuminPool(self)
- CuminJob(self)
# Systems
@@ -126,6 +126,16 @@
return value
+class AdProperty(object):
+ def __init__(self, cls, name):
+ self.cumin_model = cls.cumin_model
+ self.cumin_class = cls
+
+ self.name = name
+ self.writable = True
+
+ self.cumin_class.add_ad_property(self)
+
class CuminAction(object):
def __init__(self, cls, name):
self.cumin_model = cls.cumin_model
@@ -336,6 +346,8 @@
self.mint_class = mint_class
self.properties = list()
+ self.ad_properties = list()
+ self.ad_properties_by_name = dict()
self.stats = list()
self.actions = list()
@@ -344,6 +356,10 @@
def add_property(self, prop):
self.properties.append(prop)
setattr(self, prop.name, prop)
+
+ def add_ad_property(self, prop):
+ self.ad_properties.append(prop)
+ self.ad_properties_by_name[prop.name] = prop
def add_stat(self, stat):
self.stats.append(stat)
@@ -1439,6 +1455,9 @@
prop.title = "Group"
prop.summary = True
+ prop = AdProperty(self, "CondorVersion")
+ prop.writable = False
+
#prop = self.SchedulerProperty(self, "Scheduler")
#prop.title = "Scheduler"
#prop.summary = True
16 years, 6 months
rhmessaging commits: r2386 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-09-02 17:14:21 -0400 (Tue, 02 Sep 2008)
New Revision: 2386
Modified:
mgmt/trunk/mint/python/mint/schemaparser.py
Log:
support groups in xml schema
Modified: mgmt/trunk/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/trunk/mint/python/mint/schemaparser.py 2008-09-02 20:09:10 UTC (rev 2385)
+++ mgmt/trunk/mint/python/mint/schemaparser.py 2008-09-02 21:14:21 UTC (rev 2386)
@@ -13,6 +13,7 @@
self.currentClass = ""
self.pythonOutput = ""
self.finalPythonOutput = ""
+ self.groups = dict()
# mapping between xml schema types and database column types
# see xml/MintTypes.xml
self.dataTypesMap = dict()
@@ -115,9 +116,7 @@
elif (elem["@type"] == "lstr" or elem["@type"] == "ftable"):
args += "length=4000"
self.generateAttrib(self.attrNameFromDbColumn(elemName), self.dataTypesMap[elem["@type"]], args)
-
self.pythonOutput += "\n"
- self.pythonOutput += " classInfos = dict() # brokerId => classInfo\n"
def startClass(self, schemaName, stats=False):
schemaName = self.renameReservedWord(schemaName)
@@ -145,6 +144,7 @@
self.generateForeignKeyAttrib("statsPrev", statsPythonName)
self.finalPythonOutput += "classToSchemaNameMap['%s'] = '%s'\n" % (pythonName, schemaName)
self.finalPythonOutput += "schemaNameToClassMap['%s'] = %s\n" % (schemaName, pythonName)
+ self.pythonOutput += " classInfos = dict() # brokerId => classInfo\n"
def generateMethod(self, elem):
if (elem["@desc"] != None):
@@ -185,15 +185,28 @@
outputFile = open(self.pythonFilePath, "w")
for xmlFile in self.xmlFilePaths:
schema = mllib.xml_parse(xmlFile)
+ # parse groups and store their structure as is
+ groups = schema.query["schema/group"]
+ for grp in groups:
+ self.groups[grp["@name"]] = grp.query["property"], grp.query["statistic"]
+
+ # parse class definitions
classes = schema.query["schema/class"]
for cls in classes:
self.startClass(cls["@name"])
self.generateClassAttribs(cls["@name"], cls.query["property"])
+ # generate properties attribs from any groups included in this class
+ for clsGroup in cls.query["group"]:
+ self.generateClassAttribs(cls["@name"], self.groups[clsGroup["@name"]][0])
for elem in cls.query["method"]:
self.generateMethod(elem)
self.endClass()
+
self.startClass(cls["@name"], stats=True)
self.generateClassAttribs(cls["@name"], cls.query["statistic"])
+ # generate statistics attribs from any groups included in this class
+ for clsGroup in cls.query["group"]:
+ self.generateClassAttribs(cls["@name"], self.groups[clsGroup["@name"]][1])
self.endClass()
self.pythonOutput += "\n\n"
outputFile.write(self.pythonOutput + self.finalPythonOutput)
16 years, 6 months