[rhmessaging-commits] rhmessaging commits: r2231 - store/trunk/cpp/lib/jrnl.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Jul 28 11:27:55 EDT 2008


Author: kpvdr
Date: 2008-07-28 11:27:55 -0400 (Mon, 28 Jul 2008)
New Revision: 2231

Modified:
   store/trunk/cpp/lib/jrnl/nlfh.cpp
   store/trunk/cpp/lib/jrnl/rmgr.cpp
   store/trunk/cpp/lib/jrnl/rrfc.cpp
   store/trunk/cpp/lib/jrnl/wmgr.cpp
Log:
Removed some unneeded #defines left over from old tests

Modified: store/trunk/cpp/lib/jrnl/nlfh.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/nlfh.cpp	2008-07-25 20:43:46 UTC (rev 2230)
+++ store/trunk/cpp/lib/jrnl/nlfh.cpp	2008-07-28 15:27:55 UTC (rev 2231)
@@ -54,13 +54,8 @@
         _rec_enqcnt(0),
         _rd_subm_cnt_dblks(0),
         _rd_cmpl_cnt_dblks(0),
-#ifdef RHM_RDONLY
-        _wr_subm_cnt_dblks(JRNL_SBLK_SIZE * (jfsize_dblks + 1)),
-        _wr_cmpl_cnt_dblks(JRNL_SBLK_SIZE * (jfsize_dblks + 1)),
-#else
         _wr_subm_cnt_dblks(0),
         _wr_cmpl_cnt_dblks(0),
-#endif
         _aio_cnt(0)
 {}
 
@@ -74,13 +69,8 @@
         _rec_enqcnt(0),
         _rd_subm_cnt_dblks(0),
         _rd_cmpl_cnt_dblks(0),
-#ifdef RHM_RDONLY
-        _wr_subm_cnt_dblks(JRNL_SBLK_SIZE * (jfsize_dblks + 1)),
-        _wr_cmpl_cnt_dblks(JRNL_SBLK_SIZE * (jfsize_dblks + 1)),
-#else
         _wr_subm_cnt_dblks(0),
         _wr_cmpl_cnt_dblks(0),
-#endif
         _aio_cnt(0)
 {
     initialize(fbasename, fid, jfsize_sblks, ro);
@@ -167,16 +157,12 @@
             return true;
         }
     }
-#ifndef RHM_WRONLY
     // Journal overflow test - checks if the file to be reset still contains enqueued records
     // or outstanding aios
     if (_rec_enqcnt || _aio_cnt)
         return false;
-#endif
-#ifndef RHM_RDONLY
     _wr_subm_cnt_dblks = 0;
     _wr_cmpl_cnt_dblks = 0;
-#endif
     return true;
 }
 

Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp	2008-07-25 20:43:46 UTC (rev 2230)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp	2008-07-28 15:27:55 UTC (rev 2231)
@@ -152,9 +152,6 @@
             {
                 _enq_rec.reset(); // sets enqueue rec size
                 // Check if RID of this rec is still enqueued, if so read it, else skip
-#ifdef RHM_RDONLY
-                bool is_enq = true;
-#else
                 u_int16_t fid = 0;
                 bool is_enq = false;
                 try
@@ -187,7 +184,7 @@
                     if (!_jc->is_read_only() && is_enq)
                         return RHM_IORES_TXPENDING;
                 }
-#endif
+
                 if (is_enq) // ok, this record is enqueued, check it, then read it...
                 {
                     if (dtokp->rid())
@@ -205,7 +202,7 @@
                     }
                     else
                         dtokp->set_rid(_hdr._rid);
-#ifndef RHM_RDONLY
+
 // TODO: Add member _fid to pmgr::page_cb which indicates the fid from which this page was
 // populated. When this value is set in wmgr::flush() somewehere, then uncomment the following
 // check:
@@ -219,7 +216,7 @@
 //                         throw jexception(jerrno::JERR_RMGR_FIDMISMATCH, oss.str(), "rmgr",
 //                              "read");
 //                     }
-#endif
+
                     const iores res = read_enq(_hdr, rptr, dtokp);
                     dsize = _enq_rec.get_data(datapp);
                     xidsize = _enq_rec.get_xid(xidpp);

Modified: store/trunk/cpp/lib/jrnl/rrfc.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rrfc.cpp	2008-07-25 20:43:46 UTC (rev 2230)
+++ store/trunk/cpp/lib/jrnl/rrfc.cpp	2008-07-28 15:27:55 UTC (rev 2231)
@@ -74,20 +74,9 @@
     if (next_fh_index == _nfiles)
         next_fh_index = 0;
     nlfh* next_fh = _fh_arr[next_fh_index];
-#ifdef RHM_RDONLY
-    // Since write constrains read, it is wrfc::rotate() that normally resets both the
-    // read and write states. However, in the RHM_RDONLY test mode (no writes), it must
-    // be done here.
-    bool ret = next_fh->reset();
-#endif
-
     _fh_index = next_fh_index;
     _curr_fh = next_fh;
-#ifdef RHM_RDONLY
-    return ret;
-#else
     return true;
-#endif
 }
 
 nlfh*

Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp	2008-07-25 20:43:46 UTC (rev 2230)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp	2008-07-28 15:27:55 UTC (rev 2231)
@@ -190,7 +190,6 @@
             // enqueued.
             _wrfc.incr_enqcnt(dtokp->fid());
 
-#if !(defined(RHM_WRONLY) || defined(RHM_RDONLY))
             if (xid_len) // If part of transaction, add to transaction map
             {
                 std::string xid((char*)xid_ptr, xid_len);
@@ -198,7 +197,6 @@
             }
             else
                 _emap.insert_fid(rid, dtokp->fid());
-#endif
 
             done = true;
         }
@@ -324,7 +322,6 @@
             // TODO: Incorrect - must set state to ENQ_CACHED; ENQ_SUBM is set when AIO returns.
             dtokp->set_wstate(data_tok::DEQ_SUBM);
 
-#if !(defined(RHM_WRONLY) || defined(RHM_RDONLY))
             if (xid_len) // If part of transaction, add to transaction map
             {
                 // If the enqueue is part of a pending txn, it will not yet be in emap
@@ -341,7 +338,6 @@
                 u_int16_t fid = _emap.get_remove_fid(dtokp->dequeue_rid());
                 _wrfc.decr_enqcnt(fid);
             }
-#endif
 
             done = true;
         }
@@ -457,7 +453,6 @@
         {
             dtokp->set_wstate(data_tok::ABORT_SUBM);
 
-#if !(defined(RHM_WRONLY) || defined(RHM_RDONLY))
             // Delete this txn from tmap, unlock any locked records in emap
             std::string xid((char*)xid_ptr, xid_len);
             txn_data_list tdl = _tmap.get_remove_tdata_list(xid);
@@ -482,7 +477,6 @@
                 oss << std::hex << "_txn_pending_set: xid=\"" << xid << "\"";
                 throw jexception(jerrno::JERR_MAP_DUPLICATE, oss.str(), "wmgr", "abort");
             }
-#endif
 
             done = true;
         }
@@ -598,7 +592,6 @@
         {
             dtokp->set_wstate(data_tok::COMMIT_SUBM);
 
-#if !(defined(RHM_WRONLY) || defined(RHM_RDONLY))
             // Delete this txn from tmap, process records into emap
             std::string xid((char*)xid_ptr, xid_len);
             txn_data_list tdl = _tmap.get_remove_tdata_list(xid);
@@ -619,7 +612,6 @@
                 oss << std::hex << "_txn_pending_set: xid=\"" << xid << "\"";
                 throw jexception(jerrno::JERR_MAP_DUPLICATE, oss.str(), "wmgr", "commit");
             }
-#endif
 
             done = true;
         }
@@ -820,7 +812,6 @@
                         dtokl.push_back(dtokp);
                         tot_data_toks++;
                         dtokp->set_wstate(data_tok::ABORTED);
-#if !(defined(RHM_WRONLY) || defined(RHM_RDONLY))
                         it = _txn_pending_set.find(dtokp->xid());
                         if (it == _txn_pending_set.end())
                         {
@@ -831,13 +822,11 @@
                                     "get_events");
                         }
                         _txn_pending_set.erase(it);
-#endif
                         break;
                     case data_tok::COMMIT_SUBM:
                         dtokl.push_back(dtokp);
                         tot_data_toks++;
                         dtokp->set_wstate(data_tok::COMMITTED);
-#if !(defined(RHM_WRONLY) || defined(RHM_RDONLY))
                         it = _txn_pending_set.find(dtokp->xid());
                         if (it == _txn_pending_set.end())
                         {
@@ -848,7 +837,6 @@
                                     "get_events");
                         }
                         _txn_pending_set.erase(it);
-#endif
                         break;
                     case data_tok::ENQ_PART:
                     case data_tok::DEQ_PART:
@@ -943,11 +931,7 @@
 
 iores
 wmgr::pre_write_check(const _op_type op, const data_tok* const dtokp,
-#if defined(RHM_WRONLY)
-        const std::size_t /*xidsize*/, const std::size_t /*dsize*/, const bool /*external*/
-#else
         const std::size_t xidsize, const std::size_t dsize, const bool external
-#endif
         ) const
 {
     // Check status of current file
@@ -978,13 +962,11 @@
     {
         case WMGR_ENQUEUE:
             {
-#if !defined(RHM_WRONLY)
                 // Check for enqueue reaching cutoff threshold
                 u_int32_t size_dblks = jrec::size_dblks(enq_rec::rec_size(xidsize, dsize,
                         external));
                 if (!_enq_busy && _wrfc.enq_threshold(_cached_offset_dblks + size_dblks))
                     return RHM_IORES_ENQCAPTHRESH;
-#endif
                 if (!dtokp->is_writable())
                 {
                     std::ostringstream oss;




More information about the rhmessaging-commits mailing list