jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1393740 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene: LuceneEditor.java LuceneIndex.java
Date Wed, 03 Oct 2012 20:02:28 GMT
Author: alexparvulescu
Date: Wed Oct  3 20:02:28 2012
New Revision: 1393740

URL: http://svn.apache.org/viewvc?rev=1393740&view=rev
Log:
OAK-340 Basic reindex support in the lucene index
 - setting the path to Iterable was a bad idea, it can get consumed and future iteration will
just get an empty iterator 

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndex.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditor.java?rev=1393740&r1=1393739&r2=1393740&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditor.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditor.java
Wed Oct  3 20:02:28 2012
@@ -73,10 +73,10 @@ class LuceneEditor implements CommitHook
         }
     }
 
-    private final Iterable<String> path;
+    private final IndexDefinition index;
 
     public LuceneEditor(IndexDefinition indexDefinition) {
-        this.path = elements(indexDefinition.getPath());
+        this.index = indexDefinition;
     }
 
     /*
@@ -89,7 +89,7 @@ class LuceneEditor implements CommitHook
             throws CommitFailedException {
         NodeBuilder rootBuilder = after.getBuilder();
         NodeBuilder builder = rootBuilder;
-        for (String name : path) {
+        for (String name : elements(index.getPath())) {
             builder = builder.getChildBuilder(name);
         }
         builder = builder.getChildBuilder(INDEX_DATA_CHILD_NAME);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndex.java?rev=1393740&r1=1393739&r2=1393740&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndex.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneIndex.java
Wed Oct  3 20:02:28 2012
@@ -80,11 +80,8 @@ public class LuceneIndex implements Quer
 
     private final IndexDefinition index;
 
-    private final Iterable<String> path;
-
     public LuceneIndex(IndexDefinition indexDefinition) {
         this.index = indexDefinition;
-        this.path = elements(indexDefinition.getPath());
     }
 
     @Override
@@ -106,7 +103,7 @@ public class LuceneIndex implements Quer
     public Cursor query(Filter filter, NodeState root) {
 
         NodeBuilder builder = new ReadOnlyBuilder(root);
-        for (String name : path) {
+        for (String name : elements(index.getPath())) {
             builder = builder.getChildBuilder(name);
         }
         if (!builder.hasChildNode(INDEX_DATA_CHILD_NAME)) {



Mime
View raw message