Author: kpvdr
Date: 2007-09-25 16:25:49 -0400 (Tue, 25 Sep 2007)
New Revision: 947
Added:
store/trunk/cpp/lib/jrnl/deq_rec.cpp
store/trunk/cpp/lib/jrnl/deq_rec.hpp
store/trunk/cpp/lib/jrnl/dtx_rec.cpp
store/trunk/cpp/lib/jrnl/dtx_rec.hpp
store/trunk/cpp/lib/jrnl/enq_rec.cpp
store/trunk/cpp/lib/jrnl/enq_rec.hpp
Removed:
store/trunk/cpp/lib/jrnl/data_rec.cpp
store/trunk/cpp/lib/jrnl/data_rec.hpp
Modified:
store/trunk/cpp/lib/Makefile.am
store/trunk/cpp/lib/jrnl/file_hdr.cpp
store/trunk/cpp/lib/jrnl/file_hdr.hpp
store/trunk/cpp/lib/jrnl/jcfg.hpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jrec.cpp
store/trunk/cpp/lib/jrnl/jrec.hpp
store/trunk/cpp/lib/jrnl/pmgr.cpp
store/trunk/cpp/lib/jrnl/pmgr.hpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
store/trunk/cpp/lib/jrnl/wmgr.cpp
store/trunk/cpp/tests/jrnl/Makefile.rtest
store/trunk/cpp/tests/jrnl/ftest.py
store/trunk/cpp/tests/jrnl/msg_consumer.cpp
store/trunk/cpp/tests/jrnl/rtest
store/trunk/cpp/tests/jrnl/rtests.csv
store/trunk/cpp/tests/jrnl/rwtests.csv
store/trunk/cpp/tests/jrnl/tests.ods
store/trunk/cpp/tests/jrnl/wtests.csv
Log:
Added XID fields to journal disk records, new dtx_rec and deq_rec classes (still shells).
Modified: store/trunk/cpp/lib/Makefile.am
===================================================================
--- store/trunk/cpp/lib/Makefile.am 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/Makefile.am 2007-09-25 20:25:49 UTC (rev 947)
@@ -33,10 +33,11 @@
StoreException.h \
StringDbt.h \
TxnCtxt.h \
- jrnl/data_rec.cpp \
- jrnl/data_rec.hpp \
jrnl/data_tok.cpp \
+ jrnl/deq_rec.cpp \
+ jrnl/dtx_rec.cpp \
jrnl/enq_map.cpp \
+ jrnl/enq_rec.cpp \
jrnl/file_hdr.cpp \
jrnl/jcntl.cpp \
jrnl/jdir.cpp \
@@ -52,9 +53,11 @@
jrnl/wmgr.cpp \
jrnl/wrfc.cpp \
jrnl/aio_cb.hpp \
- jrnl/data_rec.hpp \
jrnl/data_tok.hpp \
+ jrnl/deq_rec.hpp \
+ jrnl/dtx_rec.hpp \
jrnl/enq_map.hpp \
+ jrnl/enq_rec.hpp \
jrnl/file_hdr.hpp \
jrnl/jcfg.hpp \
jrnl/jcntl.hpp \
Deleted: store/trunk/cpp/lib/jrnl/data_rec.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/data_rec.cpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/jrnl/data_rec.cpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -1,467 +0,0 @@
-/**
-* \file data_rec.cpp
-*
-* Red Hat Messaging - Message Journal
-*
-* This file contains the code for the rhm::journal::data_rec (journal data
-* record) class. See comments in file data_rec.hpp for details.
-*
-* \author Kim van der Riet
-*
-* Copyright 2007 Red Hat, Inc.
-*
-* This file is part of Red Hat Messaging.
-*
-* Red Hat Messaging is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public
-* License as published by the Free Software Foundation; either
-* version 2.1 of the License, or (at your option) any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
-* USA
-*
-* The GNU Lesser General Public License is available in the file COPYING.
-*/
-
-#include <jrnl/data_rec.hpp>
-
-#include <assert.h>
-#include <iomanip>
-#include <sstream>
-#include <jrnl/jerrno.hpp>
-
-namespace rhm
-{
-namespace journal
-{
-
-// Default constructor; must be used in conjunction with reset() to prepare
-// instance for use with write or read operations
-data_rec::data_rec():
- jrec(), // superclass
- _enq_hdr(RHM_JDAT_ENQ_MAGIC, 0, 0, RHM_JDAT_VERSION),
- _data(NULL),
- _buff(NULL),
- _enq_tail(_enq_hdr),
- _max_data_size(0),
- _data_size(0),
- _rec_size(0)
-{}
-
-// Constructor used for write operations, where dbuf contains data to be written.
-data_rec::data_rec(const u_int64_t rid, const void* const dbuf, const size_t dlen):
- jrec(), // superclass
- _enq_hdr(RHM_JDAT_ENQ_MAGIC, rid, dlen, RHM_JDAT_VERSION),
- _data(dbuf),
- _buff(NULL),
- _enq_tail(_enq_hdr),
- _max_data_size(0),
- _data_size(dlen),
- _rec_size(size_dblks(dlen + enq_hdr::size() + enq_tail::size()) *
JRNL_DBLK_SIZE)
-{}
-
-// Constructor used for read operations, where buf contains preallocated space
-// to receive data.
-data_rec::data_rec(void* const buf, const size_t bufsize):
- jrec(), // superclass
- _enq_hdr(RHM_JDAT_ENQ_MAGIC, 0, bufsize, RHM_JDAT_VERSION),
- _data(NULL),
- _buff(buf),
- _enq_tail(_enq_hdr),
- _max_data_size(bufsize),
- _data_size(0),
- _rec_size(0)
-{}
-
-data_rec::~data_rec()
-{
-#ifdef RHM_NOAIO
- if (_wbuff)
- {
- ::free(_wbuff);
- _wbuff = NULL;
- }
-#endif
-}
-
-// Prepare instance for use in writing data to journal, where dbuf contains data to be
written.
-void
-data_rec::reset(const u_int64_t rid, const void* const dbuf, const size_t dlen)
-{
- _enq_hdr._hdr._rid = rid;
- _enq_hdr._dsize = dlen;
- _data = dbuf;
- _buff = NULL;
- _enq_tail._rid = rid;
- _max_data_size = 0;
- _data_size = dlen;
- _rec_size = size_dblks(dlen + enq_hdr::size() + enq_tail::size()) * JRNL_DBLK_SIZE;
-}
-
-// Prepare instance for use in reading data from journal, where buf contains preallocated
space
-// to receive data.
-void
-data_rec::reset(void* const buf, const size_t bufsize)
-{
- _enq_hdr._hdr._rid = 0;
- _enq_hdr._dsize = bufsize;
- _data = NULL;
- _buff = buf;
- _enq_tail._rid = 0;
- _max_data_size = bufsize;
- _data_size = 0;
- _rec_size = 0;
-}
-
-u_int32_t
-data_rec::encode(void* wptr, u_int32_t rec_offs_dblks, u_int32_t max_size_dblks) throw
(jexception)
-{
- assert(wptr != NULL);
- assert(max_size_dblks > 0);
-
- size_t rec_offs = rec_offs_dblks * JRNL_DBLK_SIZE;
- size_t rem = max_size_dblks * JRNL_DBLK_SIZE;
- size_t wr_cnt = 0;
- if (rec_offs_dblks) // Continuation of split data record (over 2 or more pages)
- {
- if (size_dblks(rec_size()) - rec_offs_dblks > max_size_dblks) // Further split
required
- {
- // TODO: The header will never be split as it will always be less than one
dblk.
- // Remove this check...
- size_t wsize = sizeof(_enq_hdr) > rec_offs ? sizeof(_enq_hdr) - rec_offs :
0;
- size_t wsize2 = wsize;
- if (wsize)
- {
- if (wsize > rem)
- wsize = rem;
- ::memcpy(wptr, (char*)&_enq_hdr + rec_offs, wsize);
- wr_cnt = wsize;
- rem -= wsize;
- }
- rec_offs -= sizeof(_enq_hdr) - wsize2;
- if (rem)
- {
- wsize = _data_size > rec_offs ? _data_size - rec_offs : 0;
- wsize2 = wsize;
- if (wsize)
- {
- if (wsize > rem)
- wsize = rem;
- ::memcpy((char*)wptr + wr_cnt, (char*)_data + rec_offs, wsize);
- wr_cnt += wsize;
- rem -= wsize;
- }
- rec_offs -= _data_size - wsize2;
- }
- if (rem)
- {
- wsize = sizeof(_enq_tail) > rec_offs ? sizeof(_enq_tail) - rec_offs :
0;
- wsize2 = wsize;
- if (wsize)
- {
- if (wsize > rem)
- wsize = rem;
- ::memcpy((char*)wptr + wr_cnt, (char*)&_enq_tail + rec_offs,
wsize);
- wr_cnt += wsize;
- rem -= wsize;
- }
- rec_offs -= sizeof(_enq_tail) - wsize2;
- }
- assert(rem == 0);
- assert(rec_offs == 0);
- }
- else // No further split required
- {
- // TODO: The header will never be split as it will always be less than one
dblk.
- // Remove this check...
- size_t wsize = sizeof(_enq_hdr) > rec_offs ? sizeof(_enq_hdr) - rec_offs :
0;
- if (wsize)
- {
- ::memcpy(wptr, (char*)&_enq_hdr + rec_offs, wsize);
- wr_cnt = wsize;
- }
- rec_offs -= sizeof(_enq_hdr) - wsize;
- wsize = _data_size > rec_offs ? _data_size - rec_offs : 0;
- if (wsize)
- {
- ::memcpy((char*)wptr + wr_cnt, (char*)_data + rec_offs, wsize);
- wr_cnt += wsize;
- }
- rec_offs -= _data_size - wsize;
- wsize = sizeof(_enq_tail) > rec_offs ? sizeof(_enq_tail) - rec_offs : 0;
- if (wsize)
- {
- ::memcpy((char*)wptr + wr_cnt, (char*)&_enq_tail + rec_offs, wsize);
- wr_cnt += wsize;
-#ifdef RHM_CLEAN
- ::memset((char*)wptr + wr_cnt, RHM_CLEAN_CHAR,
- _rec_size - (rec_offs_dblks * JRNL_DBLK_SIZE) - wr_cnt);
-#endif
- }
- rec_offs -= sizeof(_enq_tail) - wsize;
- assert(rec_offs == 0);
- }
- }
- else // Start at beginning of data record
- {
- if (size_dblks(rec_size()) > max_size_dblks) // Split required
- {
- size_t wsize = rem >= sizeof(_enq_hdr) ? sizeof(_enq_hdr) : rem;
- ::memcpy(wptr, (void*)&_enq_hdr, wsize);
- wr_cnt = wsize;
- rem -= wsize;
- if (rem)
- {
- wsize = rem >= _data_size ? _data_size : rem;
- ::memcpy((char*)wptr + wr_cnt, _data, wsize);
- wr_cnt += wsize;
- rem -= wsize;
- }
- if (rem)
- {
- wsize = rem >= sizeof(_enq_tail) ? sizeof(_enq_tail) : rem;
- ::memcpy((char*)wptr + wr_cnt, (void*)&_enq_tail, wsize);
- wr_cnt += wsize;
- rem -= wsize;
- }
- assert(rem == 0);
- }
- else // No split required
- {
- ::memcpy(wptr, (void*)&_enq_hdr, sizeof(_enq_hdr));
- wr_cnt = sizeof(_enq_hdr);
- ::memcpy((char*)wptr + wr_cnt, _data, _data_size);
- wr_cnt += _data_size;
- ::memcpy((char*)wptr + wr_cnt, (void*)&_enq_tail, sizeof(_enq_tail));
- wr_cnt += sizeof(_enq_tail);
-#ifdef RHM_CLEAN
- ::memset((char*)wptr + wr_cnt, RHM_CLEAN_CHAR, _rec_size - wr_cnt);
-#endif
- }
- }
- return size_dblks(wr_cnt);
-}
-
-u_int32_t
-data_rec::decode(hdr& h, void* rptr, u_int32_t rec_offs_dblks, u_int32_t
max_size_dblks)
- throw (jexception)
-{
- assert(rptr != NULL);
- assert(max_size_dblks > 0);
-
- size_t rd_cnt = 0;
- if (rec_offs_dblks) // Continuation of record on new page
- {
- const u_int32_t hdr_data_dblks = size_dblks(enq_hdr::size() + _data_size);
- const u_int32_t hdr_data_tail_dblks = size_dblks(enq_hdr::size() + _data_size +
- enq_tail::size());
- const size_t rec_offs = rec_offs_dblks * JRNL_DBLK_SIZE;
-
- if (hdr_data_tail_dblks - rec_offs_dblks <= max_size_dblks)
- {
- // Remainder of record fits within this page
- if (rec_offs - enq_hdr::size() < _data_size)
- {
- // Data still outstanding, copy remainder of data and tail
- const size_t data_offs = rec_offs - enq_hdr::size();
- const size_t data_rem = _data_size - data_offs;
- ::memcpy((char*)_buff + data_offs, rptr, data_rem);
- rd_cnt += data_rem;
- ::memcpy((void*)&_enq_tail, ((char*)rptr + data_rem),
sizeof(_enq_tail));
- chk_tail(_enq_tail, _enq_hdr);
- rd_cnt += sizeof(_enq_tail);
- }
- else
- {
- // Tail or part of tail only outstanding, complete tail
- const size_t tail_offs = rec_offs - enq_hdr::size() - _data_size;
- const size_t tail_rem = enq_tail::size() - tail_offs;
- ::memcpy((char*)&_enq_tail + tail_offs, rptr, tail_rem);
- chk_tail(_enq_tail, _enq_hdr);
- rd_cnt = tail_rem;
- }
- }
- else if (hdr_data_dblks - rec_offs_dblks <= max_size_dblks)
- {
- // Remainder of record data fits within this page, tail split
- const size_t data_offs = rec_offs - enq_hdr::size();
- const size_t data_rem = _data_size - data_offs;
- ::memcpy((char*)_buff + data_offs, rptr, data_rem);
- rd_cnt += data_rem;
- const size_t tail_rem = (max_size_dblks * JRNL_DBLK_SIZE) - rd_cnt;
- if (tail_rem)
- {
- ::memcpy((void*)&_enq_tail, ((char*)rptr + data_rem), tail_rem);
- rd_cnt += tail_rem;
- }
- }
- else
- {
- // Remainder of record data split
- const size_t data_cp_size = (max_size_dblks * JRNL_DBLK_SIZE);
- ::memcpy((char*)_buff + rec_offs - enq_hdr::size(), rptr, data_cp_size);
- rd_cnt += data_cp_size;
- }
- }
- else // Start of record
- {
- // Get and check header
- _enq_hdr._hdr.copy(h);
- _enq_hdr._dsize = *(size_t*)((char*)rptr + sizeof(hdr));
- rd_cnt = _enq_hdr.size();
- chk_hdr(_enq_hdr);
- _data_size = _enq_hdr._dsize;
- const u_int32_t hdr_data_dblks = size_dblks(enq_hdr::size() + _data_size);
- const u_int32_t hdr_data_tail_dblks = size_dblks(enq_hdr::size() + _data_size +
- enq_tail::size());
-
- if (_data_size)
- {
- // Check if record (header + data + tail) fits within this page, we can check
the
- // tail before the expense of copying data to memory
- if (hdr_data_tail_dblks <= max_size_dblks)
- {
- // Entire header, data and tail fits within this page
- ::memcpy((void*)&_enq_tail, (char*)rptr + rd_cnt + _data_size,
sizeof(_enq_tail));
- chk_tail(_enq_tail, _enq_hdr);
- ::memcpy(_buff, (char*)rptr + rd_cnt, _data_size);
- rd_cnt += _data_size + sizeof(_enq_tail);
- }
- else if (hdr_data_dblks <= max_size_dblks)
- {
- // Entire header and data fit within this page, tail split
- ::memcpy(_buff, (char*)rptr + rd_cnt, _data_size);
- rd_cnt += _data_size;
- const size_t tail_rem = (max_size_dblks * JRNL_DBLK_SIZE) - rd_cnt;
- if (tail_rem)
- {
- ::memcpy((void*)&_enq_tail, (char*)rptr + rd_cnt, tail_rem);
- rd_cnt += tail_rem;
- }
- }
- else
- {
- // Header fits within this page, record data split
- const size_t data_cp_size = (max_size_dblks * JRNL_DBLK_SIZE) - rd_cnt;
- ::memcpy(_buff, (char*)rptr + rd_cnt, data_cp_size);
- rd_cnt += data_cp_size;
- }
- }
- }
- return size_dblks(rd_cnt);
-}
-
-std::string&
-data_rec::str(std::string& str) const
-{
- std::stringstream ss;
- ss << "data_rec: m=" << _enq_hdr._hdr._magic;
- ss << " v=" << (int)_enq_hdr._hdr._version;
- ss << " rid=" << _enq_hdr._hdr._rid;
- ss << " len=" << _enq_hdr._dsize;
- str.append(ss.str());
- return str;
-}
-
-const size_t
-data_rec::data_size() const
-{
- return _data_size;
-}
-
-const size_t
-data_rec::rec_size() const
-{
- return _data_size + enq_hdr::size() + enq_tail::size();
-}
-
-void
-data_rec::set_rid(const u_int64_t rid)
-{
- _enq_hdr._hdr._rid = rid;
- _enq_tail._rid = rid;
-}
-
-void
-data_rec::chk_hdr(enq_hdr& hdr, u_int64_t rid, bool enq) const throw (jexception)
-{
- chk_hdr(hdr, enq);
- if (hdr._hdr._rid != rid)
- {
- std::stringstream ss;
- ss << std::hex << std::setfill('0');
- ss << "rid mismatch: expected=0x" << std::setw(16) <<
rid;
- ss << " read=0x" << std::setw(16) << hdr._hdr._rid;
- throw jexception(jerrno::JERR_DREC_INVRHDR, ss.str(), "data_rec",
"chk_hdr");
- }
-}
-
-void
-data_rec::chk_hdr(enq_hdr& hdr, bool enq) const throw (jexception)
-{
- if (enq)
- {
- if (hdr._hdr._magic != RHM_JDAT_ENQ_MAGIC)
- {
- std::stringstream ss;
- ss << std::hex << std::setfill('0');
- ss << "enq magic: rid=0x" << std::setw(16) <<
hdr._hdr._rid;
- ss << ": expected=0x" << std::setw(8) <<
RHM_JDAT_ENQ_MAGIC;
- ss << " read=0x" << std::setw(2) <<
(int)hdr._hdr._magic;
- throw jexception(jerrno::JERR_DREC_INVRHDR, ss.str(), "data_rec",
"chk_hdr");
- }
- }
- else
- {
- if (hdr._hdr._magic != RHM_JDAT_DEQ_MAGIC)
- {
- std::stringstream ss;
- ss << std::hex << std::setfill('0');
- ss << "deq magic: rid=0x" << std::setw(16) <<
hdr._hdr._rid;
- ss << ": expected=0x" << std::setw(8) <<
RHM_JDAT_DEQ_MAGIC;
- ss << " read=0x" << std::setw(2) <<
(int)hdr._hdr._magic;
- throw jexception(jerrno::JERR_DREC_INVRHDR, ss.str(), "data_rec",
"chk_hdr");
- }
- }
- if (hdr._hdr._version != RHM_JDAT_VERSION)
- {
- std::stringstream ss;
- ss << std::hex << std::setfill('0');
- ss << "version: rid=0x" << std::setw(16) <<
hdr._hdr._rid;
- ss << ": expected=0x" << std::setw(2) <<
(int)RHM_JDAT_VERSION;
- ss << " read=0x" << std::setw(2) <<
(int)hdr._hdr._version;
- throw jexception(jerrno::JERR_DREC_INVRHDR, ss.str(), "data_rec",
"chk_hdr");
- }
-#if defined (JRNL_LITTLE_ENDIAN)
- u_int8_t endian_flag = RHM_LENDIAN_FLAG;
-#else
- u_int8_t endian_flag = RHM_BENDIAN_FLAG;
-#endif
- if (hdr._hdr._eflag != endian_flag)
- {
- std::stringstream ss;
- ss << std::hex << std::setfill('0');
- ss << "endian_flag: rid=" << std::setw(16) <<
hdr._hdr._rid;
- ss << ": expected=0x" << std::setw(2) <<
(int)endian_flag;
- ss << " read=0x" << std::setw(2) <<
(int)hdr._hdr._eflag;
- throw jexception(jerrno::JERR_DREC_INVRHDR, ss.str(), "data_rec",
"chk_hdr");
- }
- if (hdr._dsize > _max_data_size)
- {
- std::stringstream ss;
- ss << std::hex << std::setfill('0');
- ss << "data_size: rid=" << std::setw(16) <<
hdr._hdr._rid;
- ss << std::dec << ": buff_size=" << _max_data_size
<< " data_size=" << hdr._dsize;
- throw jexception(jerrno::JERR_DREC_BUFFSIZE, ss.str(), "data_rec",
"chk_hdr");
- }
-}
-
-} // namespace journal
-} // namespace rhm
Deleted: store/trunk/cpp/lib/jrnl/data_rec.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/data_rec.hpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/jrnl/data_rec.hpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -1,113 +0,0 @@
-/**
-* \file data_rec.hpp
-*
-* Red Hat Messaging - Message Journal
-*
-* This file contains the code for the rhm::journal::data_rec (journal data
-* record) class. See class documentation for details.
-*
-* \author Kim van der Riet
-*
-* Copyright 2007 Red Hat, Inc.
-*
-* This file is part of Red Hat Messaging.
-*
-* Red Hat Messaging is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public
-* License as published by the Free Software Foundation; either
-* version 2.1 of the License, or (at your option) any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
-* USA
-*
-* The GNU Lesser General Public License is available in the file COPYING.
-*/
-
-#ifndef rhm_journal_data_rec_hpp
-#define rhm_journal_data_rec_hpp
-
-namespace rhm
-{
-namespace journal
-{
-class data_rec;
-}
-}
-
-#include <jrnl/jrec.hpp>
-
-namespace rhm
-{
-namespace journal
-{
-
- /**
- * \class data_rec
- * \brief Class to handle a single journal data record. These are the records
- * contained in the jouranl data files.
- */
- class data_rec : public jrec
- {
- private:
- enq_hdr _enq_hdr;
- const void* _data; ///< Pointer to data to be written
- void* _buff; ///< Pointer to buffer to receive read data
- enq_tail _enq_tail;
- size_t _max_data_size; ///< Max buffer size for decoding into during
read
- size_t _data_size; ///< Size of data (bytes)
- size_t _rec_size; ///< Size of data blocks required for record
(bytes)
-
- public:
- /**
- * \brief Default constructor; must be used in conjunction with reset() to
prepare
- * instance for use with write or read operations.
- */
- data_rec();
-
- /**
- * \brief Constructor used for write operations, where mbuf contains data to be
written.
- */
- data_rec(const u_int64_t rid, const void* const dbuf, const size_t dlen);
-
- /**
- * \brief Constructor used for read operations, where buf contains preallocated
space
- * to receive data.
- */
- data_rec(void* const buf, const size_t bufsize);
- ~data_rec();
-
- // Prepare instance for use in writing data to journal
- void reset(const u_int64_t rid, const void* const dbuf, const size_t dlen);
- // Prepare instance for use in reading data from journal
- void reset(void* const buf, const size_t bufsize);
-
- u_int32_t encode(void* wptr, u_int32_t rec_offs_dblks, u_int32_t max_size_dblks)
- throw (jexception);
- u_int32_t decode(hdr& h, void* rptr, u_int32_t rec_offs_dblks, u_int32_t
max_size_dblks)
- throw (jexception);
- std::string& str(std::string& str) const;
- inline const size_t max_data_size() const { return _max_data_size; }
- inline const size_t max_rec_size() const
- { return _max_data_size + enq_hdr::size() + enq_tail::size(); }
- const size_t data_size() const;
- const size_t rec_size() const;
- inline const u_int32_t rec_size_dblks() const { return size_dblks(rec_size()); }
- inline const u_int64_t rid() const { return _enq_hdr._hdr._rid; }
- void set_rid(const u_int64_t rid);
-
- private:
- void chk_hdr(enq_hdr& hdr, u_int64_t rid, bool enq = true) const throw
(jexception);
- void chk_hdr(enq_hdr& hdr, bool enq = true) const throw (jexception);
- }; // class data_rec
-
-} // namespace journal
-} // namespace rhm
-
-#endif // ifndef rhm_journal_data_rec_hpp
Added: store/trunk/cpp/lib/jrnl/deq_rec.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/deq_rec.cpp (rev 0)
+++ store/trunk/cpp/lib/jrnl/deq_rec.cpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -0,0 +1,42 @@
+/**
+* \file deq_rec.cpp
+*
+* Red Hat Messaging - Message Journal
+*
+* This file contains the code for the rhm::journal::deq_rec (journal dequeue
+* record) class. See comments in file deq_rec.hpp for details.
+*
+* \author Kim van der Riet
+*
+* Copyright 2007 Red Hat, Inc.
+*
+* This file is part of Red Hat Messaging.
+*
+* Red Hat Messaging is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+* USA
+*
+* The GNU Lesser General Public License is available in the file COPYING.
+*/
+
+#include <jrnl/deq_rec.hpp>
+
+namespace rhm
+{
+namespace journal
+{
+
+
+} // namespace journal
+} // namespace rhm
Added: store/trunk/cpp/lib/jrnl/deq_rec.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/deq_rec.hpp (rev 0)
+++ store/trunk/cpp/lib/jrnl/deq_rec.hpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -0,0 +1,62 @@
+/**
+* \file deq_rec.hpp
+*
+* Red Hat Messaging - Message Journal
+*
+* This file contains the code for the rhm::journal::deq_rec (journal dequeue
+* record) class. See class documentation for details.
+*
+* \author Kim van der Riet
+*
+* Copyright 2007 Red Hat, Inc.
+*
+* This file is part of Red Hat Messaging.
+*
+* Red Hat Messaging is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+* USA
+*
+* The GNU Lesser General Public License is available in the file COPYING.
+*/
+
+#ifndef rhm_journal_deq_rec_hpp
+#define rhm_journal_deq_rec_hpp
+
+namespace rhm
+{
+namespace journal
+{
+class deq_rec;
+}
+}
+
+#include <jrnl/jrec.hpp>
+
+namespace rhm
+{
+namespace journal
+{
+
+ /**
+ * \class deq_rec
+ * \brief Class to handle a single journal dequeue record.
+ */
+ class deq_rec : public jrec
+ {
+ }; // class deq_rec
+
+} // namespace journal
+} // namespace rhm
+
+#endif // ifndef rhm_journal_deq_rec_hpp
Added: store/trunk/cpp/lib/jrnl/dtx_rec.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/dtx_rec.cpp (rev 0)
+++ store/trunk/cpp/lib/jrnl/dtx_rec.cpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -0,0 +1,42 @@
+/**
+* \file dtx_rec.cpp
+*
+* Red Hat Messaging - Message Journal
+*
+* This file contains the code for the rhm::journal::dtx_rec (journal dequeue
+* record) class. See comments in file dtx_rec.hpp for details.
+*
+* \author Kim van der Riet
+*
+* Copyright 2007 Red Hat, Inc.
+*
+* This file is part of Red Hat Messaging.
+*
+* Red Hat Messaging is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+* USA
+*
+* The GNU Lesser General Public License is available in the file COPYING.
+*/
+
+#include <jrnl/dtx_rec.hpp>
+
+namespace rhm
+{
+namespace journal
+{
+
+
+} // namespace journal
+} // namespace rhm
Added: store/trunk/cpp/lib/jrnl/dtx_rec.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/dtx_rec.hpp (rev 0)
+++ store/trunk/cpp/lib/jrnl/dtx_rec.hpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -0,0 +1,62 @@
+/**
+* \file dtx_rec.hpp
+*
+* Red Hat Messaging - Message Journal
+*
+* This file contains the code for the rhm::journal::dtx_rec (journal data
+* record) class. See class documentation for details.
+*
+* \author Kim van der Riet
+*
+* Copyright 2007 Red Hat, Inc.
+*
+* This file is part of Red Hat Messaging.
+*
+* Red Hat Messaging is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+* USA
+*
+* The GNU Lesser General Public License is available in the file COPYING.
+*/
+
+#ifndef rhm_journal_dtx_rec_hpp
+#define rhm_journal_dtx_rec_hpp
+
+namespace rhm
+{
+namespace journal
+{
+class dtx_rec;
+}
+}
+
+#include <jrnl/jrec.hpp>
+
+namespace rhm
+{
+namespace journal
+{
+
+ /**
+ * \class dtx_rec
+ * \brief Class to handle a single journal DTX commit or abort record.
+ */
+ class dtx_rec : public jrec
+ {
+ }; // class dtx_rec
+
+} // namespace journal
+} // namespace rhm
+
+#endif // ifndef rhm_journal_dtx_rec_hpp
Copied: store/trunk/cpp/lib/jrnl/enq_rec.cpp (from rev 946,
store/trunk/cpp/lib/jrnl/data_rec.cpp)
===================================================================
--- store/trunk/cpp/lib/jrnl/enq_rec.cpp (rev 0)
+++ store/trunk/cpp/lib/jrnl/enq_rec.cpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -0,0 +1,478 @@
+/**
+* \file enq_rec.cpp
+*
+* Red Hat Messaging - Message Journal
+*
+* This file contains the code for the rhm::journal::enq_rec (journal enqueue
+* record) class. See comments in file enq_rec.hpp for details.
+*
+* \author Kim van der Riet
+*
+* Copyright 2007 Red Hat, Inc.
+*
+* This file is part of Red Hat Messaging.
+*
+* Red Hat Messaging is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+* USA
+*
+* The GNU Lesser General Public License is available in the file COPYING.
+*/
+
+#include <jrnl/enq_rec.hpp>
+
+#include <assert.h>
+#include <iomanip>
+#include <sstream>
+#include <jrnl/jerrno.hpp>
+
+namespace rhm
+{
+namespace journal
+{
+
+// Default constructor; must be used in conjunction with reset() to prepare
+// instance for use with write or read operations
+enq_rec::enq_rec():
+ jrec(), // superclass
+ _enq_hdr(RHM_JDAT_ENQ_MAGIC, 0, 0, 0, RHM_JDAT_VERSION),
+ _data(NULL),
+ _buff(NULL),
+ _enq_tail(_enq_hdr._hdr),
+ _max_data_size(0),
+ _data_size(0),
+ _rec_size(0)
+{}
+
+// Constructor used for write operations, where dbuf contains data to be written.
+enq_rec::enq_rec(const u_int64_t rid, const void* const dbuf, const size_t dlen):
+ jrec(), // superclass
+ _enq_hdr(RHM_JDAT_ENQ_MAGIC, rid, 0, dlen, RHM_JDAT_VERSION),
+ _data(dbuf),
+ _buff(NULL),
+ _enq_tail(_enq_hdr._hdr),
+ _max_data_size(0),
+ _data_size(dlen),
+ _rec_size(size_dblks(dlen + enq_hdr::size() + rec_tail::size()) *
JRNL_DBLK_SIZE)
+{}
+
+// Constructor used for read operations, where buf contains preallocated space
+// to receive data.
+enq_rec::enq_rec(void* const buf, const size_t bufsize):
+ jrec(), // superclass
+ _enq_hdr(RHM_JDAT_ENQ_MAGIC, 0, 0, bufsize, RHM_JDAT_VERSION),
+ _data(NULL),
+ _buff(buf),
+ _enq_tail(_enq_hdr._hdr),
+ _max_data_size(bufsize),
+ _data_size(0),
+ _rec_size(0)
+{}
+
+enq_rec::~enq_rec()
+{
+#ifdef RHM_NOAIO
+ if (_wbuff)
+ {
+ ::free(_wbuff);
+ _wbuff = NULL;
+ }
+#endif
+}
+
+// Prepare instance for use in writing data to journal, where dbuf contains data to be
written.
+void
+enq_rec::reset(const u_int64_t rid, const void* const dbuf, const size_t dlen)
+{
+ _enq_hdr._hdr._rid = rid;
+ _enq_hdr._xidsize = 0;
+ _enq_hdr._dsize = dlen;
+ _data = dbuf;
+ _buff = NULL;
+ _enq_tail._rid = rid;
+ _max_data_size = 0;
+ _data_size = dlen;
+ _rec_size = size_dblks(dlen + enq_hdr::size() + rec_tail::size()) * JRNL_DBLK_SIZE;
+}
+
+// Prepare instance for use in reading data from journal, where buf contains preallocated
space
+// to receive data.
+void
+enq_rec::reset(void* const buf, const size_t bufsize)
+{
+ _enq_hdr._hdr._rid = 0;
+ _enq_hdr._xidsize = 0;
+ _enq_hdr._dsize = bufsize;
+ _data = NULL;
+ _buff = buf;
+ _enq_tail._rid = 0;
+ _max_data_size = bufsize;
+ _data_size = 0;
+ _rec_size = 0;
+}
+
+u_int32_t
+enq_rec::encode(void* wptr, u_int32_t rec_offs_dblks, u_int32_t max_size_dblks) throw
(jexception)
+{
+ assert(wptr != NULL);
+ assert(max_size_dblks > 0);
+
+ size_t rec_offs = rec_offs_dblks * JRNL_DBLK_SIZE;
+ size_t rem = max_size_dblks * JRNL_DBLK_SIZE;
+ size_t wr_cnt = 0;
+ if (rec_offs_dblks) // Continuation of split data record (over 2 or more pages)
+ {
+ if (size_dblks(rec_size()) - rec_offs_dblks > max_size_dblks) // Further split
required
+ {
+ // TODO: The header will never be split as it will always be less than one
dblk.
+ // Remove this check...
+ size_t wsize = sizeof(_enq_hdr) > rec_offs ? sizeof(_enq_hdr) - rec_offs :
0;
+ size_t wsize2 = wsize;
+ if (wsize)
+ {
+ if (wsize > rem)
+ wsize = rem;
+ ::memcpy(wptr, (char*)&_enq_hdr + rec_offs, wsize);
+ wr_cnt = wsize;
+ rem -= wsize;
+ }
+ rec_offs -= sizeof(_enq_hdr) - wsize2;
+ if (rem)
+ {
+ wsize = _data_size > rec_offs ? _data_size - rec_offs : 0;
+ wsize2 = wsize;
+ if (wsize)
+ {
+ if (wsize > rem)
+ wsize = rem;
+ ::memcpy((char*)wptr + wr_cnt, (char*)_data + rec_offs, wsize);
+ wr_cnt += wsize;
+ rem -= wsize;
+ }
+ rec_offs -= _data_size - wsize2;
+ }
+ if (rem)
+ {
+ wsize = sizeof(_enq_tail) > rec_offs ? sizeof(_enq_tail) - rec_offs :
0;
+ wsize2 = wsize;
+ if (wsize)
+ {
+ if (wsize > rem)
+ wsize = rem;
+ ::memcpy((char*)wptr + wr_cnt, (char*)&_enq_tail + rec_offs,
wsize);
+ wr_cnt += wsize;
+ rem -= wsize;
+ }
+ rec_offs -= sizeof(_enq_tail) - wsize2;
+ }
+ assert(rem == 0);
+ assert(rec_offs == 0);
+ }
+ else // No further split required
+ {
+ // TODO: The header will never be split as it will always be less than one
dblk.
+ // Remove this check...
+ size_t wsize = sizeof(_enq_hdr) > rec_offs ? sizeof(_enq_hdr) - rec_offs :
0;
+ if (wsize)
+ {
+ ::memcpy(wptr, (char*)&_enq_hdr + rec_offs, wsize);
+ wr_cnt = wsize;
+ }
+ rec_offs -= sizeof(_enq_hdr) - wsize;
+ wsize = _data_size > rec_offs ? _data_size - rec_offs : 0;
+ if (wsize)
+ {
+ ::memcpy((char*)wptr + wr_cnt, (char*)_data + rec_offs, wsize);
+ wr_cnt += wsize;
+ }
+ rec_offs -= _data_size - wsize;
+ wsize = sizeof(_enq_tail) > rec_offs ? sizeof(_enq_tail) - rec_offs : 0;
+ if (wsize)
+ {
+ ::memcpy((char*)wptr + wr_cnt, (char*)&_enq_tail + rec_offs, wsize);
+ wr_cnt += wsize;
+#ifdef RHM_CLEAN
+ ::memset((char*)wptr + wr_cnt, RHM_CLEAN_CHAR,
+ _rec_size - (rec_offs_dblks * JRNL_DBLK_SIZE) - wr_cnt);
+#endif
+ }
+ rec_offs -= sizeof(_enq_tail) - wsize;
+ assert(rec_offs == 0);
+ }
+ }
+ else // Start at beginning of data record
+ {
+ if (size_dblks(rec_size()) > max_size_dblks) // Split required
+ {
+ size_t wsize = rem >= sizeof(_enq_hdr) ? sizeof(_enq_hdr) : rem;
+ ::memcpy(wptr, (void*)&_enq_hdr, wsize);
+ wr_cnt = wsize;
+ rem -= wsize;
+ if (rem)
+ {
+ wsize = rem >= _data_size ? _data_size : rem;
+ ::memcpy((char*)wptr + wr_cnt, _data, wsize);
+ wr_cnt += wsize;
+ rem -= wsize;
+ }
+ if (rem)
+ {
+ wsize = rem >= sizeof(_enq_tail) ? sizeof(_enq_tail) : rem;
+ ::memcpy((char*)wptr + wr_cnt, (void*)&_enq_tail, wsize);
+ wr_cnt += wsize;
+ rem -= wsize;
+ }
+ assert(rem == 0);
+ }
+ else // No split required
+ {
+ ::memcpy(wptr, (void*)&_enq_hdr, sizeof(_enq_hdr));
+ wr_cnt = sizeof(_enq_hdr);
+ ::memcpy((char*)wptr + wr_cnt, _data, _data_size);
+ wr_cnt += _data_size;
+ ::memcpy((char*)wptr + wr_cnt, (void*)&_enq_tail, sizeof(_enq_tail));
+ wr_cnt += sizeof(_enq_tail);
+#ifdef RHM_CLEAN
+ ::memset((char*)wptr + wr_cnt, RHM_CLEAN_CHAR, _rec_size - wr_cnt);
+#endif
+ }
+ }
+ return size_dblks(wr_cnt);
+}
+
+u_int32_t
+enq_rec::decode(hdr& h, void* rptr, u_int32_t rec_offs_dblks, u_int32_t
max_size_dblks)
+ throw (jexception)
+{
+ assert(rptr != NULL);
+ assert(max_size_dblks > 0);
+
+ size_t rd_cnt = 0;
+ if (rec_offs_dblks) // Continuation of record on new page
+ {
+ const u_int32_t hdr_data_dblks = size_dblks(enq_hdr::size() + _data_size);
+ const u_int32_t hdr_data_tail_dblks = size_dblks(enq_hdr::size() + _data_size +
+ rec_tail::size());
+ const size_t rec_offs = rec_offs_dblks * JRNL_DBLK_SIZE;
+
+ if (hdr_data_tail_dblks - rec_offs_dblks <= max_size_dblks)
+ {
+ // Remainder of record fits within this page
+ if (rec_offs - enq_hdr::size() < _data_size)
+ {
+ // Data still outstanding, copy remainder of data and tail
+ const size_t data_offs = rec_offs - enq_hdr::size();
+ const size_t data_rem = _data_size - data_offs;
+ ::memcpy((char*)_buff + data_offs, rptr, data_rem);
+ rd_cnt += data_rem;
+ ::memcpy((void*)&_enq_tail, ((char*)rptr + data_rem),
sizeof(_enq_tail));
+ chk_tail(_enq_tail, _enq_hdr);
+ rd_cnt += sizeof(_enq_tail);
+ }
+ else
+ {
+ // Tail or part of tail only outstanding, complete tail
+ const size_t tail_offs = rec_offs - enq_hdr::size() - _data_size;
+ const size_t tail_rem = rec_tail::size() - tail_offs;
+ ::memcpy((char*)&_enq_tail + tail_offs, rptr, tail_rem);
+ chk_tail(_enq_tail, _enq_hdr);
+ rd_cnt = tail_rem;
+ }
+ }
+ else if (hdr_data_dblks - rec_offs_dblks <= max_size_dblks)
+ {
+ // Remainder of record data fits within this page, tail split
+ const size_t data_offs = rec_offs - enq_hdr::size();
+ const size_t data_rem = _data_size - data_offs;
+ ::memcpy((char*)_buff + data_offs, rptr, data_rem);
+ rd_cnt += data_rem;
+ const size_t tail_rem = (max_size_dblks * JRNL_DBLK_SIZE) - rd_cnt;
+ if (tail_rem)
+ {
+ ::memcpy((void*)&_enq_tail, ((char*)rptr + data_rem), tail_rem);
+ rd_cnt += tail_rem;
+ }
+ }
+ else
+ {
+ // Remainder of record data split
+ const size_t data_cp_size = (max_size_dblks * JRNL_DBLK_SIZE);
+ ::memcpy((char*)_buff + rec_offs - enq_hdr::size(), rptr, data_cp_size);
+ rd_cnt += data_cp_size;
+ }
+ }
+ else // Start of record
+ {
+ // Get and check header
+ _enq_hdr._hdr.copy(h);
+ _enq_hdr._xidsize = *(size_t*)((char*)rptr + sizeof(hdr));
+ _enq_hdr._dsize = *(size_t*)((char*)rptr + sizeof(hdr) +
+#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
+ sizeof(u_int32_t) +
+#endif
+ sizeof(size_t)
+#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
+ + sizeof(u_int32_t)
+#endif
+ );
+ rd_cnt = _enq_hdr.size();
+ chk_hdr(_enq_hdr);
+ _data_size = _enq_hdr._dsize;
+ const u_int32_t hdr_data_dblks = size_dblks(enq_hdr::size() + _data_size);
+ const u_int32_t hdr_data_tail_dblks = size_dblks(enq_hdr::size() + _data_size +
+ rec_tail::size());
+
+ if (_data_size)
+ {
+ // Check if record (header + data + tail) fits within this page, we can check
the
+ // tail before the expense of copying data to memory
+ if (hdr_data_tail_dblks <= max_size_dblks)
+ {
+ // Entire header, data and tail fits within this page
+ ::memcpy((void*)&_enq_tail, (char*)rptr + rd_cnt + _data_size,
sizeof(_enq_tail));
+ chk_tail(_enq_tail, _enq_hdr);
+ ::memcpy(_buff, (char*)rptr + rd_cnt, _data_size);
+ rd_cnt += _data_size + sizeof(_enq_tail);
+ }
+ else if (hdr_data_dblks <= max_size_dblks)
+ {
+ // Entire header and data fit within this page, tail split
+ ::memcpy(_buff, (char*)rptr + rd_cnt, _data_size);
+ rd_cnt += _data_size;
+ const size_t tail_rem = (max_size_dblks * JRNL_DBLK_SIZE) - rd_cnt;
+ if (tail_rem)
+ {
+ ::memcpy((void*)&_enq_tail, (char*)rptr + rd_cnt, tail_rem);
+ rd_cnt += tail_rem;
+ }
+ }
+ else
+ {
+ // Header fits within this page, record data split
+ const size_t data_cp_size = (max_size_dblks * JRNL_DBLK_SIZE) - rd_cnt;
+ ::memcpy(_buff, (char*)rptr + rd_cnt, data_cp_size);
+ rd_cnt += data_cp_size;
+ }
+ }
+ }
+ return size_dblks(rd_cnt);
+}
+
+std::string&
+enq_rec::str(std::string& str) const
+{
+ std::stringstream ss;
+ ss << "enq_rec: m=" << _enq_hdr._hdr._magic;
+ ss << " v=" << (int)_enq_hdr._hdr._version;
+ ss << " rid=" << _enq_hdr._hdr._rid;
+ ss << " len=" << _enq_hdr._dsize;
+ str.append(ss.str());
+ return str;
+}
+
+const size_t
+enq_rec::data_size() const
+{
+ return _data_size;
+}
+
+const size_t
+enq_rec::rec_size() const
+{
+ return _data_size + enq_hdr::size() + rec_tail::size();
+}
+
+void
+enq_rec::set_rid(const u_int64_t rid)
+{
+ _enq_hdr._hdr._rid = rid;
+ _enq_tail._rid = rid;
+}
+
+void
+enq_rec::chk_hdr(enq_hdr& hdr, u_int64_t rid, bool enq) const throw (jexception)
+{
+ chk_hdr(hdr, enq);
+ if (hdr._hdr._rid != rid)
+ {
+ std::stringstream ss;
+ ss << std::hex << std::setfill('0');
+ ss << "rid mismatch: expected=0x" << std::setw(16) <<
rid;
+ ss << " read=0x" << std::setw(16) << hdr._hdr._rid;
+ throw jexception(jerrno::JERR_DREC_INVRHDR, ss.str(), "enq_rec",
"chk_hdr");
+ }
+}
+
+void
+enq_rec::chk_hdr(enq_hdr& hdr, bool enq) const throw (jexception)
+{
+ if (enq)
+ {
+ if (hdr._hdr._magic != RHM_JDAT_ENQ_MAGIC)
+ {
+ std::stringstream ss;
+ ss << std::hex << std::setfill('0');
+ ss << "enq magic: rid=0x" << std::setw(16) <<
hdr._hdr._rid;
+ ss << ": expected=0x" << std::setw(8) <<
RHM_JDAT_ENQ_MAGIC;
+ ss << " read=0x" << std::setw(2) <<
(int)hdr._hdr._magic;
+ throw jexception(jerrno::JERR_DREC_INVRHDR, ss.str(), "enq_rec",
"chk_hdr");
+ }
+ }
+ else
+ {
+ if (hdr._hdr._magic != RHM_JDAT_DEQ_MAGIC)
+ {
+ std::stringstream ss;
+ ss << std::hex << std::setfill('0');
+ ss << "deq magic: rid=0x" << std::setw(16) <<
hdr._hdr._rid;
+ ss << ": expected=0x" << std::setw(8) <<
RHM_JDAT_DEQ_MAGIC;
+ ss << " read=0x" << std::setw(2) <<
(int)hdr._hdr._magic;
+ throw jexception(jerrno::JERR_DREC_INVRHDR, ss.str(), "enq_rec",
"chk_hdr");
+ }
+ }
+ if (hdr._hdr._version != RHM_JDAT_VERSION)
+ {
+ std::stringstream ss;
+ ss << std::hex << std::setfill('0');
+ ss << "version: rid=0x" << std::setw(16) <<
hdr._hdr._rid;
+ ss << ": expected=0x" << std::setw(2) <<
(int)RHM_JDAT_VERSION;
+ ss << " read=0x" << std::setw(2) <<
(int)hdr._hdr._version;
+ throw jexception(jerrno::JERR_DREC_INVRHDR, ss.str(), "enq_rec",
"chk_hdr");
+ }
+#if defined (JRNL_LITTLE_ENDIAN)
+ u_int8_t endian_flag = RHM_LENDIAN_FLAG;
+#else
+ u_int8_t endian_flag = RHM_BENDIAN_FLAG;
+#endif
+ if (hdr._hdr._eflag != endian_flag)
+ {
+ std::stringstream ss;
+ ss << std::hex << std::setfill('0');
+ ss << "endian_flag: rid=" << std::setw(16) <<
hdr._hdr._rid;
+ ss << ": expected=0x" << std::setw(2) <<
(int)endian_flag;
+ ss << " read=0x" << std::setw(2) <<
(int)hdr._hdr._eflag;
+ throw jexception(jerrno::JERR_DREC_INVRHDR, ss.str(), "enq_rec",
"chk_hdr");
+ }
+ if (hdr._dsize > _max_data_size)
+ {
+ std::stringstream ss;
+ ss << std::hex << std::setfill('0');
+ ss << "data_size: rid=" << std::setw(16) <<
hdr._hdr._rid;
+ ss << std::dec << ": buff_size=" << _max_data_size
<< " data_size=" << hdr._dsize;
+ throw jexception(jerrno::JERR_DREC_BUFFSIZE, ss.str(), "enq_rec",
"chk_hdr");
+ }
+}
+
+} // namespace journal
+} // namespace rhm
Copied: store/trunk/cpp/lib/jrnl/enq_rec.hpp (from rev 946,
store/trunk/cpp/lib/jrnl/data_rec.hpp)
===================================================================
--- store/trunk/cpp/lib/jrnl/enq_rec.hpp (rev 0)
+++ store/trunk/cpp/lib/jrnl/enq_rec.hpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -0,0 +1,112 @@
+/**
+* \file enq_rec.hpp
+*
+* Red Hat Messaging - Message Journal
+*
+* This file contains the code for the rhm::journal::enq_rec (journal enqueue
+* record) class. See class documentation for details.
+*
+* \author Kim van der Riet
+*
+* Copyright 2007 Red Hat, Inc.
+*
+* This file is part of Red Hat Messaging.
+*
+* Red Hat Messaging is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+* USA
+*
+* The GNU Lesser General Public License is available in the file COPYING.
+*/
+
+#ifndef rhm_journal_enq_rec_hpp
+#define rhm_journal_enq_rec_hpp
+
+namespace rhm
+{
+namespace journal
+{
+class enq_rec;
+}
+}
+
+#include <jrnl/jrec.hpp>
+
+namespace rhm
+{
+namespace journal
+{
+
+ /**
+ * \class enq_rec
+ * \brief Class to handle a single journal enqueue record.
+ */
+ class enq_rec : public jrec
+ {
+ private:
+ enq_hdr _enq_hdr;
+ const void* _data; ///< Pointer to data to be written
+ void* _buff; ///< Pointer to buffer to receive read data
+ rec_tail _enq_tail;
+ size_t _max_data_size; ///< Max buffer size for decoding into during
read
+ size_t _data_size; ///< Size of data (bytes)
+ size_t _rec_size; ///< Size of data blocks required for record
(bytes)
+
+ public:
+ /**
+ * \brief Default constructor; must be used in conjunction with reset() to
prepare
+ * instance for use with write or read operations.
+ */
+ enq_rec();
+
+ /**
+ * \brief Constructor used for write operations, where mbuf contains data to be
written.
+ */
+ enq_rec(const u_int64_t rid, const void* const dbuf, const size_t dlen);
+
+ /**
+ * \brief Constructor used for read operations, where buf contains preallocated
space
+ * to receive data.
+ */
+ enq_rec(void* const buf, const size_t bufsize);
+ ~enq_rec();
+
+ // Prepare instance for use in writing data to journal
+ void reset(const u_int64_t rid, const void* const dbuf, const size_t dlen);
+ // Prepare instance for use in reading data from journal
+ void reset(void* const buf, const size_t bufsize);
+
+ u_int32_t encode(void* wptr, u_int32_t rec_offs_dblks, u_int32_t max_size_dblks)
+ throw (jexception);
+ u_int32_t decode(hdr& h, void* rptr, u_int32_t rec_offs_dblks, u_int32_t
max_size_dblks)
+ throw (jexception);
+ std::string& str(std::string& str) const;
+ inline const size_t max_data_size() const { return _max_data_size; }
+ inline const size_t max_rec_size() const
+ { return _max_data_size + enq_hdr::size() + rec_tail::size(); }
+ const size_t data_size() const;
+ const size_t rec_size() const;
+ inline const u_int32_t rec_size_dblks() const { return size_dblks(rec_size()); }
+ inline const u_int64_t rid() const { return _enq_hdr._hdr._rid; }
+ void set_rid(const u_int64_t rid);
+
+ private:
+ void chk_hdr(enq_hdr& hdr, u_int64_t rid, bool enq = true) const throw
(jexception);
+ void chk_hdr(enq_hdr& hdr, bool enq = true) const throw (jexception);
+ }; // class enq_rec
+
+} // namespace journal
+} // namespace rhm
+
+#endif // ifndef rhm_journal_enq_rec_hpp
Modified: store/trunk/cpp/lib/jrnl/file_hdr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/file_hdr.cpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/jrnl/file_hdr.cpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -42,6 +42,8 @@
namespace journal
{
+// ***** struct hdr *****
+
hdr::hdr():
_magic(0),
_version(0),
@@ -83,6 +85,27 @@
_rid = 0;
}
+
+// ***** struct rec_tail *****
+
+rec_tail::rec_tail():
+ _xmagic(0xffffff), // 1's complement of 0
+ _rid(0)
+{}
+
+rec_tail::rec_tail(const hdr& _hdr):
+ _xmagic(~_hdr._magic),
+ _rid(_hdr._rid)
+{}
+
+rec_tail::rec_tail(const u_int32_t xmagic, const u_int64_t rid):
+ _xmagic(xmagic),
+ _rid(rid)
+{}
+
+
+// ***** struct file_hdr *****
+
file_hdr::file_hdr():
_hdr(),
_fid(0),
@@ -173,54 +196,101 @@
_ts_nsec = ts.tv_nsec;
}
+
+// ***** struct enq_hdr *****
+
enq_hdr::enq_hdr():
_hdr(),
#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
_filler0(0),
#endif
+ _xidsize(0),
+#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
+ _filler0(0),
+#endif
+#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
+ _filler1(0),
+#endif
_dsize(0)
#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
- , _filler0(0)
+ , _filler1(0)
#endif
{}
-enq_hdr::enq_hdr(const u_int32_t magic, const u_int64_t rid, const size_t dsize,
- const u_int8_t version, const u_int8_t uflag):
- _hdr(magic, rid, version, uflag),
+enq_hdr::enq_hdr(const u_int32_t magic, const u_int64_t rid, const size_t xidsize,
+ const size_t dsize, const u_int8_t version, const bool transient):
+ _hdr(magic, rid, version, transient?ENQ_HDR_TRANSIENT_MASK:0),
#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
_filler0(0),
#endif
+ _xidsize(xidsize),
+#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
+ _filler0(0),
+#endif
+#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
+ _filler1(0),
+#endif
_dsize(dsize)
#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
- , _filler0(0)
+ , _filler1(0)
#endif
{}
+const u_int32_t enq_hdr::ENQ_HDR_TRANSIENT_MASK = 0x1;
-enq_tail::enq_tail():
- _xmagic(0xffffff), // 1's complement of 0
- _rid(0)
-{}
-enq_tail::enq_tail(const enq_hdr& rhdr):
- _xmagic(~rhdr._hdr._magic),
- _rid(rhdr._hdr._rid)
+// ***** struct deq_hdr *****
+
+deq_hdr::deq_hdr():
+ _hdr(),
+ _deq_rid(0),
+#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
+ _filler0(0),
+#endif
+ _xidsize(0)
+#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
+ , _filler0(0)
+#endif
{}
-enq_tail::enq_tail(const u_int32_t xmagic, const u_int64_t rid):
- _xmagic(xmagic),
- _rid(rid)
+deq_hdr::deq_hdr(const u_int32_t magic, const u_int64_t rid, const u_int64_t deq_rid,
+ const size_t xidsize, const u_int8_t version, const u_int8_t uflag):
+ _hdr(magic, rid, version, uflag),
+ _deq_rid(deq_rid),
+#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
+ _filler0(0),
+#endif
+ _xidsize(xidsize)
+#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
+ , _filler0(0)
+#endif
{}
-deq_hdr::deq_hdr():
+
+// ***** struct dtx_hdr *****
+
+
+dtx_hdr::dtx_hdr():
_hdr(),
- _deq_rid(0)
+#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
+ _filler0(0),
+#endif
+ _xidsize(0)
+#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
+ , _filler0(0)
+#endif
{}
-deq_hdr::deq_hdr(const u_int32_t magic, const u_int64_t rid, const u_int64_t deq_rid,
- const u_int8_t version, const u_int8_t uflag):
+dtx_hdr::dtx_hdr(const u_int32_t magic, const u_int64_t rid, const size_t xidsize,
+ const u_int8_t version, const u_int8_t uflag):
_hdr(magic, rid, version, uflag),
- _deq_rid(deq_rid)
+#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
+ _filler0(0),
+#endif
+ _xidsize(xidsize)
+#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
+ , _filler0(0)
+#endif
{}
} // namespace journal
Modified: store/trunk/cpp/lib/jrnl/file_hdr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/file_hdr.hpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/jrnl/file_hdr.hpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -53,7 +53,6 @@
#pragma pack(1)
/**
- * \struct hdr
* \brief Struct for data common to the head of all journal files and records.
* This includes identification for the file type, the encoding version, endian
* indicator and a record ID.
@@ -64,7 +63,7 @@
* +---+---+---+---+---+---+---+---+
* | magic | v | e | flags |
* +---+---+---+---+---+---+---+---+
- * | rec-id |
+ * | rid |
* +---+---+---+---+---+---+---+---+
* v = file version (If the format or encoding of this file changes, then this
* number should be incremented)
@@ -114,7 +113,54 @@
/**
- * \struct file_hdr
+ * \brief Struct for data common to the tail of all records. The magic number
+ * used here is the binary inverse (1's complement) of the magic used in the
+ * record header; this minimizes possible confusion with other headers that may
+ * be present during recovery.
+ *
+ * This header precedes all records in journal files.
+ *
+ * Record header info in binary format (12 bytes):
+ * <pre>
+ * 0 7
+ * +---+---+---+---+---+---+---+---+
+ * | ~(magic) | rid |
+ * +---+---+---+---+---+---+---+---+
+ * | rid (con't) |
+ * +---+---+---+---+
+ * </pre>
+ */
+ struct rec_tail
+ {
+ u_int32_t _xmagic; ///< Binary inverse (1's complement) of hdr magic
number
+ u_int64_t _rid; ///< ID (rotating 64-bit counter)
+
+
+ /**
+ * \brief Default constructor, which sets all values to 0.
+ */
+ rec_tail();
+
+
+ /**
+ * \brief Convenience constructor which initializes values during construction
from
+ * existing enq_hdr instance.
+ */
+ rec_tail(const hdr& _hdr);
+
+ /**
+ * \brief Convenience constructor which initializes values during construction.
+ */
+ rec_tail(const u_int32_t xmagic, const u_int64_t rid);
+
+ /**
+ * \brief Returns the size of the header in bytes.
+ */
+ inline static const size_t size() { return sizeof(rec_tail); }
+ };
+
+
+ /**
* \brief Struct for data common to the head of all journal files. In addition to
* the common data, this includes the record ID and offset of the first record in
* the file.
@@ -129,7 +175,7 @@
* +---+---+---+---+---+---+---+---+ -+
* | magic | v | e | flags | |
* +---+---+---+---+---+---+---+---+ | struct hdr
- * | first rec-id in file | |
+ * | first rid in file | |
* +---+---+---+---+---+---+---+---+ -+
* | fid | reserved (0) |
* +---+---+---+---+---+---+---+---+
@@ -209,20 +255,23 @@
/**
- * \struct enq_hdr
- * \brief Struct for data common to the head of all records. In addition to
- * the common data, this includes the data blob size.
+ * \brief Struct for enqueue record.
*
- * This header precedes all records in journal files.
+ * Struct for enqueue record. In addition to the common data, this header includes
both the
+ * xid and data blob sizes.
*
- * Record header info in binary format (24 bytes):
+ * This header precedes all enqueue data in journal files.
+ *
+ * Record header info in binary format (32 bytes):
* <pre>
* 0 7
* +---+---+---+---+---+---+---+---+ -+
* | magic | v | e | flags | |
* +---+---+---+---+---+---+---+---+ | struct hdr
- * | rec-id | |
+ * | rid | |
* +---+---+---+---+---+---+---+---+ -+
+ * | xidsize |
+ * +---+---+---+---+---+---+---+---+
* | dsize |
* +---+---+---+---+---+---+---+---+
* v = file version (If the format or encoding of this file changes, then this
@@ -241,10 +290,18 @@
#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
u_int32_t _filler0; ///< Big-endian filler for 32-bit size_t
#endif
- size_t _dsize; ///< Record data size
+ size_t _xidsize; ///< XID size
#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
u_int32_t _filler0; ///< Little-endian filler for 32-bit size_t
#endif
+#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
+ u_int32_t _filler1; ///< Big-endian filler for 32-bit size_t
+#endif
+ size_t _dsize; ///< Record data size
+#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
+ u_int32_t _filler1; ///< Little-endian filler for 32-bit size_t
+#endif
+ static const u_int32_t ENQ_HDR_TRANSIENT_MASK;
/**
* \brief Default constructor, which sets all values to 0.
@@ -254,8 +311,10 @@
/**
* \brief Convenience constructor which initializes values during construction.
*/
- enq_hdr(const u_int32_t magic, const u_int64_t rid, const size_t dsize,
- const u_int8_t version = 0, const u_int8_t uflag = 0);
+ enq_hdr(const u_int32_t magic, const u_int64_t rid, const size_t xidsize,
+ const size_t dsize, const u_int8_t version = 0, const bool transient =
false);
+
+ inline const bool is_transient() { return _hdr._uflag &
ENQ_HDR_TRANSIENT_MASK; }
/**
* \brief Returns the size of the header in bytes.
@@ -265,71 +324,89 @@
/**
- * \struct enq_tail
- * \brief Struct for data common to the tail of all records. The magic number
- * used here is the binary inverse (1's complement) of the magic used in the
- * record header; this minimizes possible confusion with other headers that may
- * be present during recovery.
+ * \brief Struct for dequeue record.
*
- * This header precedes all records in journal files.
+ * Struct for dequeue record. If this record has a non-zero xidsize field (i.e., there
is a
+ * valid XID), then this header is followed by the XID of xidsize bytes and a
rec_tail. If,
+ * on the other hand, this record has a zero xidsize (i.e., there is no XID), then the
rec_tail
+ * is absent.
*
- * Record header info in binary format (12 bytes):
+ * Note that this record had its own rid distinct from the rid of the record it is
dequeueing.
+ * The rid field below is the rid of the dequeue record itself; the deq-rid field is
the rid of a
+ * previous enqueue record being dequeued by this record.
+ *
+ * Record header info in binary format (24 bytes):
* <pre>
* 0 7
+ * +---+---+---+---+---+---+---+---+ -+
+ * | magic | v | e | flags | |
+ * +---+---+---+---+---+---+---+---+ | struct hdr
+ * | rid | |
+ * +---+---+---+---+---+---+---+---+ -+
+ * | deq-rid |
* +---+---+---+---+---+---+---+---+
- * | ~(magic) | rec-id |
+ * | xidsize |
* +---+---+---+---+---+---+---+---+
- * |rec-id (con't) |
- * +---+---+---+---+
+ * v = file version (If the format or encoding of this file changes, then this
+ * number should be incremented)
+ * e = endian flag, false (0x00) for little endian, true (0x01) for big endian
* </pre>
+ *
+ * Note that journal files should be transferable between 32- and 64-bit
+ * hardware of the same endianness, but not between hardware of opposite
+ * entianness without some sort of binary conversion utility. Thus buffering
+ * will be needed for types that change size between 32- and 64-bit compiles.
*/
- struct enq_tail
+ struct deq_hdr
{
- u_int32_t _xmagic; ///< Binary inverse (1's complement) of hdr magic
number
- u_int64_t _rid; ///< ID (rotating 64-bit counter)
+ hdr _hdr; ///< Common header
+ u_int64_t _deq_rid; ///< Record ID of dequeued record
+#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
+ u_int32_t _filler0; ///< Big-endian filler for 32-bit size_t
+#endif
+ size_t _xidsize; ///< XID size
+#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
+ u_int32_t _filler0; ///< Little-endian filler for 32-bit size_t
+#endif
-
/**
* \brief Default constructor, which sets all values to 0.
*/
- enq_tail();
+ deq_hdr();
-
/**
- * \brief Convenience constructor which initializes values during construction
from
- * existing enq_hdr instance.
- */
- enq_tail(const enq_hdr& rhdr);
-
- /**
* \brief Convenience constructor which initializes values during construction.
*/
- enq_tail(const u_int32_t xmagic, const u_int64_t rid);
+ deq_hdr(const u_int32_t magic, const u_int64_t rid, const u_int64_t deq_rid,
+ const size_t xidsize, const u_int8_t version = 0, const u_int8_t uflag =
0);
/**
* \brief Returns the size of the header in bytes.
*/
- inline static const size_t size() { return sizeof(enq_tail); }
+ inline static const size_t size() { return sizeof(deq_hdr); }
};
/**
- * \struct deq_hdr
- * \brief Struct for dequeue record. This record carries no data or tail,
- * and consists of this struct only. The record-id (part of hdr struct) is
- * the record id for this struct which is counted as a record.
+ * \brief Struct for DTX commit and abort records.
*
- * This header precedes all records in journal files.
+ * Struct for DTX commit and abort records. Only the magic distinguishes between them.
Since
+ * this record must be used in the context of a valid XID, the xidsize field must not
be zero.
+ * Immediately following this record is the XID itself which is xidsize bytes long,
followed by
+ * a rec_tail.
*
+ * Note that this record had its own rid distinct from the rids of the record(s)
making up the
+ * transaction it is committing or aborting.
+ *
* Record header info in binary format (24 bytes):
* <pre>
* 0 7
* +---+---+---+---+---+---+---+---+ -+
* | magic | v | e | flags | |
* +---+---+---+---+---+---+---+---+ | struct hdr
- * | rec-id | |
+ * | rid | |
* +---+---+---+---+---+---+---+---+ -+
- * | deq-rec-id |
+ * | xidsize |
* +---+---+---+---+---+---+---+---+
* v = file version (If the format or encoding of this file changes, then this
* number should be incremented)
@@ -341,26 +418,32 @@
* entianness without some sort of binary conversion utility. Thus buffering
* will be needed for types that change size between 32- and 64-bit compiles.
*/
- struct deq_hdr
+ struct dtx_hdr
{
hdr _hdr; ///< Common header
- u_int64_t _deq_rid; ///< Record ID of dequeued record
+#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
+ u_int32_t _filler0; ///< Big-endian filler for 32-bit size_t
+#endif
+ size_t _xidsize; ///< XID size
+#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
+ u_int32_t _filler0; ///< Little-endian filler for 32-bit size_t
+#endif
/**
* \brief Default constructor, which sets all values to 0.
*/
- deq_hdr();
+ dtx_hdr();
/**
* \brief Convenience constructor which initializes values during construction.
*/
- deq_hdr(const u_int32_t magic, const u_int64_t rid, const u_int64_t deq_rid,
+ dtx_hdr(const u_int32_t magic, const u_int64_t rid, const size_t xidsize,
const u_int8_t version = 0, const u_int8_t uflag = 0);
/**
* \brief Returns the size of the header in bytes.
*/
- inline static const size_t size() { return sizeof(deq_hdr); }
+ inline static const size_t size() { return sizeof(dtx_hdr); }
};
#pragma pack()
Modified: store/trunk/cpp/lib/jrnl/jcfg.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcfg.hpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/jrnl/jcfg.hpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -75,9 +75,11 @@
#define JRNL_INFO_EXTENSION "jinf" ///< Extension for journal info
files
#define JRNL_DATA_EXTENSION "jdat" ///< Extension for journal data
files
+#define RHM_JDAT_DTXA_MAGIC 0x614d4852 ///< ("RHMa" in little endian)
Magic for dtx abort hdrs
+#define RHM_JDAT_DTXC_MAGIC 0x634d4852 ///< ("RHMc" in little endian)
Magic for dtx commit hdrs
+#define RHM_JDAT_DEQ_MAGIC 0x644d4852 ///< ("RHMd" in little endian)
Magic for deq rec hdrs
+#define RHM_JDAT_ENQ_MAGIC 0x654d4852 ///< ("RHMe" in little endian)
Magic for enq rec hdrs
#define RHM_JDAT_FILE_MAGIC 0x664d4852 ///< ("RHMf" in little endian)
Magic for file hdrs
-#define RHM_JDAT_ENQ_MAGIC 0x654d4852 ///< ("RHMe" in little endian)
Magic for enq rec hdrs
-#define RHM_JDAT_DEQ_MAGIC 0x644d4852 ///< ("RHMd" in little endian)
Magic for deq rec hdrs
#define RHM_JDAT_EMPTY_MAGIC 0x784d4852 ///< ("RHMx" in little endian)
Magic for empty dblk
#define RHM_JDAT_VERSION 0x01 ///< Version (of file layout)
#define RHM_CLEAN_CHAR 0xff ///< Char used to clear empty space on
disk
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -395,10 +395,18 @@
{
case RHM_JDAT_ENQ_MAGIC:
{
+ size_t xidsize = 0;
size_t recsize = 0;
#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
jifs.ignore(sizeof(u_int32_t));
#endif
+ jifs.read((char*)&xidsize, sizeof(size_t));
+#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
+ jifs.ignore(sizeof(u_int32_t));
+#endif
+#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
+ jifs.ignore(sizeof(u_int32_t));
+#endif
jifs.read((char*)&recsize, sizeof(size_t));
#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
jifs.ignore(sizeof(u_int32_t));
@@ -409,7 +417,7 @@
rd._h_rid = h._rid;
//std::cout << " e" << h._rid;
u_int32_t rec_dblks = jrec::size_dblks((size_t)recsize +
sizeof(enq_hdr) +
- sizeof(enq_tail));
+ sizeof(rec_tail));
foffs += rec_dblks * JRNL_DBLK_SIZE;
jifs.seekg(foffs);
}
@@ -417,7 +425,15 @@
case RHM_JDAT_DEQ_MAGIC:
{
u_int64_t drid = 0;
+ size_t xidsize = 0;
jifs.read((char*)&drid, sizeof(u_int64_t));
+#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
+ jifs.ignore(sizeof(u_int32_t));
+#endif
+ jifs.read((char*)&xidsize, sizeof(size_t));
+#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
+ jifs.ignore(sizeof(u_int32_t));
+#endif
try
{
_emap.get_remove_fid(drid);
Modified: store/trunk/cpp/lib/jrnl/jrec.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jrec.cpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/jrnl/jrec.cpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -64,7 +64,7 @@
}
void
-jrec::chk_tail(enq_tail& tail, enq_hdr& hdr) const throw (jexception)
+jrec::chk_tail(rec_tail& tail, enq_hdr& hdr) const throw (jexception)
{
std::stringstream ss;
if (tail._xmagic != ~hdr._hdr._magic)
Modified: store/trunk/cpp/lib/jrnl/jrec.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jrec.hpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/jrnl/jrec.hpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -159,7 +159,7 @@
protected:
virtual void chk_hdr(enq_hdr& hdr, u_int64_t rid, bool enq = true)
const throw (jexception) = 0;
- virtual void chk_tail(enq_tail& tail, enq_hdr& hdr) const throw
(jexception);
+ virtual void chk_tail(rec_tail& tail, enq_hdr& hdr) const throw
(jexception);
}; // class jrec
} // namespace journal
Modified: store/trunk/cpp/lib/jrnl/pmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/pmgr.cpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/jrnl/pmgr.cpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -109,7 +109,7 @@
_pg_cntr(0),
_pg_offset_dblks(0),
_aio_evt_rem(0),
- _data_rec(),
+ _enq_rec(),
_cb(NULL)
{
initialize();
Modified: store/trunk/cpp/lib/jrnl/pmgr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/pmgr.hpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/jrnl/pmgr.hpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -45,7 +45,7 @@
#include <deque>
#include <libaio.h>
#include <jrnl/aio_cb.hpp>
-#include <jrnl/data_rec.hpp>
+#include <jrnl/enq_rec.hpp>
#include <jrnl/data_tok.hpp>
#include <jrnl/enq_map.hpp>
#include <jrnl/nlfh.hpp>
@@ -60,13 +60,13 @@
*/
enum _iores
{
- RHM_IORES_SUCCESS = 0, ///< Success: IO operation completed noramlly.
- RHM_IORES_AIO_WAIT, ///< IO operation suspended as all pages in cache are
waiting for AIO.
- RHM_IORES_EMPTY, ///< During read operations, nothing further is available
to read.
- RHM_IORES_FULL, ///< During write operations, the journal files are full.
- RHM_IORES_BUSY, ///< Another blocking operation is in progress.
- RHM_IORES_TXPENDING, ///< Operation blocked by pending transaction.
- RHM_IORES_NOTIMPL ///< Not yet implemented.
+ RHM_IORES_SUCCESS = 0, ///< Success: IO operation completed noramlly.
+ RHM_IORES_AIO_WAIT, ///< IO operation suspended - all pages are waiting
for AIO.
+ RHM_IORES_EMPTY, ///< During read operations, nothing further is
available to read.
+ RHM_IORES_FULL, ///< During write operations, the journal files are
full.
+ RHM_IORES_BUSY, ///< Another blocking operation is in progress.
+ RHM_IORES_TXPENDING, ///< Operation blocked by pending transaction.
+ RHM_IORES_NOTIMPL ///< Not yet implemented.
};
typedef _iores iores;
@@ -125,7 +125,7 @@
u_int32_t _pg_cntr; ///< Page counter; determines if file rotation
req'd
u_int32_t _pg_offset_dblks; ///< Page offset (used so far) in data blocks
u_int32_t _aio_evt_rem; ///< Remaining AIO events
- data_rec _data_rec; ///< Data record into/from which data is
encoded/decoded
+ enq_rec _enq_rec; ///< Data record into/from which data is
encoded/decoded
// TODO: move _cb down to wmgr, it is the only class that uses it There is no
need for
// read callbacks based on AIO. - (check this asertion)
aio_cb _cb; ///< Callback function pointer for AIO events
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -130,7 +130,7 @@
case RHM_JDAT_ENQ_MAGIC:
{
//std::cout << " E" << std::flush;
- _data_rec.reset(mbuf, mbsize); // sets enqueue rec size
+ _enq_rec.reset(mbuf, mbsize); // sets enqueue rec size
// Check if RID of this rec is still enqueued, if so read it, else skip
#ifdef RHM_RDONLY
bool is_enq = true;
@@ -189,7 +189,11 @@
{
//std::cout << " %" << std::flush;
// skip this record, it is already dequeued
- u_int64_t* sizep = (u_int64_t*)((char*)rptr + sizeof(hdr));
+ u_int64_t* sizep = (u_int64_t*)((char*)rptr + sizeof(hdr) +
+#if defined(JRNL_32_BIT)
+ sizeof(u_int32_t) + // filler
+#endif
+ sizeof(size_t));
//u_int32_t dblks = jrec::size_dblks((size_t)*sizep + sizeof(enq_hdr) +
sizeof(enq_tail));
//std::cout << "{" << *sizep << "=" << dblks
<< "d}" << std::flush;
dtokp->set_dsize((size_t)*sizep);
@@ -293,25 +297,25 @@
//std::cout << " V" << dtokp->dblocks_read() <<
"," << dblks_rem() << std::flush;
// Read data from this page, first block will have header and data size.
- u_int32_t dblks_rd = _data_rec.decode(h, rptr, dtokp->dblocks_read(),
dblks_rem());
+ u_int32_t dblks_rd = _enq_rec.decode(h, rptr, dtokp->dblocks_read(),
dblks_rem());
dtokp->incr_dblocks_read(dblks_rd);
_pg_offset_dblks += dblks_rd;
// If data still incomplete, move to next page and decode again
- while (dtokp->dblocks_read() < _data_rec.rec_size_dblks())
+ while (dtokp->dblocks_read() < _enq_rec.rec_size_dblks())
{
//std::cout << " W" << std::flush;
rotate_page();
if (_page_cb_arr[_pg_index]._state != AIO_COMPLETE)
{
dtokp->set_rstate(data_tok::READ_PART);
- dtokp->set_dsize(_data_rec.data_size());
+ dtokp->set_dsize(_enq_rec.data_size());
return RHM_IORES_AIO_WAIT;
}
rptr = (void*)((char*)_page_ptr_arr[_pg_index]);
- dblks_rd = _data_rec.decode(h, rptr, dtokp->dblocks_read(), dblks_rem());
+ dblks_rd = _enq_rec.decode(h, rptr, dtokp->dblocks_read(), dblks_rem());
dtokp->incr_dblocks_read(dblks_rd);
_pg_offset_dblks += dblks_rd;
}
@@ -324,7 +328,7 @@
// Set the record size in dtokp
dtokp->set_rstate(data_tok::READ);
- dtokp->set_dsize(_data_rec.data_size());
+ dtokp->set_dsize(_enq_rec.data_size());
return RHM_IORES_SUCCESS;
}
@@ -349,7 +353,7 @@
const iores
rmgr::skip(data_tok* dtokp) throw (jexception)
{
- u_int32_t dsize_dblks = jrec::size_dblks(dtokp->dsize() + sizeof(enq_hdr) +
sizeof(enq_tail));
+ u_int32_t dsize_dblks = jrec::size_dblks(dtokp->dsize() + sizeof(enq_hdr) +
sizeof(rec_tail));
u_int32_t tot_dblk_cnt = dtokp->rstate() == data_tok::SKIP_PART ?
dtokp->dblocks_read() : 0;
//std::cout << " S" << tot_dblk_cnt << std::flush;
while (true)
@@ -367,15 +371,15 @@
dtokp->incr_dblocks_read(this_dblk_cnt);
_pg_offset_dblks += this_dblk_cnt;
tot_dblk_cnt += this_dblk_cnt;
- if (tot_dblk_cnt < _data_rec.rec_size_dblks())
+ if (tot_dblk_cnt < _enq_rec.rec_size_dblks())
{
-//std::cout << " * t=" << tot_dblk_cnt << " rs="
<< _data_rec.rec_size_dblks() << std::flush;
+//std::cout << " * t=" << tot_dblk_cnt << " rs="
<< _enq_rec.rec_size_dblks() << std::flush;
rotate_page();
if (_page_cb_arr[_pg_index]._state != AIO_COMPLETE)
{
dtokp->set_rstate(data_tok::SKIP_PART);
// Use data_tok::dblocks_proc field to save how many skip bloks still to
go...
- dtokp->set_dblocks_read(_data_rec.rec_size_dblks() - tot_dblk_cnt);
+ dtokp->set_dblocks_read(_enq_rec.rec_size_dblks() - tot_dblk_cnt);
return RHM_IORES_AIO_WAIT;
}
//std::cout << " !" << std::flush;
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -114,7 +114,7 @@
else
rid = cont ? _wrfc.rid() - 1 : _wrfc.get_incr_rid();
- _data_rec.reset(rid, mbuf, dlen);
+ _enq_rec.reset(rid, mbuf, dlen);
if (!cont)
dtok->set_rid(rid);
bool done = false;
@@ -123,7 +123,7 @@
assert(_pg_offset_dblks < JRNL_WMGR_PAGE_SIZE * JRNL_SBLK_SIZE);
void* wptr = (void*)((char*)_page_ptr_arr[_pg_index] + _pg_offset_dblks *
JRNL_DBLK_SIZE);
u_int32_t data_offs_dblks = dtok->dblocks_written();
- u_int32_t ret = _data_rec.encode(wptr, data_offs_dblks,
+ u_int32_t ret = _enq_rec.encode(wptr, data_offs_dblks,
(JRNL_WMGR_PAGE_SIZE * JRNL_SBLK_SIZE) - _pg_offset_dblks);
#if !(defined(RHM_WRONLY) || defined(RHM_RDONLY))
if (data_offs_dblks == 0)
@@ -137,7 +137,7 @@
dtok->incr_dblocks_written(ret);
// Is the encoding of this record complete?
- if (dtok->dblocks_written() >= _data_rec.rec_size_dblks())
+ if (dtok->dblocks_written() >= _enq_rec.rec_size_dblks())
{
// TODO: Incorrect - must set state to ENQ_CACHED; ENQ_SUBM is set when AIO
returns.
dtok->set_wstate(data_tok::ENQ_SUBM);
@@ -153,7 +153,7 @@
// Has the file header been written (i.e. write pointers still at 0)?
if (_wrfc.empty())
{
- u_int32_t rec_dblks_rem = _data_rec.rec_size_dblks() - data_offs_dblks;
+ u_int32_t rec_dblks_rem = _enq_rec.rec_size_dblks() - data_offs_dblks;
bool file_fit = rec_dblks_rem <= JRNL_FILE_SIZE * JRNL_SBLK_SIZE;
bool file_full = rec_dblks_rem == JRNL_FILE_SIZE * JRNL_SBLK_SIZE;
size_t fro = 0;
@@ -232,7 +232,7 @@
// (currently dblk = 128 bytes). JRNL_DBLK_SIZE must be a power of 2.
// IF JRNL_DBLK_SIZE IS SET TO < 32 (i.e. 16 OR LESS) BYTES, THIS ENCODING WILL
FAIL!
//***
- deq_hdr dhdr(RHM_JDAT_DEQ_MAGIC, rid, dtok->rid(), RHM_JDAT_VERSION);
+ deq_hdr dhdr(RHM_JDAT_DEQ_MAGIC, rid, dtok->rid(), 0, RHM_JDAT_VERSION);
void* wptr = (void*)((char*)_page_ptr_arr[_pg_index] + _pg_offset_dblks *
JRNL_DBLK_SIZE);
::memcpy(wptr, &dhdr, sizeof(dhdr));
#ifdef RHM_CLEAN
Modified: store/trunk/cpp/tests/jrnl/Makefile.rtest
===================================================================
--- store/trunk/cpp/tests/jrnl/Makefile.rtest 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/tests/jrnl/Makefile.rtest 2007-09-25 20:25:49 UTC (rev 947)
@@ -55,7 +55,9 @@
data_tok.o \
file_hdr.o \
jrec.o \
- data_rec.o \
+ enq_rec.o \
+ deq_rec.o \
+ dtx_rec.o \
nlfh.o \
lfh.o \
rrfc.o \
@@ -123,6 +125,8 @@
clean-data:
@rm -rf jdata
+
+clean-test-data:
@rm -rf rd_test_jrnls
-clean-all: clean clean-data
+clean-all: clean clean-data clean-test-data
Modified: store/trunk/cpp/tests/jrnl/ftest.py
===================================================================
--- store/trunk/cpp/tests/jrnl/ftest.py 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/tests/jrnl/ftest.py 2007-09-25 20:25:49 UTC (rev 947)
@@ -29,6 +29,7 @@
sblk_size = 4 * dblk_size
file_size = (3072 + 1) * sblk_size
num_files = 8
+hdr_ver = 1
def load(f, klass):
args = load_args(f, klass)
@@ -91,7 +92,7 @@
self.flags = flags
self.rid = rid
if self.magic[-1] not in ['0x00', 'd', 'e', 'f',
'x']:
- error = 3;
+ error = 3
def __str__(self):
if self.empty():
@@ -111,6 +112,8 @@
def check(self):
if self.empty() or self.magic[-1] not in ['d', 'e', 'f',
'x']:
return True
+ if self.ver != hdr_ver and self.magic[-1] != 'x':
+ raise Exception('%s: Invalid header version: found %d, expected %d.'
% (self, self.ver, hdr_ver))
return False
@@ -142,16 +145,17 @@
class DeqHdr(Hdr):
- format = '=Q'
+ format = '=QQ'
- def init(self, f, foffs, deq_rid):
+ def init(self, f, foffs, deq_rid, xid):
self.deq_rid = deq_rid
+ self.xid = xid
def __str__(self):
- return '%s d=%d' % (Hdr.__str__(self), self.deq_rid)
+ return '%s d=%d x=%d' % (Hdr.__str__(self), self.deq_rid, self.xid)
-class EnqTail(Sizeable):
+class RecTail(Sizeable):
format = '=IQ'
@@ -169,9 +173,10 @@
class EnqRec(Hdr):
- format = '=Q'
+ format = '=QQ'
- def init(self, f, foffs, dsize):
+ def init(self, f, foffs, xid, dsize):
+ self.xid = xid
self.dsize = dsize
self.data = None
self.enq_tail = None
@@ -209,12 +214,12 @@
def load_tail(self, f):
if self.tail_bin == None:
self.tail_offs = f.tell()
- self.tail_bin = f.read(calcsize(EnqTail.format))
- if len(self.tail_bin) != calcsize(EnqTail.format):
+ self.tail_bin = f.read(calcsize(RecTail.format))
+ if len(self.tail_bin) != calcsize(RecTail.format):
return
else:
- self.tail_bin += f.read(calcsize(EnqTail.format) - len(self.tail_bin))
- self.enq_tail = EnqTail(self.tail_offs, *unpack(EnqTail.format, self.tail_bin))
+ self.tail_bin += f.read(calcsize(RecTail.format) - len(self.tail_bin))
+ self.enq_tail = RecTail(self.tail_offs, *unpack(RecTail.format, self.tail_bin))
magic_int = 0
inv_magic_int_1 = 0
for i in range(0,4):
@@ -235,7 +240,7 @@
dstr = self.data
if self.enq_tail == None:
return '%s s=%d data=\"%s\" [no tail]' %
(Hdr.__str__(self), self.dsize, dstr)
- return '%s s=%d data=\"%s\" %s' % (Hdr.__str__(self),
self.dsize, dstr, self.enq_tail)
+ return '%s x=%d s=%d data=\"%s\" %s' % (Hdr.__str__(self),
self.xid, self.dsize, dstr, self.enq_tail)
class Main:
@@ -284,7 +289,7 @@
else:
print ' * fro ok: 0x%08x' % self.fhdr.fro
self.first_rec = False
- if isinstance(hdr, EnqRec):
+ if isinstance(hdr, EnqRec) and not stop:
while not hdr.complete():
stop = self.advance_file()
if stop:
@@ -299,7 +304,7 @@
self.msg_cnt += 1
if self.auto_deq:
self.enqueued[hdr.rid] = hdr
- elif isinstance(hdr, DeqHdr):
+ elif isinstance(hdr, DeqHdr) and not stop:
if self.auto_deq:
if hdr.deq_rid in self.enqueued:
del self.enqueued[hdr.deq_rid]
Modified: store/trunk/cpp/tests/jrnl/msg_consumer.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/msg_consumer.cpp 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/tests/jrnl/msg_consumer.cpp 2007-09-25 20:25:49 UTC (rev 947)
@@ -71,13 +71,6 @@
msg_consumer::initialize(const u_int32_t numMsgs)
{
_num_msgs = numMsgs;
-// for (u_int32_t i=0; i<_num_msgs; i++)
-// {
-// rhm::journal::data_tok* dtp = new rhm::journal::data_tok;
-// dtp->set_wstate(rhm::journal::data_tok::ENQ); // Assume all msgs enqueued
OK
-// _dtok_master_list.push_back(dtp);
-//
-// }
}
void
@@ -93,15 +86,6 @@
_tot_dblks = 0;
_tot_dsize = 0;
_aio_cmpl_dtok_list.clear();
-// for (u_int32_t i=0; i<_dtok_master_list.size(); i++)
-// {
-// if (_dtok_master_list[i])
-// {
-// delete _dtok_master_list[i];
-// _dtok_master_list[i] = NULL;
-// }
-// }
-// _dtok_master_list.clear();
}
u_int32_t
Modified: store/trunk/cpp/tests/jrnl/rtest
===================================================================
--- store/trunk/cpp/tests/jrnl/rtest 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/tests/jrnl/rtest 2007-09-25 20:25:49 UTC (rev 947)
@@ -290,7 +290,8 @@
# Remove all previous data and build
echo -n "Clearing previous build and test files..."
- ${MAKE} clean-all
+ ${MAKE} clean
+ ${MAKE} clean-data
echo " ok"
# Make for write pipeline tests
Modified: store/trunk/cpp/tests/jrnl/rtests.csv
===================================================================
--- store/trunk/cpp/tests/jrnl/rtests.csv 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/tests/jrnl/rtests.csv 2007-09-25 20:25:49 UTC (rev 947)
@@ -8,65 +8,65 @@
4,10,10,10,TRUE,,"10-byte message"
,,,,,,
"Transition from one d-block to two per message",,,,,,
-5,10,92,92,FALSE,,"1 dblk exact fit"
-6,10,93,93,FALSE,,"1 dblk + 1 byte"
-7,10,92,92,TRUE,,"1 dblk exact fit"
-8,10,93,93,TRUE,,"1 dblk + 1 byte"
+5,10,84,84,FALSE,,"1 dblk exact fit"
+6,10,85,85,FALSE,,"1 dblk + 1 byte"
+7,10,84,84,TRUE,,"1 dblk exact fit"
+8,10,85,85,TRUE,,"1 dblk + 1 byte"
,,,,,,
"Transition from one s-block to two per message",,,,,,
-9,10,476,476,FALSE,,"1 sblk exact fit"
-10,10,477,477,FALSE,,"1 sblk + 1 byte"
-11,10,476,476,TRUE,,"1 sblk exact fit"
-12,10,477,477,TRUE,,"1 sblk + 1 byte"
+9,10,468,468,FALSE,,"1 sblk exact fit"
+10,10,469,469,FALSE,,"1 sblk + 1 byte"
+11,10,468,468,TRUE,,"1 sblk exact fit"
+12,10,469,469,TRUE,,"1 sblk + 1 byte"
,,,,,,
"Transition from first page to second",,,,,,
-13,8,8156,8156,FALSE,,"8 * 1/8 page; Total = 1 page exact fit"
-14,9,8156,8156,FALSE,,"9 * 1/8 page"
-15,8,8157,8157,FALSE,,"8 * (1/8 page + 1 byte)"
-16,8,8028,8028,TRUE,,"8 * (1/8 page – 1 dblk for deq record); Total = 1 page exact
fit with deqs"
-17,9,8028,8028,TRUE,,"9 * (1/8 page – 1 dblk for deq record)"
-18,8,8029,8029,TRUE,,"8 * (1/8 page – 1 dblk for deq record + 1 byte)"
+13,8,8148,8148,FALSE,,"8 * 1/8 page; Total = 1 page exact fit"
+14,9,8148,8148,FALSE,,"9 * 1/8 page"
+15,8,8149,8149,FALSE,,"8 * (1/8 page + 1 byte)"
+16,8,8020,8020,TRUE,,"8 * (1/8 page – 1 dblk for deq record); Total = 1 page exact
fit with deqs"
+17,9,8020,8020,TRUE,,"9 * (1/8 page – 1 dblk for deq record)"
+18,8,8021,8021,TRUE,,"8 * (1/8 page – 1 dblk for deq record + 1 byte)"
,,,,,,
"Page cache rollover (from last page back to page 0) - no dequeues as exact sizes
are needed and dequeues are non-deterministic",,,,,,
-19,16,65500,65500,FALSE,,"16 * (1 page exact fit); Total = entire cache
exactly"
-20,17,65500,65500,FALSE,,"17 * (1 page exact fit); Total = entire cache + reuse of 1
page"
-21,11,98268,98268,FALSE,,"11 * 1.5 pages"
-22,11,98140,98140,TRUE,,"11 * (1.5 pages including 1 sblk for deq record)"
+19,16,65492,65492,FALSE,,"16 * (1 page exact fit); Total = entire cache
exactly"
+20,17,65492,65492,FALSE,,"17 * (1 page exact fit); Total = entire cache + reuse of 1
page"
+21,11,98260,98260,FALSE,,"11 * 1.5 pages"
+22,11,98132,98132,TRUE,,"11 * (1.5 pages including 1 sblk for deq record)"
,,,,,,
"File transition (from file 0000 to 0001) - no dequeues as exact sizes are needed
and dequeues are non-deterministic",,,,,,
-23,24,65500,65500,FALSE,,"24 * (1 page exact fit); Total = entire file
exactly"
-24,25,65500,65500,FALSE,,"25 * (1 page exact fit); Total = entire file + 1
page"
-25,10,163804,163804,FALSE,,"10 * (2.5 pages); Total = entire file + 2 pages"
-26,10,163676,163676,TRUE,,"10 * (2.5 pages including 1 sblk for deq record); Total =
entire file + 2 pages"
+23,24,65492,65492,FALSE,,"24 * (1 page exact fit); Total = entire file
exactly"
+24,25,65492,65492,FALSE,,"25 * (1 page exact fit); Total = entire file + 1
page"
+25,10,163796,163796,FALSE,,"10 * (2.5 pages); Total = entire file + 2 pages"
+26,10,163668,163668,TRUE,,"10 * (2.5 pages including 1 sblk for deq record); Total =
entire file + 2 pages"
,,,,,,
"File rollover (from file 0007 to 0000) - RHM_WRONLY req'd for auto-dequeue ==
FALSE",,,,,,
-27,16,786396,786396,FALSE,,"16 * (12 pages = ½ file); Total = 8 files exactly"
+27,16,786388,786388,FALSE,,"16 * (12 pages = ½ file); Total = 8 files exactly"
,,,,,,
"Multi-page messages (large messages) - tests various paths in encoder; no dequeues
required to test this functionality.",,,,,,
-28,16,65500,65500,FALSE,,"16 * (1 page exact fit)"
-29,16,65501,65501,FALSE,,"16 * (1 page + 1 byte): tail split"
-30,16,65511,65511,FALSE,,"16 * (1 page + 11 bytes): tail split"
-31,16,65512,65512,FALSE,,"16 * (1 page + 12 bytes): tail separated exactly"
-32,16,65513,65513,FALSE,,"16 * (1 page + 13 bytes): data split"
-33,16,131036,131036,FALSE,,"16 * (2 pages exact fit)"
-34,16,131037,131037,FALSE,,"16 * (2 pages + 1 byte): tail split"
-35,16,131047,131047,FALSE,,"16 * (2 pages + 11 bytes): tail split"
-36,16,131048,131048,FALSE,,"16 * (2 pages + 12 bytes): tail separated exactly"
-37,16,131049,131049,FALSE,,"16 * (2 pages + 13 bytes) data split"
-38,16,262108,262108,FALSE,,"16 * (4 pages exact fit)"
-39,16,262109,262109,FALSE,,"16 * (4 pages + 1 byte: tail split)"
-40,16,262119,262119,FALSE,,"16 * (4 pages + 1 byte: tail split)"
-41,16,262120,262120,FALSE,,"16 * (4 pages + 12 bytes: tail separated)"
-42,16,262121,262121,FALSE,,"16 * (4 pages + 13 bytes: data split)"
-43,16,229340,229340,FALSE,,"16 * (3.5 pages)"
-44,16,229341,229341,FALSE,,"16 * (3.5 pages + 1 byte)"
+28,16,65492,65492,FALSE,,"16 * (1 page exact fit)"
+29,16,65493,65493,FALSE,,"16 * (1 page + 1 byte): tail split"
+30,16,65503,65503,FALSE,,"16 * (1 page + 11 bytes): tail split"
+31,16,65504,65504,FALSE,,"16 * (1 page + 12 bytes): tail separated exactly"
+32,16,65505,65505,FALSE,,"16 * (1 page + 13 bytes): data split"
+33,16,131028,131028,FALSE,,"16 * (2 pages exact fit)"
+34,16,131029,131029,FALSE,,"16 * (2 pages + 1 byte): tail split"
+35,16,131039,131039,FALSE,,"16 * (2 pages + 11 bytes): tail split"
+36,16,131040,131040,FALSE,,"16 * (2 pages + 12 bytes): tail separated exactly"
+37,16,131041,131041,FALSE,,"16 * (2 pages + 13 bytes) data split"
+38,16,262100,262100,FALSE,,"16 * (4 pages exact fit)"
+39,16,262101,262101,FALSE,,"16 * (4 pages + 1 byte: tail split)"
+40,16,262111,262111,FALSE,,"16 * (4 pages + 1 byte: tail split)"
+41,16,262112,262112,FALSE,,"16 * (4 pages + 12 bytes: tail separated)"
+42,16,262113,262113,FALSE,,"16 * (4 pages + 13 bytes: data split)"
+43,16,229332,229332,FALSE,,"16 * (3.5 pages)"
+44,16,229333,229333,FALSE,,"16 * (3.5 pages + 1 byte)"
,,,,,,
"These set up journals for circular tests (repeatedly reading same journal) Make
sure value testing is off!",,,,,,
-45,98304,0,92,FALSE,,"1 dblk no dequeues"
-46,49152,0,92,TRUE,,"1 dblk with dequeues"
-47,49152,0,220,FALSE,,"2 dblk no dequeues"
-48,24576,0,220,TRUE,,"2 dblk with dequeues"
-49,32768,220,220,TRUE,,"2 dblk fixed with dequeues"
+45,98304,0,84,FALSE,,"1 dblk no dequeues"
+46,49152,0,84,TRUE,,"1 dblk with dequeues"
+47,49152,0,212,FALSE,,"2 dblk no dequeues"
+48,24576,0,212,TRUE,,"2 dblk with dequeues"
+49,32768,212,212,TRUE,,"2 dblk fixed with dequeues"
,,,,,,
"Circular tests",,,,,,
50,10000000,0,0,FALSE,,"Read 10,000,000 messages from one of the circular test
journals above"
Modified: store/trunk/cpp/tests/jrnl/rwtests.csv
===================================================================
--- store/trunk/cpp/tests/jrnl/rwtests.csv 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/tests/jrnl/rwtests.csv 2007-09-25 20:25:49 UTC (rev 947)
@@ -8,61 +8,61 @@
4,10,10,10,TRUE,,"10-byte message"
,,,,,,
"Transition from one d-block to two per message",,,,,,
-5,10,92,92,FALSE,,"1 dblk exact fit"
-6,10,93,93,FALSE,,"1 dblk + 1 byte"
-7,10,92,92,TRUE,,"1 dblk exact fit"
-8,10,93,93,TRUE,,"1 dblk + 1 byte"
+5,10,84,84,FALSE,,"1 dblk exact fit"
+6,10,85,85,FALSE,,"1 dblk + 1 byte"
+7,10,84,84,TRUE,,"1 dblk exact fit"
+8,10,85,85,TRUE,,"1 dblk + 1 byte"
,,,,,,
"Transition from one s-block to two per message",,,,,,
-9,10,476,476,FALSE,,"1 sblk exact fit"
-10,10,477,477,FALSE,,"1 sblk + 1 byte"
-11,10,476,476,TRUE,,"1 sblk exact fit"
-12,10,477,477,TRUE,,"1 sblk + 1 byte"
+9,10,468,468,FALSE,,"1 sblk exact fit"
+10,10,469,469,FALSE,,"1 sblk + 1 byte"
+11,10,468,468,TRUE,,"1 sblk exact fit"
+12,10,469,469,TRUE,,"1 sblk + 1 byte"
,,,,,,
"Transition from first page to second",,,,,,
-13,8,4060,4060,FALSE,,"8 * 1/8 page; Total = 1 page exact fit"
-14,9,4060,4060,FALSE,,"9 * 1/8 page"
-15,8,4061,4061,FALSE,,"8 * (1/8 page + 1 byte)"
-16,8,3932,3932,TRUE,,"8 * (1/8 page - 1 dblk for deq record); Total = 1 page exact
fit with deqs"
-17,9,3932,3932,TRUE,,"9 * (1/8 page - 1 dblk for deq record)"
-18,8,3933,3933,TRUE,,"8 * (1/8 page - 1 dblk for deq record + 1 byte)"
+13,8,4052,4052,FALSE,,"8 * 1/8 page; Total = 1 page exact fit"
+14,9,4052,4052,FALSE,,"9 * 1/8 page"
+15,8,4053,4053,FALSE,,"8 * (1/8 page + 1 byte)"
+16,8,3924,3924,TRUE,,"8 * (1/8 page - 1 dblk for deq record); Total = 1 page exact
fit with deqs"
+17,9,3924,3924,TRUE,,"9 * (1/8 page - 1 dblk for deq record)"
+18,8,3925,3925,TRUE,,"8 * (1/8 page - 1 dblk for deq record + 1 byte)"
,,,,,,
"Page cache rollover (from page 32 back to page 0) - no dequeues as exact sizes are
needed and dequeues are non-deterministic",,,,,,
-19,32,32732,32732,FALSE,,"32 * (1 page exact fit); Total = entire cache
exactly"
-20,33,32732,32732,FALSE,,"33 * (1 page exact fit); Total = entire cache + reuse of 1
page"
-21,22,49116,49116,FALSE,,"22 * 1.5 pages"
-22,22,48988,48988,TRUE,,"22 * (1.5 pages including 1 sblk for deq record)"
+19,32,32724,32724,FALSE,,"32 * (1 page exact fit); Total = entire cache
exactly"
+20,33,32724,32724,FALSE,,"33 * (1 page exact fit); Total = entire cache + reuse of 1
page"
+21,22,49108,49108,FALSE,,"22 * 1.5 pages"
+22,22,48980,48980,TRUE,,"22 * (1.5 pages including 1 sblk for deq record)"
,,,,,,
"File transition (from file 0000 to 0001) - no dequeues as exact sizes are needed
and dequeues are non-deterministic",,,,,,
-23,48,32732,32732,FALSE,,"48 * (1 page exact fit); Total = entire file
exactly"
-24,49,32732,32732,FALSE,,"49 * (1 page exact fit); Total = entire file + 1
page"
-25,20,81884,81884,FALSE,,"20 * (2.5 pages); Total = entire file + 2 pages"
-26,20,81756,81756,TRUE,,"20 * (2.5 pages including 1 sblk for deq record); Total =
entire file + 2 pages"
+23,48,32724,32724,FALSE,,"48 * (1 page exact fit); Total = entire file
exactly"
+24,49,32724,32724,FALSE,,"49 * (1 page exact fit); Total = entire file + 1
page"
+25,20,81876,81876,FALSE,,"20 * (2.5 pages); Total = entire file + 2 pages"
+26,20,81748,81748,TRUE,,"20 * (2.5 pages including 1 sblk for deq record); Total =
entire file + 2 pages"
,,,,,,
"File rollover (from file 0007 to 0000) - RHM_WRONLY req'd for auto-dequeue ==
FALSE",,,,,,
-27,16,786396,786396,FALSE,,"16 * (24 pages = ½ file); Total = 8 files exactly"
-28,16,786268,786268,TRUE,,"16 * (24 pages = ½ file); Total = 8 files exactly"
-29,17,786268,786268,TRUE,,"17 * (24 pages = ½ file); Total = 8 files + file 0
overwritten by ½ file"
-30,16,786269,786269,TRUE,,"16 * (24 pages + 1 byte); Total = 8 files + file 0
overwritten by 16 sblks"
-31,32,786268,786268,TRUE,,"32 * (24 pages = ½ file); Total = 16 files exactly, all
files overwritten once"
-32,33,786268,786268,TRUE,,"33 * (24 pages = ½ file); Total = 16 ½ files, all files
overwritten once + file 0 overwritten again by ½ file"
-33,32,786269,786269,TRUE,,"32 * (24 pages + 1 byte); All files overwritten once +
file 0 overwritten again by 32 sblks"
+27,16,786388,786388,FALSE,,"16 * (24 pages = ½ file); Total = 8 files exactly"
+28,16,786260,786260,TRUE,,"16 * (24 pages = ½ file); Total = 8 files exactly"
+29,17,786260,786260,TRUE,,"17 * (24 pages = ½ file); Total = 8 files + file 0
overwritten by ½ file"
+30,16,786261,786261,TRUE,,"16 * (24 pages + 1 byte); Total = 8 files + file 0
overwritten by 16 sblks"
+31,32,786260,786260,TRUE,,"32 * (24 pages = ½ file); Total = 16 files exactly, all
files overwritten once"
+32,33,786260,786260,TRUE,,"33 * (24 pages = ½ file); Total = 16 ½ files, all files
overwritten once + file 0 overwritten again by ½ file"
+33,32,786261,786261,TRUE,,"32 * (24 pages + 1 byte); All files overwritten once +
file 0 overwritten again by 32 sblks"
,,,,,,
"Multi-page messages (large messages) - tests various paths in encoder; no dequeues
required to test this functionality.",,,,,,
-34,16,32732,32732,FALSE,,"16 * (1 page exact fit)"
-35,16,32733,32733,FALSE,,"16 * (1 page + 1 byte): tail split"
-36,16,32743,32743,FALSE,,"16 * (1 page + 11 bytes): tail split"
-37,16,32744,32744,FALSE,,"16 * (1 page + 12 bytes): tail separated exactly"
-38,16,32745,32745,FALSE,,"16 * (1 page + 13 bytes): data split"
-39,16,65500,65500,FALSE,,"16 * (2 pages exact fit)"
-40,16,65501,65501,FALSE,,"16 * (2 pages + 1 byte): tail split"
-41,16,65511,65511,FALSE,,"16 * (2 pages + 11 bytes): tail split"
-42,16,65512,65512,FALSE,,"16 * (2 pages + 12 bytes): tail separated exactly"
-43,16,65513,65513,FALSE,,"16 * (2 pages + 13 bytes) data split"
-44,16,131036,131036,FALSE,,"16 * (4 pages exact fit)"
-45,16,131037,131037,FALSE,,"16 * (4 pages + 1 byte: tail split)"
-46,16,131047,131047,FALSE,,"16 * (4 pages + 1 byte: tail split)"
-47,16,131048,131048,FALSE,,"16 * (4 pages + 12 bytes: tail separated)"
-48,16,131049,131049,FALSE,,"16 * (4 pages + 13 bytes: data split)"
-49,16,114652,114652,FALSE,,"16 * (3.5 pages)"
-50,16,114653,114653,FALSE,,"16 * (3.5 pages + 1 byte)"
+34,16,32724,32724,FALSE,,"16 * (1 page exact fit)"
+35,16,32725,32725,FALSE,,"16 * (1 page + 1 byte): tail split"
+36,16,32735,32735,FALSE,,"16 * (1 page + 11 bytes): tail split"
+37,16,32736,32736,FALSE,,"16 * (1 page + 12 bytes): tail separated exactly"
+38,16,32737,32737,FALSE,,"16 * (1 page + 13 bytes): data split"
+39,16,65492,65492,FALSE,,"16 * (2 pages exact fit)"
+40,16,65493,65493,FALSE,,"16 * (2 pages + 1 byte): tail split"
+41,16,65503,65503,FALSE,,"16 * (2 pages + 11 bytes): tail split"
+42,16,65504,65504,FALSE,,"16 * (2 pages + 12 bytes): tail separated exactly"
+43,16,65505,65505,FALSE,,"16 * (2 pages + 13 bytes) data split"
+44,16,131028,131028,FALSE,,"16 * (4 pages exact fit)"
+45,16,131029,131029,FALSE,,"16 * (4 pages + 1 byte: tail split)"
+46,16,131039,131039,FALSE,,"16 * (4 pages + 1 byte: tail split)"
+47,16,131040,131040,FALSE,,"16 * (4 pages + 12 bytes: tail separated)"
+48,16,131041,131041,FALSE,,"16 * (4 pages + 13 bytes: data split)"
+49,16,114644,114644,FALSE,,"16 * (3.5 pages)"
+50,16,114645,114645,FALSE,,"16 * (3.5 pages + 1 byte)"
Modified: store/trunk/cpp/tests/jrnl/tests.ods
===================================================================
(Binary files differ)
Modified: store/trunk/cpp/tests/jrnl/wtests.csv
===================================================================
--- store/trunk/cpp/tests/jrnl/wtests.csv 2007-09-25 19:25:41 UTC (rev 946)
+++ store/trunk/cpp/tests/jrnl/wtests.csv 2007-09-25 20:25:49 UTC (rev 947)
@@ -8,99 +8,99 @@
4,10,10,10,TRUE,,"10-byte message"
,,,,,,
"Transition from one d-block to two per message",,,,,,
-5,10,92,92,FALSE,,"1 dblk exact fit"
-6,10,93,93,FALSE,,"1 dblk + 1 byte"
-7,10,92,92,TRUE,,"1 dblk exact fit"
-8,10,93,93,TRUE,,"1 dblk + 1 byte"
+5,10,84,84,FALSE,,"1 dblk exact fit"
+6,10,85,85,FALSE,,"1 dblk + 1 byte"
+7,10,84,84,TRUE,,"1 dblk exact fit"
+8,10,85,85,TRUE,,"1 dblk + 1 byte"
,,,,,,
"Transition from one s-block to two per message",,,,,,
-9,10,476,476,FALSE,,"1 sblk exact fit"
-10,10,477,477,FALSE,,"1 sblk + 1 byte"
-11,10,476,476,TRUE,,"1 sblk exact fit"
-12,10,477,477,TRUE,,"1 sblk + 1 byte"
+9,10,468,468,FALSE,,"1 sblk exact fit"
+10,10,469,469,FALSE,,"1 sblk + 1 byte"
+11,10,468,468,TRUE,,"1 sblk exact fit"
+12,10,469,469,TRUE,,"1 sblk + 1 byte"
,,,,,,
"Transition from first page to second",,,,,,
-13,8,4060,4060,FALSE,,"8 * 1/8 page; Total = 1 page exact fit"
-14,9,4060,4060,FALSE,,"9 * 1/8 page"
-15,8,4061,4061,FALSE,,"8 * (1/8 page + 1 byte)"
-16,8,3932,3932,TRUE,,"8 * (1/8 page - 1 dblk for deq record); Total = 1 page exact
fit with deqs"
-17,9,3932,3932,TRUE,,"9 * (1/8 page - 1 dblk for deq record)"
-18,8,3933,3933,TRUE,,"8 * (1/8 page - 1 dblk for deq record + 1 byte)"
+13,8,4052,4052,FALSE,,"8 * 1/8 page; Total = 1 page exact fit"
+14,9,4052,4052,FALSE,,"9 * 1/8 page"
+15,8,4053,4053,FALSE,,"8 * (1/8 page + 1 byte)"
+16,8,3924,3924,TRUE,,"8 * (1/8 page - 1 dblk for deq record); Total = 1 page exact
fit with deqs"
+17,9,3924,3924,TRUE,,"9 * (1/8 page - 1 dblk for deq record)"
+18,8,3925,3925,TRUE,,"8 * (1/8 page - 1 dblk for deq record + 1 byte)"
,,,,,,
"Page cache rollover (from page 32 back to page 0) - no dequeues as exact sizes are
needed and dequeues are non-deterministic",,,,,,
-19,32,32732,32732,FALSE,,"32 * (1 page exact fit); Total = entire cache
exactly"
-20,33,32732,32732,FALSE,,"33 * (1 page exact fit); Total = entire cache + reuse of 1
page"
-21,22,49116,49116,FALSE,,"22 * 1.5 pages"
-22,22,48988,48988,TRUE,,"22 * (1.5 pages including 1 sblk for deq record)"
+19,32,32724,32724,FALSE,,"32 * (1 page exact fit); Total = entire cache
exactly"
+20,33,32724,32724,FALSE,,"33 * (1 page exact fit); Total = entire cache + reuse of 1
page"
+21,22,49108,49108,FALSE,,"22 * 1.5 pages"
+22,22,48980,48980,TRUE,,"22 * (1.5 pages including 1 sblk for deq record)"
,,,,,,
"File transition (from file 0000 to 0001) - no dequeues as exact sizes are needed
and dequeues are non-deterministic",,,,,,
-23,48,32732,32732,FALSE,,"48 * (1 page exact fit); Total = entire file
exactly"
-24,49,32732,32732,FALSE,,"49 * (1 page exact fit); Total = entire file + 1
page"
-25,20,81884,81884,FALSE,,"20 * (2.5 pages); Total = entire file + 2 pages"
-26,20,81756,81756,TRUE,,"20 * (2.5 pages including 1 sblk for deq record); Total =
entire file + 2 pages"
+23,48,32724,32724,FALSE,,"48 * (1 page exact fit); Total = entire file
exactly"
+24,49,32724,32724,FALSE,,"49 * (1 page exact fit); Total = entire file + 1
page"
+25,20,81876,81876,FALSE,,"20 * (2.5 pages); Total = entire file + 2 pages"
+26,20,81748,81748,TRUE,,"20 * (2.5 pages including 1 sblk for deq record); Total =
entire file + 2 pages"
,,,,,,
"File rollover (from file 0007 to 0000) - RHM_WRONLY req'd for auto-dequeue ==
FALSE",,,,,,
-27,16,786396,786396,FALSE,,"16 * (24 pages = ½ file); Total = 8 files exactly"
-28,17,786396,786396,FALSE,,"17 * (24 pages = ½ file); Total = 8 files + file 0
overwritten by ½ file"
-29,16,786397,786397,FALSE,,"16 * (24 pages + 1 byte); Total = 8 files + file 0
overwritten by 16 sblks"
-30,32,786396,786396,FALSE,,"32 * (24 pages = ½ file); Total = 16 files exactly, all
files overwritten once"
-31,33,786396,786396,FALSE,,"33 * (24 pages = ½ file); Total = 16 ½ files, all files
overwritten once + file 0 overwritten again by ½ file"
-32,32,786397,786397,FALSE,,"32 * (24 pages + 1 byte); All files overwritten once +
file 0 overwritten again by 32 sblks"
+27,16,786388,786388,FALSE,,"16 * (24 pages = ½ file); Total = 8 files exactly"
+28,17,786388,786388,FALSE,,"17 * (24 pages = ½ file); Total = 8 files + file 0
overwritten by ½ file"
+29,16,786389,786389,FALSE,,"16 * (24 pages + 1 byte); Total = 8 files + file 0
overwritten by 16 sblks"
+30,32,786388,786388,FALSE,,"32 * (24 pages = ½ file); Total = 16 files exactly, all
files overwritten once"
+31,33,786388,786388,FALSE,,"33 * (24 pages = ½ file); Total = 16 ½ files, all files
overwritten once + file 0 overwritten again by ½ file"
+32,32,786389,786389,FALSE,,"32 * (24 pages + 1 byte); All files overwritten once +
file 0 overwritten again by 32 sblks"
,,,,,,
"Multi-page messages (large messages) - tests various paths in encoder; no dequeues
required to test this functionality.",,,,,,
-33,16,32732,32732,FALSE,,"16 * (1 page exact fit)"
-34,16,32733,32733,FALSE,,"16 * (1 page + 1 byte): tail split"
-35,16,32743,32743,FALSE,,"16 * (1 page + 11 bytes): tail split"
-36,16,32744,32744,FALSE,,"16 * (1 page + 12 bytes): tail separated exactly"
-37,16,32745,32745,FALSE,,"16 * (1 page + 13 bytes): data split"
-38,16,65500,65500,FALSE,,"16 * (2 pages exact fit)"
-39,16,65501,65501,FALSE,,"16 * (2 pages + 1 byte): tail split"
-40,16,65511,65511,FALSE,,"16 * (2 pages + 11 bytes): tail split"
-41,16,65512,65512,FALSE,,"16 * (2 pages + 12 bytes): tail separated exactly"
-42,16,65513,65513,FALSE,,"16 * (2 pages + 13 bytes) data split"
-43,16,131036,131036,FALSE,,"16 * (4 pages exact fit)"
-44,16,131037,131037,FALSE,,"16 * (4 pages + 1 byte: tail split)"
-45,16,131047,131047,FALSE,,"16 * (4 pages + 1 byte: tail split)"
-46,16,131048,131048,FALSE,,"16 * (4 pages + 12 bytes: tail separated)"
-47,16,131049,131049,FALSE,,"16 * (4 pages + 13 bytes: data split)"
-48,16,114652,114652,FALSE,,"16 * (3.5 pages)"
-49,16,114653,114653,FALSE,,"16 * (3.5 pages + 1 byte)"
+33,16,32724,32724,FALSE,,"16 * (1 page exact fit)"
+34,16,32725,32725,FALSE,,"16 * (1 page + 1 byte): tail split"
+35,16,32735,32735,FALSE,,"16 * (1 page + 11 bytes): tail split"
+36,16,32736,32736,FALSE,,"16 * (1 page + 12 bytes): tail separated exactly"
+37,16,32737,32737,FALSE,,"16 * (1 page + 13 bytes): data split"
+38,16,65492,65492,FALSE,,"16 * (2 pages exact fit)"
+39,16,65493,65493,FALSE,,"16 * (2 pages + 1 byte): tail split"
+40,16,65503,65503,FALSE,,"16 * (2 pages + 11 bytes): tail split"
+41,16,65504,65504,FALSE,,"16 * (2 pages + 12 bytes): tail separated exactly"
+42,16,65505,65505,FALSE,,"16 * (2 pages + 13 bytes) data split"
+43,16,131028,131028,FALSE,,"16 * (4 pages exact fit)"
+44,16,131029,131029,FALSE,,"16 * (4 pages + 1 byte: tail split)"
+45,16,131039,131039,FALSE,,"16 * (4 pages + 1 byte: tail split)"
+46,16,131040,131040,FALSE,,"16 * (4 pages + 12 bytes: tail separated)"
+47,16,131041,131041,FALSE,,"16 * (4 pages + 13 bytes: data split)"
+48,16,114644,114644,FALSE,,"16 * (3.5 pages)"
+49,16,114645,114645,FALSE,,"16 * (3.5 pages + 1 byte)"
,,,,,,
"Large (multi-megabyte) messages - RHM_WRONLY req'd for auto-dequeue ==
FALSE",,,,,,
-50,32,1572828,1572828,FALSE,,"32 * (48 pages = 1 file exactly)"
-51,32,1572829,1572829,FALSE,,"32 * (48 pages + 1 byte)"
-52,32,1605596,1605596,FALSE,,"32 * (49 pages = 1 file + 1 page)"
-53,16,3145692,3145692,FALSE,,"16 * (96 pages = 2 files exactly)"
-54,16,3145693,3145693,FALSE,,"16 * (96 pages + 1 byte)"
-55,16,3178460,3178460,FALSE,,"16 * (97 pages = 2 files + 1 page"
-56,8,6291420,6291420,FALSE,,"8 * (192 pages = 4 files exactly)"
-57,8,6291421,6291421,FALSE,,"8 * (192 pages + 1 byte)"
-58,8,6324188,6324188,FALSE,,"8 * (193 pages = 4 files + 1 page)"
-59,32,1572700,1572700,TRUE,,"32 * (48 pages including 1 sblk for deq record = 1 file
exactly)"
-60,32,1572701,1572701,TRUE,,"32 * (48 pages including 1 sblk for deq record + 1
byte)"
-61,32,1605468,1605468,TRUE,,"32 * (49 pages including 1 sblk for deq record = 1 file
+ 1 page)"
-62,16,3145564,3145564,TRUE,,"16 * (96 pages including 1 sblk for deq record = 2
files exactly)"
-63,16,3145565,3145565,TRUE,,"16 * (96 pages including 1 sblk for deq record + 1
byte)"
-64,16,3178332,3178332,TRUE,,"16 * (97 pages including 1 sblk for deq record = 2
files + 1 page"
-65,8,6291292,6291292,TRUE,,"8 * (192 pages including 1 sblk for deq record = 4 files
exactly)"
-66,8,6291293,6291293,TRUE,,"8 * (192 pages including 1 sblk for deq record + 1
byte)"
-67,8,6324060,6324060,TRUE,,"8 * (193 pages including 1 sblk for deq record = 4 files
+ 1 page)"
+50,32,1572820,1572820,FALSE,,"32 * (48 pages = 1 file exactly)"
+51,32,1572821,1572821,FALSE,,"32 * (48 pages + 1 byte)"
+52,32,1605588,1605588,FALSE,,"32 * (49 pages = 1 file + 1 page)"
+53,16,3145684,3145684,FALSE,,"16 * (96 pages = 2 files exactly)"
+54,16,3145685,3145685,FALSE,,"16 * (96 pages + 1 byte)"
+55,16,3178452,3178452,FALSE,,"16 * (97 pages = 2 files + 1 page"
+56,8,6291412,6291412,FALSE,,"8 * (192 pages = 4 files exactly)"
+57,8,6291413,6291413,FALSE,,"8 * (192 pages + 1 byte)"
+58,8,6324180,6324180,FALSE,,"8 * (193 pages = 4 files + 1 page)"
+59,32,1572692,1572692,TRUE,,"32 * (48 pages including 1 sblk for deq record = 1 file
exactly)"
+60,32,1572693,1572693,TRUE,,"32 * (48 pages including 1 sblk for deq record + 1
byte)"
+61,32,1605460,1605460,TRUE,,"32 * (49 pages including 1 sblk for deq record = 1 file
+ 1 page)"
+62,16,3145556,3145556,TRUE,,"16 * (96 pages including 1 sblk for deq record = 2
files exactly)"
+63,16,3145557,3145557,TRUE,,"16 * (96 pages including 1 sblk for deq record + 1
byte)"
+64,16,3178324,3178324,TRUE,,"16 * (97 pages including 1 sblk for deq record = 2
files + 1 page"
+65,8,6291284,6291284,TRUE,,"8 * (192 pages including 1 sblk for deq record = 4 files
exactly)"
+66,8,6291285,6291285,TRUE,,"8 * (192 pages including 1 sblk for deq record + 1
byte)"
+67,8,6324052,6324052,TRUE,,"8 * (193 pages including 1 sblk for deq record = 4 files
+ 1 page)"
,,,,,,
"High volume tests of random message lengths - RHM_WRONLY req'd for auto-dequeue
== FALSE",,,,,,
-68,5000000,0,92,FALSE,,"1 dblk max"
-69,3000000,0,348,FALSE,,"3 dblks max"
-70,1600000,0,1244,FALSE,,"10 dblks max"
-71,600000,0,3804,FALSE,,"30 dblks max"
-72,200000,0,12764,FALSE,,"100 dblks max"
-73,60000,0,38364,FALSE,,"300 dblks max"
-74,20000,0,127964,FALSE,,"1000 dblks max"
-75,2500000,0,92,TRUE,,"1 dblk max"
-76,1500000,0,348,TRUE,,"3 dblks max"
-77,800000,0,1244,TRUE,,"10 dblks max"
-78,300000,0,3804,TRUE,,"30 dblks max"
-79,100000,0,12768,TRUE,,"100 dblks max"
-80,30000,0,38364,TRUE,,"300 dblks max"
-81,10000,0,127964,TRUE,,"1000 dblks max"
+68,5000000,0,84,FALSE,,"1 dblk max"
+69,3000000,0,340,FALSE,,"3 dblks max"
+70,1600000,0,1236,FALSE,,"10 dblks max"
+71,600000,0,3796,FALSE,,"30 dblks max"
+72,200000,0,12756,FALSE,,"100 dblks max"
+73,60000,0,38356,FALSE,,"300 dblks max"
+74,20000,0,127956,FALSE,,"1000 dblks max"
+75,2500000,0,84,TRUE,,"1 dblk max"
+76,1500000,0,340,TRUE,,"3 dblks max"
+77,800000,0,1236,TRUE,,"10 dblks max"
+78,300000,0,3796,TRUE,,"30 dblks max"
+79,100000,0,12756,TRUE,,"100 dblks max"
+80,30000,0,38356,TRUE,,"300 dblks max"
+81,10000,0,127956,TRUE,,"1000 dblks max"
,,,,,,
"STANDARD PERFORMANCE BENCHMARK: 10,000,000 writes, data=220b (2 dblks)",,,,,,
82,10000000,220,220,FALSE,,"2 dblks"