qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmora...@apache.org
Subject svn commit: r1558790 - in /qpid/trunk/qpid/cpp/src/qpid: broker/PagedQueue.cpp broker/PagedQueue.h sys/MemoryMappedFile.h sys/posix/MemoryMappedFile.cpp sys/windows/MemoryMappedFile.cpp
Date Thu, 16 Jan 2014 13:45:07 GMT
Author: pmoravec
Date: Thu Jan 16 13:45:07 2014
New Revision: 1558790

URL: http://svn.apache.org/r1558790
Log:
QPID-5485  Deleting paged queue does not remove underlying file

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/PagedQueue.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/PagedQueue.h
    qpid/trunk/qpid/cpp/src/qpid/sys/MemoryMappedFile.h
    qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/windows/MemoryMappedFile.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/PagedQueue.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/PagedQueue.cpp?rev=1558790&r1=1558789&r2=1558790&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/PagedQueue.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/PagedQueue.cpp Thu Jan 16 13:45:07 2014
@@ -75,6 +75,11 @@ PagedQueue::PagedQueue(const std::string
     QPID_LOG(debug, "PagedQueue[" << path << "]");
 }
 
+PagedQueue::~PagedQueue()
+{
+    file.close(path);
+}
+
 size_t PagedQueue::size()
 {
     size_t total(0);

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/PagedQueue.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/PagedQueue.h?rev=1558790&r1=1558789&r2=1558790&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/PagedQueue.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/PagedQueue.h Thu Jan 16 13:45:07 2014
@@ -38,6 +38,7 @@ class ProtocolRegistry;
 class PagedQueue : public Messages {
   public:
     PagedQueue(const std::string& name, const std::string& directory, uint maxLoaded,
uint pageFactor, ProtocolRegistry& protocols);
+    ~PagedQueue();
     size_t size();
     bool deleted(const QueueCursor&);
     void publish(const Message& added);

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/MemoryMappedFile.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/MemoryMappedFile.h?rev=1558790&r1=1558789&r2=1558790&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/MemoryMappedFile.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/MemoryMappedFile.h Thu Jan 16 13:45:07 2014
@@ -40,6 +40,10 @@ class MemoryMappedFile {
      */
     QPID_COMMON_EXTERN std::string open(const std::string& name, const std::string&
directory);
     /**
+     * Closes and removes the file that can be mapped by region into memory
+     */
+    QPID_COMMON_EXTERN void close(const std::string& path);
+    /**
      * Returns the page size
      */
     QPID_COMMON_EXTERN size_t getPageSize();

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp?rev=1558790&r1=1558789&r2=1558790&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp Thu Jan 16 13:45:07 2014
@@ -71,6 +71,11 @@ std::string MemoryMappedFile::open(const
     state->fd = fd;
     return path;
 }
+void MemoryMappedFile::close(const std::string& path)
+{
+    ::close(state->fd);
+    ::unlink(path.c_str());
+}
 size_t MemoryMappedFile::getPageSize()
 {
     return ::sysconf(_SC_PAGE_SIZE);

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/windows/MemoryMappedFile.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/windows/MemoryMappedFile.cpp?rev=1558790&r1=1558789&r2=1558790&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/windows/MemoryMappedFile.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/windows/MemoryMappedFile.cpp Thu Jan 16 13:45:07 2014
@@ -31,6 +31,9 @@ std::string MemoryMappedFile::open(const
 {
     return std::string();
 }
+void MemoryMappedFile::close(const std::string& /*path*/)
+{
+}
 size_t MemoryMappedFile::getPageSize()
 {
     return 0;



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


Mime
View raw message