qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kp...@apache.org
Subject svn commit: r1545563 - in /qpid/trunk/qpid/cpp/src: linearstore.cmake qpid/linearstore/journal/LinearFileController.cpp qpid/linearstore/journal/LinearFileController.h
Date Tue, 26 Nov 2013 08:13:30 GMT
Author: kpvdr
Date: Tue Nov 26 08:13:30 2013
New Revision: 1545563

URL: http://svn.apache.org/r1545563
Log:
QPID-5357 "Linearstore: Empty file recycling not functional": Fix which implements the empty
file check for trailing empty files.

Modified:
    qpid/trunk/qpid/cpp/src/linearstore.cmake
    qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/LinearFileController.cpp
    qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/LinearFileController.h

Modified: qpid/trunk/qpid/cpp/src/linearstore.cmake
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/linearstore.cmake?rev=1545563&r1=1545562&r2=1545563&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/linearstore.cmake (original)
+++ qpid/trunk/qpid/cpp/src/linearstore.cmake Tue Nov 26 08:13:30 2013
@@ -147,10 +147,10 @@ if (BUILD_LINEARSTORE)
     )
 
     if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/db-inc.h)
-      message(STATUS "Including BDB from ${DB_INCLUDE_DIR}/db_cxx.h")
+      message(STATUS "Including BDB from ${DB_CXX_INCLUDE_DIR}/db_cxx.h")
         file(WRITE 
              ${CMAKE_CURRENT_BINARY_DIR}/db-inc.h
-             "#include <${DB_INCLUDE_DIR}/db_cxx.h>\n")
+             "#include <${DB_CXX_INCLUDE_DIR}/db_cxx.h>\n")
     endif()
 
     add_library (linearstoreutils SHARED

Modified: qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/LinearFileController.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/LinearFileController.cpp?rev=1545563&r1=1545562&r2=1545563&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/LinearFileController.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/LinearFileController.cpp Tue Nov 26 08:13:30
2013
@@ -36,7 +36,8 @@ LinearFileController::LinearFileControll
             emptyFilePoolPtr_(0),
             currentJournalFilePtr_(0),
             fileSeqCounter_("LinearFileController::fileSeqCounter", 0),
-            recordIdCounter_("LinearFileController::recordIdCounter", 0)
+            recordIdCounter_("LinearFileController::recordIdCounter", 0),
+            decrCounter_("LinearFileController::decrCounter", 0)
 {}
 
 LinearFileController::~LinearFileController() {}
@@ -106,7 +107,15 @@ uint32_t LinearFileController::incrEnque
 uint32_t LinearFileController::decrEnqueuedRecordCount(const efpFileCount_t fileSeqNumber)
{
     slock l(journalFileListMutex_);
     uint32_t r = find(fileSeqNumber)->decrEnqueuedRecordCount();
-//    purgeEmptyFilesToEfpNoLock();
+
+    // TODO: Re-evaluate after testing and profiling
+    // This is the first go at implementing auto-purge, which checks for all trailing empty
files and recycles
+    // them back to the EFP. This version checks every 100 decrements using decrCounter_
(an action which releases
+    // records). We need to check this rather simple scheme works for outlying scenarios
(large and tiny data
+    // records) without impacting performance or performing badly (leaving excessive empty
files in the journals).
+    if (decrCounter_.increment() % 100ULL == 0ULL) {
+        purgeEmptyFilesToEfpNoLock();
+    }
     return r;
 }
 

Modified: qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/LinearFileController.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/LinearFileController.h?rev=1545563&r1=1545562&r2=1545563&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/LinearFileController.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/LinearFileController.h Tue Nov 26 08:13:30
2013
@@ -47,6 +47,7 @@ protected:
     JournalFile* currentJournalFilePtr_;
     AtomicCounter<uint64_t> fileSeqCounter_;
     AtomicCounter<uint64_t> recordIdCounter_;
+    AtomicCounter<uint64_t> decrCounter_;
 
     JournalFileList_t journalFileList_;
     smutex journalFileListMutex_;



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


Mime
View raw message