Modified: 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Utils.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Utils.java?rev=1765293&r1=1765292&r2=1765293&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Utils.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Utils.java
 Mon Oct 17 14:20:11 2016
@@ -25,10 +25,9 @@ import java.io.File;
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.jackrabbit.oak.segment.file.FileStore;
-import org.apache.jackrabbit.oak.segment.file.FileStore.ReadOnlyStore;
 import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
 import org.apache.jackrabbit.oak.segment.file.JournalReader;
+import org.apache.jackrabbit.oak.segment.file.ReadOnlyFileStore;
 import org.apache.jackrabbit.oak.segment.file.tooling.BasicReadOnlyBlobStore;
 import org.apache.jackrabbit.oak.spi.blob.BlobStore;
 
@@ -38,7 +37,7 @@ class Utils {
 
     private static final int TAR_SEGMENT_CACHE_SIZE = 
Integer.getInteger("cache", 256);
 
-    static FileStore openReadOnlyFileStore(File path, BlobStore blobStore) 
throws IOException, InvalidFileStoreVersionException {
+    static ReadOnlyFileStore openReadOnlyFileStore(File path, BlobStore 
blobStore) throws IOException, InvalidFileStoreVersionException {
         return fileStoreBuilder(isValidFileStoreOrFail(path))
                 .withSegmentCacheSize(TAR_SEGMENT_CACHE_SIZE)
                 .withMemoryMapping(TAR_STORAGE_MEMORY_MAPPED)
@@ -46,7 +45,7 @@ class Utils {
                 .buildReadOnly();
     }
 
-    static ReadOnlyStore openReadOnlyFileStore(File path) throws IOException, 
InvalidFileStoreVersionException {
+    static ReadOnlyFileStore openReadOnlyFileStore(File path) throws 
IOException, InvalidFileStoreVersionException {
         return fileStoreBuilder(isValidFileStoreOrFail(path))
                 .withSegmentCacheSize(TAR_SEGMENT_CACHE_SIZE)
                 .withMemoryMapping(TAR_STORAGE_MEMORY_MAPPED)

Modified: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentBufferWriterTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentBufferWriterTest.java?rev=1765293&r1=1765292&r2=1765293&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentBufferWriterTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentBufferWriterTest.java
 Mon Oct 17 14:20:11 2016
@@ -27,6 +27,7 @@ import java.io.File;
 import java.util.List;
 
 import org.apache.jackrabbit.oak.segment.file.FileStore;
+import org.apache.jackrabbit.oak.segment.file.ReadOnlyFileStore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -40,18 +41,28 @@ public class SegmentBufferWriterTest {
         return fileStoreBuilder(folder.getRoot()).build();
     }
 
+    private ReadOnlyFileStore openReadOnlyFileStore() throws Exception {
+        return fileStoreBuilder(folder.getRoot()).buildReadOnly();
+    }
+
     @Test
     public void nonDirtyBuffersShouldNotBeFlushed() throws Exception {
         List<SegmentId> before;
 
         try (FileStore store = openFileStore()) {
+            // init
+        }
+        try (ReadOnlyFileStore store = openReadOnlyFileStore()) {
             before = newArrayList(store.getSegmentIds());
+        }
+
+        try (FileStore store = openFileStore()) {
             segmentWriterBuilder("t").build(store).flush();
         }
 
         List<SegmentId> after;
 
-        try (FileStore store = openFileStore()) {
+        try (ReadOnlyFileStore store = openReadOnlyFileStore()) {
             after = newArrayList(store.getSegmentIds());
         }
 
@@ -63,7 +74,13 @@ public class SegmentBufferWriterTest {
         List<SegmentId> before;
 
         try (FileStore store = openFileStore()) {
+            // init
+        }
+        try (ReadOnlyFileStore store = openReadOnlyFileStore()) {
             before = newArrayList(store.getSegmentIds());
+        }
+
+        try (FileStore store = openFileStore()) {
             SegmentWriter writer = segmentWriterBuilder("t").build(store);
             writer.writeString("test");
             writer.flush();
@@ -71,7 +88,7 @@ public class SegmentBufferWriterTest {
 
         List<SegmentId> after;
 
-        try (FileStore store = openFileStore()) {
+        try (ReadOnlyFileStore store = openReadOnlyFileStore()) {
             after = newArrayList(store.getSegmentIds());
         }
 

Modified: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentGraphTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentGraphTest.java?rev=1765293&r1=1765292&r2=1765293&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentGraphTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentGraphTest.java
 Mon Oct 17 14:20:11 2016
@@ -41,9 +41,10 @@ import com.google.common.base.Predicates
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Multiset;
+
 import org.apache.jackrabbit.oak.segment.SegmentGraph.Graph;
 import org.apache.jackrabbit.oak.segment.file.FileStore;
-import org.apache.jackrabbit.oak.segment.file.FileStore.ReadOnlyStore;
+import org.apache.jackrabbit.oak.segment.file.ReadOnlyFileStore;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.junit.Before;
 import org.junit.Rule;
@@ -127,7 +128,7 @@ public class SegmentGraphTest {
 
     @Test
     public void testSegmentGraph() throws Exception {
-        ReadOnlyStore store = 
fileStoreBuilder(getStoreFolder()).buildReadOnly();
+        ReadOnlyFileStore store = 
fileStoreBuilder(getStoreFolder()).buildReadOnly();
         try {
             Graph<UUID> segmentGraph = parseSegmentGraph(store, 
Predicates.<UUID>alwaysTrue());
             assertEquals(segments, newHashSet(segmentGraph.vertices()));
@@ -143,7 +144,7 @@ public class SegmentGraphTest {
 
     @Test
     public void testSegmentGraphWithFilter() throws Exception {
-        ReadOnlyStore store = 
fileStoreBuilder(getStoreFolder()).buildReadOnly();
+        ReadOnlyFileStore store = 
fileStoreBuilder(getStoreFolder()).buildReadOnly();
         try {
             Predicate<UUID> filter = 
createRegExpFilter(".*(writer2|writer3).*", store);
             Graph<UUID> segmentGraph = parseSegmentGraph(store, filter);
@@ -163,7 +164,7 @@ public class SegmentGraphTest {
         // TODO Improve test coverage to non trivial cases with more than a 
single generation
         // This is quite tricky as there is no easy way to construct a file 
store with
         // a segment graphs having edges between generations (OAK-3348)
-        ReadOnlyStore store = 
fileStoreBuilder(getStoreFolder()).buildReadOnly();
+        ReadOnlyFileStore store = 
fileStoreBuilder(getStoreFolder()).buildReadOnly();
         try {
             Graph<String> gcGraph = SegmentGraph.parseGCGraph(store);
             assertEquals(ImmutableSet.of("0"), newHashSet(gcGraph.vertices()));

Modified: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/FileStoreIT.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/FileStoreIT.java?rev=1765293&r1=1765292&r2=1765293&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/FileStoreIT.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/FileStoreIT.java
 Mon Oct 17 14:20:11 2016
@@ -42,7 +42,6 @@ import org.apache.jackrabbit.oak.segment
 import org.apache.jackrabbit.oak.segment.SegmentNodeBuilder;
 import org.apache.jackrabbit.oak.segment.SegmentNodeState;
 import org.apache.jackrabbit.oak.segment.SegmentWriter;
-import org.apache.jackrabbit.oak.segment.file.FileStore.ReadOnlyStore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -204,7 +203,7 @@ public class FileStoreIT {
         store.getRevisions().setHead(base.getRecordId(), 
builder.getNodeState().getRecordId());
         store.flush(); // second 1kB
 
-        ReadOnlyStore ro = null;
+        ReadOnlyFileStore ro = null;
         try {
             ro = fileStoreBuilder(getFileStoreFolder()).buildReadOnly();
             assertEquals(store.getRevisions().getHead(), 
ro.getRevisions().getHead());
@@ -227,7 +226,7 @@ public class FileStoreIT {
             RecordId id2 = store.getRevisions().getHead();
             store.flush();
 
-            try (ReadOnlyStore roStore = 
fileStoreBuilder(getFileStoreFolder()).buildReadOnly()) {
+            try (ReadOnlyFileStore roStore = 
fileStoreBuilder(getFileStoreFolder()).buildReadOnly()) {
                 assertEquals(id2, roStore.getRevisions().getHead());
 
                 roStore.setRevision(id1.toString());

Modified: 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/TarRevisionsTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/TarRevisionsTest.java?rev=1765293&r1=1765292&r2=1765293&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/TarRevisionsTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/TarRevisionsTest.java
 Mon Oct 17 14:20:11 2016
@@ -78,7 +78,7 @@ public class TarRevisionsTest {
 
     @Test(expected = IllegalStateException.class)
     public void unboundRevisions() throws IOException {
-        try (TarRevisions tarRevisions = new TarRevisions(false, 
folder.getRoot())) {
+        try (TarRevisions tarRevisions = new TarRevisions(folder.getRoot())) {
             tarRevisions.getHead();
         }
     }


Reply via email to