Author: kpvdr
Date: 2009-03-23 10:51:38 -0400 (Mon, 23 Mar 2009)
New Revision: 3197
Added:
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.h
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/Makefile.am
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Package.cpp
store/trunk/cpp/lib/jrnl/wmgr.hpp
store/trunk/cpp/lib/qmf-schema.xml
Log:
Added management agent events for journal enqueue threshold exceeded and journal full;
also for journal create and recover events. Also added some auto-expand related management
and added transaction depth. Fixed some typos in the comments.
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2009-03-23 12:55:48 UTC (rev 3196)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2009-03-23 14:51:38 UTC (rev 3197)
@@ -28,6 +28,10 @@
#include "qpid/log/Statement.h"
#include "qpid/agent/ManagementAgent.h"
#include "qmf/com/redhat/rhm/store/ArgsJournalExpand.h"
+#include "qmf/com/redhat/rhm/store/EventCreated.h"
+#include "qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.h"
+#include "qmf/com/redhat/rhm/store/EventFull.h"
+#include "qmf/com/redhat/rhm/store/EventRecovered.h"
#include "qpid/sys/Monitor.h"
#include "StoreException.h"
@@ -70,11 +74,11 @@
journalTimerPtr->start();
journalTimerPtr->add(inactivityFireEventPtr);
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent != 0)
+ _agent = ManagementAgent::Singleton::getInstance();
+ if (_agent != 0)
{
_mgmtObject = new _qmf::Journal
- (agent, (qpid::management::Manageable*) this);
+ (_agent, (qpid::management::Manageable*) this);
_mgmtObject->set_name(journalId);
_mgmtObject->set_directory(journalDirectory);
@@ -89,7 +93,7 @@
_mgmtObject->set_writePageSize(0);
_mgmtObject->set_writePages(0);
- agent->addObject(_mgmtObject);
+ _agent->addObject(_mgmtObject);
}
log(LOG_NOTICE, "Created");
@@ -142,11 +146,16 @@
if (_mgmtObject != 0)
{
_mgmtObject->set_initialFileCount(_lpmgr.num_jfiles());
+ _mgmtObject->set_autoExpand(_lpmgr.is_ae());
+ _mgmtObject->set_currentFileCount(_lpmgr.num_jfiles());
+ _mgmtObject->set_maxFileCount(_lpmgr.ae_max_jfiles());
_mgmtObject->set_dataFileSize(_jfsize_sblks * JRNL_SBLK_SIZE *
JRNL_DBLK_SIZE);
- _mgmtObject->set_currentFileCount(_lpmgr.num_jfiles());
_mgmtObject->set_writePageSize(wcache_pgsize_sblks * JRNL_SBLK_SIZE *
JRNL_DBLK_SIZE);
_mgmtObject->set_writePages(wcache_num_pages);
}
+ if (_agent != 0)
+ _agent->raiseEvent(qmf::com::redhat::rhm::store::EventCreated(_jid,
_jfsize_sblks * JRNL_SBLK_SIZE * JRNL_DBLK_SIZE, _lpmgr.num_jfiles()),
+ qpid::management::ManagementAgent::SEV_NOTE);
}
void
@@ -171,8 +180,10 @@
if (_mgmtObject != 0)
{
_mgmtObject->set_initialFileCount(_lpmgr.num_jfiles());
+ _mgmtObject->set_autoExpand(_lpmgr.is_ae());
+ _mgmtObject->set_currentFileCount(_lpmgr.num_jfiles());
+ _mgmtObject->set_maxFileCount(_lpmgr.ae_max_jfiles());
_mgmtObject->set_dataFileSize(_jfsize_sblks * JRNL_SBLK_SIZE *
JRNL_DBLK_SIZE);
- _mgmtObject->set_currentFileCount(_lpmgr.num_jfiles());
_mgmtObject->set_writePageSize(wcache_pgsize_sblks * JRNL_SBLK_SIZE *
JRNL_DBLK_SIZE);
_mgmtObject->set_writePages(wcache_num_pages);
}
@@ -222,6 +233,7 @@
{
_mgmtObject->inc_recordDepth(_emap.size());
_mgmtObject->inc_enqueues(_emap.size());
+ _mgmtObject->inc_txn(_tmap.size());
_mgmtObject->inc_txnEnqueues(_tmap.enq_cnt());
_mgmtObject->inc_txnDequeues(_tmap.deq_cnt());
}
@@ -232,6 +244,9 @@
{
jcntl::recover_complete();
log(LOG_DEBUG, "Recover phase 2 complete; journal now writable.");
+ if (_agent != 0)
+ _agent->raiseEvent(qmf::com::redhat::rhm::store::EventRecovered(_jid,
_jfsize_sblks * JRNL_SBLK_SIZE * JRNL_DBLK_SIZE, _lpmgr.num_jfiles(),
+ _emap.size(), _tmap.size(), _tmap.enq_cnt(), _tmap.deq_cnt()),
qpid::management::ManagementAgent::SEV_NOTE);
}
#define MAX_AIO_SLEEPS 1000 // 10 sec
@@ -244,7 +259,7 @@
// Free any previous msg
free_read_buffers();
- // TODO: This is a brutal approach - very inefficient and slow. Rather intruduce
a system of remembering
+ // TODO: This is a brutal approach - very inefficient and slow. Rather introduce
a system of remembering
// jumpover points and allow the read to jump back to the first known jumpover
point - but this needs
// a mechanism in rrfc to accomplish it. Also helpful is a struct containing a
journal address - a
// combination of lid/offset.
@@ -346,10 +361,14 @@
JournalImpl::enqueue_txn_data_record(const void* const data_buff, const size_t
tot_data_len,
const size_t this_data_len, data_tok* dtokp, const std::string& xid, const
bool transient)
{
+ bool txn_incr = _mgmtObject != 0 ? _tmap.in_map(xid) : false;
+
handleIoResult(jcntl::enqueue_txn_data_record(data_buff, tot_data_len, this_data_len,
dtokp, xid, transient));
if (_mgmtObject != 0)
{
+ if (txn_incr)
+ _mgmtObject->inc_txn();
_mgmtObject->inc_enqueues();
_mgmtObject->inc_txnEnqueues();
_mgmtObject->inc_recordDepth();
@@ -360,10 +379,14 @@
JournalImpl::enqueue_extern_txn_data_record(const size_t tot_data_len, data_tok* dtokp,
const std::string& xid, const bool transient)
{
+ bool txn_incr = _mgmtObject != 0 ? _tmap.in_map(xid) : false;
+
handleIoResult(jcntl::enqueue_extern_txn_data_record(tot_data_len, dtokp, xid,
transient));
if (_mgmtObject != 0)
{
+ if (txn_incr)
+ _mgmtObject->inc_txn();
_mgmtObject->inc_enqueues();
_mgmtObject->inc_txnEnqueues();
_mgmtObject->inc_recordDepth();
@@ -402,7 +425,10 @@
handleIoResult(jcntl::txn_abort(dtokp, xid));
if (_mgmtObject != 0)
+ {
+ _mgmtObject->dec_txn();
_mgmtObject->inc_txnAborts();
+ }
}
void
@@ -411,7 +437,10 @@
handleIoResult(jcntl::txn_commit(dtokp, xid));
if (_mgmtObject != 0)
+ {
+ _mgmtObject->dec_txn();
_mgmtObject->inc_txnCommits();
+ }
}
void
@@ -536,6 +565,9 @@
std::ostringstream oss;
oss << "Enqueue capacity threshold exceeded on queue
\"" << _jid << "\".";
log(LOG_WARN, oss.str());
+ if (_agent != 0)
+
_agent->raiseEvent(qmf::com::redhat::rhm::store::EventEnqThresholdExceeded(_jid,
"Journal enqueue capacity threshold exceeded"),
+ qpid::management::ManagementAgent::SEV_WARN);
THROW_STORE_FULL_EXCEPTION(oss.str());
}
case mrg::journal::RHM_IORES_FULL:
@@ -543,6 +575,8 @@
std::ostringstream oss;
oss << "Journal full on queue \"" << _jid
<< "\".";
log(LOG_CRITICAL, oss.str());
+ if (_agent != 0)
+ _agent->raiseEvent(qmf::com::redhat::rhm::store::EventFull(_jid,
"Journal full"), qpid::management::ManagementAgent::SEV_ERROR);
THROW_STORE_FULL_EXCEPTION(oss.str());
}
default:
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2009-03-23 12:55:48 UTC (rev 3196)
+++ store/trunk/cpp/lib/JournalImpl.h 2009-03-23 14:51:38 UTC (rev 3197)
@@ -90,6 +90,8 @@
size_t _dlen;
journal::data_tok _dtok;
bool _external;
+
+ qpid::management::ManagementAgent* _agent;
qmf::com::redhat::rhm::store::Journal* _mgmtObject;
public:
Modified: store/trunk/cpp/lib/Makefile.am
===================================================================
--- store/trunk/cpp/lib/Makefile.am 2009-03-23 12:55:48 UTC (rev 3196)
+++ store/trunk/cpp/lib/Makefile.am 2009-03-23 14:51:38 UTC (rev 3197)
@@ -125,6 +125,14 @@
jrnl/txn_rec.hpp \
jrnl/wmgr.hpp \
jrnl/wrfc.hpp \
+ gen/qmf/com/redhat/rhm/store/EventCreated.cpp \
+ gen/qmf/com/redhat/rhm/store/EventCreated.h \
+ gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp \
+ gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.h \
+ gen/qmf/com/redhat/rhm/store/EventFull.cpp \
+ gen/qmf/com/redhat/rhm/store/EventFull.h \
+ gen/qmf/com/redhat/rhm/store/EventRecovered.cpp \
+ gen/qmf/com/redhat/rhm/store/EventRecovered.h \
gen/qmf/com/redhat/rhm/store/Package.cpp \
gen/qmf/com/redhat/rhm/store/Package.h \
gen/qmf/com/redhat/rhm/store/Journal.cpp \
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-03-23 12:55:48 UTC (rev 3196)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-03-23 14:51:38 UTC (rev 3197)
@@ -425,7 +425,7 @@
value = args.get("qpid.file_size");
if (value.get() != 0 && !value->empty() &&
value->convertsTo<int>())
localFileSizeSblks = (u_int32_t) value->get<int>() *
JRNL_RMGR_PAGE_SIZE;
-
+
if (queue.getName().size() == 0)
{
QPID_LOG(error, "Cannot create store for empty (null) queue name - ignoring
and attempting to continue.");
@@ -711,7 +711,7 @@
{
QPID_LOG(error, "Cannot recover empty (null) queue name - ignoring and
attempting to continue.");
break;
- }
+ }
{
qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
jQueue = new JournalImpl(queueName, getJrnlDir(queueName),
std::string("JournalData"), defJournalGetEventsTimeout,
defJournalFlushTimeout);
@@ -1056,7 +1056,7 @@
// another thread on one of the active queues by the time the
get_tdata_list() call below is made.
// Since reading the TPL is not considered a high-speed operation and is
used for recovery and other
// infrequent uses, the following try-catch will work as well as
attempting to lock down the
- // entire transaction map for this operation - but with less complixity.
+ // entire transaction map for this operation - but with less complexity.
try {
journal::txn_data_list txnList = tmap.get_tdata_list(xid);
unsigned enqCnt = 0;
Added: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.cpp
(rev 0)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.cpp 2009-03-23 14:51:38
UTC (rev 3197)
@@ -0,0 +1,103 @@
+
+//
+// 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 "EventCreated.h"
+
+using namespace qmf::com::redhat::rhm::store;
+using namespace qpid::framing;
+using qpid::management::ManagementAgent;
+using qpid::management::Manageable;
+using qpid::management::ManagementObject;
+using qpid::management::Args;
+using std::string;
+
+string EventCreated::packageName = string ("com.redhat.rhm.store");
+string EventCreated::eventName = string ("created");
+uint8_t EventCreated::md5Sum[16] =
+ {0x6f,0x7,0x35,0xf6,0xdc,0xa3,0x18,0x29,0x23,0xf0,0x19,0x61,0xcc,0xe7,0x1c,0x5b};
+
+EventCreated::EventCreated (const std::string& _jrnlId,
+ const uint32_t _fileSize,
+ const uint16_t _numFiles) :
+ jrnlId(_jrnlId),
+ fileSize(_fileSize),
+ numFiles(_numFiles)
+{}
+
+namespace {
+ const string NAME("name");
+ const string TYPE("type");
+ const string DESC("desc");
+ const string ARGCOUNT("argCount");
+ const string ARGS("args");
+}
+
+void EventCreated::registerSelf(ManagementAgent* agent)
+{
+ agent->registerEvent(packageName, eventName, md5Sum, writeSchema);
+}
+
+void EventCreated::writeSchema (Buffer& buf)
+{
+ FieldTable ft;
+
+ // Schema class header:
+ buf.putOctet (CLASS_KIND_EVENT);
+ buf.putShortString (packageName); // Package Name
+ buf.putShortString (eventName); // Event Name
+ buf.putBin128 (md5Sum); // Schema Hash
+ buf.putShort (3); // Argument Count
+
+ // Arguments
+ ft.clear();
+ ft.setString (NAME, "jrnlId");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setString (DESC, "Journal Id");
+ buf.put (ft);
+
+ ft.clear();
+ ft.setString (NAME, "fileSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (DESC, "Journal file size in bytes");
+ buf.put (ft);
+
+ ft.clear();
+ ft.setString (NAME, "numFiles");
+ ft.setInt (TYPE, TYPE_U16);
+ ft.setString (DESC, "Number of journal files");
+ buf.put (ft);
+
+
+}
+
+void EventCreated::encode(::qpid::framing::Buffer& buf) const
+{
+ buf.putShortString(jrnlId);
+ buf.putLong(fileSize);
+ buf.putShort(numFiles);
+
+}
Added: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.h
(rev 0)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventCreated.h 2009-03-23 14:51:38
UTC (rev 3197)
@@ -0,0 +1,69 @@
+
+#ifndef _MANAGEMENT_CREATED_
+#define _MANAGEMENT_CREATED_
+
+//
+// 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/ManagementEvent.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/framing/Uuid.h"
+
+namespace qmf {
+namespace com {
+namespace redhat {
+namespace rhm {
+namespace store {
+
+
+class EventCreated : public ::qpid::management::ManagementEvent
+{
+ private:
+ static void writeSchema (::qpid::framing::Buffer& buf);
+ static std::string packageName;
+ static std::string eventName;
+ static uint8_t md5Sum[16];
+
+ const std::string& jrnlId;
+ const uint32_t fileSize;
+ const uint16_t numFiles;
+
+
+ public:
+ writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; }
+
+ EventCreated(const std::string& _jrnlId,
+ const uint32_t _fileSize,
+ const uint16_t _numFiles);
+ ~EventCreated() {};
+
+ static void registerSelf(::qpid::management::ManagementAgent* agent);
+ std::string& getPackageName() const { return packageName; }
+ std::string& getEventName() const { return eventName; }
+ uint8_t* getMd5Sum() const { return md5Sum; }
+ uint8_t getSeverity() const { return 5; }
+ void encode(::qpid::framing::Buffer& buffer) const;
+};
+
+}}}}}
+
+#endif /*!_MANAGEMENT_CREATED_*/
Added: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp
(rev 0)
+++
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.cpp 2009-03-23
14:51:38 UTC (rev 3197)
@@ -0,0 +1,94 @@
+
+//
+// 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 "EventEnqThresholdExceeded.h"
+
+using namespace qmf::com::redhat::rhm::store;
+using namespace qpid::framing;
+using qpid::management::ManagementAgent;
+using qpid::management::Manageable;
+using qpid::management::ManagementObject;
+using qpid::management::Args;
+using std::string;
+
+string EventEnqThresholdExceeded::packageName = string
("com.redhat.rhm.store");
+string EventEnqThresholdExceeded::eventName = string
("enqThresholdExceeded");
+uint8_t EventEnqThresholdExceeded::md5Sum[16] =
+ {0x5b,0x1f,0xd4,0x87,0x9c,0xf6,0x1e,0xc3,0xdc,0x3e,0xc4,0x4,0x49,0xf3,0xa8,0xf3};
+
+EventEnqThresholdExceeded::EventEnqThresholdExceeded (const std::string& _jrnlId,
+ const std::string& _what) :
+ jrnlId(_jrnlId),
+ what(_what)
+{}
+
+namespace {
+ const string NAME("name");
+ const string TYPE("type");
+ const string DESC("desc");
+ const string ARGCOUNT("argCount");
+ const string ARGS("args");
+}
+
+void EventEnqThresholdExceeded::registerSelf(ManagementAgent* agent)
+{
+ agent->registerEvent(packageName, eventName, md5Sum, writeSchema);
+}
+
+void EventEnqThresholdExceeded::writeSchema (Buffer& buf)
+{
+ FieldTable ft;
+
+ // Schema class header:
+ buf.putOctet (CLASS_KIND_EVENT);
+ buf.putShortString (packageName); // Package Name
+ buf.putShortString (eventName); // Event Name
+ buf.putBin128 (md5Sum); // Schema Hash
+ buf.putShort (2); // Argument Count
+
+ // Arguments
+ ft.clear();
+ ft.setString (NAME, "jrnlId");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setString (DESC, "Journal Id");
+ buf.put (ft);
+
+ ft.clear();
+ ft.setString (NAME, "what");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setString (DESC, "Description of event");
+ buf.put (ft);
+
+
+}
+
+void EventEnqThresholdExceeded::encode(::qpid::framing::Buffer& buf) const
+{
+ buf.putShortString(jrnlId);
+ buf.putShortString(what);
+
+}
Added: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.h
(rev 0)
+++
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventEnqThresholdExceeded.h 2009-03-23
14:51:38 UTC (rev 3197)
@@ -0,0 +1,67 @@
+
+#ifndef _MANAGEMENT_ENQTHRESHOLDEXCEEDED_
+#define _MANAGEMENT_ENQTHRESHOLDEXCEEDED_
+
+//
+// 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/ManagementEvent.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/framing/Uuid.h"
+
+namespace qmf {
+namespace com {
+namespace redhat {
+namespace rhm {
+namespace store {
+
+
+class EventEnqThresholdExceeded : public ::qpid::management::ManagementEvent
+{
+ private:
+ static void writeSchema (::qpid::framing::Buffer& buf);
+ static std::string packageName;
+ static std::string eventName;
+ static uint8_t md5Sum[16];
+
+ const std::string& jrnlId;
+ const std::string& what;
+
+
+ public:
+ writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; }
+
+ EventEnqThresholdExceeded(const std::string& _jrnlId,
+ const std::string& _what);
+ ~EventEnqThresholdExceeded() {};
+
+ static void registerSelf(::qpid::management::ManagementAgent* agent);
+ std::string& getPackageName() const { return packageName; }
+ std::string& getEventName() const { return eventName; }
+ uint8_t* getMd5Sum() const { return md5Sum; }
+ uint8_t getSeverity() const { return 4; }
+ void encode(::qpid::framing::Buffer& buffer) const;
+};
+
+}}}}}
+
+#endif /*!_MANAGEMENT_ENQTHRESHOLDEXCEEDED_*/
Added: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.cpp
(rev 0)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.cpp 2009-03-23 14:51:38 UTC
(rev 3197)
@@ -0,0 +1,94 @@
+
+//
+// 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 "EventFull.h"
+
+using namespace qmf::com::redhat::rhm::store;
+using namespace qpid::framing;
+using qpid::management::ManagementAgent;
+using qpid::management::Manageable;
+using qpid::management::ManagementObject;
+using qpid::management::Args;
+using std::string;
+
+string EventFull::packageName = string ("com.redhat.rhm.store");
+string EventFull::eventName = string ("full");
+uint8_t EventFull::md5Sum[16] =
+ {0x23,0x4c,0x70,0xc1,0xb0,0xeb,0x4e,0x5d,0x72,0x37,0x56,0x60,0xc3,0x10,0x78,0x68};
+
+EventFull::EventFull (const std::string& _jrnlId,
+ const std::string& _what) :
+ jrnlId(_jrnlId),
+ what(_what)
+{}
+
+namespace {
+ const string NAME("name");
+ const string TYPE("type");
+ const string DESC("desc");
+ const string ARGCOUNT("argCount");
+ const string ARGS("args");
+}
+
+void EventFull::registerSelf(ManagementAgent* agent)
+{
+ agent->registerEvent(packageName, eventName, md5Sum, writeSchema);
+}
+
+void EventFull::writeSchema (Buffer& buf)
+{
+ FieldTable ft;
+
+ // Schema class header:
+ buf.putOctet (CLASS_KIND_EVENT);
+ buf.putShortString (packageName); // Package Name
+ buf.putShortString (eventName); // Event Name
+ buf.putBin128 (md5Sum); // Schema Hash
+ buf.putShort (2); // Argument Count
+
+ // Arguments
+ ft.clear();
+ ft.setString (NAME, "jrnlId");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setString (DESC, "Journal Id");
+ buf.put (ft);
+
+ ft.clear();
+ ft.setString (NAME, "what");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setString (DESC, "Description of event");
+ buf.put (ft);
+
+
+}
+
+void EventFull::encode(::qpid::framing::Buffer& buf) const
+{
+ buf.putShortString(jrnlId);
+ buf.putShortString(what);
+
+}
Added: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.h
(rev 0)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventFull.h 2009-03-23 14:51:38 UTC
(rev 3197)
@@ -0,0 +1,67 @@
+
+#ifndef _MANAGEMENT_FULL_
+#define _MANAGEMENT_FULL_
+
+//
+// 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/ManagementEvent.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/framing/Uuid.h"
+
+namespace qmf {
+namespace com {
+namespace redhat {
+namespace rhm {
+namespace store {
+
+
+class EventFull : public ::qpid::management::ManagementEvent
+{
+ private:
+ static void writeSchema (::qpid::framing::Buffer& buf);
+ static std::string packageName;
+ static std::string eventName;
+ static uint8_t md5Sum[16];
+
+ const std::string& jrnlId;
+ const std::string& what;
+
+
+ public:
+ writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; }
+
+ EventFull(const std::string& _jrnlId,
+ const std::string& _what);
+ ~EventFull() {};
+
+ static void registerSelf(::qpid::management::ManagementAgent* agent);
+ std::string& getPackageName() const { return packageName; }
+ std::string& getEventName() const { return eventName; }
+ uint8_t* getMd5Sum() const { return md5Sum; }
+ uint8_t getSeverity() const { return 3; }
+ void encode(::qpid::framing::Buffer& buffer) const;
+};
+
+}}}}}
+
+#endif /*!_MANAGEMENT_FULL_*/
Added: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.cpp
(rev 0)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.cpp 2009-03-23
14:51:38 UTC (rev 3197)
@@ -0,0 +1,139 @@
+
+//
+// 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 "EventRecovered.h"
+
+using namespace qmf::com::redhat::rhm::store;
+using namespace qpid::framing;
+using qpid::management::ManagementAgent;
+using qpid::management::Manageable;
+using qpid::management::ManagementObject;
+using qpid::management::Args;
+using std::string;
+
+string EventRecovered::packageName = string ("com.redhat.rhm.store");
+string EventRecovered::eventName = string ("recovered");
+uint8_t EventRecovered::md5Sum[16] =
+ {0x23,0x28,0x44,0x5a,0x72,0xb0,0x1e,0xda,0x7d,0xff,0x0,0x9,0x1,0x6d,0xa8,0xd4};
+
+EventRecovered::EventRecovered (const std::string& _jrnlId,
+ const uint32_t _fileSize,
+ const uint16_t _numFiles,
+ const uint32_t _numEnq,
+ const uint32_t _numTxn,
+ const uint32_t _numTxnEnq,
+ const uint32_t _numTxnDeq) :
+ jrnlId(_jrnlId),
+ fileSize(_fileSize),
+ numFiles(_numFiles),
+ numEnq(_numEnq),
+ numTxn(_numTxn),
+ numTxnEnq(_numTxnEnq),
+ numTxnDeq(_numTxnDeq)
+{}
+
+namespace {
+ const string NAME("name");
+ const string TYPE("type");
+ const string DESC("desc");
+ const string ARGCOUNT("argCount");
+ const string ARGS("args");
+}
+
+void EventRecovered::registerSelf(ManagementAgent* agent)
+{
+ agent->registerEvent(packageName, eventName, md5Sum, writeSchema);
+}
+
+void EventRecovered::writeSchema (Buffer& buf)
+{
+ FieldTable ft;
+
+ // Schema class header:
+ buf.putOctet (CLASS_KIND_EVENT);
+ buf.putShortString (packageName); // Package Name
+ buf.putShortString (eventName); // Event Name
+ buf.putBin128 (md5Sum); // Schema Hash
+ buf.putShort (7); // Argument Count
+
+ // Arguments
+ ft.clear();
+ ft.setString (NAME, "jrnlId");
+ ft.setInt (TYPE, TYPE_SSTR);
+ ft.setString (DESC, "Journal Id");
+ buf.put (ft);
+
+ ft.clear();
+ ft.setString (NAME, "fileSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (DESC, "Journal file size in bytes");
+ buf.put (ft);
+
+ ft.clear();
+ ft.setString (NAME, "numFiles");
+ ft.setInt (TYPE, TYPE_U16);
+ ft.setString (DESC, "Number of journal files");
+ buf.put (ft);
+
+ ft.clear();
+ ft.setString (NAME, "numEnq");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (DESC, "Number of recovered enqueues");
+ buf.put (ft);
+
+ ft.clear();
+ ft.setString (NAME, "numTxn");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (DESC, "Number of recovered transactions");
+ buf.put (ft);
+
+ ft.clear();
+ ft.setString (NAME, "numTxnEnq");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (DESC, "Number of recovered transactional enqueues");
+ buf.put (ft);
+
+ ft.clear();
+ ft.setString (NAME, "numTxnDeq");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (DESC, "Number of recovered transactional dequeues");
+ buf.put (ft);
+
+
+}
+
+void EventRecovered::encode(::qpid::framing::Buffer& buf) const
+{
+ buf.putShortString(jrnlId);
+ buf.putLong(fileSize);
+ buf.putShort(numFiles);
+ buf.putLong(numEnq);
+ buf.putLong(numTxn);
+ buf.putLong(numTxnEnq);
+ buf.putLong(numTxnDeq);
+
+}
Added: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.h
(rev 0)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/EventRecovered.h 2009-03-23 14:51:38
UTC (rev 3197)
@@ -0,0 +1,77 @@
+
+#ifndef _MANAGEMENT_RECOVERED_
+#define _MANAGEMENT_RECOVERED_
+
+//
+// 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/ManagementEvent.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/framing/Uuid.h"
+
+namespace qmf {
+namespace com {
+namespace redhat {
+namespace rhm {
+namespace store {
+
+
+class EventRecovered : public ::qpid::management::ManagementEvent
+{
+ private:
+ static void writeSchema (::qpid::framing::Buffer& buf);
+ static std::string packageName;
+ static std::string eventName;
+ static uint8_t md5Sum[16];
+
+ const std::string& jrnlId;
+ const uint32_t fileSize;
+ const uint16_t numFiles;
+ const uint32_t numEnq;
+ const uint32_t numTxn;
+ const uint32_t numTxnEnq;
+ const uint32_t numTxnDeq;
+
+
+ public:
+ writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; }
+
+ EventRecovered(const std::string& _jrnlId,
+ const uint32_t _fileSize,
+ const uint16_t _numFiles,
+ const uint32_t _numEnq,
+ const uint32_t _numTxn,
+ const uint32_t _numTxnEnq,
+ const uint32_t _numTxnDeq);
+ ~EventRecovered() {};
+
+ static void registerSelf(::qpid::management::ManagementAgent* agent);
+ std::string& getPackageName() const { return packageName; }
+ std::string& getEventName() const { return eventName; }
+ uint8_t* getMd5Sum() const { return md5Sum; }
+ uint8_t getSeverity() const { return 5; }
+ void encode(::qpid::framing::Buffer& buffer) const;
+};
+
+}}}}}
+
+#endif /*!_MANAGEMENT_RECOVERED_*/
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp 2009-03-23 12:55:48 UTC
(rev 3196)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp 2009-03-23 14:51:38 UTC
(rev 3197)
@@ -40,7 +40,7 @@
string Journal::packageName = string ("com.redhat.rhm.store");
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};
+ {0x9,0xc2,0xe2,0xfc,0xcc,0x2e,0x72,0xaa,0x3f,0xce,0x36,0x28,0xce,0x81,0xc,0xd4};
Journal::Journal (ManagementAgent* _agent, Manageable* _core) :
ManagementObject(_agent, _core)
@@ -55,8 +55,10 @@
readPageSize = 0;
readPages = 0;
initialFileCount = 0;
+ autoExpand = 0;
+ currentFileCount = 0;
+ maxFileCount = 0;
dataFileSize = 0;
- currentFileCount = 0;
recordDepth = 0;
recordDepthHigh = 0;
recordDepthLow = 0;
@@ -126,8 +128,8 @@
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 (13); // Config Element Count
+ buf.putShort (29); // Inst Element Count
buf.putShort (1); // Method Count
// Properties
@@ -216,18 +218,17 @@
buf.put (ft);
ft.clear();
- ft.setString (NAME, "dataFileSize");
- ft.setInt (TYPE, TYPE_U32);
+ ft.setString (NAME, "autoExpand");
+ ft.setInt (TYPE, TYPE_BOOL);
ft.setInt (ACCESS, ACCESS_RO);
ft.setInt (IS_INDEX, 0);
ft.setInt (IS_OPTIONAL, 0);
- ft.setString (UNIT, "byte");
- ft.setString (DESC, "Size of each journal data file");
+ ft.setString (DESC, "Auto-expand enabled");
buf.put (ft);
ft.clear();
ft.setString (NAME, "currentFileCount");
- ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (TYPE, TYPE_U16);
ft.setInt (ACCESS, ACCESS_RO);
ft.setInt (IS_INDEX, 0);
ft.setInt (IS_OPTIONAL, 0);
@@ -235,7 +236,27 @@
ft.setString (DESC, "Number of files currently allocated to this
journal");
buf.put (ft);
+ ft.clear();
+ ft.setString (NAME, "maxFileCount");
+ ft.setInt (TYPE, TYPE_U16);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (IS_INDEX, 0);
+ ft.setInt (IS_OPTIONAL, 0);
+ ft.setString (UNIT, "file");
+ ft.setString (DESC, "Max number of files allowed for this journal");
+ buf.put (ft);
+ ft.clear();
+ ft.setString (NAME, "dataFileSize");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setInt (ACCESS, ACCESS_RO);
+ ft.setInt (IS_INDEX, 0);
+ ft.setInt (IS_OPTIONAL, 0);
+ ft.setString (UNIT, "byte");
+ ft.setString (DESC, "Size of each journal data file");
+ buf.put (ft);
+
+
// Statistics
ft.clear();
ft.setString (NAME, "recordDepth");
@@ -273,6 +294,13 @@
buf.put (ft);
ft.clear();
+ ft.setString (NAME, "txn");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Total open transactions (xids) on journal");
+ buf.put (ft);
+
+ ft.clear();
ft.setString (NAME, "txnEnqueues");
ft.setInt (TYPE, TYPE_U64);
ft.setString (UNIT, "record");
@@ -456,6 +484,7 @@
{
totals->enqueues = 0;
totals->dequeues = 0;
+ totals->txn = 0;
totals->txnEnqueues = 0;
totals->txnDequeues = 0;
totals->txnCommits = 0;
@@ -470,6 +499,7 @@
if (threadStats != 0) {
totals->enqueues += threadStats->enqueues;
totals->dequeues += threadStats->dequeues;
+ totals->txn += threadStats->txn;
totals->txnEnqueues += threadStats->txnEnqueues;
totals->txnDequeues += threadStats->txnDequeues;
totals->txnCommits += threadStats->txnCommits;
@@ -500,8 +530,10 @@
buf.putLong(readPageSize);
buf.putLong(readPages);
buf.putShort(initialFileCount);
+ buf.putOctet(autoExpand?1:0);
+ buf.putShort(currentFileCount);
+ buf.putShort(maxFileCount);
buf.putLong(dataFileSize);
- buf.putLong(currentFileCount);
}
@@ -522,6 +554,7 @@
buf.putLong(recordDepthLow);
buf.putLongLong(totals.enqueues);
buf.putLongLong(totals.dequeues);
+ buf.putLong(totals.txn);
buf.putLongLong(totals.txnEnqueues);
buf.putLongLong(totals.txnDequeues);
buf.putLongLong(totals.txnCommits);
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h 2009-03-23 12:55:48 UTC
(rev 3196)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h 2009-03-23 14:51:38 UTC
(rev 3197)
@@ -54,8 +54,10 @@
uint32_t readPageSize;
uint32_t readPages;
uint16_t initialFileCount;
+ uint8_t autoExpand;
+ uint16_t currentFileCount;
+ uint16_t maxFileCount;
uint32_t dataFileSize;
- uint32_t currentFileCount;
// Statistics
uint32_t recordDepth;
@@ -82,6 +84,7 @@
struct PerThreadStats {
uint64_t enqueues;
uint64_t dequeues;
+ uint32_t txn;
uint64_t txnEnqueues;
uint64_t txnDequeues;
uint64_t txnCommits;
@@ -103,6 +106,7 @@
perThreadStatsArray[idx] = threadStats;
threadStats->enqueues = 0;
threadStats->dequeues = 0;
+ threadStats->txn = 0;
threadStats->txnEnqueues = 0;
threadStats->txnDequeues = 0;
threadStats->txnCommits = 0;
@@ -227,24 +231,42 @@
::qpid::sys::Mutex::ScopedLock mutex(accessLock);
return initialFileCount;
}
- inline void set_dataFileSize (uint32_t val) {
+ inline void set_autoExpand (uint8_t val) {
::qpid::sys::Mutex::ScopedLock mutex(accessLock);
- dataFileSize = val;
+ autoExpand = val;
configChanged = true;
}
- inline uint32_t get_dataFileSize() {
+ inline uint8_t get_autoExpand() {
::qpid::sys::Mutex::ScopedLock mutex(accessLock);
- return dataFileSize;
+ return autoExpand;
}
- inline void set_currentFileCount (uint32_t val) {
+ inline void set_currentFileCount (uint16_t val) {
::qpid::sys::Mutex::ScopedLock mutex(accessLock);
currentFileCount = val;
configChanged = true;
}
- inline uint32_t get_currentFileCount() {
+ inline uint16_t get_currentFileCount() {
::qpid::sys::Mutex::ScopedLock mutex(accessLock);
return currentFileCount;
}
+ inline void set_maxFileCount (uint16_t val) {
+ ::qpid::sys::Mutex::ScopedLock mutex(accessLock);
+ maxFileCount = val;
+ configChanged = true;
+ }
+ inline uint16_t get_maxFileCount() {
+ ::qpid::sys::Mutex::ScopedLock mutex(accessLock);
+ return maxFileCount;
+ }
+ inline void set_dataFileSize (uint32_t val) {
+ ::qpid::sys::Mutex::ScopedLock mutex(accessLock);
+ dataFileSize = val;
+ configChanged = true;
+ }
+ inline uint32_t get_dataFileSize() {
+ ::qpid::sys::Mutex::ScopedLock mutex(accessLock);
+ return dataFileSize;
+ }
inline void inc_recordDepth (uint32_t by = 1) {
::qpid::sys::Mutex::ScopedLock mutex(accessLock);
recordDepth += by;
@@ -275,6 +297,14 @@
getThreadStats()->dequeues -= by;
instChanged = true;
}
+ inline void inc_txn (uint32_t by = 1) {
+ getThreadStats()->txn += by;
+ instChanged = true;
+ }
+ inline void dec_txn (uint32_t by = 1) {
+ getThreadStats()->txn -= by;
+ instChanged = true;
+ }
inline void inc_txnEnqueues (uint64_t by = 1) {
getThreadStats()->txnEnqueues += by;
instChanged = true;
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Package.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Package.cpp 2009-03-23 12:55:48 UTC
(rev 3196)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Package.cpp 2009-03-23 14:51:38 UTC
(rev 3197)
@@ -24,6 +24,10 @@
#include "Package.h"
#include "Store.h"
#include "Journal.h"
+#include "EventEnqThresholdExceeded.h"
+#include "EventCreated.h"
+#include "EventFull.h"
+#include "EventRecovered.h"
using namespace qmf::com::redhat::rhm::store;
@@ -32,6 +36,10 @@
{
Store::registerSelf(agent);
Journal::registerSelf(agent);
+ EventEnqThresholdExceeded::registerSelf(agent);
+ EventCreated::registerSelf(agent);
+ EventFull::registerSelf(agent);
+ EventRecovered::registerSelf(agent);
}
Modified: store/trunk/cpp/lib/jrnl/wmgr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.hpp 2009-03-23 12:55:48 UTC (rev 3196)
+++ store/trunk/cpp/lib/jrnl/wmgr.hpp 2009-03-23 14:51:38 UTC (rev 3197)
@@ -56,17 +56,17 @@
* \brief Class for managing a write page cache of arbitrary size and number of
pages.
*
* The write page cache works on the principle of caching the write data within a page
until
- * that page is either full or flushed; this initiates a sinlge AIO write operation to
store
+ * that page is either full or flushed; this initiates a single AIO write operation to
store
* the data on disk.
*
- * The maximum disk troughput is acheived by keeping the write operations of uniform
size.
+ * The maximum disk throughput is achieved by keeping the write operations of uniform
size.
* Waiting for a page cache to fill achieves this; and in high data volume/throughput
situations
* achieves the optimal disk throughput. Calling flush() forces a write of the current
page cache
* no matter how full it is, and disrupts the uniformity of the write operations. This
should
* normally only be done if throughput drops and there is a danger of a page of
unwritten data
* waiting around for excessive time.
*
- * The usual tradeoff between data storage latency and thoughput performance applies.
+ * The usual tradeoff between data storage latency and throughput performance
applies.
*/
class wmgr : public pmgr
{
Modified: store/trunk/cpp/lib/qmf-schema.xml
===================================================================
--- store/trunk/cpp/lib/qmf-schema.xml 2009-03-23 12:55:48 UTC (rev 3196)
+++ store/trunk/cpp/lib/qmf-schema.xml 2009-03-23 14:51:38 UTC (rev 3197)
@@ -53,12 +53,15 @@
<property name="readPageSize" type="uint32"
access="RO" unit="byte" desc="Page size in
read-page-cache"/>
<property name="readPages" type="uint32"
access="RO" unit="rpage" desc="Number of pages in
read-page-cache"/>
<property name="initialFileCount" type="uint16"
access="RO" unit="file" desc="Number of files initially
allocated to this journal"/>
+ <property name="autoExpand" type="bool"
access="RO" desc="Auto-expand enabled"/>
+ <property name="currentFileCount" type="uint16"
access="RO" unit="file" desc="Number of files currently
allocated to this journal"/>
+ <property name="maxFileCount" type="uint16"
access="RO" unit="file" desc="Max number of files allowed for
this journal"/>
<property name="dataFileSize" type="uint32"
access="RO" unit="byte" desc="Size of each journal data
file"/>
- <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="txn" type="count32"
unit="record" desc="Total open transactions (xids) on journal"/>
<statistic name="txnEnqueues" type="count64"
unit="record" desc="Total transactional enqueued records on
journal"/>
<statistic name="txnDequeues" type="count64"
unit="record" desc="Total transactional dequeued records on
journal"/>
<statistic name="txnCommits" type="count64"
unit="record" desc="Total transactional commit records on
journal"/>
@@ -81,4 +84,20 @@
<arg name="by" type="uint32" dir="I"
desc="Number of files to increase journal size by"/>
</method>
</class>
+
+ <eventArguments>
+ <arg name="autoExpand" type="bool" desc="Journal
auto-expand enabled"/>
+ <arg name="fileSize" type="uint32" desc="Journal file
size in bytes"/>
+ <arg name="jrnlId" type="sstr" desc="Journal
Id"/>
+ <arg name="numEnq" type="uint32" desc="Number of
recovered enqueues"/>
+ <arg name="numFiles" type="uint16" desc="Number of
journal files"/>
+ <arg name="numTxn" type="uint32" desc="Number of
recovered transactions"/>
+ <arg name="numTxnDeq" type="uint32" desc="Number of
recovered transactional dequeues"/>
+ <arg name="numTxnEnq" type="uint32" desc="Number of
recovered transactional enqueues"/>
+ <arg name="what" type="sstr" desc="Description of
event"/>
+ </eventArguments>
+ <event name="enqThresholdExceeded" sev="warn"
args="jrnlId, what"/>
+ <event name="created" sev="notice"
args="jrnlId, fileSize, numFiles"/>
+ <event name="full" sev="error"
args="jrnlId, what"/>
+ <event name="recovered" sev="notice"
args="jrnlId, fileSize, numFiles, numEnq, numTxn, numTxnEnq, numTxnDeq"/>
</schema>