Author: kpvdr
Date: 2009-07-29 07:48:45 -0400 (Wed, 29 Jul 2009)
New Revision: 3524
Modified:
store/trunk/cpp/lib/TxnCtxt.h
store/trunk/cpp/lib/jrnl/lpmgr.cpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
Log:
Small refactorization of read manager syncronization code
Modified: store/trunk/cpp/lib/TxnCtxt.h
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.h 2009-07-28 13:01:08 UTC (rev 3523)
+++ store/trunk/cpp/lib/TxnCtxt.h 2009-07-29 11:48:45 UTC (rev 3524)
@@ -79,7 +79,7 @@
/**
* Call to make sure all the data for this txn is written to safe store
*
- *@return if the data sucessfully synced.
+ *@return if the data successfully synced.
*/
void sync();
void sync_jrnl(JournalImpl* jc, bool firstloop, bool& allWritten);
Modified: store/trunk/cpp/lib/jrnl/lpmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/lpmgr.cpp 2009-07-28 13:01:08 UTC (rev 3523)
+++ store/trunk/cpp/lib/jrnl/lpmgr.cpp 2009-07-29 11:48:45 UTC (rev 3524)
@@ -64,7 +64,7 @@
if (ae && ae_max_jfiles > 0 && ae_max_jfiles <= num_jfiles)
{
std::ostringstream oss;
- oss << "_ae_max_jfiles=" << _ae_max_jfiles << ";
num_jfiles=" << num_jfiles;
+ oss << "_ae_max_jfiles=" << ae_max_jfiles << ";
num_jfiles=" << num_jfiles;
throw jexception(jerrno::JERR_LFMGR_BADAEFNUMLIM, oss.str(), "lpmgr",
"initialize");
}
_ae = ae;
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-07-28 13:01:08 UTC (rev 3523)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2009-07-29 11:48:45 UTC (rev 3524)
@@ -528,6 +528,20 @@
iores
rmgr::aio_cycle()
{
+ // Perform validity checks
+ if (_fhdr_rd_outstanding)
+ return RHM_IORES_SUCCESS;
+ if (!_rrfc.is_valid())
+ {
+ init_validation(); // flush outstanding read aio ops (if any), set all pages to
UNUSED state, reset counters.
+ _jc->get_earliest_fid(); // determine initial file to read; calls
_rrfc.set_findex() to set value
+ // If this file has not yet been written to, return RHM_IORES_EMPTY
+ if (_rrfc.is_void() && !_rrfc.is_wr_aio_outstanding())
+ return RHM_IORES_EMPTY;
+ init_file_header_read(); // send off AIO read request for file header
+ return RHM_IORES_SUCCESS;
+ }
+
int16_t first_uninit = -1;
u_int16_t num_uninit = 0;
u_int16_t num_compl = 0;
@@ -568,21 +582,8 @@
iores
rmgr::init_aio_reads(const int16_t first_uninit, const u_int16_t num_uninit)
{
- if (_fhdr_rd_outstanding)
- return RHM_IORES_SUCCESS;
for (int16_t i=0; i<num_uninit; i++)
{
-
- if (!_rrfc.is_valid())
- {
- init_validation();
- _jc->get_earliest_fid(); // calls _rrfc.set_findex()
- // If this file has not yet been written to, return RHM_IORES_EMPTY
- if (_rrfc.is_void() && !_rrfc.is_wr_aio_outstanding())
- return RHM_IORES_EMPTY;
- init_file_header_read();
- break;
- }
if (_rrfc.is_void()) // Nothing to do; this file not yet written to
break;
Show replies by date