Author: kpvdr
Date: 2011-12-08 16:56:42 -0500 (Thu, 08 Dec 2011)
New Revision: 4486
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/jrnl/time_ns.cpp
store/trunk/cpp/lib/jrnl/time_ns.hpp
store/trunk/cpp/perf/ScopedTimer.hpp
Log:
760112
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2011-12-05 16:14:39 UTC (rev 4485)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2011-12-08 21:56:42 UTC (rev 4486)
@@ -70,7 +70,6 @@
_dlen(0),
_dtok(),
_external(false),
- _agent(a),
_mgmtObject(0),
deleteCallback(onDelete)
{
@@ -81,27 +80,8 @@
timer.add(inactivityFireEventPtr);
}
- if (_agent != 0)
- {
- _mgmtObject = new _qmf::Journal
- (_agent, (qpid::management::Manageable*) this);
+ initManagement(a);
- _mgmtObject->set_name(journalId);
- _mgmtObject->set_directory(journalDirectory);
- _mgmtObject->set_baseFileName(journalBaseFilename);
- _mgmtObject->set_readPageSize(JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE *
JRNL_DBLK_SIZE);
- _mgmtObject->set_readPages(JRNL_RMGR_PAGES);
-
- // The following will be set on initialize(), but being properties, these must be
set to 0 in the meantime
- _mgmtObject->set_initialFileCount(0);
- _mgmtObject->set_dataFileSize(0);
- _mgmtObject->set_currentFileCount(0);
- _mgmtObject->set_writePageSize(0);
- _mgmtObject->set_writePages(0);
-
- _agent->addObject(_mgmtObject, 0, true);
- }
-
log(LOG_NOTICE, "Created");
std::ostringstream oss;
oss << "Journal directory = \"" << journalDirectory
<< "\"; Base file name = \"" << journalBaseFilename
<< "\"";
@@ -128,6 +108,33 @@
}
void
+JournalImpl::initManagement(qpid::management::ManagementAgent* a)
+{
+ _agent = a;
+ if (_agent != 0)
+ {
+ _mgmtObject = new _qmf::Journal
+ (_agent, (qpid::management::Manageable*) this);
+
+ _mgmtObject->set_name(_jid);
+ _mgmtObject->set_directory(_jdir.dirname());
+ _mgmtObject->set_baseFileName(_base_filename);
+ _mgmtObject->set_readPageSize(JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE *
JRNL_DBLK_SIZE);
+ _mgmtObject->set_readPages(JRNL_RMGR_PAGES);
+
+ // The following will be set on initialize(), but being properties, these must be
set to 0 in the meantime
+ _mgmtObject->set_initialFileCount(0);
+ _mgmtObject->set_dataFileSize(0);
+ _mgmtObject->set_currentFileCount(0);
+ _mgmtObject->set_writePageSize(0);
+ _mgmtObject->set_writePages(0);
+
+ _agent->addObject(_mgmtObject, 0, true);
+ }
+}
+
+
+void
JournalImpl::initialize(const u_int16_t num_jfiles,
const bool auto_expand,
const u_int16_t ae_max_jfiles,
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2011-12-05 16:14:39 UTC (rev 4485)
+++ store/trunk/cpp/lib/JournalImpl.h 2011-12-08 21:56:42 UTC (rev 4486)
@@ -115,6 +115,8 @@
virtual ~JournalImpl();
+ void initManagement(qpid::management::ManagementAgent* agent);
+
void initialize(const u_int16_t num_jfiles,
const bool auto_expand,
const u_int16_t ae_max_jfiles,
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2011-12-05 16:14:39 UTC (rev 4485)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2011-12-08 21:56:42 UTC (rev 4486)
@@ -238,6 +238,11 @@
mgmtObject->set_tplCurrentFileCount(tplNumJrnlFiles);
agent->addObject(mgmtObject, 0, true);
+
+ // Initialize all existing queues (ie those recovered before management was
initialized)
+ for (JournalListMapItr i=journalList.begin(); i!=journalList.end(); i++) {
+ i->second->initManagement(agent);
+ }
}
}
}
Modified: store/trunk/cpp/lib/jrnl/time_ns.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/time_ns.cpp 2011-12-05 16:14:39 UTC (rev 4485)
+++ store/trunk/cpp/lib/jrnl/time_ns.cpp 2011-12-08 21:56:42 UTC (rev 4486)
@@ -4,7 +4,7 @@
* Qpid asynchronous store plugin library
*
* Messaging journal time struct mrg::journal::time_ns, derived from
- * the ::timespec struct and provided with helper functions.
+ * the timespec struct and provided with helper functions.
*
* \author Kim van der Riet
*
Modified: store/trunk/cpp/lib/jrnl/time_ns.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/time_ns.hpp 2011-12-05 16:14:39 UTC (rev 4485)
+++ store/trunk/cpp/lib/jrnl/time_ns.hpp 2011-12-08 21:56:42 UTC (rev 4486)
@@ -4,7 +4,7 @@
* Qpid asynchronous store plugin library
*
* Messaging journal time struct mrg::journal::time_ns, derived from
- * the ::timespec struct and provided with helper functions.
+ * the timespec struct and provided with helper functions.
*
* \author Kim van der Riet
*
Modified: store/trunk/cpp/perf/ScopedTimer.hpp
===================================================================
--- store/trunk/cpp/perf/ScopedTimer.hpp 2011-12-05 16:14:39 UTC (rev 4485)
+++ store/trunk/cpp/perf/ScopedTimer.hpp 2011-12-08 21:56:42 UTC (rev 4486)
@@ -64,7 +64,7 @@
class ScopedTimer
{
double& _elapsed; ///< Ref to elapsed time, will be written on
destruction of ScopedTimer instances
- std::timespec _startTime; ///< Start time, set on construction
+ ::timespec _startTime; ///< Start time, set on construction
/**
* \brief Convert ::timespec to seconds
@@ -74,7 +74,7 @@
* \param ts std::timespec struct containing the time to be converted.
* \return A double which represents the time in parameter ts in seconds.
*/
- static double _s_getDoubleTime(const std::timespec& ts);
+ static double _s_getDoubleTime(const ::timespec& ts);
public:
/**