Author: cctrieloff
Date: 2007-09-10 16:24:55 -0400 (Mon, 10 Sep 2007)
New Revision: 919
Modified:
store/trunk/cpp/lib/jrnl/data_tok.cpp
store/trunk/cpp/lib/jrnl/data_tok.hpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
store/trunk/cpp/lib/jrnl/wmgr.cpp
Log:
- general integration code
- commented out exception in rid() of dtok
Modified: store/trunk/cpp/lib/jrnl/data_tok.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/data_tok.cpp 2007-09-09 19:42:12 UTC (rev 918)
+++ store/trunk/cpp/lib/jrnl/data_tok.cpp 2007-09-10 20:24:55 UTC (rev 919)
@@ -125,9 +125,9 @@
const u_int64_t
data_tok::rid() const throw (jexception)
{
- if (_wstate == NONE)
+/* if (_wstate == NONE)
throw new jexception(jerrno::JERR_DTOK_RIDNOTSET,
- "Instance in write state NONE; rid not known.",
"data_tok","rid");
+ "Instance in write state NONE; rid not known.",
"data_tok","rid"); */
return _rid;
}
Modified: store/trunk/cpp/lib/jrnl/data_tok.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/data_tok.hpp 2007-09-09 19:42:12 UTC (rev 918)
+++ store/trunk/cpp/lib/jrnl/data_tok.hpp 2007-09-10 20:24:55 UTC (rev 919)
@@ -93,6 +93,7 @@
size_t _dsize; ///< Data size in bytes
u_int32_t _dblks_proc; ///< Data blocks read/written
u_int64_t _rid; ///< RID of data set by enqueue operation
+ u_int64_t _dequeue_rid; ///< RID of data set by dequeue operation
qpid::broker::PersistableMessage* _sourceMsg; ///< Pointer back to source Message in
Broker
public:
@@ -124,6 +125,8 @@
inline void reset_dblks_proc() { _dblks_proc = 0; }
const u_int64_t rid() const throw (jexception);
inline void set_rid(const u_int64_t rid) { _rid = rid; }
+ inline const u_int64_t dequeue_rid() const throw (jexception) {return
_dequeue_rid; }
+ inline void set_dequeue_rid(const u_int64_t rid) { _dequeue_rid = rid; }
void reset();
};
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2007-09-09 19:42:12 UTC (rev 918)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2007-09-10 20:24:55 UTC (rev 919)
@@ -146,7 +146,7 @@
/**
* \brief Destructor.
*/
- ~jcntl();
+ ~jcntl();
/**
* \brief Initialize the journal for storing data.
@@ -173,6 +173,17 @@
initialize(&_aio_rd_cmpl_dtok_list, &aio_rd_callback,
&_aio_wr_cmpl_dtok_list, &aio_wr_callback );
}
+
+ /// replace with real code to recover
+// void recover(std::deque<data_tok*>* rd_dtokl, const aio_cb rd_cb,
+// std::deque<data_tok*>* wr_dtokl, const aio_cb wr_cb) throw (jexception);
+
+
+ void recover() {
+ initialize(&_aio_rd_cmpl_dtok_list, &aio_rd_callback,
&_aio_wr_cmpl_dtok_list, &aio_wr_callback );
+ }
+
+
/**
* \brief Delete the journal directory of files matching the base filename
* by moving them into a subdirectory
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2007-09-09 19:42:12 UTC (rev 918)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2007-09-10 20:24:55 UTC (rev 919)
@@ -107,7 +107,10 @@
u_int64_t rid;
if (dtok->getSourceMessage())
+ {
rid = dtok->rid();
+ assert(rid != 0);
+ }
else
rid = cont ? _wrfc.rid() - 1 : _wrfc.get_incr_rid();
@@ -211,7 +214,16 @@
if (res != RHM_IORES_SUCCESS)
return res;
- u_int64_t rid = _wrfc.get_incr_rid();
+ u_int64_t rid;
+ if (dtok->getSourceMessage())
+ {
+ rid = dtok->dequeue_rid();
+ assert(rid != 0);
+ }
+ else
+ rid = _wrfc.get_incr_rid();
+
+
//***
// NOTE: ASSUMPTION: sizeof(deq_hdr) <= JRNL_DBLK_SIZE
// This encoding is a simplification: it assumes deq_hdr (currently 20 bytes) fits
inside
Show replies by date