]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsMemorySearcher.java
Add logging to indexing & replace File-API with NIO Path-API
[simantics/platform.git] / bundles / org.simantics.db.indexing / src / org / simantics / db / indexing / IndexedRelationsMemorySearcher.java
index ac0918ea52e9eb9e33bc4c0c6a27a3becbfd7d79..8fc0ce911b32fe5f012463a8f7796fc80d0dee45 100644 (file)
@@ -36,6 +36,8 @@ import org.simantics.db.Session;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.adapter.GenericRelation;
 import org.simantics.utils.datastructures.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @author Tuukka Lehtonen
@@ -43,6 +45,8 @@ import org.simantics.utils.datastructures.Pair;
  */
 public class IndexedRelationsMemorySearcher extends IndexedRelationsSearcherBase {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(IndexedRelationsMemorySearcher.class);
+    
     final IndexedRelationsSearcher backend;
     final GenericRelation r;
     
@@ -173,19 +177,16 @@ public class IndexedRelationsMemorySearcher extends IndexedRelationsSearcherBase
     @Override
     Directory getDirectory(Session session) throws IOException {
        MemoryIndexing mem = MemoryIndexing.getInstance(session);
-        String path = indexPath.getAbsolutePath();
+        String path = indexPath.toAbsolutePath().toString();
         return mem.getDirectory(path, Queries.getAnalyzer());
     }
     
     @Override
     Throwable bestEffortClear(IProgressMonitor monitor, Session session) {
-
-       setProblem(null);
-       
        MemoryIndexing mem = MemoryIndexing.getInstance(session);
         changed.clear();
         
-        String path = indexPath.getAbsolutePath();
+        String path = indexPath.toAbsolutePath().toString();
         mem.remove(path);
         
         return null;
@@ -196,5 +197,10 @@ public class IndexedRelationsMemorySearcher extends IndexedRelationsSearcherBase
     protected boolean requireChangeInfoOnReplace() {
        return false;
     }
+
+    @Override
+    protected Logger getLogger() {
+        return LOGGER;
+    }
     
 }