You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ss...@apache.org on 2013/07/11 16:03:42 UTC

git commit: changed the logging of the garbage collector

Updated Branches:
  refs/heads/develop 621626539 -> 08c0567e6


changed the logging of the garbage collector


Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/08c0567e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/08c0567e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/08c0567e

Branch: refs/heads/develop
Commit: 08c0567e6a438f36dd2d3770b9ddcdb8507cbd7a
Parents: 6216265
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Thu Jul 11 16:03:35 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Thu Jul 11 16:03:35 2013 +0200

----------------------------------------------------------------------
 .../apache/marmotta/kiwi/persistence/KiWiGarbageCollector.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/08c0567e/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiGarbageCollector.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiGarbageCollector.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiGarbageCollector.java
index 9ff6edb..ece139f 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiGarbageCollector.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiGarbageCollector.java
@@ -102,6 +102,8 @@ public class KiWiGarbageCollector extends Thread {
     protected int garbageCollect() throws SQLException {
         round++;
 
+        long start = System.currentTimeMillis();
+
         Connection con = persistence.getJDBCConnection(true);
         try {
             int count = 0;
@@ -120,7 +122,6 @@ public class KiWiGarbageCollector extends Thread {
             }
 
             // garbage collect nodes (only every 10th garbage collection, only makes sense when we previously deleted triples ...)
-            // TODO: this is currently not working, because the nodes remain in the cache; we need to find a different solution ...
             if(count > 0 && round % 10 == 1) {
                 // flush all nodes from the value factory first
                 if(persistence.getValueFactory() != null) {
@@ -146,6 +147,7 @@ public class KiWiGarbageCollector extends Thread {
                     log.warn("SQL error while executing garbage collection on nodes table: {}", ex.getMessage());
                 }
             }
+            log.info("... cleaned up {} entries (duration: {} ms)", count, (System.currentTimeMillis()-start));
 
             return count;
         } finally {
@@ -170,11 +172,9 @@ public class KiWiGarbageCollector extends Thread {
             while(!shutdown) {
                 // don't run immediately on startup
                 if(started) {
-                    long start = System.currentTimeMillis();
                     log.info("running garbage collection ...");
                     try {
                         int count = garbageCollect();
-                        log.info("... cleaned up {} entries (duration: {} ms)", count, (System.currentTimeMillis()-start));
                     } catch (SQLException e) {
                         log.error("error while executing garbage collection: {}",e.getMessage());
                     }