Author: kpvdr
Date: 2008-01-31 12:11:24 -0500 (Thu, 31 Jan 2008)
New Revision: 1630
Modified:
store/trunk/cpp/tests/jrnl/jtest.cpp
store/trunk/cpp/tests/jrnl/jtest.hpp
store/trunk/cpp/tests/jrnl/msg_producer.cpp
store/trunk/cpp/tests/jrnl/msg_producer.hpp
Log:
Fix for jtest program which has fallen behind recent developments
Modified: store/trunk/cpp/tests/jrnl/jtest.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtest.cpp 2008-01-31 15:28:06 UTC (rev 1629)
+++ store/trunk/cpp/tests/jrnl/jtest.cpp 2008-01-31 17:11:24 UTC (rev 1630)
@@ -149,7 +149,7 @@
#ifndef RHM_WRONLY
_mc.initialize(c_args);
#endif
- _jc.initialize(&_dtok_rd_aio_list, NULL, &_dtok_wr_aio_list,
&mp_aio_cb);
+ _jc.initialize(&mp_aio_cb);
for (u_int32_t i=0; i<p_args->_num_msgs; i++)
{
@@ -283,9 +283,9 @@
// static method
void
-jtest::mp_aio_cb(rhm::journal::jcntl* jc, u_int32_t num_dtoks)
+jtest::mp_aio_cb(rhm::journal::jcntl* jc, std::vector<rhm::journal::data_tok*>&
dtokl)
{
- jtest::_mp.aio_callback(jc, num_dtoks);
+ jtest::_mp.aio_callback(jc, dtokl);
}
// static method
Modified: store/trunk/cpp/tests/jrnl/jtest.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtest.hpp 2008-01-31 15:28:06 UTC (rev 1629)
+++ store/trunk/cpp/tests/jrnl/jtest.hpp 2008-01-31 17:11:24 UTC (rev 1630)
@@ -105,7 +105,7 @@
string& report_time(string& str) const;
// AIO callback functions
- static void mp_aio_cb(rhm::journal::jcntl* jc, u_int32_t num_dtoks);
+ static void mp_aio_cb(rhm::journal::jcntl* jc,
std::vector<rhm::journal::data_tok*>& dtokl);
};
#endif
Modified: store/trunk/cpp/tests/jrnl/msg_producer.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/msg_producer.cpp 2008-01-31 15:28:06 UTC (rev 1629)
+++ store/trunk/cpp/tests/jrnl/msg_producer.cpp 2008-01-31 17:11:24 UTC (rev 1630)
@@ -301,35 +301,29 @@
}
void
-msg_producer::aio_callback(rhm::journal::jcntl* /*jc*/, u_int32_t num_dtoks)
+msg_producer::aio_callback(rhm::journal::jcntl* /*jc*/,
std::vector<rhm::journal::data_tok*>& dtokl)
{
- assert(num_dtoks == _aio_cmpl_dtok_list.size());
- std::deque<rhm::journal::data_tok*>
this_dtok_list(_aio_cmpl_dtok_list.begin(),
- _aio_cmpl_dtok_list.end());
- _aio_cmpl_dtok_list.clear();
- for (u_int32_t i=0; i<num_dtoks; i++)
+ for (std::vector<rhm::journal::data_tok*>::const_iterator i=dtokl.begin();
i!=dtokl.end(); i++)
{
- rhm::journal::data_tok*& dtokp = this_dtok_list.front();
- rhm::journal::data_tok::write_state st = dtokp->wstate();
+ rhm::journal::data_tok::write_state st = (*i)->wstate();
if (st == rhm::journal::data_tok::ENQ)
{
_num_msgs_enq++;
//std::cout << " >E" << dtokp->id() << " "
<< std::flush;
- _dd_dtok_list.push_back(dtokp);
+ _dd_dtok_list.push_back(*i);
}
- else if (dtokp->wstate() == rhm::journal::data_tok::DEQ)
+ else if (st == rhm::journal::data_tok::DEQ)
{
//std::cout << " >D" << dtokp->id() << " "
<< std::flush;
_num_msgs_deq++;
}
- else if (dtokp->wstate() == rhm::journal::data_tok::ABORTED ||
- dtokp->wstate() == rhm::journal::data_tok::COMMITTED)
+ else if (st == rhm::journal::data_tok::ABORTED ||
+ st == rhm::journal::data_tok::COMMITTED)
{
//std::cout << " >T" << dtokp->id() << " "
<< std::flush;
_num_txn++;
}
//else std::cout << " >?" << dtokp->id() << "
st=" << dtokp->wstate_str() << " " << std::flush;
- this_dtok_list.pop_front();
}
}
Modified: store/trunk/cpp/tests/jrnl/msg_producer.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/msg_producer.hpp 2008-01-31 15:28:06 UTC (rev 1629)
+++ store/trunk/cpp/tests/jrnl/msg_producer.hpp 2008-01-31 17:11:24 UTC (rev 1630)
@@ -95,7 +95,7 @@
const size_t minXidSize, const size_t maxXidSize, const bool transient,
const bool external) throw (rhm::journal::jexception);
u_int32_t produce(_p_args* args) throw (rhm::journal::jexception);
- void aio_callback(rhm::journal::jcntl* jc, u_int32_t num_dtoks);
+ void aio_callback(rhm::journal::jcntl* jc,
std::vector<rhm::journal::data_tok*>& dtokl);
const inline u_int64_t get_tot_dblks() const { return _tot_dblks; }
const inline u_int64_t get_tot_dsize() const { return _tot_dsize; }
Show replies by date