qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject [qpid-cpp] 09/10: QPID-8326: Remove unused code/data in Linearstore
Date Wed, 19 Jun 2019 13:52:17 GMT
This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-cpp.git

commit e0a836bde06ab8315ceee72fd35d69213c25b204
Author: Andrew Stitcher <astitcher@apache.org>
AuthorDate: Fri Jun 14 02:28:42 2019 -0400

    QPID-8326: Remove unused code/data in Linearstore
---
 src/qpid/linearstore/journal/pmgr.cpp | 20 --------------------
 src/qpid/linearstore/journal/pmgr.h   |  8 ++------
 src/qpid/linearstore/journal/wmgr.cpp |  7 +++----
 3 files changed, 5 insertions(+), 30 deletions(-)

diff --git a/src/qpid/linearstore/journal/pmgr.cpp b/src/qpid/linearstore/journal/pmgr.cpp
index 269c8c5..c507b54 100644
--- a/src/qpid/linearstore/journal/pmgr.cpp
+++ b/src/qpid/linearstore/journal/pmgr.cpp
@@ -25,7 +25,6 @@ namespace qpid {
 namespace linearstore {
 namespace journal {
 
-// TODO: almost identical to pmgr::page_state_str() below - resolve
 const char*
 pmgr::page_cb::state_str() const
 {
@@ -112,11 +111,8 @@ pmgr::initialize(aio_callback* const cbp, const uint32_t cache_pgsize_sblks,
con
     for (uint16_t i=0; i<_cache_num_pages; i++)
     {
         _page_ptr_arr[i] = (void*)((char*)_page_base_ptr + _cache_pgsize_sblks * _sblkSizeBytes
* i);
-        _page_cb_arr[i]._index = i;
         _page_cb_arr[i]._state = UNUSED;
-        _page_cb_arr[i]._pbuff = _page_ptr_arr[i];
         _page_cb_arr[i]._pdtokl = new std::deque<data_tok*>;
-        _page_cb_arr[i]._pdtokl->clear();
         _aio_cb_arr[i].data = (void*)&_page_cb_arr[i];
     }
 
@@ -163,20 +159,4 @@ pmgr::clean()
     _aio_event_arr = 0;
 }
 
-// TODO: almost identical to pmgr::page_cb::state_str() above - resolve
-const char*
-pmgr::page_state_str(page_state ps)
-{
-    switch (ps)
-    {
-        case UNUSED:
-            return "UNUSED";
-        case IN_USE:
-            return "IN_USE";
-        case AIO_PENDING:
-            return "AIO_PENDING";
-    }
-    return "<page_state unknown>";
-}
-
 }}}
diff --git a/src/qpid/linearstore/journal/pmgr.h b/src/qpid/linearstore/journal/pmgr.h
index 05127ae..e482f46 100644
--- a/src/qpid/linearstore/journal/pmgr.h
+++ b/src/qpid/linearstore/journal/pmgr.h
@@ -62,13 +62,10 @@ public:
     */
     struct page_cb
     {
-        uint16_t _index;            ///< Index of this page
-        page_state _state;          ///< Status of page
-        uint64_t _frid;             ///< First rid in page (used for fhdr init)
-        uint32_t _wdblks;           ///< Total number of dblks in page so far
         std::deque<data_tok*>* _pdtokl; ///< Page message tokens list
         JournalFile* _jfp;          ///< Journal file for incrementing compl counts
-        void* _pbuff;               ///< Page buffer
+        uint32_t _wdblks;           ///< Total number of dblks in page so far
+        page_state _state;          ///< Status of page
 
         const char* state_str() const; ///< Return state as string for this pcb
     };
@@ -102,7 +99,6 @@ public:
 
     virtual int32_t get_events(timespec* const timeout, bool flush) = 0;
     inline uint32_t get_aio_evt_rem() const { return _aio_evt_rem; }
-    static const char* page_state_str(page_state ps);
     inline uint32_t cache_pgsize_sblks() const { return _cache_pgsize_sblks; }
     inline uint16_t cache_num_pages() const { return _cache_num_pages; }
 
diff --git a/src/qpid/linearstore/journal/wmgr.cpp b/src/qpid/linearstore/journal/wmgr.cpp
index 1ff18da..961e650 100644
--- a/src/qpid/linearstore/journal/wmgr.cpp
+++ b/src/qpid/linearstore/journal/wmgr.cpp
@@ -773,12 +773,11 @@ wmgr::get_events(timespec* const timeout,
             oss << "  iocb->u.c.resfd=" << aiocbp->u.c.resfd << std::endl;
             if (pcbp) {
                 oss << "  Page Control Block: (iocb->data):" << std::endl;
-                oss << "    pcb.index=" << pcbp->_index << std::endl;
-                oss << "    pcb.state=" << pcbp->_state << " (" <<
pmgr::page_state_str(pcbp->_state) << ")" << std::endl;
-                oss << "    pcb.frid=0x" << std::hex << pcbp->_frid
<< std::dec << std::endl;
+                oss << "    pcb index=" << pcbp-_page_cb_arr << std::endl;
+                oss << "    pcb.state=" << pcbp->_state << " (" <<
pcbp->state_str() << ")" << std::endl;
                 oss << "    pcb.wdblks=0x" << std::hex << pcbp->_wdblks
<< std::dec << std::endl;
                 oss << "    pcb.pdtokl.size=" << pcbp->_pdtokl->size()
<< std::endl;
-                oss << "    pcb.pbuff=" << pcbp->_pbuff << std::endl;
+                oss << "    pcb pbuff=" << &_page_ptr_arr[pcbp-_page_cb_arr]
<< std::endl;
                 oss << "    JournalFile (pcb.jfp):" << std::endl;
                 oss << pcbp->_jfp->status_str(6) << std::endl;
             } else {


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


Mime
View raw message