jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1539825 - /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
Date Thu, 07 Nov 2013 21:16:40 GMT
Author: jukka
Date: Thu Nov  7 21:16:40 2013
New Revision: 1539825

URL: http://svn.apache.org/r1539825
Log:
OAK-1152: SegmentMK: Improved debuggability

Add an "inspect" mode to oak-run, for inspecting TarMK contents

Modified:
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java?rev=1539825&r1=1539824&r2=1539825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java (original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java Thu
Nov  7 21:16:40 2013
@@ -19,6 +19,7 @@ package org.apache.jackrabbit.oak.run;
 import java.io.File;
 import java.io.InputStream;
 import java.util.Properties;
+import java.util.UUID;
 
 import javax.jcr.Repository;
 
@@ -74,6 +75,22 @@ public class Main {
                 System.err.println("usage: upgrade <olddir> <newdir>");
                 System.exit(1);
             }
+        } else if ("inspect".equals(command)) {
+            if (args.length == 0) {
+                System.err.println("usage: inspect <path> [uuid...]");
+                System.exit(1);
+            } else {
+                File file = new File(args[0]);
+                FileStore store = new FileStore(file, 256 * 1024 * 1024, false);
+                try {
+                    for (int i = 1; i < args.length; i++) {
+                        UUID uuid = UUID.fromString(args[i]);
+                        System.out.println(store.readSegment(uuid));
+                    }
+                } finally {
+                    store.close();
+                }
+            }
         } else {
             System.err.println("Unknown command: " + command);
             System.exit(1);



Mime
View raw message