jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1165314 - /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java
Date Mon, 05 Sep 2011 15:09:45 GMT
Author: thomasm
Date: Mon Sep  5 15:09:44 2011
New Revision: 1165314

URL: http://svn.apache.org/viewvc?rev=1165314&view=rev
Log:
Index mechanism (WIP) - always update to the head

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java?rev=1165314&r1=1165313&r2=1165314&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java
Mon Sep  5 15:09:44 2011
@@ -167,12 +167,15 @@ public class Indexer {
         }
         if (toRevision.equals(readRevision)) {
             return;
+        } else {
+            toRevision = mk.getHeadRevision();
         }
         String journal = mk.getJournal(readRevision, toRevision);
         JsopTokenizer t = new JsopTokenizer(journal);
         String lastRevision = readRevision;
         t.read('[');
         if (t.matches(']')) {
+            readRevision = toRevision;
             // nothing to update
             return;
         }
@@ -341,6 +344,9 @@ public class Indexer {
         }
         String nodePath = PathUtils.getParentPath(path);
         String property = PathUtils.getName(path);
+        if (!mk.nodeExists(nodePath, lastRevision)) {
+            return;
+        }
         String node = mk.getNodes(nodePath, lastRevision, Integer.MAX_VALUE, 0, Integer.MAX_VALUE);
         JsopTokenizer t = new JsopTokenizer(node);
         NodeMap map = new NodeMap();
@@ -371,6 +377,9 @@ public class Indexer {
             // don't index the index
             return;
         }
+        if (!mk.nodeExists(path, lastRevision)) {
+            return;
+        }
         String node = mk.getNodes(path, lastRevision, Integer.MAX_VALUE, 0, Integer.MAX_VALUE);
         JsopTokenizer t = new JsopTokenizer(node);
         NodeMap map = new NodeMap();



Mime
View raw message