Author: adulceanu
Date: Wed Feb  8 10:15:38 2017
New Revision: 1782137

URL: http://svn.apache.org/viewvc?rev=1782137&view=rev
Log:
OAK-5595 - The check command should do deep traversals by default

Modified:
    jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/segment/overview.md
    
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/CheckCommand.java

Modified: 
jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/segment/overview.md
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/segment/overview.md?rev=1782137&r1=1782136&r2=1782137&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/segment/overview.md 
(original)
+++ 
jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/segment/overview.md 
Wed Feb  8 10:15:38 2017
@@ -531,18 +531,17 @@ This tool is the counterpart of `backup`
 ### <a name="check"/> Check
 
 ```
-java -jar oak-run.jar check PATH [--journal JOURNAL] [--deep] [--notify SECS] 
[--bin [LENGTH]] [--io-stats]
+java -jar oak-run.jar check PATH [--journal JOURNAL] [--notify SECS] [--bin 
LENGTH] [--io-stats]
 ```
 
 The `check` tool inspects an existing Segment Store at `PATH` for eventual 
inconsistencies. 
 The algorithm implemented by this tool traverses every revision in the 
journal, from the most recent to the oldest.
 For every revision, the actual nodes and properties are traversed, verifying 
that every piece of data is reachable and undamaged.
+A deep scan of the content tree, traversing every node, will be performed by 
default.
   
 If the `--journal` option is specified, the tool will use the journal file at 
`JOURNAL` instead of picking up the one contained in `PATH`. 
 `JOURNAL` must be a path to a valid journal file for the Segment Store. 
 
-If the `--deep` option is specified, the tool will perform a deep scan of the 
content tree, traversing every node.
-
 If the `--notify` option is specified, the tool will print progress 
information messages every `SECS` seconds.
 If not specified, progress information messages will be disabled.
 If `SECS` equals `0`, every progress information message is printed.

Modified: 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/CheckCommand.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/CheckCommand.java?rev=1782137&r1=1782136&r2=1782137&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/CheckCommand.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/CheckCommand.java
 Wed Feb  8 10:15:38 2017
@@ -36,7 +36,7 @@ class CheckCommand implements Command {
                 "journal", "journal file")
                 
.withRequiredArg().ofType(String.class).defaultsTo("journal.log");
         OptionSpec deep = parser.accepts(
-                "deep", "enable deep consistency checking. ");
+                "deep", "<deprecated> enable deep consistency checking. ");
         ArgumentAcceptingOptionSpec<Long> notify = parser.accepts(
                 "notify", "number of seconds between progress notifications")
                 
.withRequiredArg().ofType(Long.class).defaultsTo(Long.MAX_VALUE);
@@ -54,7 +54,6 @@ class CheckCommand implements Command {
 
         File dir = isValidFileStoreOrFail(new 
File(options.nonOptionArguments().get(0).toString()));
         String journalFileName = journal.value(options);
-        boolean fullTraversal = options.has(deep);
         long debugLevel = notify.value(options);
 
         long binLen = -1L;
@@ -67,10 +66,15 @@ class CheckCommand implements Command {
             }
         }
 
+        if (options.has(deep)) {
+            printUsage(parser, "The --deep option was deprecated! Please do 
not use it in the future!"
+                    , "A deep scan of the content tree, traversing every node, 
will be performed by default.");
+        }
+        
         if (options.has(segment)) {
-            SegmentUtils.check(dir, journalFileName, fullTraversal, 
debugLevel, binLen);
+            SegmentUtils.check(dir, journalFileName, true, debugLevel, binLen);
         } else {
-            SegmentTarUtils.check(dir, journalFileName, fullTraversal, 
debugLevel, binLen, options.has(ioStatistics));
+            SegmentTarUtils.check(dir, journalFileName, true, debugLevel, 
binLen, options.has(ioStatistics));
         }
     }
 


Reply via email to