Author: chetanm
Date: Fri May 19 08:10:41 2017
New Revision: 1795592

URL: http://svn.apache.org/viewvc?rev=1795592&view=rev
Log:
OAK-6117 - Enable lucene indexing via oak-run

Enable access to BlobStore via NodeStoreFixture. If the NodeStore is backed
by a BlobStore then it would not be null

Modified:
    
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/console/NodeStoreFixture.java
    
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/console/SegmentTarFixture.java
    
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/cli/NodeStoreFixtureProvider.java
    
jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/run/JsonIndexTest.java

Modified: 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/console/NodeStoreFixture.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/console/NodeStoreFixture.java?rev=1795592&r1=1795591&r2=1795592&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/console/NodeStoreFixture.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/console/NodeStoreFixture.java
 Fri May 19 08:10:41 2017
@@ -19,10 +19,16 @@ package org.apache.jackrabbit.oak.consol
 
 import java.io.Closeable;
 
+import javax.annotation.CheckForNull;
+
+import org.apache.jackrabbit.oak.spi.blob.BlobStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 
 public interface NodeStoreFixture extends Closeable {
 
     NodeStore getStore();
 
+    @CheckForNull
+    BlobStore getBlobStore();
+
 }

Modified: 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/console/SegmentTarFixture.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/console/SegmentTarFixture.java?rev=1795592&r1=1795591&r2=1795592&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/console/SegmentTarFixture.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/console/SegmentTarFixture.java
 Fri May 19 08:10:41 2017
@@ -72,6 +72,11 @@ class SegmentTarFixture implements NodeS
     }
 
     @Override
+    public BlobStore getBlobStore() {
+        return fileStore.getBlobStore();
+    }
+
+    @Override
     public void close() throws IOException {
         fileStore.close();
     }

Modified: 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/cli/NodeStoreFixtureProvider.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/cli/NodeStoreFixtureProvider.java?rev=1795592&r1=1795591&r2=1795592&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/cli/NodeStoreFixtureProvider.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/cli/NodeStoreFixtureProvider.java
 Fri May 19 08:10:41 2017
@@ -68,7 +68,7 @@ public class NodeStoreFixtureProvider {
             store = configureSegment(options, blobStore, closer, readOnly);
         }
 
-        return new SimpleNodeStoreFixture(store, closer);
+        return new SimpleNodeStoreFixture(store, blobStore, closer);
     }
 
 
@@ -156,8 +156,10 @@ public class NodeStoreFixtureProvider {
     private static class SimpleNodeStoreFixture implements NodeStoreFixture {
         private final Closer closer;
         private final NodeStore nodeStore;
+        private final BlobStore blobStore;
 
-        private SimpleNodeStoreFixture(NodeStore nodeStore, Closer closer) {
+        private SimpleNodeStoreFixture(NodeStore nodeStore, BlobStore 
blobStore, Closer closer) {
+            this.blobStore = blobStore;
             this.closer = closer;
             this.nodeStore = nodeStore;
         }
@@ -168,6 +170,11 @@ public class NodeStoreFixtureProvider {
         }
 
         @Override
+        public BlobStore getBlobStore() {
+            return blobStore;
+        }
+
+        @Override
         public void close() throws IOException {
             closer.close();
         }

Modified: 
jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/run/JsonIndexTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/run/JsonIndexTest.java?rev=1795592&r1=1795591&r2=1795592&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/run/JsonIndexTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/run/JsonIndexTest.java
 Fri May 19 08:10:41 2017
@@ -27,6 +27,7 @@ import java.io.StringWriter;
 import org.apache.jackrabbit.oak.console.NodeStoreFixture;
 import org.apache.jackrabbit.oak.segment.SegmentNodeStoreBuilders;
 import org.apache.jackrabbit.oak.segment.memory.MemoryStore;
+import org.apache.jackrabbit.oak.spi.blob.BlobStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.junit.Test;
 
@@ -96,7 +97,12 @@ public class JsonIndexTest {
                     throw new RuntimeException(e);
                 }
             }
-            
+
+            @Override
+            public BlobStore getBlobStore() {
+                return null;
+            }
+
         };
     }
     


Reply via email to