qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kp...@apache.org
Subject svn commit: r1516176 [3/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
Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jerrno.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jerrno.h?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jerrno.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jerrno.h Wed Aug 21 14:38:12 2013
@@ -19,17 +19,6 @@
  *
  */
 
-/**
- * \file jerrno.h
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::jerrno (journal error
- * codes). See class documentation for details.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_JERRNO_H
 #define QPID_LEGACYSTORE_JRNL_JERRNO_H
 
@@ -42,8 +31,8 @@ class jerrno;
 }
 
 #include <map>
+#include <stdint.h>
 #include <string>
-#include <sys/types.h>
 
 namespace mrg
 {
@@ -56,101 +45,101 @@ namespace journal
     */
     class jerrno
     {
-        static std::map<u_int32_t, const char*> _err_map; ///< Map of error messages
-        static std::map<u_int32_t, const char*>::iterator _err_map_itr; ///< Iterator
+        static std::map<uint32_t, const char*> _err_map; ///< Map of error messages
+        static std::map<uint32_t, const char*>::iterator _err_map_itr; ///< Iterator
         static bool _initialized;                       ///< Dummy flag, used to initialise map.
 
     public:
         // generic errors
-        static const u_int32_t JERR__MALLOC;            ///< Buffer memory allocation failed
-        static const u_int32_t JERR__UNDERFLOW;         ///< Underflow error
-        static const u_int32_t JERR__NINIT;             ///< Operation on uninitialized class
-        static const u_int32_t JERR__AIO;               ///< AIO failure
-        static const u_int32_t JERR__FILEIO;            ///< File read or write failure
-        static const u_int32_t JERR__RTCLOCK;           ///< Reading real-time clock failed
-        static const u_int32_t JERR__PTHREAD;           ///< pthread failure
-        static const u_int32_t JERR__TIMEOUT;           ///< Timeout waiting for an event
-        static const u_int32_t JERR__UNEXPRESPONSE;     ///< Unexpected response to call or event
-        static const u_int32_t JERR__RECNFOUND;         ///< Record not found
-        static const u_int32_t JERR__NOTIMPL;           ///< Not implemented
+        static const uint32_t JERR__MALLOC;            ///< Buffer memory allocation failed
+        static const uint32_t JERR__UNDERFLOW;         ///< Underflow error
+        static const uint32_t JERR__NINIT;             ///< Operation on uninitialized class
+        static const uint32_t JERR__AIO;               ///< AIO failure
+        static const uint32_t JERR__FILEIO;            ///< File read or write failure
+        static const uint32_t JERR__RTCLOCK;           ///< Reading real-time clock failed
+        static const uint32_t JERR__PTHREAD;           ///< pthread failure
+        static const uint32_t JERR__TIMEOUT;           ///< Timeout waiting for an event
+        static const uint32_t JERR__UNEXPRESPONSE;     ///< Unexpected response to call or event
+        static const uint32_t JERR__RECNFOUND;         ///< Record not found
+        static const uint32_t JERR__NOTIMPL;           ///< Not implemented
 
         // class jcntl
-        static const u_int32_t JERR_JCNTL_STOPPED;      ///< Operation on stopped journal
-        static const u_int32_t JERR_JCNTL_READONLY;     ///< Write operation on read-only journal
-        static const u_int32_t JERR_JCNTL_AIOCMPLWAIT;  ///< Timeout waiting for AIOs to complete
-        static const u_int32_t JERR_JCNTL_UNKNOWNMAGIC; ///< Found record with unknown magic
-        static const u_int32_t JERR_JCNTL_NOTRECOVERED; ///< Req' recover() to be called first
-        static const u_int32_t JERR_JCNTL_RECOVERJFULL; ///< Journal data files full, cannot write
-        static const u_int32_t JERR_JCNTL_OWIMISMATCH;  ///< OWI change found in unexpected location
+        static const uint32_t JERR_JCNTL_STOPPED;      ///< Operation on stopped journal
+        static const uint32_t JERR_JCNTL_READONLY;     ///< Write operation on read-only journal
+        static const uint32_t JERR_JCNTL_AIOCMPLWAIT;  ///< Timeout waiting for AIOs to complete
+        static const uint32_t JERR_JCNTL_UNKNOWNMAGIC; ///< Found record with unknown magic
+        static const uint32_t JERR_JCNTL_NOTRECOVERED; ///< Req' recover() to be called first
+        static const uint32_t JERR_JCNTL_RECOVERJFULL; ///< Journal data files full, cannot write
+        static const uint32_t JERR_JCNTL_OWIMISMATCH;  ///< OWI change found in unexpected location
 
         // class jdir
-        static const u_int32_t JERR_JDIR_NOTDIR;        ///< Exists but is not a directory
-        static const u_int32_t JERR_JDIR_MKDIR;         ///< Directory creation failed
-        static const u_int32_t JERR_JDIR_OPENDIR;       ///< Directory open failed
-        static const u_int32_t JERR_JDIR_READDIR;       ///< Directory read failed
-        static const u_int32_t JERR_JDIR_CLOSEDIR;      ///< Directory close failed
-        static const u_int32_t JERR_JDIR_RMDIR;         ///< Directory delete failed
-        static const u_int32_t JERR_JDIR_NOSUCHFILE;    ///< File does not exist
-        static const u_int32_t JERR_JDIR_FMOVE;         ///< File move failed
-        static const u_int32_t JERR_JDIR_STAT;          ///< File stat failed
-        static const u_int32_t JERR_JDIR_UNLINK;        ///< File delete failed
-        static const u_int32_t JERR_JDIR_BADFTYPE;      ///< Bad or unknown file type (stat mode)
+        static const uint32_t JERR_JDIR_NOTDIR;        ///< Exists but is not a directory
+        static const uint32_t JERR_JDIR_MKDIR;         ///< Directory creation failed
+        static const uint32_t JERR_JDIR_OPENDIR;       ///< Directory open failed
+        static const uint32_t JERR_JDIR_READDIR;       ///< Directory read failed
+        static const uint32_t JERR_JDIR_CLOSEDIR;      ///< Directory close failed
+        static const uint32_t JERR_JDIR_RMDIR;         ///< Directory delete failed
+        static const uint32_t JERR_JDIR_NOSUCHFILE;    ///< File does not exist
+        static const uint32_t JERR_JDIR_FMOVE;         ///< File move failed
+        static const uint32_t JERR_JDIR_STAT;          ///< File stat failed
+        static const uint32_t JERR_JDIR_UNLINK;        ///< File delete failed
+        static const uint32_t JERR_JDIR_BADFTYPE;      ///< Bad or unknown file type (stat mode)
 
         // class fcntl
-        static const u_int32_t JERR_FCNTL_OPENWR;       ///< Unable to open file for write
-        static const u_int32_t JERR_FCNTL_WRITE;        ///< Unable to write to file
-        static const u_int32_t JERR_FCNTL_CLOSE;        ///< File close failed
-        static const u_int32_t JERR_FCNTL_FILEOFFSOVFL; ///< Increased offset past file size
-        static const u_int32_t JERR_FCNTL_CMPLOFFSOVFL; ///< Increased cmpl offs past subm offs
-        static const u_int32_t JERR_FCNTL_RDOFFSOVFL;   ///< Increased read offs past write offs
+//        static const uint32_t JERR_FCNTL_OPENWR;       ///< Unable to open file for write
+//        static const uint32_t JERR_FCNTL_WRITE;        ///< Unable to write to file
+//        static const uint32_t JERR_FCNTL_CLOSE;        ///< File close failed
+//        static const uint32_t JERR_FCNTL_FILEOFFSOVFL; ///< Increased offset past file size
+//        static const uint32_t JERR_FCNTL_CMPLOFFSOVFL; ///< Increased cmpl offs past subm offs
+//        static const uint32_t JERR_FCNTL_RDOFFSOVFL;   ///< Increased read offs past write offs
 
         // class lfmgr
-        static const u_int32_t JERR_LFMGR_BADAEFNUMLIM; ///< Bad auto-expand file number limit
-        static const u_int32_t JERR_LFMGR_AEFNUMLIMIT;  ///< Exceeded auto-expand file number limit
-        static const u_int32_t JERR_LFMGR_AEDISABLED;   ///< Attempted to expand with auto-expand disabled
+//        static const uint32_t JERR_LFMGR_BADAEFNUMLIM; ///< Bad auto-expand file number limit
+//        static const uint32_t JERR_LFMGR_AEFNUMLIMIT;  ///< Exceeded auto-expand file number limit
+//        static const uint32_t JERR_LFMGR_AEDISABLED;   ///< Attempted to expand with auto-expand disabled
 
         // class rrfc
-        static const u_int32_t JERR_RRFC_OPENRD;        ///< Unable to open file for read
+//        static const uint32_t JERR_RRFC_OPENRD;        ///< Unable to open file for read
 
         // class jrec, enq_rec, deq_rec, txn_rec
-        static const u_int32_t JERR_JREC_BADRECHDR;     ///< Invalid data record header
-        static const u_int32_t JERR_JREC_BADRECTAIL;    ///< Invalid data record tail
+        static const uint32_t JERR_JREC_BADRECHDR;     ///< Invalid data record header
+        static const uint32_t JERR_JREC_BADRECTAIL;    ///< Invalid data record tail
 
         // class wmgr
-        static const u_int32_t JERR_WMGR_BADPGSTATE;    ///< Page buffer in illegal state.
-        static const u_int32_t JERR_WMGR_BADDTOKSTATE;  ///< Data token in illegal state.
-        static const u_int32_t JERR_WMGR_ENQDISCONT;    ///< Enq. new dtok when previous part compl.
-        static const u_int32_t JERR_WMGR_DEQDISCONT;    ///< Deq. new dtok when previous part compl.
-        static const u_int32_t JERR_WMGR_DEQRIDNOTENQ;  ///< Deq. rid not enqueued
+        static const uint32_t JERR_WMGR_BADPGSTATE;    ///< Page buffer in illegal state.
+        static const uint32_t JERR_WMGR_BADDTOKSTATE;  ///< Data token in illegal state.
+        static const uint32_t JERR_WMGR_ENQDISCONT;    ///< Enq. new dtok when previous part compl.
+        static const uint32_t JERR_WMGR_DEQDISCONT;    ///< Deq. new dtok when previous part compl.
+        static const uint32_t JERR_WMGR_DEQRIDNOTENQ;  ///< Deq. rid not enqueued
 
         // class rmgr
-        static const u_int32_t JERR_RMGR_UNKNOWNMAGIC;  ///< Found record with unknown magic
-        static const u_int32_t JERR_RMGR_RIDMISMATCH;   ///< RID mismatch between rec and dtok
-        //static const u_int32_t JERR_RMGR_FIDMISMATCH;   ///< FID mismatch between emap and rrfc
-        static const u_int32_t JERR_RMGR_ENQSTATE;      ///< Attempted read when wstate not ENQ
-        static const u_int32_t JERR_RMGR_BADRECTYPE;    ///< Attempted op on incorrect rec type
+        static const uint32_t JERR_RMGR_UNKNOWNMAGIC;  ///< Found record with unknown magic
+        static const uint32_t JERR_RMGR_RIDMISMATCH;   ///< RID mismatch between rec and dtok
+        //static const uint32_t JERR_RMGR_FIDMISMATCH;   ///< FID mismatch between emap and rrfc
+        static const uint32_t JERR_RMGR_ENQSTATE;      ///< Attempted read when wstate not ENQ
+        static const uint32_t JERR_RMGR_BADRECTYPE;    ///< Attempted op on incorrect rec type
 
         // class data_tok
-        static const u_int32_t JERR_DTOK_ILLEGALSTATE;  ///< Attempted to change to illegal state
-//         static const u_int32_t JERR_DTOK_RIDNOTSET;     ///< Record ID not set
+        static const uint32_t JERR_DTOK_ILLEGALSTATE;  ///< Attempted to change to illegal state
+//         static const uint32_t JERR_DTOK_RIDNOTSET;     ///< Record ID not set
 
         // class enq_map, txn_map
-        static const u_int32_t JERR_MAP_DUPLICATE;      ///< Attempted to insert using duplicate key
-        static const u_int32_t JERR_MAP_NOTFOUND;       ///< Key not found in map
-        static const u_int32_t JERR_MAP_LOCKED;         ///< rid locked by pending txn
+        static const uint32_t JERR_MAP_DUPLICATE;      ///< Attempted to insert using duplicate key
+        static const uint32_t JERR_MAP_NOTFOUND;       ///< Key not found in map
+        static const uint32_t JERR_MAP_LOCKED;         ///< rid locked by pending txn
 
         // class jinf
-        static const u_int32_t JERR_JINF_CVALIDFAIL;    ///< Compatibility validation failure
-        static const u_int32_t JERR_JINF_NOVALUESTR;    ///< No value attr found in jinf file
-        static const u_int32_t JERR_JINF_BADVALUESTR;   ///< Bad format for value attr in jinf file
-        static const u_int32_t JERR_JINF_JDATEMPTY;     ///< Journal data files empty
-        static const u_int32_t JERR_JINF_TOOMANYFILES;  ///< Too many journal data files
-        static const u_int32_t JERR_JINF_INVALIDFHDR;   ///< Invalid file header
-        static const u_int32_t JERR_JINF_STAT;          ///< Error while trying to stat a file
-        static const u_int32_t JERR_JINF_NOTREGFILE;    ///< Target file is not a regular file
-        static const u_int32_t JERR_JINF_BADFILESIZE;   ///< File is of incorrect or unexpected size
-        static const u_int32_t JERR_JINF_OWIBAD;        ///< OWI inconsistent (>1 transition in non-ae journal)
-        static const u_int32_t JERR_JINF_ZEROLENFILE;   ///< Journal info file is zero length (empty).
+//        static const uint32_t JERR_JINF_CVALIDFAIL;    ///< Compatibility validation failure
+//        static const uint32_t JERR_JINF_NOVALUESTR;    ///< No value attr found in jinf file
+//        static const uint32_t JERR_JINF_BADVALUESTR;   ///< Bad format for value attr in jinf file
+//        static const uint32_t JERR_JINF_JDATEMPTY;     ///< Journal data files empty
+//        static const uint32_t JERR_JINF_TOOMANYFILES;  ///< Too many journal data files
+//        static const uint32_t JERR_JINF_INVALIDFHDR;   ///< Invalid file header
+//        static const uint32_t JERR_JINF_STAT;          ///< Error while trying to stat a file
+//        static const uint32_t JERR_JINF_NOTREGFILE;    ///< Target file is not a regular file
+//        static const uint32_t JERR_JINF_BADFILESIZE;   ///< File is of incorrect or unexpected size
+//        static const uint32_t JERR_JINF_OWIBAD;        ///< OWI inconsistent (>1 transition in non-ae journal)
+//        static const uint32_t JERR_JINF_ZEROLENFILE;   ///< Journal info file is zero length (empty).
 
         // Negative returns for some functions
         static const int32_t AIO_TIMEOUT;               ///< Timeout waiting for AIO return
@@ -158,7 +147,7 @@ namespace journal
         /**
         * \brief Method to access error message from known error number.
         */
-        static const char* err_msg(const u_int32_t err_no) throw ();
+        static const char* err_msg(const uint32_t err_no) throw ();
 
     private:
         /**

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jexception.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jexception.cpp?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jexception.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jexception.cpp Wed Aug 21 14:38:12 2013
@@ -19,22 +19,11 @@
  *
  */
 
-/**
- * \file jexception.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * Generic journal exception class mrg::journal::jexception. See comments
- * in file jexception.h for details.
- *
- * \author Kim van der Riet
- */
-
-#include "qpid/legacystore/jrnl/jexception.h"
+#include "qpid/linearstore/jrnl/jexception.h"
 
 #include <iomanip>
 #include <sstream>
-#include "qpid/legacystore/jrnl/jerrno.h"
+#include "qpid/linearstore/jrnl/jerrno.h"
 
 #define CATLEN(p) MAX_MSG_SIZE - std::strlen(p) - 1
 
@@ -50,7 +39,7 @@ jexception::jexception() throw ():
     format();
 }
 
-jexception::jexception(const u_int32_t err_code) throw ():
+jexception::jexception(const uint32_t err_code) throw ():
         std::exception(),
         _err_code(err_code)
 {
@@ -73,7 +62,7 @@ jexception::jexception(const std::string
     format();
 }
 
-jexception::jexception(const u_int32_t err_code, const char* additional_info) throw ():
+jexception::jexception(const uint32_t err_code, const char* additional_info) throw ():
         std::exception(),
         _err_code(err_code),
         _additional_info(additional_info)
@@ -81,7 +70,7 @@ jexception::jexception(const u_int32_t e
     format();
 }
 
-jexception::jexception(const u_int32_t err_code, const std::string& additional_info) throw ():
+jexception::jexception(const uint32_t err_code, const std::string& additional_info) throw ():
         std::exception(),
         _err_code(err_code),
         _additional_info(additional_info)
@@ -89,7 +78,7 @@ jexception::jexception(const u_int32_t e
     format();
 }
 
-jexception::jexception(const u_int32_t err_code, const char* throwing_class,
+jexception::jexception(const uint32_t err_code, const char* throwing_class,
         const char* throwing_fn) throw ():
         std::exception(),
         _err_code(err_code),
@@ -99,7 +88,7 @@ jexception::jexception(const u_int32_t e
     format();
 }
 
-jexception::jexception(const u_int32_t err_code, const std::string& throwing_class,
+jexception::jexception(const uint32_t err_code, const std::string& throwing_class,
         const std::string& throwing_fn) throw ():
         std::exception(),
         _err_code(err_code),
@@ -109,7 +98,7 @@ jexception::jexception(const u_int32_t e
     format();
 }
 
-jexception::jexception(const u_int32_t err_code, const char* additional_info,
+jexception::jexception(const uint32_t err_code, const char* additional_info,
         const char* throwing_class, const char* throwing_fn) throw ():
         std::exception(),
         _err_code(err_code),
@@ -120,7 +109,7 @@ jexception::jexception(const u_int32_t e
     format();
 }
 
-jexception::jexception(const u_int32_t err_code, const std::string& additional_info,
+jexception::jexception(const uint32_t err_code, const std::string& additional_info,
         const std::string& throwing_class, const std::string& throwing_fn) throw ():
         std::exception(),
         _err_code(err_code),

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jexception.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jexception.h?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jexception.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jexception.h Wed Aug 21 14:38:12 2013
@@ -19,19 +19,6 @@
  *
  */
 
-/**
- * \file jexception.h
- *
- * Qpid asynchronous store plugin library
- *
- * Generic journal exception class mrg::journal::jexception (derived
- * from class std::exception). Intended to serve as a common exception
- * class for all more speicalized exceptions in the message journal. See
- * class documentation for details.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_JEXCEPTION_H
 #define QPID_LEGACYSTORE_JRNL_JEXCEPTION_H
 
@@ -48,10 +35,9 @@ class jexception;
 #include <cstdlib>
 #include <cstring>
 #include <exception>
-#include "qpid/legacystore/jrnl/jerrno.h"
+#include "qpid/linearstore/jrnl/jerrno.h"
 #include <sstream>
 #include <string>
-#include <sys/types.h>
 
 // Macro for formatting commom system errors
 #define FORMAT_SYSERR(errno) " errno=" << errno << " (" << std::strerror(errno) << ")"
@@ -96,7 +82,7 @@ namespace journal
     class jexception : public std::exception
     {
     private:
-        u_int32_t _err_code;
+        uint32_t _err_code;
         std::string _additional_info;
         std::string _throwing_class;
         std::string _throwing_fn;
@@ -106,28 +92,28 @@ namespace journal
     public:
         jexception() throw ();
 
-        jexception(const u_int32_t err_code) throw ();
+        jexception(const uint32_t err_code) throw ();
 
         jexception(const char* additional_info) throw ();
         jexception(const std::string& additional_info) throw ();
 
-        jexception(const u_int32_t err_code, const char* additional_info) throw ();
-        jexception(const u_int32_t err_code, const std::string& additional_info) throw ();
+        jexception(const uint32_t err_code, const char* additional_info) throw ();
+        jexception(const uint32_t err_code, const std::string& additional_info) throw ();
 
-        jexception(const u_int32_t err_code, const char* throwing_class, const char* throwing_fn)
+        jexception(const uint32_t err_code, const char* throwing_class, const char* throwing_fn)
                 throw ();
-        jexception(const u_int32_t err_code, const std::string& throwing_class,
+        jexception(const uint32_t err_code, const std::string& throwing_class,
                 const std::string& throwing_fn) throw ();
 
-        jexception(const u_int32_t err_code, const char* additional_info,
+        jexception(const uint32_t err_code, const char* additional_info,
                 const char* throwing_class, const char* throwing_fn) throw ();
-        jexception(const u_int32_t err_code, const std::string& additional_info,
+        jexception(const uint32_t err_code, const std::string& additional_info,
                 const std::string& throwing_class, const std::string& throwing_fn) throw ();
 
         virtual ~jexception() throw ();
         virtual const char* what() const throw (); // override std::exception::what()
 
-        inline u_int32_t err_code() const throw () { return _err_code; }
+        inline uint32_t err_code() const throw () { return _err_code; }
         inline const std::string additional_info() const throw () { return _additional_info; }
         inline const std::string throwing_class() const throw () { return _throwing_class; }
         inline const std::string throwing_fn() const throw () { return _throwing_fn; }

Copied: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.cpp (from r1513311, qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.cpp)
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.cpp?p2=qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.cpp&p1=qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.cpp&r1=1513311&r2=1516176&rev=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.cpp Wed Aug 21 14:38:12 2013
@@ -19,22 +19,11 @@
  *
  */
 
-/**
- * \file jrec.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * File containing source code for class mrg::journal::jrec (abstract journal
- * jrecord). See comments in file jrec.h for details.
- *
- * \author Kim van der Riet
- */
-
-#include "qpid/legacystore/jrnl/jrec.h"
+#include "qpid/linearstore/jrnl/jrec.h"
 
 #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
@@ -46,7 +35,7 @@ jrec::jrec() {}
 jrec::~jrec() {}
 
 void
-jrec::chk_hdr(const rec_hdr& hdr)
+jrec::chk_hdr(const rec_hdr_t& hdr)
 {
     if (hdr._magic == 0)
     {
@@ -55,33 +44,33 @@ jrec::chk_hdr(const rec_hdr& hdr)
         oss << "enq magic NULL: rid=0x" << hdr._rid;
         throw jexception(jerrno::JERR_JREC_BADRECHDR, oss.str(), "jrec", "chk_hdr");
     }
-    if (hdr._version != RHM_JDAT_VERSION)
+    if (hdr._version != QLS_JRNL_VERSION)
     {
         std::ostringstream oss;
         oss << std::hex << std::setfill('0');
         oss << "version: rid=0x" << hdr._rid;
-        oss << ": expected=0x" << std::setw(2) << (int)RHM_JDAT_VERSION;
+        oss << ": expected=0x" << std::setw(2) << (int)QLS_JRNL_VERSION;
         oss << " read=0x" << std::setw(2) << (int)hdr._version;
         throw jexception(jerrno::JERR_JREC_BADRECHDR, oss.str(), "jrec", "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._eflag != endian_flag)
-    {
-        std::ostringstream oss;
-        oss << std::hex << std::setfill('0');
-        oss << "endian_flag: rid=" << hdr._rid;
-        oss << ": expected=0x" << std::setw(2) << (int)endian_flag;
-        oss << " read=0x" << std::setw(2) << (int)hdr._eflag;
-        throw jexception(jerrno::JERR_JREC_BADRECHDR, oss.str(), "jrec", "chk_hdr");
-    }
+//#if defined (JRNL_LITTLE_ENDIAN)
+//    uint8_t endian_flag = RHM_LENDIAN_FLAG;
+//#else
+//    uint8_t endian_flag = RHM_BENDIAN_FLAG;
+//#endif
+//    if (hdr._eflag != endian_flag)
+//    {
+//        std::ostringstream oss;
+//        oss << std::hex << std::setfill('0');
+//        oss << "endian_flag: rid=" << hdr._rid;
+//        oss << ": expected=0x" << std::setw(2) << (int)endian_flag;
+//        oss << " read=0x" << std::setw(2) << (int)hdr._eflag;
+//        throw jexception(jerrno::JERR_JREC_BADRECHDR, oss.str(), "jrec", "chk_hdr");
+//    }
 }
 
 void
-jrec::chk_rid(const rec_hdr& hdr, const u_int64_t rid)
+jrec::chk_rid(const rec_hdr_t& hdr, const uint64_t rid)
 {
     if (hdr._rid != rid)
     {
@@ -94,7 +83,7 @@ jrec::chk_rid(const rec_hdr& hdr, const 
 }
 
 void
-jrec::chk_tail(const rec_tail& tail, const rec_hdr& hdr)
+jrec::chk_tail(const rec_tail_t& tail, const rec_hdr_t& hdr)
 {
     if (tail._xmagic != ~hdr._magic)
     {

Copied: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.h (from r1513311, qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.h)
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.h?p2=qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.h&p1=qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.h&r1=1513311&r2=1516176&rev=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/jrec.h Wed Aug 21 14:38:12 2013
@@ -19,17 +19,6 @@
  *
  */
 
-/**
- * \file jrec.h
- *
- * Qpid asynchronous store plugin library
- *
- * File containing source code for class mrg::journal::jrec (abstract journal
- * jrecord). See class documentation for details.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_JREC_H
 #define QPID_LEGACYSTORE_JRNL_JREC_H
 
@@ -43,10 +32,10 @@ class jrec;
 
 #include <cstddef>
 #include <fstream>
-#include "qpid/legacystore/jrnl/rec_hdr.h"
-#include "qpid/legacystore/jrnl/rec_tail.h"
+#include "qpid/linearstore/jrnl/jcfg.h"
+#include "qpid/linearstore/jrnl/utils/rec_hdr.h"
+#include "qpid/linearstore/jrnl/utils/rec_tail.h"
 #include <string>
-#include <sys/types.h>
 
 namespace mrg
 {
@@ -116,8 +105,8 @@ namespace journal
         * \param max_size_dblks Maximum number of data-blocks to write to pointer wptr.
         * \returns Number of data-blocks encoded.
         */
-        virtual u_int32_t encode(void* wptr, u_int32_t rec_offs_dblks,
-                u_int32_t max_size_dblks) = 0;
+        virtual uint32_t encode(void* wptr, uint32_t rec_offs_dblks,
+                uint32_t max_size_dblks) = 0;
 
         /**
         * \brief Decode into this instance of jrec from the read buffer at the disk-block-aligned
@@ -149,31 +138,31 @@ namespace journal
         * \param max_size_dblks Maximum number of data-blocks to read from pointer rptr.
         * \returns Number of data-blocks read (consumed).
         */
-        virtual u_int32_t decode(rec_hdr& h, void* rptr, u_int32_t rec_offs_dblks,
-                u_int32_t max_size_dblks) = 0;
+        virtual uint32_t decode(rec_hdr_t& h, void* rptr, uint32_t rec_offs_dblks,
+                uint32_t max_size_dblks) = 0;
 
-        virtual bool rcv_decode(rec_hdr h, std::ifstream* ifsp, std::size_t& rec_offs) = 0;
+        virtual bool rcv_decode(rec_hdr_t h, std::ifstream* ifsp, std::size_t& rec_offs) = 0;
 
         virtual std::string& str(std::string& str) const = 0;
         virtual std::size_t data_size() const = 0;
         virtual std::size_t xid_size() const = 0;
         virtual std::size_t rec_size() const = 0;
-        inline virtual u_int32_t rec_size_dblks() const { return size_dblks(rec_size()); }
-        static inline u_int32_t size_dblks(const std::size_t size)
+        inline virtual uint32_t rec_size_dblks() const { return size_dblks(rec_size()); }
+        static inline uint32_t size_dblks(const std::size_t size)
                 { return size_blks(size, JRNL_DBLK_SIZE); }
-        static inline u_int32_t size_sblks(const std::size_t size)
+        static inline uint32_t size_sblks(const std::size_t size)
                 { return size_blks(size, JRNL_DBLK_SIZE * JRNL_SBLK_SIZE); }
-        static inline u_int32_t size_blks(const std::size_t size, const std::size_t blksize)
+        static inline uint32_t size_blks(const std::size_t size, const std::size_t blksize)
                 { return (size + blksize - 1)/blksize; }
-        virtual u_int64_t rid() const = 0;
+        virtual uint64_t rid() const = 0;
 
     protected:
         virtual void chk_hdr() const = 0;
-        virtual void chk_hdr(u_int64_t rid) const = 0;
+        virtual void chk_hdr(uint64_t rid) const = 0;
         virtual void chk_tail() const = 0;
-        static void chk_hdr(const rec_hdr& hdr);
-        static void chk_rid(const rec_hdr& hdr, u_int64_t rid);
-        static void chk_tail(const rec_tail& tail, const rec_hdr& hdr);
+        static void chk_hdr(const rec_hdr_t& hdr);
+        static void chk_rid(const rec_hdr_t& hdr, uint64_t rid);
+        static void chk_tail(const rec_tail_t& tail, const rec_hdr_t& hdr);
         virtual void clean() = 0;
     }; // class jrec
 

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/pmgr.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/pmgr.cpp?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/pmgr.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/pmgr.cpp Wed Aug 21 14:38:12 2013
@@ -19,25 +19,14 @@
  *
  */
 
-/**
- * \file pmgr.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::pmgr (page manager). See
- * comments in file pmgr.h for details.
- *
- * \author Kim van der Riet
- */
-
-#include "qpid/legacystore/jrnl/pmgr.h"
+#include "qpid/linearstore/jrnl/pmgr.h"
 
 #include <cerrno>
 #include <cstdlib>
 #include <cstring>
-#include "qpid/legacystore/jrnl/jcfg.h"
-#include "qpid/legacystore/jrnl/jcntl.h"
-#include "qpid/legacystore/jrnl/jerrno.h"
+#include "qpid/linearstore/jrnl/jcfg.h"
+#include "qpid/linearstore/jrnl/jcntl.h"
+#include "qpid/linearstore/jrnl/jerrno.h"
 #include <sstream>
 
 
@@ -46,14 +35,14 @@ namespace mrg
 namespace journal
 {
 
-pmgr::page_cb::page_cb(u_int16_t index):
+pmgr::page_cb::page_cb(uint16_t index):
         _index(index),
         _state(UNUSED),
         _wdblks(0),
         _rdblks(0),
         _pdtokl(0),
-        _wfh(0),
-        _rfh(0),
+//        _wfh(0),
+//        _rfh(0),
         _pbuff(0)
 {}
 
@@ -74,7 +63,7 @@ pmgr::page_cb::state_str() const
     return "<unknown>";
 }
 
-const u_int32_t pmgr::_sblksize = JRNL_SBLK_SIZE * JRNL_DBLK_SIZE;
+const uint32_t pmgr::_sblksize = JRNL_SBLK_SIZE * JRNL_DBLK_SIZE;
 
 pmgr::pmgr(jcntl* jc, enq_map& emap, txn_map& tmap):
         _cache_pgsize_sblks(0),
@@ -104,7 +93,7 @@ pmgr::~pmgr()
 }
 
 void
-pmgr::initialize(aio_callback* const cbp, const u_int32_t cache_pgsize_sblks, const u_int16_t cache_num_pages)
+pmgr::initialize(aio_callback* const cbp, const uint32_t cache_pgsize_sblks, const uint16_t cache_num_pages)
 {
     // As static use of this class keeps old values around, clean up first...
     pmgr::clean();
@@ -140,7 +129,7 @@ pmgr::initialize(aio_callback* const cbp
     MALLOC_CHK(_aio_cb_arr, "_aio_cb_arr", "pmgr", "initialize");
 
     // 6. Set page pointers in _page_ptr_arr, _page_cb_arr and iocbs to pages within page block
-    for (u_int16_t i=0; i<_cache_num_pages; i++)
+    for (uint16_t i=0; i<_cache_num_pages; i++)
     {
         _page_ptr_arr[i] = (void*)((char*)_page_base_ptr + _cache_pgsize_sblks * _sblksize * i);
         _page_cb_arr[i]._index = i;
@@ -152,7 +141,7 @@ pmgr::initialize(aio_callback* const cbp
     }
 
     // 7. Allocate io_event array, max one event per cache page plus one for each file
-    const u_int16_t max_aio_evts = _cache_num_pages + _jc->num_jfiles();
+    const uint16_t max_aio_evts = _cache_num_pages /*+ _jc->num_jfiles()*/; // TODO find replacement here for linear store
     _aio_event_arr = (aio_event*)std::malloc(max_aio_evts * sizeof(aio_event));
     MALLOC_CHK(_aio_event_arr, "_aio_event_arr", "pmgr", "initialize");
 

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/pmgr.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/pmgr.h?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/pmgr.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/pmgr.h Wed Aug 21 14:38:12 2013
@@ -19,17 +19,6 @@
  *
  */
 
-/**
- * \file pmgr.h
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::pmgr (page manager). See
- * class documentation for details.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_PMGR_H
 #define QPID_LEGACYSTORE_JRNL_PMGR_H
 
@@ -43,15 +32,15 @@ namespace journal
 }
 
 #include <deque>
-#include "qpid/legacystore/jrnl/aio.h"
-#include "qpid/legacystore/jrnl/aio_callback.h"
-#include "qpid/legacystore/jrnl/data_tok.h"
-#include "qpid/legacystore/jrnl/deq_rec.h"
-#include "qpid/legacystore/jrnl/enq_map.h"
-#include "qpid/legacystore/jrnl/enq_rec.h"
-#include "qpid/legacystore/jrnl/fcntl.h"
-#include "qpid/legacystore/jrnl/txn_map.h"
-#include "qpid/legacystore/jrnl/txn_rec.h"
+#include "qpid/linearstore/jrnl/aio.h"
+#include "qpid/linearstore/jrnl/aio_callback.h"
+#include "qpid/linearstore/jrnl/data_tok.h"
+#include "qpid/linearstore/jrnl/deq_rec.h"
+#include "qpid/linearstore/jrnl/enq_map.h"
+#include "qpid/linearstore/jrnl/enq_rec.h"
+//#include "qpid/linearstore/jrnl/fcntl.h"
+#include "qpid/linearstore/jrnl/txn_map.h"
+#include "qpid/linearstore/jrnl/txn_rec.h"
 
 namespace mrg
 {
@@ -83,23 +72,23 @@ namespace journal
         */
         struct page_cb
         {
-            u_int16_t _index;           ///< Index of this page
+            uint16_t _index;            ///< Index of this page
             page_state _state;          ///< Status of page
-            u_int64_t _frid;            ///< First rid in page (used for fhdr init)
-            u_int32_t _wdblks;          ///< Total number of dblks in page so far
-            u_int32_t _rdblks;          ///< Total number of dblks in page
+            uint64_t _frid;             ///< First rid in page (used for fhdr init)
+            uint32_t _wdblks;           ///< Total number of dblks in page so far
+            uint32_t _rdblks;           ///< Total number of dblks in page
             std::deque<data_tok*>* _pdtokl; ///< Page message tokens list
-            fcntl* _wfh;                ///< File handle for incrementing write compl counts
-            fcntl* _rfh;                ///< File handle for incrementing read compl counts
+            //fcntl* _wfh;                ///< File handle for incrementing write compl counts
+            //fcntl* _rfh;                ///< File handle for incrementing read compl counts
             void* _pbuff;               ///< Page buffer
 
-            page_cb(u_int16_t index);   ///< Convenience constructor
+            page_cb(uint16_t index);   ///< Convenience constructor
             const char* state_str() const; ///< Return state as string for this pcb
         };
 
-        static const u_int32_t _sblksize; ///< Disk softblock size
-        u_int32_t _cache_pgsize_sblks;  ///< Size of page cache cache_num_pages
-        u_int16_t _cache_num_pages;     ///< Number of page cache cache_num_pages
+        static const uint32_t _sblksize; ///< Disk softblock size
+        uint32_t _cache_pgsize_sblks;   ///< Size of page cache cache_num_pages
+        uint16_t _cache_num_pages;      ///< Number of page cache cache_num_pages
         jcntl* _jc;                     ///< Pointer to journal controller
         enq_map& _emap;                 ///< Ref to enqueue map
         txn_map& _tmap;                 ///< Ref to transaction map
@@ -109,10 +98,10 @@ namespace journal
         aio_cb* _aio_cb_arr;            ///< Array of iocb structs
         aio_event* _aio_event_arr;      ///< Array of io_events
         io_context_t _ioctx;            ///< AIO context for read/write operations
-        u_int16_t _pg_index;            ///< Index of current page being used
-        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
+        uint16_t _pg_index;             ///< Index of current page being used
+        uint32_t _pg_cntr;              ///< Page counter; determines if file rotation req'd
+        uint32_t _pg_offset_dblks;      ///< Page offset (used so far) in data blocks
+        uint32_t _aio_evt_rem;          ///< Remaining AIO events
         aio_callback* _cbp;             ///< Pointer to callback object
 
         enq_rec _enq_rec;               ///< Enqueue record used for encoding/decoding
@@ -124,14 +113,14 @@ namespace journal
         virtual ~pmgr();
 
         virtual int32_t get_events(page_state state, timespec* const timeout, bool flush = false) = 0;
-        inline u_int32_t get_aio_evt_rem() const { return _aio_evt_rem; }
+        inline uint32_t get_aio_evt_rem() const { return _aio_evt_rem; }
         static const char* page_state_str(page_state ps);
-        inline u_int32_t cache_pgsize_sblks() const { return _cache_pgsize_sblks; }
-        inline u_int16_t cache_num_pages() const { return _cache_num_pages; }
+        inline uint32_t cache_pgsize_sblks() const { return _cache_pgsize_sblks; }
+        inline uint16_t cache_num_pages() const { return _cache_num_pages; }
 
     protected:
-        virtual void initialize(aio_callback* const cbp, const u_int32_t cache_pgsize_sblks,
-                const u_int16_t cache_num_pages);
+        virtual void initialize(aio_callback* const cbp, const uint32_t cache_pgsize_sblks,
+                const uint16_t cache_num_pages);
         virtual void rotate_page() = 0;
         virtual void clean();
     };

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/rcvdat.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/rcvdat.h?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/rcvdat.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/rcvdat.h Wed Aug 21 14:38:12 2013
@@ -19,25 +19,15 @@
  *
  */
 
-/**
- * \file rcvdat.h
- *
- * Qpid asynchronous store plugin library
- *
- * Contains structure for recovery status and offset data.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_RCVDAT_H
 #define QPID_LEGACYSTORE_JRNL_RCVDAT_H
 
 #include <cstddef>
 #include <iomanip>
 #include <map>
-#include "qpid/legacystore/jrnl/jcfg.h"
+#include "qpid/linearstore/jrnl/jcfg.h"
 #include <sstream>
-#include <sys/types.h>
+#include <stdint.h>
 #include <vector>
 
 namespace mrg
@@ -47,28 +37,28 @@ namespace journal
 
         struct rcvdat
         {
-            u_int16_t _njf;     ///< Number of journal files
-            bool _ae;           ///< Auto-expand mode
-            u_int16_t _aemjf;   ///< Auto-expand mode max journal files
-            bool _owi;          ///< Overwrite indicator
-            bool _frot;         ///< First rotation flag
+            uint16_t _njf;      ///< Number of journal files
+//            bool _ae;           ///< Auto-expand mode
+//            uint16_t _aemjf;    ///< Auto-expand mode max journal files
+//            bool _owi;          ///< Overwrite indicator
+//            bool _frot;         ///< First rotation flag
             bool _jempty;       ///< Journal data files empty
-            u_int16_t _ffid;    ///< First file id
+            uint16_t _ffid;     ///< First file id
             std::size_t _fro;   ///< First record offset in ffid
-            u_int16_t _lfid;    ///< Last file id
+            uint16_t _lfid;     ///< Last file id
             std::size_t _eo;    ///< End offset (first byte past last record)
-            u_int64_t _h_rid;   ///< Highest rid found
+            uint64_t _h_rid;    ///< Highest rid found
             bool _lffull;       ///< Last file is full
             bool _jfull;        ///< Journal is full
-            std::vector<u_int16_t> _fid_list; ///< Fid-lid mapping - list of fids in order of lid
-            std::vector<u_int32_t> _enq_cnt_list; ///< Number enqueued records found for each file
+//            std::vector<uint16_t> _fid_list; ///< Fid-lid mapping - list of fids in order of lid
+            std::vector<uint32_t> _enq_cnt_list; ///< Number enqueued records found for each file
 
             rcvdat():
                     _njf(0),
-                    _ae(false),
-                    _aemjf(0),
-                    _owi(false),
-                    _frot(false),
+//                    _ae(false),
+//                    _aemjf(0),
+//                    _owi(false),
+//                    _frot(false),
                     _jempty(true),
                     _ffid(0),
                     _fro(0),
@@ -77,17 +67,17 @@ namespace journal
                     _h_rid(0),
                     _lffull(false),
                     _jfull(false),
-                    _fid_list(),
+//                    _fid_list(),
                     _enq_cnt_list()
             {}
 
-            void reset(const u_int16_t num_jfiles, const bool auto_expand, const u_int16_t ae_max_jfiles)
+            void reset(const uint16_t num_jfiles/*, const bool auto_expand, const uint16_t ae_max_jfiles*/)
             {
                 _njf = num_jfiles;
-                _ae = auto_expand;
-                _aemjf = ae_max_jfiles;
-                _owi = false;
-                _frot = false;
+//                _ae = auto_expand;
+//                _aemjf = ae_max_jfiles;
+//                _owi = false;
+//                _frot = false;
                 _jempty = true;
                 _ffid = 0;
                 _fro = 0;
@@ -96,15 +86,15 @@ namespace journal
                 _h_rid = 0;
                 _lffull = false;
                 _jfull = false;
-                _fid_list.clear();
+//                _fid_list.clear();
                 _enq_cnt_list.clear();
                 _enq_cnt_list.resize(num_jfiles, 0);
             }
 
             // Find first fid with enqueued records
-            u_int16_t ffid()
+            uint16_t ffid()
             {
-                u_int16_t index = _ffid;
+                uint16_t index = _ffid;
                 while (index != _lfid && _enq_cnt_list[index] == 0)
                 {
                     if (++index >= _njf)
@@ -118,10 +108,10 @@ namespace journal
                 std::ostringstream oss;
                 oss << "Recover file analysis (jid=\"" << jid << "\"):" << std::endl;
                 oss << "  Number of journal files (_njf) = " << _njf << std::endl;
-                oss << "  Auto-expand mode (_ae) = " << (_ae ? "TRUE" : "FALSE") << std::endl;
-                if (_ae) oss << "  Auto-expand mode max journal files (_aemjf) = " << _aemjf << std::endl;
-                oss << "  Overwrite indicator (_owi) = " << (_owi ? "TRUE" : "FALSE") << std::endl;
-                oss << "  First rotation (_frot) = " << (_frot ? "TRUE" : "FALSE") << std::endl;
+//                oss << "  Auto-expand mode (_ae) = " << (_ae ? "TRUE" : "FALSE") << std::endl;
+//                if (_ae) oss << "  Auto-expand mode max journal files (_aemjf) = " << _aemjf << std::endl;
+//                oss << "  Overwrite indicator (_owi) = " << (_owi ? "TRUE" : "FALSE") << std::endl;
+//                oss << "  First rotation (_frot) = " << (_frot ? "TRUE" : "FALSE") << std::endl;
                 oss << "  Journal empty (_jempty) = " << (_jempty ? "TRUE" : "FALSE") << std::endl;
                 oss << "  First (earliest) fid (_ffid) = " << _ffid << std::endl;
                 oss << "  First record offset in first fid (_fro) = 0x" << std::hex << _fro <<
@@ -133,11 +123,11 @@ namespace journal
                 oss << "  Last file full (_lffull) = " << (_lffull ? "TRUE" : "FALSE") << std::endl;
                 oss << "  Journal full (_jfull) = " << (_jfull ? "TRUE" : "FALSE") << std::endl;
                 oss << "  Normalized fid list (_fid_list) = [";
-                for (std::vector<u_int16_t>::const_iterator i = _fid_list.begin(); i < _fid_list.end(); i++)
-                {
-                    if (i != _fid_list.begin()) oss << ", ";
-                    oss << *i;
-                }
+//                for (std::vector<uint16_t>::const_iterator i = _fid_list.begin(); i < _fid_list.end(); i++)
+//                {
+//                    if (i != _fid_list.begin()) oss << ", ";
+//                    oss << *i;
+//                }
                 oss << "]" << std::endl;
                 oss << "  Enqueued records (txn & non-txn):" << std::endl;
                 for (unsigned i=0; i<_enq_cnt_list.size(); i++)
@@ -151,10 +141,10 @@ namespace journal
                 std::ostringstream oss;
                 oss << "Recover file analysis (jid=\"" << jid << "\"):";
                 oss << " njf=" << _njf;
-                oss << " ae=" << (_owi ? "T" : "F");
-                oss << " aemjf=" << _aemjf;
-                oss << " owi=" << (_ae ? "T" : "F");
-                oss << " frot=" << (_frot ? "T" : "F");
+//                oss << " ae=" << (_owi ? "T" : "F");
+//                oss << " aemjf=" << _aemjf;
+//                oss << " owi=" << (_ae ? "T" : "F");
+//                oss << " frot=" << (_frot ? "T" : "F");
                 oss << " jempty=" << (_jempty ? "T" : "F");
                 oss << " ffid=" << _ffid;
                 oss << " fro=0x" << std::hex << _fro << std::dec << " (" <<

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/rmgr.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/rmgr.cpp?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/rmgr.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/rmgr.cpp Wed Aug 21 14:38:12 2013
@@ -19,24 +19,13 @@
  *
  */
 
-/**
- * \file rmgr.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::rmgr (read manager). See
- * comments in file rmgr.h for details.
- *
- * \author Kim van der Riet
- */
-
-#include "qpid/legacystore/jrnl/rmgr.h"
+#include "qpid/linearstore/jrnl/rmgr.h"
 
 #include <cassert>
 #include <cerrno>
 #include <cstdlib>
-#include "qpid/legacystore/jrnl/jcntl.h"
-#include "qpid/legacystore/jrnl/jerrno.h"
+#include "qpid/linearstore/jrnl/jcntl.h"
+#include "qpid/linearstore/jrnl/jerrno.h"
 #include <sstream>
 
 namespace mrg
@@ -44,9 +33,9 @@ namespace mrg
 namespace journal
 {
 
-rmgr::rmgr(jcntl* jc, enq_map& emap, txn_map& tmap, rrfc& rrfc):
+rmgr::rmgr(jcntl* jc, enq_map& emap, txn_map& tmap/*, rrfc& rrfc*/):
         pmgr(jc, emap, tmap),
-        _rrfc(rrfc),
+//        _rrfc(rrfc),
         _hdr(),
         _fhdr_buffer(0),
         _fhdr_aio_cb_ptr(0),
@@ -126,14 +115,15 @@ rmgr::read(void** const datapp, std::siz
     }
 
     set_params_null(datapp, dsize, xidpp, xidsize);
-    _hdr.reset();
+    //_hdr.reset();
+    ::rec_hdr_init(&_hdr, 0, 0, 0, 0);
     // Read header, determine next record type
     while (true)
     {
-        if(dblks_rem() == 0 && _rrfc.is_compl() && !_rrfc.is_wr_aio_outstanding())
+        if(dblks_rem() == 0 /*&& _rrfc.is_compl() && !_rrfc.is_wr_aio_outstanding()*/) // TODO: replace for linear store
         {
             aio_cycle();   // check if rd AIOs returned; initiate new reads if possible
-            if(dblks_rem() == 0 && _rrfc.is_compl() && !_rrfc.is_wr_aio_outstanding())
+            if(dblks_rem() == 0 /*&& _rrfc.is_compl() && !_rrfc.is_wr_aio_outstanding()*/) // TODO: replace for linear store
             {
                 if (_jc->unflushed_dblks() > 0)
                     _jc->flush();
@@ -147,10 +137,10 @@ rmgr::read(void** const datapp, std::siz
             return RHM_IORES_PAGE_AIOWAIT;
         }
         void* rptr = (void*)((char*)_page_ptr_arr[_pg_index] + (_pg_offset_dblks * JRNL_DBLK_SIZE));
-        std::memcpy(&_hdr, rptr, sizeof(rec_hdr));
+        std::memcpy(&_hdr, rptr, sizeof(rec_hdr_t));
         switch (_hdr._magic)
         {
-            case RHM_JDAT_ENQ_MAGIC:
+            case QLS_ENQ_MAGIC:
             {
                 _enq_rec.reset(); // sets enqueue rec size
                 // Check if RID of this rec is still enqueued, if so read it, else skip
@@ -211,16 +201,16 @@ rmgr::read(void** const datapp, std::siz
                     consume_xid_rec(_hdr, rptr, dtokp);
                 break;
             }
-            case RHM_JDAT_DEQ_MAGIC:
+            case QLS_DEQ_MAGIC:
                 consume_xid_rec(_hdr, rptr, dtokp);
                 break;
-            case RHM_JDAT_TXA_MAGIC:
+            case QLS_TXA_MAGIC:
                 consume_xid_rec(_hdr, rptr, dtokp);
                 break;
-            case RHM_JDAT_TXC_MAGIC:
+            case QLS_TXC_MAGIC:
                 consume_xid_rec(_hdr, rptr, dtokp);
                 break;
-            case RHM_JDAT_EMPTY_MAGIC:
+            case QLS_EMPTY_MAGIC:
                 consume_filler();
                 break;
             default:
@@ -230,7 +220,7 @@ rmgr::read(void** const datapp, std::siz
 }
 
 int32_t
-rmgr::get_events(page_state state, timespec* const timeout, bool flush)
+rmgr::get_events(page_state /*state*/, timespec* const timeout, bool flush)
 {
     if (_aio_evt_rem == 0) // no events to get
         return 0;
@@ -247,7 +237,7 @@ rmgr::get_events(page_state state, times
     if (ret == 0 && timeout)
         return jerrno::AIO_TIMEOUT;
 
-    std::vector<u_int16_t> pil;
+    std::vector<uint16_t> pil;
     pil.reserve(ret);
     for (int i=0; i<ret; i++) // Index of returned AIOs
     {
@@ -274,6 +264,8 @@ rmgr::get_events(page_state state, times
 
         if (pcbp) // Page reads have pcb
         {
+            // TODO: replace for linear store: _rfh
+/*
             if (pcbp->_rfh->rd_subm_cnt_dblks() >= JRNL_SBLK_SIZE) // Detects if write reset of this fcntl obj has occurred.
             {
                 // Increment the completed read offset
@@ -284,25 +276,27 @@ rmgr::get_events(page_state state, times
                 pcbp->_state = state;
                 pil[i] = pcbp->_index;
             }
+*/
         }
         else // File header reads have no pcb
         {
-            std::memcpy(&_fhdr, _fhdr_buffer, sizeof(file_hdr));
-            _rrfc.add_cmpl_cnt_dblks(JRNL_SBLK_SIZE);
+            std::memcpy(&_fhdr, _fhdr_buffer, sizeof(file_hdr_t));
+            /*_rrfc.add_cmpl_cnt_dblks(JRNL_SBLK_SIZE);*/ // TODO: replace for linear store: _rrfc
 
-            u_int32_t fro_dblks = (_fhdr._fro / JRNL_DBLK_SIZE) - JRNL_SBLK_SIZE;
+            uint32_t fro_dblks = (_fhdr._fro / JRNL_DBLK_SIZE) - JRNL_SBLK_SIZE;
             // Check fro_dblks does not exceed the write pointers which can happen in some corrupted journal recoveries
-            if (fro_dblks > _jc->wr_subm_cnt_dblks(_fhdr._pfid) - JRNL_SBLK_SIZE)
-                fro_dblks = _jc->wr_subm_cnt_dblks(_fhdr._pfid) - JRNL_SBLK_SIZE;
+            // TODO: replace for linear store: _fhdr._pfid, _rrfc
+//            if (fro_dblks > _jc->wr_subm_cnt_dblks(_fhdr._pfid) - JRNL_SBLK_SIZE)
+//                fro_dblks = _jc->wr_subm_cnt_dblks(_fhdr._pfid) - JRNL_SBLK_SIZE;
             _pg_cntr = fro_dblks / (JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE);
-            u_int32_t tot_pg_offs_dblks = _pg_cntr * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
+            uint32_t tot_pg_offs_dblks = _pg_cntr * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
             _pg_index = _pg_cntr % JRNL_RMGR_PAGES;
             _pg_offset_dblks = fro_dblks - tot_pg_offs_dblks;
-            _rrfc.add_subm_cnt_dblks(tot_pg_offs_dblks);
-            _rrfc.add_cmpl_cnt_dblks(tot_pg_offs_dblks);
+//            _rrfc.add_subm_cnt_dblks(tot_pg_offs_dblks);
+//            _rrfc.add_cmpl_cnt_dblks(tot_pg_offs_dblks);
 
             _fhdr_rd_outstanding = false;
-            _rrfc.set_valid();
+//            _rrfc.set_valid();
         }
     }
 
@@ -319,8 +313,9 @@ rmgr::recover_complete()
 void
 rmgr::invalidate()
 {
-    if (_rrfc.is_valid())
-        _rrfc.set_invalid();
+    // TODO: replace for linear store: _rrfc
+//    if (_rrfc.is_valid())
+//        _rrfc.set_invalid();
 }
 
 void
@@ -339,11 +334,13 @@ rmgr::flush(timespec* timeout)
     // Reset all read states and pointers
     for (int i=0; i<_cache_num_pages; i++)
         _page_cb_arr[i]._state = UNUSED;
-    _rrfc.unset_findex();
+    // TODO: replace for linear store: _rrfc
+//    _rrfc.unset_findex();
     _pg_index = 0;
     _pg_offset_dblks = 0;
 }
 
+/*
 bool
 rmgr::wait_for_validity(timespec* timeout, const bool throw_on_timeout)
 {
@@ -356,6 +353,7 @@ rmgr::wait_for_validity(timespec* timeou
     }
     return _rrfc.is_valid();
 }
+*/
 
 iores
 rmgr::pre_read_check(data_tok* dtokp)
@@ -363,17 +361,18 @@ rmgr::pre_read_check(data_tok* dtokp)
     if (_aio_evt_rem)
         get_events(AIO_COMPLETE, 0);
 
-    if (!_rrfc.is_valid())
-        return RHM_IORES_RCINVALID;
+    // TODO: replace for linear store: _rrfc
+//    if (!_rrfc.is_valid())
+//        return RHM_IORES_RCINVALID;
 
     // block reads until outstanding file header read completes as fro is needed to read
     if (_fhdr_rd_outstanding)
         return RHM_IORES_PAGE_AIOWAIT;
 
-    if(dblks_rem() == 0 && _rrfc.is_compl() && !_rrfc.is_wr_aio_outstanding())
+    if(dblks_rem() == 0 /*&& _rrfc.is_compl() && !_rrfc.is_wr_aio_outstanding()*/)// TODO: replace for linear store: _rrfc
     {
         aio_cycle();   // check if any AIOs have returned
-        if(dblks_rem() == 0 && _rrfc.is_compl() && !_rrfc.is_wr_aio_outstanding())
+        if(dblks_rem() == 0 /*&& _rrfc.is_compl() && !_rrfc.is_wr_aio_outstanding()*/)// TODO: replace for linear store: _rrfc
         {
             if (_jc->unflushed_dblks() > 0)
                 _jc->flush();
@@ -400,7 +399,7 @@ rmgr::pre_read_check(data_tok* dtokp)
 }
 
 iores
-rmgr::read_enq(rec_hdr& h, void* rptr, data_tok* dtokp)
+rmgr::read_enq(rec_hdr_t& h, void* rptr, data_tok* dtokp)
 {
     if (_page_cb_arr[_pg_index]._state != AIO_COMPLETE)
     {
@@ -409,7 +408,7 @@ rmgr::read_enq(rec_hdr& h, void* rptr, d
     }
 
     // Read data from this page, first block will have header and data size.
-    u_int32_t dblks_rd = _enq_rec.decode(h, rptr, dtokp->dblocks_read(), dblks_rem());
+    uint32_t dblks_rd = _enq_rec.decode(h, rptr, dtokp->dblocks_read(), dblks_rem());
     dtokp->incr_dblocks_read(dblks_rd);
 
     _pg_offset_dblks += dblks_rd;
@@ -442,31 +441,31 @@ rmgr::read_enq(rec_hdr& h, void* rptr, d
 }
 
 void
-rmgr::consume_xid_rec(rec_hdr& h, void* rptr, data_tok* dtokp)
+rmgr::consume_xid_rec(rec_hdr_t& h, void* rptr, data_tok* dtokp)
 {
-    if (h._magic == RHM_JDAT_ENQ_MAGIC)
+    if (h._magic == QLS_ENQ_MAGIC)
     {
-        enq_hdr ehdr;
-        std::memcpy(&ehdr, rptr, sizeof(enq_hdr));
-        if (ehdr.is_external())
-            dtokp->set_dsize(ehdr._xidsize + sizeof(enq_hdr) + sizeof(rec_tail));
+        enq_hdr_t ehdr;
+        std::memcpy(&ehdr, rptr, sizeof(enq_hdr_t));
+        if (::is_enq_external(&ehdr))
+            dtokp->set_dsize(ehdr._xidsize + sizeof(enq_hdr_t) + sizeof(rec_tail_t));
         else
-            dtokp->set_dsize(ehdr._xidsize + ehdr._dsize + sizeof(enq_hdr) + sizeof(rec_tail));
+            dtokp->set_dsize(ehdr._xidsize + ehdr._dsize + sizeof(enq_hdr_t) + sizeof(rec_tail_t));
     }
-    else if (h._magic == RHM_JDAT_DEQ_MAGIC)
+    else if (h._magic == QLS_DEQ_MAGIC)
     {
-        deq_hdr dhdr;
-        std::memcpy(&dhdr, rptr, sizeof(deq_hdr));
+        deq_hdr_t dhdr;
+        std::memcpy(&dhdr, rptr, sizeof(deq_hdr_t));
         if (dhdr._xidsize)
-            dtokp->set_dsize(dhdr._xidsize + sizeof(deq_hdr) + sizeof(rec_tail));
+            dtokp->set_dsize(dhdr._xidsize + sizeof(deq_hdr_t) + sizeof(rec_tail_t));
         else
-            dtokp->set_dsize(sizeof(deq_hdr));
+            dtokp->set_dsize(sizeof(deq_hdr_t));
     }
-    else if (h._magic == RHM_JDAT_TXA_MAGIC || h._magic == RHM_JDAT_TXC_MAGIC)
+    else if (h._magic == QLS_TXA_MAGIC || h._magic == QLS_TXC_MAGIC)
     {
-        txn_hdr thdr;
-        std::memcpy(&thdr, rptr, sizeof(txn_hdr));
-        dtokp->set_dsize(thdr._xidsize + sizeof(txn_hdr) + sizeof(rec_tail));
+        txn_hdr_t thdr;
+        std::memcpy(&thdr, rptr, sizeof(txn_hdr_t));
+        dtokp->set_dsize(thdr._xidsize + sizeof(txn_hdr_t) + sizeof(rec_tail_t));
     }
     else
     {
@@ -490,11 +489,11 @@ rmgr::consume_filler()
 iores
 rmgr::skip(data_tok* dtokp)
 {
-    u_int32_t dsize_dblks = jrec::size_dblks(dtokp->dsize());
-    u_int32_t tot_dblk_cnt = dtokp->dblocks_read();
+    uint32_t dsize_dblks = jrec::size_dblks(dtokp->dsize());
+    uint32_t tot_dblk_cnt = dtokp->dblocks_read();
     while (true)
     {
-        u_int32_t this_dblk_cnt = 0;
+        uint32_t this_dblk_cnt = 0;
         if (dsize_dblks - tot_dblk_cnt > dblks_rem())
             this_dblk_cnt = dblks_rem();
         else
@@ -537,6 +536,8 @@ rmgr::aio_cycle()
     // Perform validity checks
     if (_fhdr_rd_outstanding) // read of file header still outstanding in aio
         return RHM_IORES_SUCCESS;
+    // TODO: replace for linear store: _rrfc
+/*
     if (!_rrfc.is_valid())
     {
         // Flush and reset all read states and pointers
@@ -549,14 +550,15 @@ rmgr::aio_cycle()
         init_file_header_read(); // send off AIO read request for file header
         return RHM_IORES_SUCCESS;
     }
+*/
 
     int16_t first_uninit = -1;
-    u_int16_t num_uninit = 0;
-    u_int16_t num_compl = 0;
+    uint16_t num_uninit = 0;
+    uint16_t num_compl = 0;
     bool outstanding = false;
     // Index must start with current buffer and cycle around so that first
     // uninitialized buffer is initialized first
-    for (u_int16_t i=_pg_index; i<_pg_index+_cache_num_pages; i++)
+    for (uint16_t i=_pg_index; i<_pg_index+_cache_num_pages; i++)
     {
         int16_t ci = i % _cache_num_pages;
         switch (_page_cb_arr[ci]._state)
@@ -588,8 +590,10 @@ rmgr::aio_cycle()
 }
 
 iores
-rmgr::init_aio_reads(const int16_t first_uninit, const u_int16_t num_uninit)
+rmgr::init_aio_reads(const int16_t /*first_uninit*/, const uint16_t /*num_uninit*/)
 {
+    // TODO: replace for linear store: _rrfc
+/*
     for (int16_t i=0; i<num_uninit; i++)
     {
         if (_rrfc.is_void()) // Nothing to do; this file not yet written to
@@ -604,10 +608,10 @@ rmgr::init_aio_reads(const int16_t first
         // TODO: Future perf improvement: Do a single AIO read for all available file
         // space into all contiguous empty pages in one AIO operation.
 
-        u_int32_t file_rem_dblks = _rrfc.remaining_dblks();
+        uint32_t file_rem_dblks = _rrfc.remaining_dblks();
         file_rem_dblks -= file_rem_dblks % JRNL_SBLK_SIZE; // round down to closest sblk boundary
-        u_int32_t pg_size_dblks = JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
-        u_int32_t rd_size = file_rem_dblks > pg_size_dblks ? pg_size_dblks : file_rem_dblks;
+        uint32_t pg_size_dblks = JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
+        uint32_t rd_size = file_rem_dblks > pg_size_dblks ? pg_size_dblks : file_rem_dblks;
         if (rd_size)
         {
             int16_t pi = (i + first_uninit) % _cache_num_pages;
@@ -627,6 +631,7 @@ rmgr::init_aio_reads(const int16_t first
         if (_rrfc.file_rotate())
             _rrfc.rotate();
     }
+*/
     return RHM_IORES_SUCCESS;
 }
 
@@ -651,7 +656,7 @@ rmgr::rotate_page()
         _pg_cntr = 0;
 }
 
-u_int32_t
+uint32_t
 rmgr::dblks_rem() const
 {
     return _page_cb_arr[_pg_index]._rdblks - _pg_offset_dblks;
@@ -669,6 +674,8 @@ rmgr::set_params_null(void** const datap
 void
 rmgr::init_file_header_read()
 {
+    // TODO: replace for linear store: _rrfc
+/*
     _jc->fhdr_wr_sync(_rrfc.index()); // wait if the file header write is outstanding
     int rfh = _rrfc.fh();
     aio::prep_pread_2(_fhdr_aio_cb_ptr, rfh, _fhdr_buffer, _sblksize, 0);
@@ -677,11 +684,12 @@ rmgr::init_file_header_read()
     _aio_evt_rem++;
     _rrfc.add_subm_cnt_dblks(JRNL_SBLK_SIZE);
     _fhdr_rd_outstanding = true;
+*/
 }
 
 /* TODO (sometime in the future)
 const iores
-rmgr::get(const u_int64_t& rid, const std::size_t& dsize, const std::size_t& dsize_avail,
+rmgr::get(const uint64_t& rid, const std::size_t& dsize, const std::size_t& dsize_avail,
         const void** const data, bool auto_discard)
 {
     return RHM_IORES_SUCCESS;

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/rmgr.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/rmgr.h?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/rmgr.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/rmgr.h Wed Aug 21 14:38:12 2013
@@ -19,17 +19,6 @@
  *
  */
 
-/**
- * \file rmgr.h
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::rmgr (read manager). See
- * class documentation for details.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_RMGR_H
 #define QPID_LEGACYSTORE_JRNL_RMGR_H
 
@@ -42,11 +31,12 @@ class rmgr;
 }
 
 #include <cstring>
-#include "qpid/legacystore/jrnl/enums.h"
-#include "qpid/legacystore/jrnl/file_hdr.h"
-#include "qpid/legacystore/jrnl/pmgr.h"
-#include "qpid/legacystore/jrnl/rec_hdr.h"
-#include "qpid/legacystore/jrnl/rrfc.h"
+#include "qpid/linearstore/jrnl/enums.h"
+//#include "qpid/linearstore/jrnl/file_hdr.h"
+#include "qpid/linearstore/jrnl/pmgr.h"
+//#include "qpid/linearstore/jrnl/rec_hdr.h"
+//#include "qpid/linearstore/jrnl/rrfc.h"
+#include "qpid/linearstore/jrnl/utils/file_hdr.h"
 
 namespace mrg
 {
@@ -62,16 +52,16 @@ namespace journal
     class rmgr : public pmgr
     {
     private:
-        rrfc& _rrfc;                ///< Ref to read rotating file controller
-        rec_hdr _hdr;               ///< Header used to determind record type
+        //rrfc& _rrfc;              ///< Ref to read rotating file controller
+        rec_hdr_t _hdr;             ///< Header used to determind record type
 
         void* _fhdr_buffer;         ///< Buffer used for fhdr reads
         aio_cb* _fhdr_aio_cb_ptr;   ///< iocb pointer for fhdr reads
-        file_hdr _fhdr;             ///< file header instance for reading file headers
+        file_hdr_t _fhdr;           ///< file header instance for reading file headers
         bool _fhdr_rd_outstanding;  ///< true if a fhdr read is outstanding
 
     public:
-        rmgr(jcntl* jc, enq_map& emap, txn_map& tmap, rrfc& rrfc);
+        rmgr(jcntl* jc, enq_map& emap, txn_map& tmap/*, rrfc& rrfc*/);
         virtual ~rmgr();
 
         using pmgr::initialize;
@@ -81,12 +71,12 @@ namespace journal
                 bool ignore_pending_txns);
         int32_t get_events(page_state state, timespec* const timeout, bool flush = false);
         void recover_complete();
-        inline iores synchronize() { if (_rrfc.is_valid()) return RHM_IORES_SUCCESS; return aio_cycle(); }
+        inline iores synchronize() { /*if (_rrfc.is_valid()) return RHM_IORES_SUCCESS;*/ return aio_cycle(); }
         void invalidate();
-        bool wait_for_validity(timespec* const timeout, const bool throw_on_timeout = false);
+//        bool wait_for_validity(timespec* const timeout, const bool throw_on_timeout = false);
 
         /* TODO (if required)
-        const iores get(const u_int64_t& rid, const std::size_t& dsize, const std::size_t& dsize_avail,
+        const iores get(const uint64_t& rid, const std::size_t& dsize, const std::size_t& dsize_avail,
                 const void** const data, bool auto_discard);
         const iores discard(data_tok* dtok);
         */
@@ -95,14 +85,14 @@ namespace journal
         void clean();
         void flush(timespec* timeout);
         iores pre_read_check(data_tok* dtokp);
-        iores read_enq(rec_hdr& h, void* rptr, data_tok* dtokp);
-        void consume_xid_rec(rec_hdr& h, void* rptr, data_tok* dtokp);
+        iores read_enq(rec_hdr_t& h, void* rptr, data_tok* dtokp);
+        void consume_xid_rec(rec_hdr_t& h, void* rptr, data_tok* dtokp);
         void consume_filler();
         iores skip(data_tok* dtokp);
         iores aio_cycle();
-        iores init_aio_reads(const int16_t first_uninit, const u_int16_t num_uninit);
+        iores init_aio_reads(const int16_t first_uninit, const uint16_t num_uninit);
         void rotate_page();
-        u_int32_t dblks_rem() const;
+        uint32_t dblks_rem() const;
         void set_params_null(void** const datapp, std::size_t& dsize, void** const xidpp,
                 std::size_t& xidsize);
         void init_file_header_read();

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/slock.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/slock.h?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/slock.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/slock.h Wed Aug 21 14:38:12 2013
@@ -19,22 +19,11 @@
  *
  */
 
-/**
- * \file slock.h
- *
- * Qpid asynchronous store plugin library
- *
- * Messaging journal scoped lock class mrg::journal::slock and scoped try-lock
- * class mrg::journal::stlock.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_SLOCK_H
 #define QPID_LEGACYSTORE_JRNL_SLOCK_H
 
-#include "qpid/legacystore/jrnl/jexception.h"
-#include "qpid/legacystore/jrnl/smutex.h"
+#include "qpid/linearstore/jrnl/jexception.h"
+#include "qpid/linearstore/jrnl/smutex.h"
 #include <pthread.h>
 
 namespace mrg

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/smutex.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/smutex.h?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/smutex.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/smutex.h Wed Aug 21 14:38:12 2013
@@ -19,21 +19,10 @@
  *
  */
 
-/**
- * \file smutex.h
- *
- * Qpid asynchronous store plugin library
- *
- * Messaging journal scoped mutex class mrg::journal::smutex.
- *
- * \author Kim van der Riet
- */
-
-
 #ifndef QPID_LEGACYSTORE_JRNL_SMUTEX_H
 #define QPID_LEGACYSTORE_JRNL_SMUTEX_H
 
-#include "qpid/legacystore/jrnl/jexception.h"
+#include "qpid/linearstore/jrnl/jexception.h"
 #include <pthread.h>
 
 namespace mrg

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/time_ns.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/time_ns.cpp?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/time_ns.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/time_ns.cpp Wed Aug 21 14:38:12 2013
@@ -19,18 +19,7 @@
  *
  */
 
-/**
- * \file time_ns.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * Messaging journal time struct mrg::journal::time_ns, derived from
- * the timespec struct and provided with helper functions.
- *
- * \author Kim van der Riet
- */
-
-#include "qpid/legacystore/jrnl/time_ns.h"
+#include "qpid/linearstore/jrnl/time_ns.h"
 
 #include <sstream>
 

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/time_ns.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/time_ns.h?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/time_ns.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/time_ns.h Wed Aug 21 14:38:12 2013
@@ -19,17 +19,6 @@
  *
  */
 
-/**
- * \file time_ns.h
- *
- * Qpid asynchronous store plugin library
- *
- * Messaging journal time struct mrg::journal::time_ns, derived from
- * the timespec struct and provided with helper functions.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_TIME_NS_H
 #define QPID_LEGACYSTORE_JRNL_TIME_NS_H
 

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/txn_map.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/txn_map.cpp?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/txn_map.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/txn_map.cpp Wed Aug 21 14:38:12 2013
@@ -19,23 +19,12 @@
  *
  */
 
-/**
- * \file txn_map.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::txn_map (transaction map). See
- * comments in file txn_map.h for details.
- *
- * \author Kim van der Riet
- */
-
-#include "qpid/legacystore/jrnl/txn_map.h"
+#include "qpid/linearstore/jrnl/txn_map.h"
 
 #include <iomanip>
-#include "qpid/legacystore/jrnl/jerrno.h"
-#include "qpid/legacystore/jrnl/jexception.h"
-#include "qpid/legacystore/jrnl/slock.h"
+#include "qpid/linearstore/jrnl/jerrno.h"
+#include "qpid/linearstore/jrnl/jexception.h"
+#include "qpid/linearstore/jrnl/slock.h"
 #include <sstream>
 
 namespace mrg
@@ -50,7 +39,7 @@ int16_t txn_map::TMAP_OK = 0;
 int16_t txn_map::TMAP_NOT_SYNCED = 0;
 int16_t txn_map::TMAP_SYNCED = 1;
 
-txn_data_struct::txn_data_struct(const u_int64_t rid, const u_int64_t drid, const u_int16_t pfid,
+txn_data_struct::txn_data_struct(const uint64_t rid, const uint64_t drid, const uint16_t pfid,
 		const bool enq_flag, const bool commit_flag):
         _rid(rid),
         _drid(drid),
@@ -68,13 +57,13 @@ txn_map::txn_map():
 txn_map::~txn_map() {}
 
 void
-txn_map::set_num_jfiles(const u_int16_t num_jfiles)
+txn_map::set_num_jfiles(const uint16_t num_jfiles)
 {
     _pfid_txn_cnt.resize(num_jfiles, 0);
 }
 
-u_int32_t
-txn_map::get_txn_pfid_cnt(const u_int16_t pfid) const
+uint32_t
+txn_map::get_txn_pfid_cnt(const uint16_t pfid) const
 {
     return _pfid_txn_cnt.at(pfid);
 }
@@ -137,23 +126,23 @@ txn_map::in_map(const std::string& xid)
     return itr != _map.end();
 }
 
-u_int32_t
+uint32_t
 txn_map::enq_cnt()
 {
     return cnt(true);
 }
 
-u_int32_t
+uint32_t
 txn_map::deq_cnt()
 {
     return cnt(true);
 }
 
-u_int32_t
+uint32_t
 txn_map::cnt(const bool enq_flag)
 {
     slock s(_mutex);
-    u_int32_t c = 0;
+    uint32_t c = 0;
     for (xmap_itr i = _map.begin(); i != _map.end(); i++)
     {
         for (tdl_itr j = i->second.begin(); j < i->second.end(); j++)
@@ -185,7 +174,7 @@ txn_map::is_txn_synced(const std::string
 }
 
 int16_t
-txn_map::set_aio_compl(const std::string& xid, const u_int64_t rid)
+txn_map::set_aio_compl(const std::string& xid, const uint64_t rid)
 {
     slock s(_mutex);
     xmap_itr itr = _map.find(xid);
@@ -204,7 +193,7 @@ txn_map::set_aio_compl(const std::string
 }
 
 bool
-txn_map::data_exists(const std::string& xid, const u_int64_t rid)
+txn_map::data_exists(const std::string& xid, const uint64_t rid)
 {
     bool found = false;
     {
@@ -221,7 +210,7 @@ txn_map::data_exists(const std::string& 
 }
 
 bool
-txn_map::is_enq(const u_int64_t rid)
+txn_map::is_enq(const uint64_t rid)
 {
     bool found = false;
     {

Modified: qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/txn_map.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/txn_map.h?rev=1516176&r1=1516175&r2=1516176&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/txn_map.h (original)
+++ qpid/branches/linearstore/qpid/cpp/src/qpid/linearstore/jrnl/txn_map.h Wed Aug 21 14:38:12 2013
@@ -19,17 +19,6 @@
  *
  */
 
-/**
- * \file txn_map.h
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::txn_map (transaction map).
- * See class documentation for details.
- *
- * \author Kim van der Riet
- */
-
 #ifndef QPID_LEGACYSTORE_JRNL_TXN_MAP_H
 #define QPID_LEGACYSTORE_JRNL_TXN_MAP_H
 
@@ -41,11 +30,10 @@ namespace journal
 }
 }
 
-#include "qpid/legacystore/jrnl/smutex.h"
+#include "qpid/linearstore/jrnl/smutex.h"
 #include <map>
 #include <pthread.h>
 #include <string>
-#include <sys/types.h>
 #include <vector>
 
 namespace mrg
@@ -60,13 +48,13 @@ namespace journal
     */
     struct txn_data_struct
     {
-        u_int64_t _rid;     ///< Record id for this operation
-        u_int64_t _drid;    ///< Dequeue record id for this operation
-        u_int16_t _pfid;    ///< Physical file id, to be used when transferring to emap on commit
+        uint64_t _rid;      ///< Record id for this operation
+        uint64_t _drid;     ///< Dequeue record id for this operation
+        uint16_t _pfid;     ///< Physical file id, to be used when transferring to emap on commit
         bool _enq_flag;     ///< If true, enq op, otherwise deq op
         bool _commit_flag;  ///< (2PC transactions) Records 2PC complete c/a mode
         bool _aio_compl;    ///< Initially false, set to true when record AIO returns
-        txn_data_struct(const u_int64_t rid, const u_int64_t drid, const u_int16_t pfid,
+        txn_data_struct(const uint64_t rid, const uint64_t drid, const uint16_t pfid,
                 const bool enq_flag, const bool commit_flag = false);
     };
     typedef txn_data_struct txn_data;
@@ -125,31 +113,31 @@ namespace journal
 
         xmap _map;
         smutex _mutex;
-        std::vector<u_int32_t> _pfid_txn_cnt;
+        std::vector<uint32_t> _pfid_txn_cnt;
         const txn_data_list _empty_data_list;
 
     public:
         txn_map();
         virtual ~txn_map();
 
-        void set_num_jfiles(const u_int16_t num_jfiles);
-        u_int32_t get_txn_pfid_cnt(const u_int16_t pfid) const;
+        void set_num_jfiles(const uint16_t num_jfiles);
+        uint32_t get_txn_pfid_cnt(const uint16_t pfid) const;
         bool insert_txn_data(const std::string& xid, const txn_data& td);
         const txn_data_list get_tdata_list(const std::string& xid);
         const txn_data_list get_remove_tdata_list(const std::string& xid);
         bool in_map(const std::string& xid);
-        u_int32_t enq_cnt();
-        u_int32_t deq_cnt();
+        uint32_t enq_cnt();
+        uint32_t deq_cnt();
         int16_t is_txn_synced(const std::string& xid); // -1=xid not found; 0=not synced; 1=synced
-        int16_t set_aio_compl(const std::string& xid, const u_int64_t rid); // -2=rid not found; -1=xid not found; 0=done
-        bool data_exists(const std::string& xid, const u_int64_t rid);
-        bool is_enq(const u_int64_t rid);
+        int16_t set_aio_compl(const std::string& xid, const uint64_t rid); // -2=rid not found; -1=xid not found; 0=done
+        bool data_exists(const std::string& xid, const uint64_t rid);
+        bool is_enq(const uint64_t rid);
         inline void clear() { _map.clear(); }
         inline bool empty() const { return _map.empty(); }
         inline size_t size() const { return _map.size(); }
         void xid_list(std::vector<std::string>& xv);
     private:
-        u_int32_t cnt(const bool enq_flag);
+        uint32_t cnt(const bool enq_flag);
         const txn_data_list get_tdata_list_nolock(const std::string& xid);
     };
 



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


Mime
View raw message