Author: kpvdr
Date: 2008-01-31 13:34:21 -0500 (Thu, 31 Jan 2008)
New Revision: 1631
Modified:
store/trunk/cpp/lib/jrnl/wmgr.cpp
store/trunk/cpp/tests/jrnl/msg_producer.cpp
store/trunk/cpp/tests/jrnl/msg_producer.hpp
Log:
Further fixes to the seldom-used jtest program
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-01-31 17:11:24 UTC (rev 1630)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-01-31 18:34:21 UTC (rev 1631)
@@ -936,8 +936,13 @@
}
const iores
-wmgr::pre_write_check(const _op_type op, const data_tok* const dtokp, const size_t
xidsize,
- const size_t dsize, const bool external) const
+wmgr::pre_write_check(const _op_type op, const data_tok* const dtokp,
+#if defined(RHM_WRONLY)
+ const size_t /*xidsize*/, const size_t /*dsize*/, const bool /*external*/
+#else
+ const size_t xidsize, const size_t dsize, const bool external
+#endif
+ ) const
{
// Check status of current file
if (!_wrfc.is_reset())
@@ -967,11 +972,13 @@
{
case WMGR_ENQUEUE:
{
+#if !defined(RHM_WRONLY)
// Check for enqueue reaching cutoff threshold
u_int32_t size_dblks = jrec::size_dblks(enq_rec::rec_size(xidsize,
dsize,
external));
if (!_enq_busy && _wrfc.enq_threshold(_cached_offset_dblks +
size_dblks))
return RHM_IORES_ENQCAPTHRESH;
+#endif
if (!dtokp->is_writable())
{
std::ostringstream oss;
Modified: store/trunk/cpp/tests/jrnl/msg_producer.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/msg_producer.cpp 2008-01-31 17:11:24 UTC (rev 1630)
+++ store/trunk/cpp/tests/jrnl/msg_producer.cpp 2008-01-31 18:34:21 UTC (rev 1631)
@@ -177,13 +177,13 @@
}
else
std::cout << "msg_producer::produce() Unexpected
msg state: id=" <<
- dtokp->id() << " ws=" <<
wsstr << " eres=" << iores_str[eres] <<
+ dtokp->id() << " ws=" <<
wsstr << " eres=" << iores_str(eres) <<
std::flush;
break;
case rhm::journal::RHM_IORES_AIO_WAIT:
if (ws >= rhm::journal::data_tok::ENQ_SUBM)
std::cout << "msg_producer::produce() Unexpected
msg state: id=" <<
- dtokp->id() << " ws=" <<
wsstr << " eres=" << iores_str[eres] <<
+ dtokp->id() << " ws=" <<
wsstr << " eres=" << iores_str(eres) <<
std::flush;
if (aio_sleep_cnt >= MAX_AIO_SLEEPS)
throw rhm::journal::jexception(EXCEPTION_BASE+2,
@@ -215,7 +215,7 @@
default:
std::stringstream ss;
ss << "msg_producer::produce() Unexpected msg state:
id=" <<
- dtokp->id() << " ws=" << wsstr
<< " res=" << iores_str[eres];
+ dtokp->id() << " ws=" << wsstr
<< " res=" << iores_str(eres);
throw rhm::journal::jexception(EXCEPTION_BASE+4,
ss.str().c_str(),
"msg_producer", "produce");
}
@@ -256,7 +256,7 @@
std::stringstream ss;
ss << "msg_producer::send_deferred_dequeues()
"
"Unexpected msg state: id=" <<
dtokp->id() << " ws=" <<
- wsstr << " res=" <<
iores_str[dres];
+ wsstr << " res=" <<
iores_str(dres);
throw rhm::journal::jexception(EXCEPTION_BASE+9,
ss.str().c_str(),
"msg_producer",
"send_deferred_dequeues");
}
@@ -389,7 +389,7 @@
default:
std::stringstream ss;
ss << "Unexpected msg state: id=" <<
ddtokp->id();
- ss << " ws=" << wsstr << "
res=" << iores_str[dres];
+ ss << " ws=" << wsstr << "
res=" << iores_str(dres);
throw rhm::journal::jexception(EXCEPTION_BASE+7,
ss.str().c_str(),
"msg_producer",
"send_deferred_dequeues");
} // switch (dres)
@@ -500,18 +500,6 @@
std::cout.flush();
}
-// *** Static member declarations ***
-
-const char* msg_producer::iores_str[] = {
- "RHM_IORES_SUCCESS",
- "RHM_IORES_AIO_WAIT",
- "RHM_IORES_EMPTY",
- "RHM_IORES_FULL",
- "RHM_IORES_BUSY",
- "RHM_IORES_TXPENDING",
- "RHM_IORES_NOTIMPL"
- };
-
u_int16_t msg_producer::instance_cnt = 0;
const size_t msg_producer::_msg_buff_size = 0x1000000;
char msg_producer::_msg_buff[msg_producer::_msg_buff_size];
Modified: store/trunk/cpp/tests/jrnl/msg_producer.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/msg_producer.hpp 2008-01-31 17:11:24 UTC (rev 1630)
+++ store/trunk/cpp/tests/jrnl/msg_producer.hpp 2008-01-31 18:34:21 UTC (rev 1631)
@@ -60,8 +60,6 @@
size_t max_xid_size, bool transient, bool external);
};
- static const char* iores_str[];
-
private:
static u_int16_t instance_cnt;
static const size_t _msg_buff_size;