jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1525190 - in /jackrabbit/oak/trunk/oak-lucene/src: main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/LuceneInitializerHelper.java test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java
Date Sat, 21 Sep 2013 02:29:49 GMT
Author: jukka
Date: Sat Sep 21 02:29:49 2013
New Revision: 1525190

URL: http://svn.apache.org/r1525190
Log:
OAK-659: Move purge logic for transient changes below the NodeBuilder interface

Adjust oak-lucene to match previous commit

Modified:
    jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/LuceneInitializerHelper.java
    jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java

Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/LuceneInitializerHelper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/LuceneInitializerHelper.java?rev=1525190&r1=1525189&r2=1525190&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/LuceneInitializerHelper.java
(original)
+++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/LuceneInitializerHelper.java
Sat Sep 21 02:29:49 2013
@@ -24,7 +24,6 @@ import java.util.Set;
 
 import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
-import org.apache.jackrabbit.oak.spi.state.NodeState;
 
 public class LuceneInitializerHelper implements RepositoryInitializer {
 
@@ -70,22 +69,19 @@ public class LuceneInitializerHelper imp
     }
 
     @Override
-    public NodeState initialize(NodeState state) {
-        if (state.hasChildNode(INDEX_DEFINITIONS_NAME)
-                && state.getChildNode(INDEX_DEFINITIONS_NAME)
-                        .hasChildNode(name)) {
-            return state;
-        }
-        NodeBuilder builder = state.builder();
-
-        if (filePath == null) {
-            newLuceneIndexDefinition(builder.child(INDEX_DEFINITIONS_NAME),
+    public void initialize(NodeBuilder builder) {
+        if (builder.hasChildNode(INDEX_DEFINITIONS_NAME)
+                && builder.getChildNode(INDEX_DEFINITIONS_NAME).hasChildNode(name))
{
+            // do nothing
+        } else if (filePath == null) {
+            newLuceneIndexDefinition(
+                    builder.child(INDEX_DEFINITIONS_NAME),
                     name, propertyTypes, excludes, async);
         } else {
-            newLuceneFileIndexDefinition(builder.child(INDEX_DEFINITIONS_NAME),
+            newLuceneFileIndexDefinition(
+                    builder.child(INDEX_DEFINITIONS_NAME),
                     name, propertyTypes, excludes, filePath, async);
         }
-        return builder.getNodeState();
     }
 
 }

Modified: jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java?rev=1525190&r1=1525189&r2=1525190&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java
(original)
+++ jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java
Sat Sep 21 02:29:49 2013
@@ -23,14 +23,13 @@ import static org.apache.jackrabbit.JcrC
 import static org.apache.jackrabbit.JcrConstants.NT_BASE;
 import static org.apache.jackrabbit.oak.plugins.index.IndexConstants.INDEX_DEFINITIONS_NAME;
 import static org.apache.jackrabbit.oak.plugins.index.lucene.util.LuceneIndexHelper.newLuceneIndexDefinition;
-import static org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.EMPTY_NODE;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.JCR_NODE_TYPES;
+import static org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.INITIAL_CONTENT;
 
 import javax.jcr.PropertyType;
 
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.plugins.index.IndexUpdateProvider;
-import org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent;
 import org.apache.jackrabbit.oak.query.ast.Operator;
 import org.apache.jackrabbit.oak.query.ast.SelectorImpl;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
@@ -55,7 +54,7 @@ public class LuceneIndexTest {
             new IndexUpdateProvider(
                     new LuceneIndexEditorProvider().with(analyzer)));
 
-    private NodeState root = new InitialContent().initialize(EMPTY_NODE);
+    private NodeState root = INITIAL_CONTENT;
 
     private NodeBuilder builder = root.builder();
 



Mime
View raw message