qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kp...@apache.org
Subject svn commit: r1516176 [2/4] - in /qpid/branches/linearstore/qpid: cpp/ cpp/docs/man/ cpp/src/ cpp/src/qpid/linearstore/jrnl/ cpp/src/qpid/linearstore/jrnl/utils/ tools/src/py/linearstore/
Date Wed, 21 Aug 2013 14:38:14 GMT
Copied: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.cpp (from r1513311, qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.cpp)
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.cpp?p2=qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.cpp&p1=qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.cpp&r1=1513311&r2=1516176&rev=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.cpp Wed Aug 21 14:38:12 2013
@@ -19,26 +19,15 @@
  *
  */
 
-/**
- * \file enq_rec.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * This file contains the code for the mrg::journal::enq_rec (journal enqueue
- * record) class. See comments in file enq_rec.h for details.
- *
- * \author Kim van der Riet
- */
-
-#include "qpid/legacystore/jrnl/enq_rec.h"
+#include "qpid/linearstore/jrnl/enq_rec.h"
 
 #include <cassert>
 #include <cerrno>
 #include <cstdlib>
 #include <cstring>
 #include <iomanip>
-#include "qpid/legacystore/jrnl/jerrno.h"
-#include "qpid/legacystore/jrnl/jexception.h"
+#include "qpid/linearstore/jrnl/jerrno.h"
+#include "qpid/linearstore/jrnl/jexception.h"
 #include <sstream>
 
 namespace mrg
@@ -49,23 +38,30 @@ namespace journal
 // Constructor used for read operations, where buf contains preallocated space to receive data.
 enq_rec::enq_rec():
         jrec(), // superclass
-        _enq_hdr(RHM_JDAT_ENQ_MAGIC, RHM_JDAT_VERSION, 0, 0, 0, false, false),
+        //_enq_hdr(QLS_ENQ_MAGIC, QLS_JRNL_VERSION, 0, 0, 0, false, false),
         _xidp(0),
         _data(0),
-        _buff(0),
-        _enq_tail(_enq_hdr)
-{}
+        _buff(0)
+        //_enq_tail(_enq_hdr)
+{
+    ::enq_hdr_init(&_enq_hdr, QLS_ENQ_MAGIC, QLS_JRNL_VERSION, 0, 0, 0, false);
+    ::rec_tail_copy(&_enq_tail, &_enq_hdr._rhdr, 0);
+}
 
 // Constructor used for transactional write operations, where dbuf contains data to be written.
-enq_rec::enq_rec(const u_int64_t rid, const void* const dbuf, const std::size_t dlen,
-        const void* const xidp, const std::size_t xidlen, const bool owi, const bool transient):
+enq_rec::enq_rec(const uint64_t rid, const void* const dbuf, const std::size_t dlen,
+        const void* const xidp, const std::size_t xidlen, const bool transient):
         jrec(), // superclass
-        _enq_hdr(RHM_JDAT_ENQ_MAGIC, RHM_JDAT_VERSION, rid, xidlen, dlen, owi, transient),
+        //_enq_hdr(QLS_ENQ_MAGIC, QLS_JRNL_VERSION, rid, xidlen, dlen, owi, transient),
         _xidp(xidp),
         _data(dbuf),
-        _buff(0),
-        _enq_tail(_enq_hdr)
-{}
+        _buff(0)
+        //_enq_tail(_enq_hdr)
+{
+    ::enq_hdr_init(&_enq_hdr, QLS_ENQ_MAGIC, QLS_JRNL_VERSION, 0, rid, xidlen, dlen);
+    ::rec_tail_copy(&_enq_tail, &_enq_hdr._rhdr, 0);
+    ::set_enq_transient(&_enq_hdr, transient);
+}
 
 enq_rec::~enq_rec()
 {
@@ -77,9 +73,8 @@ enq_rec::~enq_rec()
 void
 enq_rec::reset()
 {
-    _enq_hdr._rid = 0;
-    _enq_hdr.set_owi(false);
-    _enq_hdr.set_transient(false);
+    _enq_hdr._rhdr._rid = 0;
+    ::set_enq_transient(&_enq_hdr, false);
     _enq_hdr._xidsize = 0;
     _enq_hdr._dsize = 0;
     _xidp = 0;
@@ -91,14 +86,13 @@ enq_rec::reset()
 // Prepare instance for use in writing transactional data to journal, where dbuf contains data to
 // be written.
 void
-enq_rec::reset(const u_int64_t rid, const void* const dbuf, const std::size_t dlen,
-        const void* const xidp, const std::size_t xidlen, const bool owi, const bool transient,
+enq_rec::reset(const uint64_t rid, const void* const dbuf, const std::size_t dlen,
+        const void* const xidp, const std::size_t xidlen, const bool transient,
         const bool external)
 {
-    _enq_hdr._rid = rid;
-    _enq_hdr.set_owi(owi);
-    _enq_hdr.set_transient(transient);
-    _enq_hdr.set_external(external);
+    _enq_hdr._rhdr._rid = rid;
+    ::set_enq_transient(&_enq_hdr, transient);
+    ::set_enq_external(&_enq_hdr, external);
     _enq_hdr._xidsize = xidlen;
     _enq_hdr._dsize = dlen;
     _xidp = xidp;
@@ -107,8 +101,8 @@ enq_rec::reset(const u_int64_t rid, cons
     _enq_tail._rid = rid;
 }
 
-u_int32_t
-enq_rec::encode(void* wptr, u_int32_t rec_offs_dblks, u_int32_t max_size_dblks)
+uint32_t
+enq_rec::encode(void* wptr, uint32_t rec_offs_dblks, uint32_t max_size_dblks)
 {
     assert(wptr != 0);
     assert(max_size_dblks > 0);
@@ -134,7 +128,7 @@ enq_rec::encode(void* wptr, u_int32_t re
                 rem -= wsize;
             }
             rec_offs -= _enq_hdr._xidsize - wsize2;
-            if (rem && !_enq_hdr.is_external())
+            if (rem && !::is_enq_external(&_enq_hdr))
             {
                 wsize = _enq_hdr._dsize > rec_offs ? _enq_hdr._dsize - rec_offs : 0;
                 wsize2 = wsize;
@@ -176,7 +170,7 @@ enq_rec::encode(void* wptr, u_int32_t re
             }
             rec_offs -= _enq_hdr._xidsize - wsize;
             wsize = _enq_hdr._dsize > rec_offs ? _enq_hdr._dsize - rec_offs : 0;
-            if (wsize && !_enq_hdr.is_external())
+            if (wsize && !::is_enq_external(&_enq_hdr))
             {
                 std::memcpy((char*)wptr + wr_cnt, (const char*)_data + rec_offs, wsize);
                 wr_cnt += wsize;
@@ -213,7 +207,7 @@ enq_rec::encode(void* wptr, u_int32_t re
                 wr_cnt += wsize;
                 rem -= wsize;
             }
-            if (rem && !_enq_hdr.is_external())
+            if (rem && !::is_enq_external(&_enq_hdr))
             {
                 wsize = rem >= _enq_hdr._dsize ? _enq_hdr._dsize : rem;
                 std::memcpy((char*)wptr + wr_cnt, _data, wsize);
@@ -236,7 +230,7 @@ enq_rec::encode(void* wptr, u_int32_t re
                 std::memcpy((char*)wptr + wr_cnt, _xidp, _enq_hdr._xidsize);
                 wr_cnt += _enq_hdr._xidsize;
             }
-            if (!_enq_hdr.is_external())
+            if (!::is_enq_external(&_enq_hdr))
             {
                 std::memcpy((char*)wptr + wr_cnt, _data, _enq_hdr._dsize);
                 wr_cnt += _enq_hdr._dsize;
@@ -252,8 +246,8 @@ enq_rec::encode(void* wptr, u_int32_t re
     return size_dblks(wr_cnt);
 }
 
-u_int32_t
-enq_rec::decode(rec_hdr& h, void* rptr, u_int32_t rec_offs_dblks, u_int32_t max_size_dblks)
+uint32_t
+enq_rec::decode(rec_hdr_t& h, void* rptr, uint32_t rec_offs_dblks, uint32_t max_size_dblks)
 {
     assert(rptr != 0);
     assert(max_size_dblks > 0);
@@ -261,13 +255,13 @@ enq_rec::decode(rec_hdr& h, void* rptr, 
     std::size_t rd_cnt = 0;
     if (rec_offs_dblks) // Continuation of record on new page
     {
-        const u_int32_t hdr_xid_data_size = enq_hdr::size() + _enq_hdr._xidsize +
-                (_enq_hdr.is_external() ? 0 : _enq_hdr._dsize);
-        const u_int32_t hdr_xid_data_tail_size = hdr_xid_data_size + rec_tail::size();
-        const u_int32_t hdr_data_dblks = size_dblks(hdr_xid_data_size);
-        const u_int32_t hdr_tail_dblks = size_dblks(hdr_xid_data_tail_size);
+        const uint32_t hdr_xid_data_size = sizeof(enq_hdr_t) + _enq_hdr._xidsize +
+                (::is_enq_external(&_enq_hdr) ? 0 : _enq_hdr._dsize);
+        const uint32_t hdr_xid_data_tail_size = hdr_xid_data_size + sizeof(rec_tail_t);
+        const uint32_t hdr_data_dblks = size_dblks(hdr_xid_data_size);
+        const uint32_t hdr_tail_dblks = size_dblks(hdr_xid_data_tail_size);
         const std::size_t rec_offs = rec_offs_dblks * JRNL_DBLK_SIZE;
-        const std::size_t offs = rec_offs - enq_hdr::size();
+        const std::size_t offs = rec_offs - sizeof(enq_hdr_t);
 
         if (hdr_tail_dblks - rec_offs_dblks <= max_size_dblks)
         {
@@ -282,7 +276,7 @@ enq_rec::decode(rec_hdr& h, void* rptr, 
                 chk_tail();
                 rd_cnt += sizeof(_enq_tail);
             }
-            else if (offs < _enq_hdr._xidsize + _enq_hdr._dsize && !_enq_hdr.is_external())
+            else if (offs < _enq_hdr._xidsize + _enq_hdr._dsize && !::is_enq_external(&_enq_hdr))
             {
                 // some data still outstanding, copy remainder of data and tail
                 const std::size_t data_offs = offs - _enq_hdr._xidsize;
@@ -296,9 +290,9 @@ enq_rec::decode(rec_hdr& h, void* rptr, 
             else
             {
                 // Tail or part of tail only outstanding, complete tail
-                const std::size_t tail_offs = rec_offs - enq_hdr::size() - _enq_hdr._xidsize -
+                const std::size_t tail_offs = rec_offs - sizeof(enq_hdr_t) - _enq_hdr._xidsize -
                         _enq_hdr._dsize;
-                const std::size_t tail_rem = rec_tail::size() - tail_offs;
+                const std::size_t tail_rem = sizeof(rec_tail_t) - tail_offs;
                 std::memcpy((char*)&_enq_tail + tail_offs, rptr, tail_rem);
                 chk_tail();
                 rd_cnt = tail_rem;
@@ -329,7 +323,7 @@ enq_rec::decode(rec_hdr& h, void* rptr, 
                 std::memcpy((char*)_buff + offs, rptr, rem);
                 rd_cnt += rem;
             }
-            else if (offs < _enq_hdr._xidsize + _enq_hdr._dsize && !_enq_hdr.is_external()) // 2
+            else if (offs < _enq_hdr._xidsize + _enq_hdr._dsize && !::is_enq_external(&_enq_hdr)) // 2
             {
                 // some data still outstanding, copy remainder of data
                 const std::size_t data_offs = offs - _enq_hdr._xidsize;
@@ -355,33 +349,28 @@ enq_rec::decode(rec_hdr& h, void* rptr, 
     else // Start of record
     {
         // Get and check header
-        _enq_hdr.hdr_copy(h);
-        rd_cnt = sizeof(rec_hdr);
-#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
-        rd_cnt += sizeof(u_int32_t); // Filler 0
-#endif
+        //_enq_hdr.hdr_copy(h);
+        ::rec_hdr_copy(&_enq_hdr._rhdr, &h);
+        rd_cnt = sizeof(rec_hdr_t);
         _enq_hdr._xidsize = *(std::size_t*)((char*)rptr + rd_cnt);
         rd_cnt += sizeof(std::size_t);
-#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
-        rd_cnt += sizeof(u_int32_t); // Filler 0
-#endif
-#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
-        rd_cnt += sizeof(u_int32_t); // Filler 1
+#if defined(JRNL_32_BIT)
+        rd_cnt += sizeof(uint32_t); // Filler 0
 #endif
         _enq_hdr._dsize = *(std::size_t*)((char*)rptr + rd_cnt);
-        rd_cnt = _enq_hdr.size();
+        rd_cnt = sizeof(enq_hdr_t);
         chk_hdr();
-        if (_enq_hdr._xidsize + (_enq_hdr.is_external() ? 0 : _enq_hdr._dsize))
+        if (_enq_hdr._xidsize + (::is_enq_external(&_enq_hdr) ? 0 : _enq_hdr._dsize))
         {
-            _buff = std::malloc(_enq_hdr._xidsize + (_enq_hdr.is_external() ? 0 : _enq_hdr._dsize));
+            _buff = std::malloc(_enq_hdr._xidsize + (::is_enq_external(&_enq_hdr) ? 0 : _enq_hdr._dsize));
             MALLOC_CHK(_buff, "_buff", "enq_rec", "decode");
 
-            const u_int32_t hdr_xid_size = enq_hdr::size() + _enq_hdr._xidsize;
-            const u_int32_t hdr_xid_data_size = hdr_xid_size + (_enq_hdr.is_external() ? 0 : _enq_hdr._dsize);
-            const u_int32_t hdr_xid_data_tail_size = hdr_xid_data_size + rec_tail::size();
-            const u_int32_t hdr_xid_dblks  = size_dblks(hdr_xid_size);
-            const u_int32_t hdr_data_dblks = size_dblks(hdr_xid_data_size);
-            const u_int32_t hdr_tail_dblks = size_dblks(hdr_xid_data_tail_size);
+            const uint32_t hdr_xid_size = sizeof(enq_hdr_t) + _enq_hdr._xidsize;
+            const uint32_t hdr_xid_data_size = hdr_xid_size + (::is_enq_external(&_enq_hdr) ? 0 : _enq_hdr._dsize);
+            const uint32_t hdr_xid_data_tail_size = hdr_xid_data_size + sizeof(rec_tail_t);
+            const uint32_t hdr_xid_dblks  = size_dblks(hdr_xid_size);
+            const uint32_t hdr_data_dblks = size_dblks(hdr_xid_data_size);
+            const uint32_t hdr_tail_dblks = size_dblks(hdr_xid_data_tail_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_tail_dblks <= max_size_dblks)
@@ -392,7 +381,7 @@ enq_rec::decode(rec_hdr& h, void* rptr, 
                     std::memcpy(_buff, (char*)rptr + rd_cnt, _enq_hdr._xidsize);
                     rd_cnt += _enq_hdr._xidsize;
                 }
-                if (_enq_hdr._dsize && !_enq_hdr.is_external())
+                if (_enq_hdr._dsize && !::is_enq_external(&_enq_hdr))
                 {
                     std::memcpy((char*)_buff + _enq_hdr._xidsize, (char*)rptr + rd_cnt,
                             _enq_hdr._dsize);
@@ -410,7 +399,7 @@ enq_rec::decode(rec_hdr& h, void* rptr, 
                     std::memcpy(_buff, (char*)rptr + rd_cnt, _enq_hdr._xidsize);
                     rd_cnt += _enq_hdr._xidsize;
                 }
-                if (_enq_hdr._dsize && !_enq_hdr.is_external())
+                if (_enq_hdr._dsize && !::is_enq_external(&_enq_hdr))
                 {
                     std::memcpy((char*)_buff + _enq_hdr._xidsize, (char*)rptr + rd_cnt,
                             _enq_hdr._dsize);
@@ -431,7 +420,7 @@ enq_rec::decode(rec_hdr& h, void* rptr, 
                     std::memcpy(_buff, (char*)rptr + rd_cnt, _enq_hdr._xidsize);
                     rd_cnt += _enq_hdr._xidsize;
                 }
-                if (_enq_hdr._dsize && !_enq_hdr.is_external())
+                if (_enq_hdr._dsize && !::is_enq_external(&_enq_hdr))
                 {
                     const std::size_t data_cp_size = (max_size_dblks * JRNL_DBLK_SIZE) - rd_cnt;
                     std::memcpy((char*)_buff + _enq_hdr._xidsize, (char*)rptr + rd_cnt, data_cp_size);
@@ -451,25 +440,20 @@ enq_rec::decode(rec_hdr& h, void* rptr, 
 }
 
 bool
-enq_rec::rcv_decode(rec_hdr h, std::ifstream* ifsp, std::size_t& rec_offs)
+enq_rec::rcv_decode(rec_hdr_t h, std::ifstream* ifsp, std::size_t& rec_offs)
 {
     if (rec_offs == 0)
     {
         // Read header, allocate (if req'd) for xid
-        _enq_hdr.hdr_copy(h);
-#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
-        ifsp->ignore(sizeof(u_int32_t)); // _filler0
-#endif
+        //_enq_hdr.hdr_copy(h);
+        ::rec_hdr_copy(&_enq_hdr._rhdr, &h);
         ifsp->read((char*)&_enq_hdr._xidsize, sizeof(std::size_t));
-#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
-        ifsp->ignore(sizeof(u_int32_t)); // _filler0
-#endif
-#if defined(JRNL_BIG_ENDIAN) && defined(JRNL_32_BIT)
-        ifsp->ignore(sizeof(u_int32_t)); // _filler1
+#if defined(JRNL_32_BIT)
+        ifsp->ignore(sizeof(uint32_t)); // _filler0
 #endif
         ifsp->read((char*)&_enq_hdr._dsize, sizeof(std::size_t));
-#if defined(JRNL_LITTLE_ENDIAN) && defined(JRNL_32_BIT)
-        ifsp->ignore(sizeof(u_int32_t)); // _filler1
+#if defined(JRNL_32_BIT)
+        ifsp->ignore(sizeof(uint32_t)); // _filler1
 #endif
         rec_offs = sizeof(_enq_hdr);
         if (_enq_hdr._xidsize)
@@ -494,7 +478,7 @@ enq_rec::rcv_decode(rec_hdr h, std::ifst
             return false;
         }
     }
-    if (!_enq_hdr.is_external())
+    if (!::is_enq_external(&_enq_hdr))
     {
         if (rec_offs < sizeof(_enq_hdr) + _enq_hdr._xidsize +  _enq_hdr._dsize)
         {
@@ -514,16 +498,16 @@ enq_rec::rcv_decode(rec_hdr h, std::ifst
         }
     }
     if (rec_offs < sizeof(_enq_hdr) + _enq_hdr._xidsize +
-            (_enq_hdr.is_external() ? 0 : _enq_hdr._dsize) + sizeof(rec_tail))
+            (::is_enq_external(&_enq_hdr) ? 0 : _enq_hdr._dsize) + sizeof(rec_tail_t))
     {
         // Read tail (or continue reading tail)
         std::size_t offs = rec_offs - sizeof(_enq_hdr) - _enq_hdr._xidsize;
-        if (!_enq_hdr.is_external())
+        if (!::is_enq_external(&_enq_hdr))
             offs -= _enq_hdr._dsize;
-        ifsp->read((char*)&_enq_tail + offs, sizeof(rec_tail) - offs);
+        ifsp->read((char*)&_enq_tail + offs, sizeof(rec_tail_t) - offs);
         std::size_t size_read = ifsp->gcount();
         rec_offs += size_read;
-        if (size_read < sizeof(rec_tail) - offs)
+        if (size_read < sizeof(rec_tail_t) - offs)
         {
             assert(ifsp->eof());
             // As we may have read past eof, turn off fail bit
@@ -558,7 +542,7 @@ enq_rec::get_data(void** const datapp)
         *datapp = 0;
         return 0;
     }
-    if (_enq_hdr.is_external())
+    if (::is_enq_external(&_enq_hdr))
         *datapp = 0;
     else
         *datapp = (void*)((char*)_buff + _enq_hdr._xidsize);
@@ -569,9 +553,9 @@ std::string&
 enq_rec::str(std::string& str) const
 {
     std::ostringstream oss;
-    oss << "enq_rec: m=" << _enq_hdr._magic;
-    oss << " v=" << (int)_enq_hdr._version;
-    oss << " rid=" << _enq_hdr._rid;
+    oss << "enq_rec: m=" << _enq_hdr._rhdr._magic;
+    oss << " v=" << (int)_enq_hdr._rhdr._version;
+    oss << " rid=" << _enq_hdr._rhdr._rid;
     if (_xidp)
         oss << " xid=\"" << _xidp << "\"";
     oss << " len=" << _enq_hdr._dsize;
@@ -582,50 +566,50 @@ enq_rec::str(std::string& str) const
 std::size_t
 enq_rec::rec_size() const
 {
-    return rec_size(_enq_hdr._xidsize, _enq_hdr._dsize, _enq_hdr.is_external());
+    return rec_size(_enq_hdr._xidsize, _enq_hdr._dsize, ::is_enq_external(&_enq_hdr));
 }
 
 std::size_t
 enq_rec::rec_size(const std::size_t xidsize, const std::size_t dsize, const bool external)
 {
     if (external)
-        return enq_hdr::size() + xidsize + rec_tail::size();
-    return enq_hdr::size() + xidsize + dsize + rec_tail::size();
+        return sizeof(enq_hdr_t) + xidsize + sizeof(rec_tail_t);
+    return sizeof(enq_hdr_t) + xidsize + dsize + sizeof(rec_tail_t);
 }
 
 void
-enq_rec::set_rid(const u_int64_t rid)
+enq_rec::set_rid(const uint64_t rid)
 {
-    _enq_hdr._rid = rid;
+    _enq_hdr._rhdr._rid = rid;
     _enq_tail._rid = rid;
 }
 
 void
 enq_rec::chk_hdr() const
 {
-    jrec::chk_hdr(_enq_hdr);
-    if (_enq_hdr._magic != RHM_JDAT_ENQ_MAGIC)
+    jrec::chk_hdr(_enq_hdr._rhdr);
+    if (_enq_hdr._rhdr._magic != QLS_ENQ_MAGIC)
     {
         std::ostringstream oss;
         oss << std::hex << std::setfill('0');
-        oss << "enq magic: rid=0x" << std::setw(16) << _enq_hdr._rid;
-        oss << ": expected=0x" << std::setw(8) << RHM_JDAT_ENQ_MAGIC;
-        oss << " read=0x" << std::setw(2) << (int)_enq_hdr._magic;
+        oss << "enq magic: rid=0x" << std::setw(16) << _enq_hdr._rhdr._rid;
+        oss << ": expected=0x" << std::setw(8) << QLS_ENQ_MAGIC;
+        oss << " read=0x" << std::setw(2) << (int)_enq_hdr._rhdr._magic;
         throw jexception(jerrno::JERR_JREC_BADRECHDR, oss.str(), "enq_rec", "chk_hdr");
     }
 }
 
 void
-enq_rec::chk_hdr(u_int64_t rid) const
+enq_rec::chk_hdr(uint64_t rid) const
 {
     chk_hdr();
-    jrec::chk_rid(_enq_hdr, rid);
+    jrec::chk_rid(_enq_hdr._rhdr, rid);
 }
 
 void
 enq_rec::chk_tail() const
 {
-    jrec::chk_tail(_enq_tail, _enq_hdr);
+    jrec::chk_tail(_enq_tail, _enq_hdr._rhdr);
 }
 
 void

Copied: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.h (from r1513311, qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.h)
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.h?p2=qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.h&p1=qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.h&r1=1513311&r2=1516176&rev=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enq_rec.h Wed Aug 21 14:38:12 2013
@@ -19,15 +19,6 @@
  *
  */
 
-/**
- * \file enq_rec.h
- *
- * Qpid asynchronous store plugin library
- *
- * This file contains the code for the mrg::journal::enq_rec (journal enqueue
- * record) class. See class documentation for details.
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_ENQ_REC_H
 #define QPID_LEGACYSTORE_JRNL_ENQ_REC_H
 
@@ -40,8 +31,8 @@ class enq_rec;
 }
 
 #include <cstddef>
-#include "qpid/legacystore/jrnl/enq_hdr.h"
-#include "qpid/legacystore/jrnl/jrec.h"
+#include "qpid/linearstore/jrnl/utils/enq_hdr.h"
+#include "qpid/linearstore/jrnl/jrec.h"
 
 namespace mrg
 {
@@ -55,11 +46,11 @@ namespace journal
     class enq_rec : public jrec
     {
     private:
-        enq_hdr _enq_hdr;
+        enq_hdr_t _enq_hdr;
         const void* _xidp;          ///< xid pointer for encoding (for writing to disk)
         const void* _data;          ///< Pointer to data to be written to disk
         void* _buff;                ///< Pointer to buffer to receive data read from disk
-        rec_tail _enq_tail;
+        rec_tail_t _enq_tail;
 
     public:
         /**
@@ -70,8 +61,8 @@ namespace journal
         /**
         * \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 std::size_t dlen,
-                const void* const xidp, const std::size_t xidlen, const bool owi, const bool transient);
+        enq_rec(const uint64_t rid, const void* const dbuf, const std::size_t dlen,
+                const void* const xidp, const std::size_t xidlen, const bool transient);
 
         /**
         * \brief Destructor
@@ -81,31 +72,30 @@ namespace journal
         // Prepare instance for use in reading data from journal, xid and data will be allocated
         void reset();
         // Prepare instance for use in writing data to journal
-        void reset(const u_int64_t rid, const void* const dbuf, const std::size_t dlen,
-                const void* const xidp, const std::size_t xidlen, const bool owi, const bool transient,
+        void reset(const uint64_t rid, const void* const dbuf, const std::size_t dlen,
+                const void* const xidp, const std::size_t xidlen, const bool transient,
                 const bool external);
 
-        u_int32_t encode(void* wptr, u_int32_t rec_offs_dblks, u_int32_t max_size_dblks);
-        u_int32_t decode(rec_hdr& h, void* rptr, u_int32_t rec_offs_dblks,
-                u_int32_t max_size_dblks);
+        uint32_t encode(void* wptr, uint32_t rec_offs_dblks, uint32_t max_size_dblks);
+        uint32_t decode(rec_hdr_t& h, void* rptr, uint32_t rec_offs_dblks, uint32_t max_size_dblks);
         // Decode used for recover
-        bool rcv_decode(rec_hdr h, std::ifstream* ifsp, std::size_t& rec_offs);
+        bool rcv_decode(rec_hdr_t h, std::ifstream* ifsp, std::size_t& rec_offs);
 
         std::size_t get_xid(void** const xidpp);
         std::size_t get_data(void** const datapp);
-        inline bool is_transient() const { return _enq_hdr.is_transient(); }
-        inline bool is_external() const { return _enq_hdr.is_external(); }
+        inline bool is_transient() const { return ::is_enq_transient(&_enq_hdr); }
+        inline bool is_external() const { return ::is_enq_external(&_enq_hdr); }
         std::string& str(std::string& str) const;
         inline std::size_t data_size() const { return _enq_hdr._dsize; }
         inline std::size_t xid_size() const { return _enq_hdr._xidsize; }
         std::size_t rec_size() const;
         static std::size_t rec_size(const std::size_t xidsize, const std::size_t dsize, const bool external);
-        inline u_int64_t rid() const { return _enq_hdr._rid; }
-        void set_rid(const u_int64_t rid);
+        inline uint64_t rid() const { return _enq_hdr._rhdr._rid; }
+        void set_rid(const uint64_t rid);
 
     private:
         void chk_hdr() const;
-        void chk_hdr(u_int64_t rid) const;
+        void chk_hdr(uint64_t rid) const;
         void chk_tail() const;
         virtual void clean();
     }; // class enq_rec

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enums.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enums.h?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enums.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/enums.h Wed Aug 21 14:38:12 2013
@@ -19,16 +19,6 @@
  *
  */
 
-/**
- * \file enums.h
- *
- * Qpid asynchronous store plugin library
- *
- * File containing definitions for namespace mrg::journal enums.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_ENUMS_H
 #define QPID_LEGACYSTORE_JRNL_ENUMS_H
 

Copied: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcfg.h (from r1513311, qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcfg.h)
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcfg.h?p2=qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcfg.h&p1=qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcfg.h&r1=1513311&r2=1516176&rev=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcfg.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcfg.h Wed Aug 21 14:38:12 2013
@@ -19,35 +19,26 @@
  *
  */
 
-/**
- * \file jcfg.h
- *
- * Qpid asynchronous store plugin library
- *
- * This file contains \#defines that control the implementation details of
- * the journal.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_JCFG_H
 #define QPID_LEGACYSTORE_JRNL_JCFG_H
 
-#if defined(__i386__) /* little endian, 32 bits */
+/*
+#if defined(__i386__)  little endian, 32 bits
 #define JRNL_LITTLE_ENDIAN
 #define JRNL_32_BIT
-#elif defined(__PPC__) || defined(__s390__)  /* big endian, 32 bits */
+#elif defined(__PPC__) || defined(__s390__)   big endian, 32 bits
 #define JRNL_BIG_ENDIAN
 #define JRNL_32_BIT
-#elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__) /* little endian, 64 bits */
+#elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__)  little endian, 64 bits
 #define JRNL_LITTLE_ENDIAN
 #define JRNL_64_BIT
-#elif defined(__powerpc64__) || defined(__s390x__) /* big endian, 64 bits */
+#elif defined(__powerpc64__) || defined(__s390x__)  big endian, 64 bits
 #define JRNL_BIG_ENDIAN
 #define JRNL_64_BIT
 #else
 #error endian?
 #endif
+*/
 
 
 /**
@@ -57,35 +48,44 @@
 * </pre>
 * (The disk softblock size is 512 for Linux kernels >= 2.6)
 */
-#define JRNL_DBLK_SIZE          128         ///< Data block size in bytes (CANNOT BE LESS THAN 32!)
-#define JRNL_SBLK_SIZE          4           ///< Disk softblock size in multiples of JRNL_DBLK_SIZE
-#define JRNL_MIN_FILE_SIZE      128         ///< Min. jrnl file size in sblks (excl. file_hdr)
-#define JRNL_MAX_FILE_SIZE      4194176     ///< Max. jrnl file size in sblks (excl. file_hdr)
-#define JRNL_MIN_NUM_FILES      4           ///< Min. number of journal files
-#define JRNL_MAX_NUM_FILES      64          ///< Max. number of journal files
-#define JRNL_ENQ_THRESHOLD      80          ///< Percent full when enqueue connection will be closed
-
+#define JRNL_DBLK_SIZE          128         /**< Data block size in bytes (CANNOT BE LESS THAN 32!) */
+#define JRNL_SBLK_SIZE          32          /**< Disk softblock size in multiples of JRNL_DBLK_SIZE */
+//#define JRNL_MIN_FILE_SIZE      128         ///< Min. jrnl file size in sblks (excl. file_hdr)
+//#define JRNL_MAX_FILE_SIZE      4194176     ///< Max. jrnl file size in sblks (excl. file_hdr)
+//#define JRNL_MIN_NUM_FILES      4           ///< Min. number of journal files
+//#define JRNL_MAX_NUM_FILES      64          ///< Max. number of journal files
+//#define JRNL_ENQ_THRESHOLD      80          ///< Percent full when enqueue connection will be closed
+//
 #define JRNL_RMGR_PAGE_SIZE     128         ///< Journal page size in softblocks
 #define JRNL_RMGR_PAGES         16          ///< Number of pages to use in wmgr
-
-#define JRNL_WMGR_DEF_PAGE_SIZE 64          ///< Journal write page size in softblocks (default)
-#define JRNL_WMGR_DEF_PAGES     32          ///< Number of pages to use in wmgr (default)
-
+//
+//#define JRNL_WMGR_DEF_PAGE_SIZE 64          ///< Journal write page size in softblocks (default)
+//#define JRNL_WMGR_DEF_PAGES     32          ///< Number of pages to use in wmgr (default)
+//
 #define JRNL_WMGR_MAXDTOKPP     1024        ///< Max. dtoks (data blocks) per page in wmgr
 #define JRNL_WMGR_MAXWAITUS     100         ///< Max. wait time (us) before submitting AIO
-
-#define JRNL_INFO_EXTENSION     "jinf"      ///< Extension for journal info files
-#define JRNL_DATA_EXTENSION     "jdat"      ///< Extension for journal data files
-#define RHM_JDAT_TXA_MAGIC      0x614d4852  ///< ("RHMa" in little endian) Magic for dtx abort hdrs
-#define RHM_JDAT_TXC_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_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
-
-#define RHM_LENDIAN_FLAG 0      ///< Value of little endian flag on disk
-#define RHM_BENDIAN_FLAG 1      ///< Value of big endian flag on disk
+//
+//#define JRNL_INFO_EXTENSION     "jinf"      ///< Extension for journal info files
+//#define JRNL_DATA_EXTENSION     "jdat"      ///< Extension for journal data files
+#define QLS_JRNL_FILE_EXTENSION "jdat"      /**< Extension for journal data files */
+//#define RHM_JDAT_TXA_MAGIC      0x614d4852  ///< ("RHMa" in little endian) Magic for dtx abort hdrs
+#define QLS_TXA_MAGIC           0x61534c51  /**< ("RHMa" in little endian) Magic for dtx abort hdrs */
+//#define RHM_JDAT_TXC_MAGIC      0x634d4852  ///< ("RHMc" in little endian) Magic for dtx commit hdrs
+#define QLS_TXC_MAGIC           0x63534c51  ///< ("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 QLS_DEQ_MAGIC           0x64534c51  /**< ("QLSd" in little endian) Magic for deq rec hdrs */
+//#define RHM_JDAT_ENQ_MAGIC      0x654d4852  ///< ("RHMe" in little endian) Magic for enq rec hdrs
+#define QLS_ENQ_MAGIC           0x65534c51  /**< ("QLSe" in little endian) Magic for enq rec hdrs */
+//#define RHM_JDAT_FILE_MAGIC     0x664d4852  ///< ("RHMf" in little endian) Magic for file hdrs
+#define QLS_FILE_MAGIC          0x66534c51  /**< ("QLSf" in little endian) Magic for file hdrs */
+//#define RHM_JDAT_EMPTY_MAGIC    0x784d4852  ///< ("RHMx" in little endian) Magic for empty dblk
+#define QLS_EMPTY_MAGIC         0x78534c51  /**< ("QLSx" in little endian) Magic for empty dblk */
+//#define RHM_JDAT_VERSION        0x01        ///< Version (of file layout)
+#define QLS_JRNL_VERSION        0x0002      /**< Version (of file layout) */
+//#define RHM_CLEAN_CHAR          0xff        ///< Char used to clear empty space on disk
+#define QLS_CLEAN_CHAR          0xff        ///< Char used to clear empty space on disk
+//
+//#define RHM_LENDIAN_FLAG 0      ///< Value of little endian flag on disk
+//#define RHM_BENDIAN_FLAG 1      ///< Value of big endian flag on disk
 
 #endif // ifndef QPID_LEGACYSTORE_JRNL_JCFG_H

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcntl.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcntl.cpp?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcntl.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcntl.cpp Wed Aug 21 14:38:12 2013
@@ -19,19 +19,7 @@
  *
  */
 
-/**
- * \file jcntl.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * Messaging journal top-level control and interface class
- * mrg::journal::jcntl.  See comments in file jcntl.h for details.
- *
- * \author Kim van der Riet
- */
-
-
-#include "qpid/legacystore/jrnl/jcntl.h"
+#include "qpid/linearstore/jrnl/jcntl.h"
 
 #include <algorithm>
 #include <cassert>
@@ -41,9 +29,9 @@
 #include <fstream>
 #include <iomanip>
 #include <iostream>
-#include "qpid/legacystore/jrnl/file_hdr.h"
-#include "qpid/legacystore/jrnl/jerrno.h"
-#include "qpid/legacystore/jrnl/jinf.h"
+//#include "qpid/linearstore/jrnl/file_hdr.h"
+#include "qpid/linearstore/jrnl/jerrno.h"
+//#include "qpid/linearstore/jrnl/jinf.h"
 #include <limits>
 #include <sstream>
 #include <unistd.h>
@@ -83,13 +71,13 @@ jcntl::jcntl(const std::string& jid, con
     _readonly_flag(false),
     _autostop(true),
     _jfsize_sblks(0),
-    _lpmgr(),
+//    _lpmgr(),
     _emap(),
     _tmap(),
-    _rrfc(&_lpmgr),
-    _wrfc(&_lpmgr),
-    _rmgr(this, _emap, _tmap, _rrfc),
-    _wmgr(this, _emap, _tmap, _wrfc),
+//    _rrfc(&_lpmgr),
+//    _wrfc(&_lpmgr),
+    _rmgr(this, _emap, _tmap/*, _rrfc*/),
+    _wmgr(this, _emap, _tmap/*, _wrfc*/),
     _rcvdat()
 {}
 
@@ -98,12 +86,12 @@ jcntl::~jcntl()
     if (_init_flag && !_stop_flag)
         try { stop(true); }
         catch (const jexception& e) { std::cerr << e << std::endl; }
-    _lpmgr.finalize();
+//    _lpmgr.finalize();
 }
 
 void
-jcntl::initialize(const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles,
-        const u_int32_t jfsize_sblks, const u_int16_t wcache_num_pages, const u_int32_t wcache_pgsize_sblks,
+jcntl::initialize(const uint16_t num_jfiles/*, const bool ae, const uint16_t ae_max_jfiles*/,
+        const uint32_t jfsize_sblks, const uint16_t wcache_num_pages, const uint32_t wcache_pgsize_sblks,
         aio_callback* const cbp)
 {
     _init_flag = false;
@@ -113,40 +101,40 @@ jcntl::initialize(const u_int16_t num_jf
     _emap.clear();
     _tmap.clear();
 
-    _lpmgr.finalize();
+//    _lpmgr.finalize();
 
     // Set new file geometry parameters
-    assert(num_jfiles >= JRNL_MIN_NUM_FILES);
-    assert(num_jfiles <= JRNL_MAX_NUM_FILES);
+//    assert(num_jfiles >= JRNL_MIN_NUM_FILES);
+//    assert(num_jfiles <= JRNL_MAX_NUM_FILES);
     _emap.set_num_jfiles(num_jfiles);
     _tmap.set_num_jfiles(num_jfiles);
 
-    assert(jfsize_sblks >= JRNL_MIN_FILE_SIZE);
-    assert(jfsize_sblks <= JRNL_MAX_FILE_SIZE);
+//    assert(jfsize_sblks >= JRNL_MIN_FILE_SIZE);
+//    assert(jfsize_sblks <= JRNL_MAX_FILE_SIZE);
     _jfsize_sblks = jfsize_sblks;
 
     // Clear any existing journal files
     _jdir.clear_dir();
-    _lpmgr.initialize(num_jfiles, ae, ae_max_jfiles, this, &new_fcntl);
+//    _lpmgr.initialize(num_jfiles, ae, ae_max_jfiles, this, &new_fcntl);
 
-    _wrfc.initialize(_jfsize_sblks);
-    _rrfc.initialize();
-    _rrfc.set_findex(0);
+//    _wrfc.initialize(_jfsize_sblks);
+//    _rrfc.initialize();
+//    _rrfc.set_findex(0);
     _rmgr.initialize(cbp);
     _wmgr.initialize(cbp, wcache_pgsize_sblks, wcache_num_pages, JRNL_WMGR_MAXDTOKPP, JRNL_WMGR_MAXWAITUS);
 
     // Write info file (<basename>.jinf) to disk
-    write_infofile();
+//    write_infofile();
 
     _init_flag = true;
 }
 
 void
-jcntl::recover(const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles,
-        const u_int32_t jfsize_sblks, const u_int16_t wcache_num_pages, const u_int32_t wcache_pgsize_sblks,
+jcntl::recover(const uint16_t num_jfiles/*, const bool ae, const uint16_t ae_max_jfiles*/,
+        const uint32_t jfsize_sblks, const uint16_t wcache_num_pages, const uint32_t wcache_pgsize_sblks,
 //         const rd_aio_cb rd_cb, const wr_aio_cb wr_cb, const std::vector<std::string>* prep_txn_list_ptr,
         aio_callback* const cbp, const std::vector<std::string>* prep_txn_list_ptr,
-        u_int64_t& highest_rid)
+        uint64_t& highest_rid)
 {
     _init_flag = false;
     _stop_flag = false;
@@ -155,17 +143,17 @@ jcntl::recover(const u_int16_t num_jfile
     _emap.clear();
     _tmap.clear();
 
-    _lpmgr.finalize();
+//    _lpmgr.finalize();
 
-    assert(num_jfiles >= JRNL_MIN_NUM_FILES);
-    assert(num_jfiles <= JRNL_MAX_NUM_FILES);
-    assert(jfsize_sblks >= JRNL_MIN_FILE_SIZE);
-    assert(jfsize_sblks <= JRNL_MAX_FILE_SIZE);
+//    assert(num_jfiles >= JRNL_MIN_NUM_FILES);
+//    assert(num_jfiles <= JRNL_MAX_NUM_FILES);
+//    assert(jfsize_sblks >= JRNL_MIN_FILE_SIZE);
+//    assert(jfsize_sblks <= JRNL_MAX_FILE_SIZE);
     _jfsize_sblks = jfsize_sblks;
 
     // Verify journal dir and journal files
     _jdir.verify_dir();
-    _rcvdat.reset(num_jfiles, ae, ae_max_jfiles);
+    _rcvdat.reset(num_jfiles/*, ae, ae_max_jfiles*/);
 
     rcvr_janalyze(_rcvdat, prep_txn_list_ptr);
     highest_rid = _rcvdat._h_rid;
@@ -173,11 +161,11 @@ jcntl::recover(const u_int16_t num_jfile
         throw jexception(jerrno::JERR_JCNTL_RECOVERJFULL, "jcntl", "recover");
     this->log(LOG_DEBUG, _rcvdat.to_log(_jid));
 
-    _lpmgr.recover(_rcvdat, this, &new_fcntl);
+//    _lpmgr.recover(_rcvdat, this, &new_fcntl);
 
-    _wrfc.initialize(_jfsize_sblks, &_rcvdat);
-    _rrfc.initialize();
-    _rrfc.set_findex(_rcvdat.ffid());
+//    _wrfc.initialize(_jfsize_sblks, &_rcvdat);
+//    _rrfc.initialize();
+//    _rrfc.set_findex(_rcvdat.ffid());
     _rmgr.initialize(cbp);
     _wmgr.initialize(cbp, wcache_pgsize_sblks, wcache_num_pages, JRNL_WMGR_MAXDTOKPP, JRNL_WMGR_MAXWAITUS,
             (_rcvdat._lffull ? 0 : _rcvdat._eo));
@@ -191,11 +179,11 @@ jcntl::recover_complete()
 {
     if (!_readonly_flag)
         throw jexception(jerrno::JERR_JCNTL_NOTRECOVERED, "jcntl", "recover_complete");
-    for (u_int16_t i=0; i<_lpmgr.num_jfiles(); i++)
-        _lpmgr.get_fcntlp(i)->reset(&_rcvdat);
-    _wrfc.initialize(_jfsize_sblks, &_rcvdat);
-    _rrfc.initialize();
-    _rrfc.set_findex(_rcvdat.ffid());
+//    for (uint16_t i=0; i<_lpmgr.num_jfiles(); i++)
+//        _lpmgr.get_fcntlp(i)->reset(&_rcvdat);
+//    _wrfc.initialize(_jfsize_sblks, &_rcvdat);
+//    _rrfc.initialize();
+//    _rrfc.set_findex(_rcvdat.ffid());
     _rmgr.recover_complete();
     _readonly_flag = false;
 }
@@ -265,7 +253,7 @@ jcntl::enqueue_extern_txn_data_record(co
 
 /* TODO
 iores
-jcntl::get_data_record(const u_int64_t& rid, const std::size_t& dsize, const std::size_t& dsize_avail,
+jcntl::get_data_record(const uint64_t& rid, const std::size_t& dsize, const std::size_t& dsize_avail,
         const void** const data, bool auto_discard)
 {
     check_rstatus("get_data_record");
@@ -292,7 +280,8 @@ jcntl::read_data_record(void** const dat
         iores sres = _rmgr.synchronize(); // flushes all outstanding read events
         if (sres != RHM_IORES_SUCCESS)
             return sres;
-        _rmgr.wait_for_validity(&_aio_cmpl_timeout, true); // throw if timeout occurs
+        // TODO: Does linear store need this?
+//        _rmgr.wait_for_validity(&_aio_cmpl_timeout, true); // throw if timeout occurs
         res = _rmgr.read(datapp, dsize, xidpp, xidsize, transient, external, dtokp, ignore_pending_txns);
     }
     return res;
@@ -380,15 +369,16 @@ jcntl::stop(const bool block_till_aio_cm
     _stop_flag = true;
     if (!_readonly_flag)
         flush(block_till_aio_cmpl);
-    _rrfc.finalize();
-    _lpmgr.finalize();
+//    _rrfc.finalize();
+//    _lpmgr.finalize();
 }
 
-u_int16_t
+/*
+uint16_t
 jcntl::get_earliest_fid()
 {
-    u_int16_t ffid = _wrfc.earliest_index();
-    u_int16_t fid = _wrfc.index();
+    uint16_t ffid = _wrfc.earliest_index();
+    uint16_t fid = _wrfc.index();
     while ( _emap.get_enq_cnt(ffid) == 0 && _tmap.get_txn_pfid_cnt(ffid) == 0 && ffid != fid)
     {
         if (++ffid >= _lpmgr.num_jfiles())
@@ -398,6 +388,7 @@ jcntl::get_earliest_fid()
         _rrfc.set_findex(ffid);
     return ffid;
 }
+*/
 
 iores
 jcntl::flush(const bool block_till_aio_cmpl)
@@ -431,26 +422,30 @@ jcntl::log(log_level ll, const char* con
     }
 }
 
+/*
 void
 jcntl::chk_wr_frot()
 {
     if (_wrfc.index() == _rrfc.index())
         _rmgr.invalidate();
 }
+*/
 
 void
-jcntl::fhdr_wr_sync(const u_int16_t lid)
+jcntl::fhdr_wr_sync(const uint16_t /*lid*/)
 {
+/*
     fcntl* fcntlp = _lpmgr.get_fcntlp(lid);
     while (fcntlp->wr_fhdr_aio_outstanding())
     {
         if (get_wr_events(&_aio_cmpl_timeout) == jerrno::AIO_TIMEOUT)
             throw jexception(jerrno::JERR_JCNTL_AIOCMPLWAIT, "jcntl", "fhdr_wr_sync");
     }
+*/
 }
 
 fcntl*
-jcntl::new_fcntl(jcntl* const jcp, const u_int16_t lid, const u_int16_t fid, const rcvdat* const rdp)
+jcntl::new_fcntl(jcntl* const jcp, const uint16_t lid, const uint16_t fid, const rcvdat* const rdp)
 {
     if (!jcp) return 0;
     std::ostringstream oss;
@@ -480,6 +475,7 @@ jcntl::check_rstatus(const char* fn_name
         throw jexception(jerrno::JERR_JCNTL_STOPPED, "jcntl", fn_name);
 }
 
+/*
 void
 jcntl::write_infofile() const
 {
@@ -494,6 +490,7 @@ jcntl::write_infofile() const
             _jfsize_sblks, _wmgr.cache_pgsize_sblks(), _wmgr.cache_num_pages(), ts);
     ji.write();
 }
+*/
 
 void
 jcntl::aio_cmpl_wait()
@@ -501,7 +498,7 @@ jcntl::aio_cmpl_wait()
     //while (_wmgr.get_aio_evt_rem())
     while (true)
     {
-        u_int32_t aer;
+        uint32_t aer;
         {
             slock s(_wr_mutex);
             aer = _wmgr.get_aio_evt_rem();
@@ -532,17 +529,17 @@ jcntl::handle_aio_wait(const iores res, 
     }
     else if (res == RHM_IORES_FILE_AIOWAIT)
     {
-        while (_wmgr.curr_file_blocked())
-        {
-            if (_wmgr.get_events(pmgr::UNUSED, &_aio_cmpl_timeout) == jerrno::AIO_TIMEOUT)
-            {
-                std::ostringstream oss;
-                oss << "get_events() returned JERR_JCNTL_AIOCMPLWAIT; wmgr_status: " << _wmgr.status_str();
-                this->log(LOG_CRITICAL, oss.str());
-                throw jexception(jerrno::JERR_JCNTL_AIOCMPLWAIT, "jcntl", "handle_aio_wait");
-            }
-        }
-        _wrfc.wr_reset();
+//        while (_wmgr.curr_file_blocked())
+//        {
+//            if (_wmgr.get_events(pmgr::UNUSED, &_aio_cmpl_timeout) == jerrno::AIO_TIMEOUT)
+//            {
+//                std::ostringstream oss;
+//                oss << "get_events() returned JERR_JCNTL_AIOCMPLWAIT; wmgr_status: " << _wmgr.status_str();
+//                this->log(LOG_CRITICAL, oss.str());
+//                throw jexception(jerrno::JERR_JCNTL_AIOCMPLWAIT, "jcntl", "handle_aio_wait");
+//            }
+//        }
+//        _wrfc.wr_reset();
         resout = RHM_IORES_SUCCESS;
         data_tok::write_state ws = dtp->wstate();
         return ws == data_tok::ENQ_PART || ws == data_tok::DEQ_PART || ws == data_tok::ABORT_PART ||
@@ -552,8 +549,9 @@ jcntl::handle_aio_wait(const iores res, 
 }
 
 void
-jcntl::rcvr_janalyze(rcvdat& rd, const std::vector<std::string>* prep_txn_list_ptr)
+jcntl::rcvr_janalyze(rcvdat& /*rd*/, const std::vector<std::string>* /*prep_txn_list_ptr*/)
 {
+/*
     jinf ji(_jdir.dirname() + "/" + _base_filename + "." + JRNL_INFO_EXTENSION, true);
 
     // If the number of files does not tie up with the jinf file from the journal being recovered,
@@ -604,7 +602,7 @@ jcntl::rcvr_janalyze(rcvdat& rd, const s
     // Restore all read and write pointers and transactions
     if (!rd._jempty)
     {
-        u_int16_t fid = rd._ffid;
+        uint16_t fid = rd._ffid;
         std::ifstream ifs;
         bool lowi = rd._owi; // local copy of owi to be used during analysis
         while (rcvr_get_next_record(fid, &ifs, lowi, rd)) ;
@@ -647,17 +645,18 @@ jcntl::rcvr_janalyze(rcvdat& rd, const s
         rd._lffull = rd._eo == (1 + _jfsize_sblks) * JRNL_SBLK_SIZE * JRNL_DBLK_SIZE;
 
         // Check for journal full condition
-        u_int16_t next_wr_fid = (rd._lfid + 1) % rd._njf;
+        uint16_t next_wr_fid = (rd._lfid + 1) % rd._njf;
         rd._jfull = rd._ffid == next_wr_fid && rd._enq_cnt_list[next_wr_fid] && rd._lffull;
     }
+*/
 }
 
 bool
-jcntl::rcvr_get_next_record(u_int16_t& fid, std::ifstream* ifsp, bool& lowi, rcvdat& rd)
+jcntl::rcvr_get_next_record(uint16_t& fid, std::ifstream* ifsp/*, bool& lowi*/, rcvdat& rd)
 {
     std::size_t cum_size_read = 0;
     void* xidp = 0;
-    rec_hdr h;
+    rec_hdr_t h;
 
     bool hdr_ok = false;
     std::streampos file_pos;
@@ -665,27 +664,27 @@ jcntl::rcvr_get_next_record(u_int16_t& f
     {
         if (!ifsp->is_open())
         {
-            if (!jfile_cycle(fid, ifsp, lowi, rd, true))
+            if (!jfile_cycle(fid, ifsp/*, lowi*/, rd, true))
                 return false;
         }
         file_pos = ifsp->tellg();
-        ifsp->read((char*)&h, sizeof(rec_hdr));
-        if (ifsp->gcount() == sizeof(rec_hdr))
+        ifsp->read((char*)&h, sizeof(rec_hdr_t));
+        if (ifsp->gcount() == sizeof(rec_hdr_t))
             hdr_ok = true;
         else
         {
-            if (!jfile_cycle(fid, ifsp, lowi, rd, true))
+            if (!jfile_cycle(fid, ifsp/*, lowi*/, rd, true))
                 return false;
         }
     }
 
     switch(h._magic)
     {
-        case RHM_JDAT_ENQ_MAGIC:
+        case QLS_ENQ_MAGIC:
             {
                 enq_rec er;
-                u_int16_t start_fid = fid; // fid may increment in decode() if record folds over file boundary
-                if (!decode(er, fid, ifsp, cum_size_read, h, lowi, rd, file_pos))
+                uint16_t start_fid = fid; // fid may increment in decode() if record folds over file boundary
+                if (!decode(er, fid, ifsp, cum_size_read, h/*, lowi*/, rd, file_pos))
                     return false;
                 if (!er.is_transient()) // Ignore transient msgs
                 {
@@ -717,11 +716,11 @@ jcntl::rcvr_get_next_record(u_int16_t& f
                 }
             }
             break;
-        case RHM_JDAT_DEQ_MAGIC:
+        case QLS_DEQ_MAGIC:
             {
                 deq_rec dr;
-                u_int16_t start_fid = fid; // fid may increment in decode() if record folds over file boundary
-                if (!decode(dr, fid, ifsp, cum_size_read, h, lowi, rd, file_pos))
+                uint16_t start_fid = fid; // fid may increment in decode() if record folds over file boundary
+                if (!decode(dr, fid, ifsp, cum_size_read, h/*, lowi*/, rd, file_pos))
                     return false;
                 if (dr.xid_size())
                 {
@@ -748,10 +747,10 @@ jcntl::rcvr_get_next_record(u_int16_t& f
                 }
             }
             break;
-        case RHM_JDAT_TXA_MAGIC:
+        case QLS_TXA_MAGIC:
             {
                 txn_rec ar;
-                if (!decode(ar, fid, ifsp, cum_size_read, h, lowi, rd, file_pos))
+                if (!decode(ar, fid, ifsp, cum_size_read, h/*, lowi*/, rd, file_pos))
                     return false;
                 // Delete this txn from tmap, unlock any locked records in emap
                 ar.get_xid(&xidp);
@@ -768,10 +767,10 @@ jcntl::rcvr_get_next_record(u_int16_t& f
                 std::free(xidp);
             }
             break;
-        case RHM_JDAT_TXC_MAGIC:
+        case QLS_TXC_MAGIC:
             {
                 txn_rec cr;
-                if (!decode(cr, fid, ifsp, cum_size_read, h, lowi, rd, file_pos))
+                if (!decode(cr, fid, ifsp, cum_size_read, h/*, lowi*/, rd, file_pos))
                     return false;
                 // Delete this txn from tmap, process records into emap
                 cr.get_xid(&xidp);
@@ -800,12 +799,12 @@ jcntl::rcvr_get_next_record(u_int16_t& f
                 std::free(xidp);
             }
             break;
-        case RHM_JDAT_EMPTY_MAGIC:
+        case QLS_EMPTY_MAGIC:
             {
-                u_int32_t rec_dblks = jrec::size_dblks(sizeof(rec_hdr));
-                ifsp->ignore(rec_dblks * JRNL_DBLK_SIZE - sizeof(rec_hdr));
+                uint32_t rec_dblks = jrec::size_dblks(sizeof(rec_hdr_t));
+                ifsp->ignore(rec_dblks * JRNL_DBLK_SIZE - sizeof(rec_hdr_t));
                 assert(!ifsp->fail() && !ifsp->bad());
-                if (!jfile_cycle(fid, ifsp, lowi, rd, false))
+                if (!jfile_cycle(fid, ifsp/*, lowi*/, rd, false))
                     return false;
             }
             break;
@@ -821,13 +820,13 @@ jcntl::rcvr_get_next_record(u_int16_t& f
 }
 
 bool
-jcntl::decode(jrec& rec, u_int16_t& fid, std::ifstream* ifsp, std::size_t& cum_size_read,
-        rec_hdr& h, bool& lowi, rcvdat& rd, std::streampos& file_offs)
+jcntl::decode(jrec& rec, uint16_t& fid, std::ifstream* ifsp, std::size_t& cum_size_read,
+        rec_hdr_t& h/*, bool& lowi*/, rcvdat& rd, std::streampos& file_offs)
 {
-    u_int16_t start_fid = fid;
+    uint16_t start_fid = fid;
     std::streampos start_file_offs = file_offs;
-    if (!check_owi(fid, h, lowi, rd, file_offs))
-        return false;
+//    if (!check_owi(fid, h, lowi, rd, file_offs))
+//        return false;
     bool done = false;
     while (!done)
     {
@@ -844,7 +843,7 @@ jcntl::decode(jrec& rec, u_int16_t& fid,
 //             rd._lfid = start_fid;
             return false;
         }
-        if (!done && !jfile_cycle(fid, ifsp, lowi, rd, false))
+        if (!done && !jfile_cycle(fid, ifsp/*, lowi*/, rd, false))
         {
             check_journal_alignment(start_fid, start_file_offs, rd);
             return false;
@@ -854,7 +853,7 @@ jcntl::decode(jrec& rec, u_int16_t& fid,
 }
 
 bool
-jcntl::jfile_cycle(u_int16_t& fid, std::ifstream* ifsp, bool& lowi, rcvdat& rd, const bool jump_fro)
+jcntl::jfile_cycle(uint16_t& fid, std::ifstream* ifsp/*, bool& lowi*/, rcvdat& rd, const bool jump_fro)
 {
     if (ifsp->is_open())
     {
@@ -867,7 +866,7 @@ jcntl::jfile_cycle(u_int16_t& fid, std::
             if (++fid >= rd._njf)
             {
                 fid = 0;
-                lowi = !lowi; // Flip local owi
+//                lowi = !lowi; // Flip local owi
             }
             if (fid == rd._ffid) // used up all journal files
                 return false;
@@ -877,19 +876,19 @@ jcntl::jfile_cycle(u_int16_t& fid, std::
     {
         std::ostringstream oss;
         oss << _jdir.dirname() << "/" << _base_filename << ".";
-        oss << std::hex << std::setfill('0') << std::setw(4) << fid << "." << JRNL_DATA_EXTENSION;
+        oss << std::hex << std::setfill('0') << std::setw(4) << fid << "." << QLS_JRNL_FILE_EXTENSION;
         ifsp->clear(); // clear eof flag, req'd for older versions of c++
         ifsp->open(oss.str().c_str(), std::ios_base::in | std::ios_base::binary);
         if (!ifsp->good())
             throw jexception(jerrno::JERR__FILEIO, oss.str(), "jcntl", "jfile_cycle");
 
         // Read file header
-        file_hdr fhdr;
+        file_hdr_t fhdr;
         ifsp->read((char*)&fhdr, sizeof(fhdr));
         assert(ifsp->good());
-        if (fhdr._magic == RHM_JDAT_FILE_MAGIC)
+        if (fhdr._rhdr._magic == QLS_FILE_MAGIC)
         {
-            assert(fhdr._lfid == fid);
+//            assert(fhdr._lfid == fid);
             if (!rd._fro)
                 rd._fro = fhdr._fro;
             std::streamoff foffs = jump_fro ? fhdr._fro : JRNL_DBLK_SIZE * JRNL_SBLK_SIZE;
@@ -904,12 +903,14 @@ jcntl::jfile_cycle(u_int16_t& fid, std::
     return true;
 }
 
+
+/*
 bool
-jcntl::check_owi(const u_int16_t fid, rec_hdr& h, bool& lowi, rcvdat& rd, std::streampos& file_pos)
+jcntl::check_owi(const uint16_t fid, rec_hdr& h, bool& lowi, rcvdat& rd, std::streampos& file_pos)
 {
     if (rd._ffid ? h.get_owi() == lowi : h.get_owi() != lowi) // Overwrite indicator changed
     {
-        u_int16_t expected_fid = rd._ffid ? rd._ffid - 1 : rd._njf - 1;
+        uint16_t expected_fid = rd._ffid ? rd._ffid - 1 : rd._njf - 1;
         if (fid == expected_fid)
         {
             check_journal_alignment(fid, file_pos, rd);
@@ -929,10 +930,11 @@ jcntl::check_owi(const u_int16_t fid, re
         rd._h_rid = h._rid;
     return true;
 }
+*/
 
 
 void
-jcntl::check_journal_alignment(const u_int16_t fid, std::streampos& file_pos, rcvdat& rd)
+jcntl::check_journal_alignment(const uint16_t fid, std::streampos& file_pos, rcvdat& rd)
 {
     unsigned sblk_offs = file_pos % (JRNL_DBLK_SIZE * JRNL_SBLK_SIZE);
     if (sblk_offs)
@@ -944,10 +946,10 @@ jcntl::check_journal_alignment(const u_i
             oss << (JRNL_SBLK_SIZE - (sblk_offs/JRNL_DBLK_SIZE)) << " filler record(s) required.";
             this->log(LOG_WARN, oss.str());
         }
-        const u_int32_t xmagic = RHM_JDAT_EMPTY_MAGIC;
+        const uint32_t xmagic = QLS_EMPTY_MAGIC;
         std::ostringstream oss;
         oss << _jdir.dirname() << "/" << _base_filename << ".";
-        oss << std::hex << std::setfill('0') << std::setw(4) << fid << "." << JRNL_DATA_EXTENSION;
+        oss << std::hex << std::setfill('0') << std::setw(4) << fid << "." << QLS_JRNL_FILE_EXTENSION;
         std::ofstream ofsp(oss.str().c_str(),
                 std::ios_base::in | std::ios_base::out | std::ios_base::binary);
         if (!ofsp.good())
@@ -959,7 +961,7 @@ jcntl::check_journal_alignment(const u_i
         // Normally, RHM_CLEAN must be set before these fills are done, but this is a recover
         // situation (i.e. performance is not an issue), and it makes the location of the write
         // clear should inspection of the file be required.
-        std::memset((char*)buff + sizeof(xmagic), RHM_CLEAN_CHAR, JRNL_DBLK_SIZE - sizeof(xmagic));
+        std::memset((char*)buff + sizeof(xmagic), QLS_CLEAN_CHAR, JRNL_DBLK_SIZE - sizeof(xmagic));
 
         while (file_pos % (JRNL_DBLK_SIZE * JRNL_SBLK_SIZE))
         {
@@ -973,8 +975,8 @@ jcntl::check_journal_alignment(const u_i
         ofsp.close();
         std::free(buff);
         rd._lfid = fid;
-        if (!rd._frot)
-            rd._ffid = (fid + 1) % rd._njf;
+//        if (!rd._frot)
+//            rd._ffid = (fid + 1) % rd._njf;
         this->log(LOG_INFO, "Bad record alignment fixed.");
     }
     rd._eo = file_pos;

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcntl.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcntl.h?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcntl.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jcntl.h Wed Aug 21 14:38:12 2013
@@ -19,17 +19,6 @@
  *
  */
 
-/**
- * \file jcntl.h
- *
- * Qpid asynchronous store plugin library
- *
- * Messaging journal top-level control and interface class
- * mrg::journal::jcntl. See class documentation for details.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_JCNTL_H
 #define QPID_LEGACYSTORE_JRNL_JCNTL_H
 
@@ -43,15 +32,15 @@ namespace journal
 
 #include <cstddef>
 #include <deque>
-#include "qpid/legacystore/jrnl/jdir.h"
-#include "qpid/legacystore/jrnl/fcntl.h"
-#include "qpid/legacystore/jrnl/lpmgr.h"
-#include "qpid/legacystore/jrnl/rcvdat.h"
-#include "qpid/legacystore/jrnl/slock.h"
-#include "qpid/legacystore/jrnl/smutex.h"
-#include "qpid/legacystore/jrnl/rmgr.h"
-#include "qpid/legacystore/jrnl/wmgr.h"
-#include "qpid/legacystore/jrnl/wrfc.h"
+#include "qpid/linearstore/jrnl/jdir.h"
+//#include "qpid/linearstore/jrnl/fcntl.h"
+//#include "qpid/linearstore/jrnl/lpmgr.h"
+#include "qpid/linearstore/jrnl/rcvdat.h"
+#include "qpid/linearstore/jrnl/slock.h"
+#include "qpid/linearstore/jrnl/smutex.h"
+#include "qpid/linearstore/jrnl/rmgr.h"
+#include "qpid/linearstore/jrnl/wmgr.h"
+//#include "qpid/linearstore/jrnl/wrfc.h"
 
 namespace mrg
 {
@@ -136,12 +125,12 @@ namespace journal
         bool _autostop;             ///< Autostop flag - stops journal when overrun occurs
 
         // Journal control structures
-        u_int32_t _jfsize_sblks;    ///< Journal file size in sblks
-        lpmgr _lpmgr;               ///< LFID-PFID manager tracks inserted journal files
+        uint32_t _jfsize_sblks;    ///< Journal file size in sblks
+        //lpmgr _lpmgr;               ///< LFID-PFID manager tracks inserted journal files
         enq_map _emap;              ///< Enqueue map for low water mark management
         txn_map _tmap;              ///< Transaction map open transactions
-        rrfc _rrfc;                 ///< Read journal rotating file controller
-        wrfc _wrfc;                 ///< Write journal rotating file controller
+        //rrfc _rrfc;                 ///< Read journal rotating file controller
+        //wrfc _wrfc;                 ///< Write journal rotating file controller
         rmgr _rmgr;                 ///< Read page manager which manages AIO
         wmgr _wmgr;                 ///< Write page manager which manages AIO
         rcvdat _rcvdat;             ///< Recovery data used for recovery
@@ -201,8 +190,8 @@ namespace journal
         *
         * \exception TODO
         */
-        void initialize(const u_int16_t num_jfiles, const bool auto_expand, const u_int16_t ae_max_jfiles,
-                const u_int32_t jfsize_sblks, const u_int16_t wcache_num_pages, const u_int32_t wcache_pgsize_sblks,
+        void initialize(const uint16_t num_jfiles/*, const bool auto_expand, const uint16_t ae_max_jfiles*/,
+                const uint32_t jfsize_sblks, const uint16_t wcache_num_pages, const uint32_t wcache_pgsize_sblks,
                 aio_callback* const cbp);
 
         /**
@@ -238,9 +227,9 @@ namespace journal
         *
         * \exception TODO
         */
-        void recover(const u_int16_t num_jfiles, const bool auto_expand, const u_int16_t ae_max_jfiles,
-                const u_int32_t jfsize_sblks, const u_int16_t wcache_num_pages, const u_int32_t wcache_pgsize_sblks,
-                aio_callback* const cbp, const std::vector<std::string>* prep_txn_list_ptr, u_int64_t& highest_rid);
+        void recover(const uint16_t num_jfiles/*, const bool auto_expand, const uint16_t ae_max_jfiles*/,
+                const uint32_t jfsize_sblks, const uint16_t wcache_num_pages, const uint32_t wcache_pgsize_sblks,
+                aio_callback* const cbp, const std::vector<std::string>* prep_txn_list_ptr, uint64_t& highest_rid);
 
         /**
         * \brief Notification to the journal that recovery is complete and that normal operation
@@ -385,7 +374,7 @@ namespace journal
         * \exception TODO
         *
         // *** NOT YET IMPLEMENTED ***
-        iores get_data_record(const u_int64_t& rid, const std::size_t& dsize,
+        iores get_data_record(const uint64_t& rid, const std::size_t& dsize,
                 const std::size_t& dsize_avail, const void** const data, bool auto_discard = false);
         */
 
@@ -562,40 +551,40 @@ namespace journal
         */
         iores flush(const bool block_till_aio_cmpl = false);
 
-        inline u_int32_t get_enq_cnt() const { return _emap.size(); }
+        inline uint32_t get_enq_cnt() const { return _emap.size(); }
 
-        inline u_int32_t get_wr_aio_evt_rem() const { slock l(_wr_mutex); return _wmgr.get_aio_evt_rem(); }
+        inline uint32_t get_wr_aio_evt_rem() const { slock l(_wr_mutex); return _wmgr.get_aio_evt_rem(); }
 
-        inline u_int32_t get_rd_aio_evt_rem() const { return _rmgr.get_aio_evt_rem(); }
+        inline uint32_t get_rd_aio_evt_rem() const { return _rmgr.get_aio_evt_rem(); }
 
-        inline u_int32_t get_wr_outstanding_aio_dblks() const
-                { return _wrfc.aio_outstanding_dblks(); }
+        inline uint32_t get_wr_outstanding_aio_dblks() const;
+                /*{ return _wrfc.aio_outstanding_dblks(); }*/
 
-        inline u_int32_t get_wr_outstanding_aio_dblks(u_int16_t lfid) const
-                { return _lpmgr.get_fcntlp(lfid)->wr_aio_outstanding_dblks(); }
+//        inline uint32_t get_wr_outstanding_aio_dblks(uint16_t lfid) const;
+//                { return _lpmgr.get_fcntlp(lfid)->wr_aio_outstanding_dblks(); }
 
-        inline u_int32_t get_rd_outstanding_aio_dblks() const
-                { return _rrfc.aio_outstanding_dblks(); }
+        inline uint32_t get_rd_outstanding_aio_dblks() const;
+//                { return _rrfc.aio_outstanding_dblks(); }
 
-        inline u_int32_t get_rd_outstanding_aio_dblks(u_int16_t lfid) const
-                { return _lpmgr.get_fcntlp(lfid)->rd_aio_outstanding_dblks(); }
+//        inline uint32_t get_rd_outstanding_aio_dblks(uint16_t lfid) const;
+//                { return _lpmgr.get_fcntlp(lfid)->rd_aio_outstanding_dblks(); }
 
-        inline u_int16_t get_rd_fid() const { return _rrfc.index(); }
-        inline u_int16_t get_wr_fid() const { return _wrfc.index(); }
-        u_int16_t get_earliest_fid();
+//        inline uint16_t get_rd_fid() const { return _rrfc.index(); }
+//        inline uint16_t get_wr_fid() const { return _wrfc.index(); }
+//        uint16_t get_earliest_fid();
 
         /**
         * \brief Check if a particular rid is enqueued. Note that this function will return
         *     false if the rid is transactionally enqueued and is not committed, or if it is
         *     locked (i.e. transactionally dequeued, but the dequeue has not been committed).
         */
-        inline bool is_enqueued(const u_int64_t rid, bool ignore_lock = false)
+        inline bool is_enqueued(const uint64_t rid, bool ignore_lock = false)
                 { return _emap.is_enqueued(rid, ignore_lock); }
-        inline bool is_locked(const u_int64_t rid)
+        inline bool is_locked(const uint64_t rid)
                 { if (_emap.is_enqueued(rid, true) < enq_map::EMAP_OK) return false; return _emap.is_locked(rid) == enq_map::EMAP_TRUE; }
-        inline void enq_rid_list(std::vector<u_int64_t>& rids) { _emap.rid_list(rids); }
+        inline void enq_rid_list(std::vector<uint64_t>& rids) { _emap.rid_list(rids); }
         inline void enq_xid_list(std::vector<std::string>& xids) { _tmap.xid_list(xids); }
-        inline u_int32_t get_open_txn_cnt() const { return _tmap.size(); }
+        inline uint32_t get_open_txn_cnt() const { return _tmap.size(); }
         // TODO Make this a const, but txn_map must support const first.
         inline txn_map& get_txn_map() { return _tmap; }
 
@@ -642,21 +631,21 @@ namespace journal
         */
         inline const std::string& base_filename() const { return _base_filename; }
 
-        inline u_int16_t num_jfiles() const { return _lpmgr.num_jfiles(); }
+//        inline uint16_t num_jfiles() const; { return _lpmgr.num_jfiles(); }
 
-        inline fcntl* get_fcntlp(const u_int16_t lfid) const { return _lpmgr.get_fcntlp(lfid); }
+//        inline fcntl* get_fcntlp(const uint16_t lfid) const { return _lpmgr.get_fcntlp(lfid); }
 
-        inline u_int32_t jfsize_sblks() const { return _jfsize_sblks; }
+        inline uint32_t jfsize_sblks() const { return _jfsize_sblks; }
 
         // Logging
         virtual void log(log_level level, const std::string& log_stmt) const;
         virtual void log(log_level level, const char* const log_stmt) const;
 
         // FIXME these are _rmgr to _wmgr interactions, remove when _rmgr contains ref to _wmgr:
-        void chk_wr_frot();
-        inline u_int32_t unflushed_dblks() { return _wmgr.unflushed_dblks(); }
-        void fhdr_wr_sync(const u_int16_t lid);
-        inline u_int32_t wr_subm_cnt_dblks(const u_int16_t lfid) const { return _lpmgr.get_fcntlp(lfid)->wr_subm_cnt_dblks(); }
+        //void chk_wr_frot();
+        inline uint32_t unflushed_dblks() { return _wmgr.unflushed_dblks(); }
+        void fhdr_wr_sync(const uint16_t lid);
+        inline uint32_t wr_subm_cnt_dblks(const uint16_t lfid) const; /*{ return _lpmgr.get_fcntlp(lfid)->wr_subm_cnt_dblks(); }*/
 
         // Management instrumentation callbacks
         inline virtual void instr_incr_outstanding_aio_cnt() {}
@@ -665,7 +654,7 @@ namespace journal
         /**
         * /brief Static function for creating new fcntl objects for use with obj_arr.
         */
-        static fcntl* new_fcntl(jcntl* const jcp, const u_int16_t lid, const u_int16_t fid, const rcvdat* const rdp);
+        static fcntl* new_fcntl(jcntl* const jcp, const uint16_t lid, const uint16_t fid, const rcvdat* const rdp);
 
     protected:
         static bool _init;
@@ -684,7 +673,7 @@ namespace journal
         /**
         * \brief Write info file &lt;basefilename&gt;.jinf to disk
         */
-        void write_infofile() const;
+//        void write_infofile() const;
 
         /**
         * \brief Call that blocks while waiting for all outstanding AIOs to complete
@@ -702,18 +691,18 @@ namespace journal
         */
         void rcvr_janalyze(rcvdat& rd, const std::vector<std::string>* prep_txn_list_ptr);
 
-        bool rcvr_get_next_record(u_int16_t& fid, std::ifstream* ifsp, bool& lowi, rcvdat& rd);
+        bool rcvr_get_next_record(uint16_t& fid, std::ifstream* ifsp/*, bool& lowi*/, rcvdat& rd);
 
-        bool decode(jrec& rec, u_int16_t& fid, std::ifstream* ifsp, std::size_t& cum_size_read,
-                rec_hdr& h, bool& lowi, rcvdat& rd, std::streampos& rec_offset);
+        bool decode(jrec& rec, uint16_t& fid, std::ifstream* ifsp, std::size_t& cum_size_read,
+                rec_hdr_t& h/*, bool& lowi*/, rcvdat& rd, std::streampos& rec_offset);
 
-        bool jfile_cycle(u_int16_t& fid, std::ifstream* ifsp, bool& lowi, rcvdat& rd,
+        bool jfile_cycle(uint16_t& fid, std::ifstream* ifsp/*, bool& lowi*/, rcvdat& rd,
                 const bool jump_fro);
 
-        bool check_owi(const u_int16_t fid, rec_hdr& h, bool& lowi, rcvdat& rd,
-                std::streampos& read_pos);
+        //bool check_owi(const uint16_t fid, rec_hdr_t& h, bool& lowi, rcvdat& rd,
+        //        std::streampos& read_pos);
 
-        void check_journal_alignment(const u_int16_t fid, std::streampos& rec_offset, rcvdat& rd);
+        void check_journal_alignment(const uint16_t fid, std::streampos& rec_offset, rcvdat& rd);
     };
 
 } // namespace journal

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jdir.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jdir.cpp?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jdir.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jdir.cpp Wed Aug 21 14:38:12 2013
@@ -19,27 +19,15 @@
  *
  */
 
-/**
- * \file jdir.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::jdir (journal data
- * directory), used for controlling and manipulating journal data
- * direcories and files. See comments in file jdir.h for details.
- *
- * \author Kim van der Riet
- */
-
-#include "qpid/legacystore/jrnl/jdir.h"
+#include "qpid/linearstore/jrnl/jdir.h"
 
 #include <cstdlib>
 #include <cstring>
 #include <cerrno>
 #include <iomanip>
-#include "qpid/legacystore/jrnl/jcfg.h"
-#include "qpid/legacystore/jrnl/jerrno.h"
-#include "qpid/legacystore/jrnl/jexception.h"
+#include "qpid/linearstore/jrnl/jcfg.h"
+#include "qpid/linearstore/jrnl/jerrno.h"
+#include "qpid/linearstore/jrnl/jexception.h"
 #include <sstream>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -225,7 +213,7 @@ jdir::verify_dir(const char* dirname, co
 
 
 void
-jdir::verify_dir(const std::string& dirname, const std::string& base_filename)
+jdir::verify_dir(const std::string& dirname, const std::string& /*base_filename*/)
 {
     if (!is_dir(dirname))
     {
@@ -235,16 +223,16 @@ jdir::verify_dir(const std::string& dirn
     }
 
     // Read jinf file, then verify all journal files are present
-    jinf ji(dirname + "/" + base_filename + "." + JRNL_INFO_EXTENSION, true);
-    for (u_int16_t fnum=0; fnum < ji.num_jfiles(); fnum++)
-    {
-        std::ostringstream oss;
-        oss << dirname << "/" << base_filename << ".";
-        oss << std::setw(4) << std::setfill('0') << std::hex << fnum;
-        oss << "." << JRNL_DATA_EXTENSION;
-        if (!exists(oss.str()))
-            throw jexception(jerrno::JERR_JDIR_NOSUCHFILE, oss.str(), "jdir", "verify_dir");
-    }
+//    jinf ji(dirname + "/" + base_filename + "." + QLS_JRNL_FILE_EXTENSION, true);
+//    for (uint16_t fnum=0; fnum < ji.num_jfiles(); fnum++)
+//    {
+//        std::ostringstream oss;
+//        oss << dirname << "/" << base_filename << ".";
+//        oss << std::setw(4) << std::setfill('0') << std::hex << fnum;
+//        oss << "." << QLS_JRNL_FILE_EXTENSION;
+//        if (!exists(oss.str()))
+//            throw jexception(jerrno::JERR_JDIR_NOSUCHFILE, oss.str(), "jdir", "verify_dir");
+//    }
 }
 
 

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jdir.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jdir.h?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jdir.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jdir.h Wed Aug 21 14:38:12 2013
@@ -19,18 +19,6 @@
  *
  */
 
-/**
- * \file jdir.h
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::jdir (%journal data
- * directory), used for controlling and manipulating %journal data
- * directories and files. See class documentation for details.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_JDIR_H
 #define QPID_LEGACYSTORE_JRNL_JDIR_H
 
@@ -42,8 +30,9 @@ class jdir;
 }
 }
 
-#include "qpid/legacystore/jrnl/jinf.h"
+//#include "qpid/linearstore/jrnl/jinf.h"
 #include <dirent.h>
+#include <string>
 
 namespace mrg
 {

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jerrno.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jerrno.cpp?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jerrno.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jerrno.cpp Wed Aug 21 14:38:12 2013
@@ -19,120 +19,107 @@
  *
  */
 
-/**
- * \file jerrno.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::jerrno (journal error
- * codes). See comments in file jerrno.h for details.
- *
- * See file jerrno.h for class details.
- *
- * \author Kim van der Riet
- */
-
-#include "qpid/legacystore/jrnl/jerrno.h"
+#include "qpid/linearstore/jrnl/jerrno.h"
 
 namespace mrg
 {
 namespace journal
 {
 
-std::map<u_int32_t, const char*> jerrno::_err_map;
-std::map<u_int32_t, const char*>::iterator jerrno::_err_map_itr;
+std::map<uint32_t, const char*> jerrno::_err_map;
+std::map<uint32_t, const char*>::iterator jerrno::_err_map_itr;
 bool jerrno::_initialized = jerrno::__init();
 
 // generic errors
-const u_int32_t jerrno::JERR__MALLOC            = 0x0100;
-const u_int32_t jerrno::JERR__UNDERFLOW         = 0x0101;
-const u_int32_t jerrno::JERR__NINIT             = 0x0102;
-const u_int32_t jerrno::JERR__AIO               = 0x0103;
-const u_int32_t jerrno::JERR__FILEIO            = 0x0104;
-const u_int32_t jerrno::JERR__RTCLOCK           = 0x0105;
-const u_int32_t jerrno::JERR__PTHREAD           = 0x0106;
-const u_int32_t jerrno::JERR__TIMEOUT           = 0x0107;
-const u_int32_t jerrno::JERR__UNEXPRESPONSE     = 0x0108;
-const u_int32_t jerrno::JERR__RECNFOUND         = 0x0109;
-const u_int32_t jerrno::JERR__NOTIMPL           = 0x010a;
+const uint32_t jerrno::JERR__MALLOC            = 0x0100;
+const uint32_t jerrno::JERR__UNDERFLOW         = 0x0101;
+const uint32_t jerrno::JERR__NINIT             = 0x0102;
+const uint32_t jerrno::JERR__AIO               = 0x0103;
+const uint32_t jerrno::JERR__FILEIO            = 0x0104;
+const uint32_t jerrno::JERR__RTCLOCK           = 0x0105;
+const uint32_t jerrno::JERR__PTHREAD           = 0x0106;
+const uint32_t jerrno::JERR__TIMEOUT           = 0x0107;
+const uint32_t jerrno::JERR__UNEXPRESPONSE     = 0x0108;
+const uint32_t jerrno::JERR__RECNFOUND         = 0x0109;
+const uint32_t jerrno::JERR__NOTIMPL           = 0x010a;
 
 // class jcntl
-const u_int32_t jerrno::JERR_JCNTL_STOPPED      = 0x0200;
-const u_int32_t jerrno::JERR_JCNTL_READONLY     = 0x0201;
-const u_int32_t jerrno::JERR_JCNTL_AIOCMPLWAIT  = 0x0202;
-const u_int32_t jerrno::JERR_JCNTL_UNKNOWNMAGIC = 0x0203;
-const u_int32_t jerrno::JERR_JCNTL_NOTRECOVERED = 0x0204;
-const u_int32_t jerrno::JERR_JCNTL_RECOVERJFULL = 0x0205;
-const u_int32_t jerrno::JERR_JCNTL_OWIMISMATCH  = 0x0206;
+const uint32_t jerrno::JERR_JCNTL_STOPPED      = 0x0200;
+const uint32_t jerrno::JERR_JCNTL_READONLY     = 0x0201;
+const uint32_t jerrno::JERR_JCNTL_AIOCMPLWAIT  = 0x0202;
+const uint32_t jerrno::JERR_JCNTL_UNKNOWNMAGIC = 0x0203;
+const uint32_t jerrno::JERR_JCNTL_NOTRECOVERED = 0x0204;
+const uint32_t jerrno::JERR_JCNTL_RECOVERJFULL = 0x0205;
+const uint32_t jerrno::JERR_JCNTL_OWIMISMATCH  = 0x0206;
 
 // class jdir
-const u_int32_t jerrno::JERR_JDIR_NOTDIR        = 0x0300;
-const u_int32_t jerrno::JERR_JDIR_MKDIR         = 0x0301;
-const u_int32_t jerrno::JERR_JDIR_OPENDIR       = 0x0302;
-const u_int32_t jerrno::JERR_JDIR_READDIR       = 0x0303;
-const u_int32_t jerrno::JERR_JDIR_CLOSEDIR      = 0x0304;
-const u_int32_t jerrno::JERR_JDIR_RMDIR         = 0x0305;
-const u_int32_t jerrno::JERR_JDIR_NOSUCHFILE    = 0x0306;
-const u_int32_t jerrno::JERR_JDIR_FMOVE         = 0x0307;
-const u_int32_t jerrno::JERR_JDIR_STAT          = 0x0308;
-const u_int32_t jerrno::JERR_JDIR_UNLINK        = 0x0309;
-const u_int32_t jerrno::JERR_JDIR_BADFTYPE      = 0x030a;
+const uint32_t jerrno::JERR_JDIR_NOTDIR        = 0x0300;
+const uint32_t jerrno::JERR_JDIR_MKDIR         = 0x0301;
+const uint32_t jerrno::JERR_JDIR_OPENDIR       = 0x0302;
+const uint32_t jerrno::JERR_JDIR_READDIR       = 0x0303;
+const uint32_t jerrno::JERR_JDIR_CLOSEDIR      = 0x0304;
+const uint32_t jerrno::JERR_JDIR_RMDIR         = 0x0305;
+const uint32_t jerrno::JERR_JDIR_NOSUCHFILE    = 0x0306;
+const uint32_t jerrno::JERR_JDIR_FMOVE         = 0x0307;
+const uint32_t jerrno::JERR_JDIR_STAT          = 0x0308;
+const uint32_t jerrno::JERR_JDIR_UNLINK        = 0x0309;
+const uint32_t jerrno::JERR_JDIR_BADFTYPE      = 0x030a;
 
 // class fcntl
-const u_int32_t jerrno::JERR_FCNTL_OPENWR       = 0x0400;
-const u_int32_t jerrno::JERR_FCNTL_WRITE        = 0x0401;
-const u_int32_t jerrno::JERR_FCNTL_CLOSE        = 0x0402;
-const u_int32_t jerrno::JERR_FCNTL_FILEOFFSOVFL = 0x0403;
-const u_int32_t jerrno::JERR_FCNTL_CMPLOFFSOVFL = 0x0404;
-const u_int32_t jerrno::JERR_FCNTL_RDOFFSOVFL   = 0x0405;
+//const uint32_t jerrno::JERR_FCNTL_OPENWR       = 0x0400;
+//const uint32_t jerrno::JERR_FCNTL_WRITE        = 0x0401;
+//const uint32_t jerrno::JERR_FCNTL_CLOSE        = 0x0402;
+//const uint32_t jerrno::JERR_FCNTL_FILEOFFSOVFL = 0x0403;
+//const uint32_t jerrno::JERR_FCNTL_CMPLOFFSOVFL = 0x0404;
+//const uint32_t jerrno::JERR_FCNTL_RDOFFSOVFL   = 0x0405;
 
 // class lfmgr
-const u_int32_t jerrno::JERR_LFMGR_BADAEFNUMLIM = 0x0500;
-const u_int32_t jerrno::JERR_LFMGR_AEFNUMLIMIT  = 0x0501;
-const u_int32_t jerrno::JERR_LFMGR_AEDISABLED   = 0x0502;
+//const uint32_t jerrno::JERR_LFMGR_BADAEFNUMLIM = 0x0500;
+//const uint32_t jerrno::JERR_LFMGR_AEFNUMLIMIT  = 0x0501;
+//const uint32_t jerrno::JERR_LFMGR_AEDISABLED   = 0x0502;
 
 // class rrfc
-const u_int32_t jerrno::JERR_RRFC_OPENRD        = 0x0600;
+//const uint32_t jerrno::JERR_RRFC_OPENRD        = 0x0600;
 
 // class jrec, enq_rec, deq_rec, txn_rec
-const u_int32_t jerrno::JERR_JREC_BADRECHDR     = 0x0700;
-const u_int32_t jerrno::JERR_JREC_BADRECTAIL    = 0x0701;
+const uint32_t jerrno::JERR_JREC_BADRECHDR     = 0x0700;
+const uint32_t jerrno::JERR_JREC_BADRECTAIL    = 0x0701;
 
 // class wmgr
-const u_int32_t jerrno::JERR_WMGR_BADPGSTATE    = 0x0801;
-const u_int32_t jerrno::JERR_WMGR_BADDTOKSTATE  = 0x0802;
-const u_int32_t jerrno::JERR_WMGR_ENQDISCONT    = 0x0803;
-const u_int32_t jerrno::JERR_WMGR_DEQDISCONT    = 0x0804;
-const u_int32_t jerrno::JERR_WMGR_DEQRIDNOTENQ  = 0x0805;
+const uint32_t jerrno::JERR_WMGR_BADPGSTATE    = 0x0801;
+const uint32_t jerrno::JERR_WMGR_BADDTOKSTATE  = 0x0802;
+const uint32_t jerrno::JERR_WMGR_ENQDISCONT    = 0x0803;
+const uint32_t jerrno::JERR_WMGR_DEQDISCONT    = 0x0804;
+const uint32_t jerrno::JERR_WMGR_DEQRIDNOTENQ  = 0x0805;
 
 // class rmgr
-const u_int32_t jerrno::JERR_RMGR_UNKNOWNMAGIC  = 0x0900;
-const u_int32_t jerrno::JERR_RMGR_RIDMISMATCH   = 0x0901;
-//const u_int32_t jerrno::JERR_RMGR_FIDMISMATCH   = 0x0902;
-const u_int32_t jerrno::JERR_RMGR_ENQSTATE      = 0x0903;
-const u_int32_t jerrno::JERR_RMGR_BADRECTYPE    = 0x0904;
+const uint32_t jerrno::JERR_RMGR_UNKNOWNMAGIC  = 0x0900;
+const uint32_t jerrno::JERR_RMGR_RIDMISMATCH   = 0x0901;
+//const uint32_t jerrno::JERR_RMGR_FIDMISMATCH   = 0x0902;
+const uint32_t jerrno::JERR_RMGR_ENQSTATE      = 0x0903;
+const uint32_t jerrno::JERR_RMGR_BADRECTYPE    = 0x0904;
 
 // class data_tok
-const u_int32_t jerrno::JERR_DTOK_ILLEGALSTATE  = 0x0a00;
-// const u_int32_t jerrno::JERR_DTOK_RIDNOTSET     = 0x0a01;
+const uint32_t jerrno::JERR_DTOK_ILLEGALSTATE  = 0x0a00;
+// const uint32_t jerrno::JERR_DTOK_RIDNOTSET     = 0x0a01;
 
 // class enq_map, txn_map
-const u_int32_t jerrno::JERR_MAP_DUPLICATE      = 0x0b00;
-const u_int32_t jerrno::JERR_MAP_NOTFOUND       = 0x0b01;
-const u_int32_t jerrno::JERR_MAP_LOCKED         = 0x0b02;
+const uint32_t jerrno::JERR_MAP_DUPLICATE      = 0x0b00;
+const uint32_t jerrno::JERR_MAP_NOTFOUND       = 0x0b01;
+const uint32_t jerrno::JERR_MAP_LOCKED         = 0x0b02;
 
 // class jinf
-const u_int32_t jerrno::JERR_JINF_CVALIDFAIL    = 0x0c00;
-const u_int32_t jerrno::JERR_JINF_NOVALUESTR    = 0x0c01;
-const u_int32_t jerrno::JERR_JINF_BADVALUESTR   = 0x0c02;
-const u_int32_t jerrno::JERR_JINF_JDATEMPTY     = 0x0c03;
-const u_int32_t jerrno::JERR_JINF_TOOMANYFILES  = 0x0c04;
-const u_int32_t jerrno::JERR_JINF_INVALIDFHDR   = 0x0c05;
-const u_int32_t jerrno::JERR_JINF_STAT          = 0x0c06;
-const u_int32_t jerrno::JERR_JINF_NOTREGFILE    = 0x0c07;
-const u_int32_t jerrno::JERR_JINF_BADFILESIZE   = 0x0c08;
-const u_int32_t jerrno::JERR_JINF_OWIBAD        = 0x0c09;
-const u_int32_t jerrno::JERR_JINF_ZEROLENFILE   = 0x0c0a;
+//const uint32_t jerrno::JERR_JINF_CVALIDFAIL    = 0x0c00;
+//const uint32_t jerrno::JERR_JINF_NOVALUESTR    = 0x0c01;
+//const uint32_t jerrno::JERR_JINF_BADVALUESTR   = 0x0c02;
+//const uint32_t jerrno::JERR_JINF_JDATEMPTY     = 0x0c03;
+//const uint32_t jerrno::JERR_JINF_TOOMANYFILES  = 0x0c04;
+//const uint32_t jerrno::JERR_JINF_INVALIDFHDR   = 0x0c05;
+//const uint32_t jerrno::JERR_JINF_STAT          = 0x0c06;
+//const uint32_t jerrno::JERR_JINF_NOTREGFILE    = 0x0c07;
+//const uint32_t jerrno::JERR_JINF_BADFILESIZE   = 0x0c08;
+//const uint32_t jerrno::JERR_JINF_OWIBAD        = 0x0c09;
+//const uint32_t jerrno::JERR_JINF_ZEROLENFILE   = 0x0c0a;
 
 // Negative returns for some functions
 const int32_t jerrno::AIO_TIMEOUT               = -1;
@@ -180,20 +167,20 @@ jerrno::__init()
     _err_map[JERR_JDIR_BADFTYPE] = "JERR_JDIR_BADFTYPE: Bad or unknown file type (stat mode).";
 
     // class fcntl
-    _err_map[JERR_FCNTL_OPENWR] = "JERR_FCNTL_OPENWR: Unable to open file for write.";
-    _err_map[JERR_FCNTL_WRITE] = "JERR_FCNTL_WRITE: Unable to write to file.";
-    _err_map[JERR_FCNTL_CLOSE] = "JERR_FCNTL_CLOSE: File close failed.";
-    _err_map[JERR_FCNTL_FILEOFFSOVFL] = "JERR_FCNTL_FILEOFFSOVFL: Attempted increase file offset past file size.";
-    _err_map[JERR_FCNTL_CMPLOFFSOVFL] = "JERR_FCNTL_CMPLOFFSOVFL: Attempted increase completed file offset past submitted offset.";
-    _err_map[JERR_FCNTL_RDOFFSOVFL] = "JERR_FCNTL_RDOFFSOVFL: Attempted increase read offset past write offset.";
+//    _err_map[JERR_FCNTL_OPENWR] = "JERR_FCNTL_OPENWR: Unable to open file for write.";
+//    _err_map[JERR_FCNTL_WRITE] = "JERR_FCNTL_WRITE: Unable to write to file.";
+//    _err_map[JERR_FCNTL_CLOSE] = "JERR_FCNTL_CLOSE: File close failed.";
+//    _err_map[JERR_FCNTL_FILEOFFSOVFL] = "JERR_FCNTL_FILEOFFSOVFL: Attempted increase file offset past file size.";
+//    _err_map[JERR_FCNTL_CMPLOFFSOVFL] = "JERR_FCNTL_CMPLOFFSOVFL: Attempted increase completed file offset past submitted offset.";
+//    _err_map[JERR_FCNTL_RDOFFSOVFL] = "JERR_FCNTL_RDOFFSOVFL: Attempted increase read offset past write offset.";
 
     // class lfmgr
-    _err_map[JERR_LFMGR_BADAEFNUMLIM] = "JERR_LFMGR_BADAEFNUMLIM: Auto-expand file number limit lower than initial number of journal files.";
-    _err_map[JERR_LFMGR_AEFNUMLIMIT] = "JERR_LFMGR_AEFNUMLIMIT: Exceeded auto-expand file number limit.";
-    _err_map[JERR_LFMGR_AEDISABLED] = "JERR_LFMGR_AEDISABLED: Attempted to expand with auto-expand disabled.";
+//    _err_map[JERR_LFMGR_BADAEFNUMLIM] = "JERR_LFMGR_BADAEFNUMLIM: Auto-expand file number limit lower than initial number of journal files.";
+//    _err_map[JERR_LFMGR_AEFNUMLIMIT] = "JERR_LFMGR_AEFNUMLIMIT: Exceeded auto-expand file number limit.";
+//    _err_map[JERR_LFMGR_AEDISABLED] = "JERR_LFMGR_AEDISABLED: Attempted to expand with auto-expand disabled.";
 
     // class rrfc
-    _err_map[JERR_RRFC_OPENRD] = "JERR_RRFC_OPENRD: Unable to open file for read.";
+//    _err_map[JERR_RRFC_OPENRD] = "JERR_RRFC_OPENRD: Unable to open file for read.";
 
     // class jrec, enq_rec, deq_rec, txn_rec
     _err_map[JERR_JREC_BADRECHDR] = "JERR_JREC_BADRECHDR: Invalid data record header.";
@@ -223,17 +210,17 @@ jerrno::__init()
     _err_map[JERR_MAP_LOCKED] = "JERR_MAP_LOCKED: Record ID locked by a pending transaction.";
 
     // class jinf
-    _err_map[JERR_JINF_CVALIDFAIL] = "JERR_JINF_CVALIDFAIL: Journal compatibility validation failure.";
-    _err_map[JERR_JINF_NOVALUESTR] = "JERR_JINF_NOVALUESTR: No value attribute found in jinf file.";
-    _err_map[JERR_JINF_BADVALUESTR] = "JERR_JINF_BADVALUESTR: Bad format for value attribute in jinf file";
-    _err_map[JERR_JINF_JDATEMPTY] = "JERR_JINF_JDATEMPTY: Journal data files empty.";
-    _err_map[JERR_JINF_TOOMANYFILES] = "JERR_JINF_TOOMANYFILES: Too many journal data files.";
-    _err_map[JERR_JINF_INVALIDFHDR] = "JERR_JINF_INVALIDFHDR: Invalid journal data file header";
-    _err_map[JERR_JINF_STAT] = "JERR_JINF_STAT: Error while trying to stat a journal data file";
-    _err_map[JERR_JINF_NOTREGFILE] = "JERR_JINF_NOTREGFILE: Target journal data file is not a regular file";
-    _err_map[JERR_JINF_BADFILESIZE] = "JERR_JINF_BADFILESIZE: Journal data file is of incorrect or unexpected size";
-    _err_map[JERR_JINF_OWIBAD] = "JERR_JINF_OWIBAD: Journal data files have inconsistent OWI flags; >1 transition found in non-auto-expand or min-size journal";
-    _err_map[JERR_JINF_ZEROLENFILE] = "JERR_JINF_ZEROLENFILE: Journal info file zero length";
+//    _err_map[JERR_JINF_CVALIDFAIL] = "JERR_JINF_CVALIDFAIL: Journal compatibility validation failure.";
+//    _err_map[JERR_JINF_NOVALUESTR] = "JERR_JINF_NOVALUESTR: No value attribute found in jinf file.";
+//    _err_map[JERR_JINF_BADVALUESTR] = "JERR_JINF_BADVALUESTR: Bad format for value attribute in jinf file";
+//    _err_map[JERR_JINF_JDATEMPTY] = "JERR_JINF_JDATEMPTY: Journal data files empty.";
+//    _err_map[JERR_JINF_TOOMANYFILES] = "JERR_JINF_TOOMANYFILES: Too many journal data files.";
+//    _err_map[JERR_JINF_INVALIDFHDR] = "JERR_JINF_INVALIDFHDR: Invalid journal data file header";
+//    _err_map[JERR_JINF_STAT] = "JERR_JINF_STAT: Error while trying to stat a journal data file";
+//    _err_map[JERR_JINF_NOTREGFILE] = "JERR_JINF_NOTREGFILE: Target journal data file is not a regular file";
+//    _err_map[JERR_JINF_BADFILESIZE] = "JERR_JINF_BADFILESIZE: Journal data file is of incorrect or unexpected size";
+//    _err_map[JERR_JINF_OWIBAD] = "JERR_JINF_OWIBAD: Journal data files have inconsistent OWI flags; >1 transition found in non-auto-expand or min-size journal";
+//    _err_map[JERR_JINF_ZEROLENFILE] = "JERR_JINF_ZEROLENFILE: Journal info file zero length";
 
     //_err_map[] = "";
 
@@ -241,7 +228,7 @@ jerrno::__init()
 }
 
 const char*
-jerrno::err_msg(const u_int32_t err_no) throw ()
+jerrno::err_msg(const uint32_t err_no) throw ()
 {
     _err_map_itr = _err_map.find(err_no);
     if (_err_map_itr == _err_map.end())



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message