diff Plugins/Engine/OrthancPluginDatabase.cpp @ 3020:d207f6ac1f86 db-changes

tracking disk size by the database engine to ensure consistency across transactions
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 15 Dec 2018 10:57:18 +0100
parents 8336204d95dc
children 039a9d262d64
line wrap: on
line diff
--- a/Plugins/Engine/OrthancPluginDatabase.cpp	Fri Dec 14 18:07:40 2018 +0100
+++ b/Plugins/Engine/OrthancPluginDatabase.cpp	Sat Dec 15 10:57:18 2018 +0100
@@ -265,7 +265,7 @@
       else
       {
         // This is the case of database plugins using Orthanc SDK <= 1.5.2
-        LOG(WARNING) << "Consider upgrading your database index plugin for best performance";
+        LOG(WARNING) << "Your database index plugin is not compatible with multiple Orthanc writers";
         currentDiskSize_ = GetTotalCompressedSize();
       }
 
@@ -1146,4 +1146,18 @@
                                boost::lexical_cast<std::string>(answer.type));
     }
   }
+
+    
+  bool OrthancPluginDatabase::IsDiskSizeAbove(uint64_t threshold)
+  {
+    if (fastGetTotalSize_)
+    {
+      return GetTotalCompressedSize() > threshold;
+    }
+    else
+    {
+      assert(GetTotalCompressedSize() == currentDiskSize_);
+      return currentDiskSize_ > threshold;
+    }      
+  }
 }