Author: frm
Date: Tue Aug 30 08:35:28 2016
New Revision: 1758344

URL: http://svn.apache.org/viewvc?rev=1758344&view=rev
Log:
OAK-4716 - Upgrade dependency to oak-segment-tar to version 0.0.10

Modified:
    
jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RefreshOnGCTest.java
    jackrabbit/oak/trunk/oak-parent/pom.xml
    
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/checkpoint/SegmentTarCheckpoints.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/explorer/SegmentTarExplorerBackend.java
    
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/plugins/tika/SegmentTarUtils.java
    
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/SegmentTarUtils.java
    
jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/cli/node/SegmentTarFactory.java
    
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/IncludeExcludeSidegradeTest.java
    
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepeatedRepositorySidegradeTest.java
    
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepeatedRepositoryUpgradeTest.java
    
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/UpgradeFromTwoSourcesTest.java
    
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/cli/container/SegmentTarNodeStoreContainer.java

Modified: 
jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RefreshOnGCTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RefreshOnGCTest.java?rev=1758344&r1=1758343&r2=1758344&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RefreshOnGCTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RefreshOnGCTest.java
 Tue Aug 30 08:35:28 2016
@@ -25,7 +25,6 @@ import static org.apache.jackrabbit.oak.
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
-import java.io.IOException;
 import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
@@ -116,7 +115,7 @@ public class RefreshOnGCTest {
         return SegmentNodeStore.builder(fileStore).build();
     }
 
-    private NodeStore createSegmentTarStore(File directory, GCMonitor 
gcMonitor) throws IOException {
+    private NodeStore createSegmentTarStore(File directory, GCMonitor 
gcMonitor) throws Exception {
         final org.apache.jackrabbit.oak.segment.file.FileStore fileStore =
                 fileStoreBuilder(directory).withGCMonitor(gcMonitor).build();
         compact = new Callable<Void>() {

Modified: jackrabbit/oak/trunk/oak-parent/pom.xml
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-parent/pom.xml?rev=1758344&r1=1758343&r2=1758344&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-parent/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-parent/pom.xml Tue Aug 30 08:35:28 2016
@@ -73,7 +73,7 @@
    <!-- whether skip the surefire unit testing during the integration testing. 
       Override with -Dsurefire.skip.ut=true when needed -->
     <surefire.skip.ut>false</surefire.skip.ut>
-    <segment.tar.version>0.0.8</segment.tar.version>
+    <segment.tar.version>0.0.10</segment.tar.version>
   </properties>
 
   <issueManagement>

Modified: 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/checkpoint/SegmentTarCheckpoints.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/checkpoint/SegmentTarCheckpoints.java?rev=1758344&r1=1758343&r2=1758344&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/checkpoint/SegmentTarCheckpoints.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/checkpoint/SegmentTarCheckpoints.java
 Tue Aug 30 08:35:28 2016
@@ -27,6 +27,7 @@ import com.google.common.collect.Lists;
 import com.google.common.io.Closer;
 import org.apache.jackrabbit.oak.segment.SegmentNodeState;
 import org.apache.jackrabbit.oak.segment.file.FileStore;
+import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -34,7 +35,11 @@ import org.apache.jackrabbit.oak.spi.sta
 class SegmentTarCheckpoints extends Checkpoints {
 
     static Checkpoints create(File path, Closer closer) throws IOException {
-        return new 
SegmentTarCheckpoints(closer.register(fileStoreBuilder(path).build()));
+        try {
+            return new 
SegmentTarCheckpoints(closer.register(fileStoreBuilder(path).build()));
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
     }
 
     private final FileStore store;

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=1758344&r1=1758343&r2=1758344&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
 Tue Aug 30 08:35:28 2016
@@ -26,6 +26,7 @@ import org.apache.jackrabbit.oak.segment
 import org.apache.jackrabbit.oak.segment.SegmentNodeStoreBuilders;
 import org.apache.jackrabbit.oak.segment.file.FileStore;
 import org.apache.jackrabbit.oak.segment.file.FileStoreBuilder;
+import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
 import org.apache.jackrabbit.oak.spi.blob.BlobStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 
@@ -40,10 +41,14 @@ class SegmentTarFixture implements NodeS
 
         FileStore store;
 
-        if (readOnly) {
-            store = builder.buildReadOnly();
-        } else {
-            store = builder.build();
+        try {
+            if (readOnly) {
+                store = builder.buildReadOnly();
+            } else {
+                store = builder.build();
+            }
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
         }
 
         return new SegmentTarFixture(store);

Modified: 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/explorer/SegmentTarExplorerBackend.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/explorer/SegmentTarExplorerBackend.java?rev=1758344&r1=1758343&r2=1758344&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/explorer/SegmentTarExplorerBackend.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/explorer/SegmentTarExplorerBackend.java
 Tue Aug 30 08:35:28 2016
@@ -44,6 +44,7 @@ import org.apache.jackrabbit.oak.segment
 import org.apache.jackrabbit.oak.segment.SegmentNodeStateHelper;
 import org.apache.jackrabbit.oak.segment.SegmentPropertyState;
 import org.apache.jackrabbit.oak.segment.file.FileStore;
+import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
 import org.apache.jackrabbit.oak.segment.file.JournalReader;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
@@ -61,7 +62,11 @@ class SegmentTarExplorerBackend implemen
 
     @Override
     public void open() throws IOException {
-        store = fileStoreBuilder(path).buildReadOnly();
+        try {
+            store = fileStoreBuilder(path).buildReadOnly();
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
         index = store.getTarReaderIndex();
     }
 

Modified: 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/plugins/tika/SegmentTarUtils.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/plugins/tika/SegmentTarUtils.java?rev=1758344&r1=1758343&r2=1758344&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/plugins/tika/SegmentTarUtils.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/plugins/tika/SegmentTarUtils.java
 Tue Aug 30 08:35:28 2016
@@ -25,6 +25,7 @@ import java.io.IOException;
 import com.google.common.io.Closer;
 import org.apache.jackrabbit.oak.segment.SegmentNodeStoreBuilders;
 import org.apache.jackrabbit.oak.segment.file.FileStore;
+import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
 import org.apache.jackrabbit.oak.spi.blob.BlobStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 
@@ -35,14 +36,18 @@ class SegmentTarUtils {
     }
 
     static NodeStore bootstrap(String path, BlobStore store, Closer closer) 
throws IOException {
-        return SegmentNodeStoreBuilders.builder(fileStore(path, store, 
closer)).build();
+        try {
+            return SegmentNodeStoreBuilders.builder(fileStore(path, store, 
closer)).build();
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
     }
 
-    private static FileStore fileStore(String path, BlobStore store, Closer 
closer) throws IOException {
+    private static FileStore fileStore(String path, BlobStore store, Closer 
closer) throws IOException, InvalidFileStoreVersionException {
         return closer.register(fileStore(path, store));
     }
 
-    private static FileStore fileStore(String path, BlobStore store) throws 
IOException {
+    private static FileStore fileStore(String path, BlobStore store) throws 
IOException, InvalidFileStoreVersionException {
         return fileStoreBuilder(new File(path)).withBlobStore(store).build();
     }
 

Modified: 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/SegmentTarUtils.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/SegmentTarUtils.java?rev=1758344&r1=1758343&r2=1758344&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/SegmentTarUtils.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/SegmentTarUtils.java
 Tue Aug 30 08:35:28 2016
@@ -85,8 +85,9 @@ import org.apache.jackrabbit.oak.segment
 import org.apache.jackrabbit.oak.segment.SegmentTracker;
 import org.apache.jackrabbit.oak.segment.SegmentVersion;
 import org.apache.jackrabbit.oak.segment.file.FileStore;
-import org.apache.jackrabbit.oak.segment.file.FileStoreBuilder;
 import org.apache.jackrabbit.oak.segment.file.FileStore.ReadOnlyStore;
+import org.apache.jackrabbit.oak.segment.file.FileStoreBuilder;
+import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
 import org.apache.jackrabbit.oak.segment.file.JournalReader;
 import org.apache.jackrabbit.oak.segment.file.tooling.RevisionHistory;
 import 
org.apache.jackrabbit.oak.segment.file.tooling.RevisionHistory.HistoryElement;
@@ -108,11 +109,19 @@ final class SegmentTarUtils {
     }
 
     static NodeStore bootstrapNodeStore(String path, Closer closer) throws 
IOException {
-        return SegmentNodeStoreBuilders.builder(bootstrapFileStore(path, 
closer)).build();
+        try {
+            return SegmentNodeStoreBuilders.builder(bootstrapFileStore(path, 
closer)).build();
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
     }
 
     static BlobReferenceRetriever newBlobReferenceRetriever(String path, 
Closer closer) throws IOException {
-        return new 
SegmentBlobReferenceRetriever(closer.register(openFileStore(path, false)));
+        try {
+            return new 
SegmentBlobReferenceRetriever(closer.register(openFileStore(path, false)));
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
     }
 
     static void backup(File source, File target) throws IOException {
@@ -134,13 +143,22 @@ final class SegmentTarUtils {
     }
 
     static void restore(File source, File target) throws IOException {
-        FileStoreRestore.restore(source, target);
+        try {
+            FileStoreRestore.restore(source, target);
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
     }
 
     static void debug(String... args) throws IOException {
         File file = new File(args[0]);
         System.out.println("Debug " + file);
-        FileStore store = openReadOnlyFileStore(file);
+        FileStore store;
+        try {
+            store = openReadOnlyFileStore(file);
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
         try {
             if (args.length == 1) {
                 debugFileStore(store);
@@ -167,7 +185,12 @@ final class SegmentTarUtils {
     }
 
     static void history(File directory, File journal, String path, int depth) 
throws IOException {
-        Iterator<HistoryElement> history = new 
RevisionHistory(directory).getHistory(journal, path);
+        Iterator<HistoryElement> history;
+        try {
+            history = new RevisionHistory(directory).getHistory(journal, path);
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
         while (history.hasNext()) {
             RevisionHistory.HistoryElement historyElement = history.next();
             System.out.println(historyElement.toString(depth));
@@ -175,12 +198,21 @@ final class SegmentTarUtils {
     }
 
     static void check(File dir, String journalFileName, boolean fullTraversal, 
long debugLevel, long binLen) throws IOException {
-        checkConsistency(dir, journalFileName, fullTraversal, debugLevel, 
binLen);
+        try {
+            checkConsistency(dir, journalFileName, fullTraversal, debugLevel, 
binLen);
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
     }
 
     static void compact(File directory, boolean force) throws IOException {
-        FileStore store = newFileStoreBuilder(directory.getAbsolutePath(),
-                force).withGCOptions(defaultGCOptions().setOffline()).build();
+        FileStore store;
+        try {
+            store = newFileStoreBuilder(directory.getAbsolutePath(),
+                    
force).withGCOptions(defaultGCOptions().setOffline()).build();
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
         try {
             store.compact();
         } finally {
@@ -188,8 +220,12 @@ final class SegmentTarUtils {
         }
 
         System.out.println("    -> cleaning up");
-        store = newFileStoreBuilder(directory.getAbsolutePath(), force)
-                .withGCOptions(defaultGCOptions().setOffline()).build();
+        try {
+            store = newFileStoreBuilder(directory.getAbsolutePath(), force)
+                    .withGCOptions(defaultGCOptions().setOffline()).build();
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
         try {
             for (File file : store.cleanup()) {
                 if (!file.exists() || file.delete()) {
@@ -225,16 +261,21 @@ final class SegmentTarUtils {
     static void diff(File store, File out, boolean listOnly, String interval, 
boolean incremental, String path, boolean ignoreSNFEs) throws IOException {
         if (listOnly) {
             listRevs(store, out);
-        } else {
+            return;
+        }
+
+        try {
             diff(store, interval, incremental, out, path, ignoreSNFEs);
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
         }
     }
 
-    private static FileStore bootstrapFileStore(String path, Closer closer) 
throws IOException {
+    private static FileStore bootstrapFileStore(String path, Closer closer) 
throws IOException, InvalidFileStoreVersionException {
         return closer.register(bootstrapFileStore(path));
     }
 
-    private static FileStore bootstrapFileStore(String path) throws 
IOException {
+    private static FileStore bootstrapFileStore(String path) throws 
IOException, InvalidFileStoreVersionException {
         return fileStoreBuilder(new File(path)).build();
     }
 
@@ -284,7 +325,7 @@ final class SegmentTarUtils {
         return revs;
     }
 
-    private static void diff(File dir, String interval, boolean incremental, 
File out, String filter, boolean ignoreSNFEs) throws IOException {
+    private static void diff(File dir, String interval, boolean incremental, 
File out, String filter, boolean ignoreSNFEs) throws IOException, 
InvalidFileStoreVersionException {
         System.out.println("Store " + dir);
         System.out.println("Writing diff to " + out);
         String[] tokens = interval.trim().split("\\.\\.");
@@ -374,6 +415,19 @@ final class SegmentTarUtils {
         }
     }
 
+    private static List<SegmentId> getReferencedIds(FileStore store, Segment 
segment) {
+        List<SegmentId> segmentIds = new ArrayList<>();
+
+        for (int i = 0; i < segment.getReferencedSegmentIdCount(); i++) {
+            UUID uuid = segment.getReferencedSegmentId(i);
+            long msb = uuid.getMostSignificantBits();
+            long lsb = uuid.getLeastSignificantBits();
+            segmentIds.add(store.newSegmentId(msb, lsb));
+        }
+
+        return segmentIds;
+    }
+
     private static void debugFileStore(FileStore store) {
         Map<SegmentId, List<SegmentId>> idmap = Maps.newHashMap();
         int dataCount = 0;
@@ -389,7 +443,7 @@ final class SegmentTarUtils {
                 Segment segment = id.getSegment();
                 dataCount++;
                 dataSize += segment.size();
-                idmap.put(id, segment.getReferencedIds());
+                idmap.put(id, getReferencedIds(store, segment));
                 analyseSegment(segment, analyser);
             } else if (id.isBulkSegmentId()) {
                 bulkCount++;
@@ -623,7 +677,7 @@ final class SegmentTarUtils {
         }
     }
 
-    private static FileStore openReadOnlyFileStore(File path, BlobStore 
blobStore) throws IOException {
+    private static FileStore openReadOnlyFileStore(File path, BlobStore 
blobStore) throws IOException, InvalidFileStoreVersionException {
         return fileStoreBuilder(isValidFileStoreOrFail(path))
                 .withSegmentCacheSize(TAR_SEGMENT_CACHE_SIZE)
                 .withMemoryMapping(TAR_STORAGE_MEMORY_MAPPED)
@@ -631,26 +685,24 @@ final class SegmentTarUtils {
                 .buildReadOnly();
     }
 
-    private static ReadOnlyStore openReadOnlyFileStore(File path) throws 
IOException {
+    private static ReadOnlyStore openReadOnlyFileStore(File path) throws 
IOException, InvalidFileStoreVersionException {
         return fileStoreBuilder(isValidFileStoreOrFail(path))
                 .withSegmentCacheSize(TAR_SEGMENT_CACHE_SIZE)
                 .withMemoryMapping(TAR_STORAGE_MEMORY_MAPPED)
                 .buildReadOnly();
     }
 
-    private static FileStoreBuilder newFileStoreBuilder(String directory, 
boolean force)
-            throws IOException {
+    private static FileStoreBuilder newFileStoreBuilder(String directory, 
boolean force) throws IOException, InvalidFileStoreVersionException {
         return fileStoreBuilder(checkFileStoreVersionOrFail(directory, force))
                 .withSegmentCacheSize(TAR_SEGMENT_CACHE_SIZE)
                 .withMemoryMapping(TAR_STORAGE_MEMORY_MAPPED);
     }
 
-    private static FileStore openFileStore(String directory, boolean force)
-            throws IOException {
+    private static FileStore openFileStore(String directory, boolean force) 
throws IOException, InvalidFileStoreVersionException {
         return newFileStoreBuilder(directory, force).build();
     }
 
-    private static File checkFileStoreVersionOrFail(String path, boolean 
force) throws IOException {
+    private static File checkFileStoreVersionOrFail(String path, boolean 
force) throws IOException, InvalidFileStoreVersionException {
         File directory = new File(path);
         if (!directory.exists()) {
             return directory;

Modified: 
jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/cli/node/SegmentTarFactory.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/cli/node/SegmentTarFactory.java?rev=1758344&r1=1758343&r2=1758344&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/cli/node/SegmentTarFactory.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/cli/node/SegmentTarFactory.java
 Tue Aug 30 08:35:28 2016
@@ -29,6 +29,7 @@ import org.apache.jackrabbit.oak.segment
 import org.apache.jackrabbit.oak.segment.SegmentNodeStoreBuilders;
 import org.apache.jackrabbit.oak.segment.file.FileStore;
 import org.apache.jackrabbit.oak.segment.file.FileStoreBuilder;
+import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
 import org.apache.jackrabbit.oak.spi.blob.BlobStore;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -62,7 +63,12 @@ public class SegmentTarFactory implement
             builder.withBlobStore(blobStore);
         }
         builder.withMaxFileSize(256).withMemoryMapping(mmap);
-        final FileStore fs = builder.build();
+        final FileStore fs;
+        try {
+            fs = builder.build();
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
         closer.register(asCloseable(fs));
 
         return new TarNodeStore(SegmentNodeStoreBuilders.builder(fs).build(), 
new TarNodeStore.SuperRootProvider() {

Modified: 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/IncludeExcludeSidegradeTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/IncludeExcludeSidegradeTest.java?rev=1758344&r1=1758343&r2=1758344&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/IncludeExcludeSidegradeTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/IncludeExcludeSidegradeTest.java
 Tue Aug 30 08:35:28 2016
@@ -30,6 +30,7 @@ import org.apache.jackrabbit.oak.jcr.rep
 import org.apache.jackrabbit.oak.segment.SegmentNodeStore;
 import org.apache.jackrabbit.oak.segment.SegmentNodeStoreBuilders;
 import org.apache.jackrabbit.oak.segment.file.FileStore;
+import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.junit.Before;
 
@@ -61,7 +62,12 @@ public class IncludeExcludeSidegradeTest
 
     @Override
     protected void doUpgradeRepository(File source, NodeStore target) throws 
RepositoryException, IOException {
-        FileStore fileStore = fileStoreBuilder(source).build();
+        FileStore fileStore;
+        try {
+            fileStore = fileStoreBuilder(source).build();
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
         SegmentNodeStore segmentNodeStore = 
SegmentNodeStoreBuilders.builder(fileStore).build();
         try {
             final RepositorySidegrade sidegrade = new 
RepositorySidegrade(segmentNodeStore, target);

Modified: 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepeatedRepositorySidegradeTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepeatedRepositorySidegradeTest.java?rev=1758344&r1=1758343&r2=1758344&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepeatedRepositorySidegradeTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepeatedRepositorySidegradeTest.java
 Tue Aug 30 08:35:28 2016
@@ -33,6 +33,7 @@ import org.apache.jackrabbit.oak.jcr.rep
 import org.apache.jackrabbit.oak.segment.SegmentNodeStore;
 import org.apache.jackrabbit.oak.segment.SegmentNodeStoreBuilders;
 import org.apache.jackrabbit.oak.segment.file.FileStore;
+import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
 import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
@@ -86,7 +87,12 @@ public class RepeatedRepositorySidegrade
 
     @Override
     protected void doUpgradeRepository(File source, NodeStore target, boolean 
skipInit) throws RepositoryException, IOException {
-        FileStore fileStore = fileStoreBuilder(source).build();
+        FileStore fileStore;
+        try {
+            fileStore = fileStoreBuilder(source).build();
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
         SegmentNodeStore segmentNodeStore = 
SegmentNodeStoreBuilders.builder(fileStore).build();
         try {
             final RepositorySidegrade repositoryUpgrade = new 
RepositorySidegrade(segmentNodeStore, target);

Modified: 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepeatedRepositoryUpgradeTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepeatedRepositoryUpgradeTest.java?rev=1758344&r1=1758343&r2=1758344&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepeatedRepositoryUpgradeTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepeatedRepositoryUpgradeTest.java
 Tue Aug 30 08:35:28 2016
@@ -37,6 +37,7 @@ import org.apache.jackrabbit.core.Reposi
 import org.apache.jackrabbit.core.config.RepositoryConfig;
 import org.apache.jackrabbit.oak.segment.SegmentNodeStoreBuilders;
 import org.apache.jackrabbit.oak.segment.file.FileStore;
+import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
 import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
@@ -73,6 +74,8 @@ public class RepeatedRepositoryUpgradeTe
             upgradeComplete = false;
         } catch (IOException e) {
             throw new RuntimeException(e);
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
         }
     }
 

Modified: 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/UpgradeFromTwoSourcesTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/UpgradeFromTwoSourcesTest.java?rev=1758344&r1=1758343&r2=1758344&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/UpgradeFromTwoSourcesTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/UpgradeFromTwoSourcesTest.java
 Tue Aug 30 08:35:28 2016
@@ -30,6 +30,7 @@ import org.apache.jackrabbit.core.Reposi
 import org.apache.jackrabbit.core.config.RepositoryConfig;
 import org.apache.jackrabbit.oak.segment.SegmentNodeStoreBuilders;
 import org.apache.jackrabbit.oak.segment.file.FileStore;
+import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.junit.AfterClass;
 import org.junit.Before;
@@ -59,6 +60,8 @@ public class UpgradeFromTwoSourcesTest e
             upgradeComplete = false;
         } catch (IOException e) {
             throw new RuntimeException(e);
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
         }
     }
 

Modified: 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/cli/container/SegmentTarNodeStoreContainer.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/cli/container/SegmentTarNodeStoreContainer.java?rev=1758344&r1=1758343&r2=1758344&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/cli/container/SegmentTarNodeStoreContainer.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/cli/container/SegmentTarNodeStoreContainer.java
 Tue Aug 30 08:35:28 2016
@@ -26,6 +26,7 @@ import org.apache.commons.io.FileUtils;
 import org.apache.jackrabbit.oak.segment.SegmentNodeStoreBuilders;
 import org.apache.jackrabbit.oak.segment.file.FileStore;
 import org.apache.jackrabbit.oak.segment.file.FileStoreBuilder;
+import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 
 public class SegmentTarNodeStoreContainer implements NodeStoreContainer {
@@ -56,7 +57,11 @@ public class SegmentTarNodeStoreContaine
         if (blob != null) {
             builder.withBlobStore(blob.open());
         }
-        fs = builder.build();
+        try {
+            fs = builder.build();
+        } catch (InvalidFileStoreVersionException e) {
+            throw new IllegalStateException(e);
+        }
         return SegmentNodeStoreBuilders.builder(fs).build();
     }
 


Reply via email to