You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by ad...@apache.org on 2017/02/09 10:18:37 UTC

svn commit: r1782303 - in /jackrabbit/oak/branches/1.6: oak-doc/src/site/markdown/nodestore/segment/ oak-run/src/main/java/org/apache/jackrabbit/oak/run/ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/

Author: adulceanu
Date: Thu Feb  9 10:18:37 2017
New Revision: 1782303

URL: http://svn.apache.org/viewvc?rev=1782303&view=rev
Log:
OAK-5276 - The check command overloads the meaning of the deep option (merging rev. 1781379)

Modified:
    jackrabbit/oak/branches/1.6/oak-doc/src/site/markdown/nodestore/segment/overview.md
    jackrabbit/oak/branches/1.6/oak-run/src/main/java/org/apache/jackrabbit/oak/run/CheckCommand.java
    jackrabbit/oak/branches/1.6/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Check.java

Modified: jackrabbit/oak/branches/1.6/oak-doc/src/site/markdown/nodestore/segment/overview.md
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.6/oak-doc/src/site/markdown/nodestore/segment/overview.md?rev=1782303&r1=1782302&r2=1782303&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.6/oak-doc/src/site/markdown/nodestore/segment/overview.md (original)
+++ jackrabbit/oak/branches/1.6/oak-doc/src/site/markdown/nodestore/segment/overview.md Thu Feb  9 10:18:37 2017
@@ -514,7 +514,7 @@ This tool is the counterpart of `backup`
 ### <a name="check"/> Check
 
 ```
-java -jar oak-run.jar check --path PATH [--journal JOURNAL] [--deep [SECS]] [--bin [LENGTH]]
+java -jar oak-run.jar check --path PATH [--journal JOURNAL] [--deep] [--notify SECS] [--bin [LENGTH]]
 ```
 
 The `check` tool inspects an existing Segment Store at `PATH` for eventual inconsistencies. 
@@ -525,9 +525,10 @@ If the `--journal` option is specified,
 `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.
-The optional argument `SECS` is the number of seconds between progress information messages.
-If not specified, `SECS` defaults to positive infinity, effectively disabling progress information messages.
-If `SECS` is specified to be `0`, every progress information message is printed.
+
+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.
 
 If the `--bin` option is specified, the tool will scan the content of binary properties, up to the specified length `LENGTH`.
 The default value for `LENGTH` is `0`, effectively disabling the traversal of binary properties.

Modified: jackrabbit/oak/branches/1.6/oak-run/src/main/java/org/apache/jackrabbit/oak/run/CheckCommand.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.6/oak-run/src/main/java/org/apache/jackrabbit/oak/run/CheckCommand.java?rev=1782303&r1=1782302&r2=1782303&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.6/oak-run/src/main/java/org/apache/jackrabbit/oak/run/CheckCommand.java (original)
+++ jackrabbit/oak/branches/1.6/oak-run/src/main/java/org/apache/jackrabbit/oak/run/CheckCommand.java Thu Feb  9 10:18:37 2017
@@ -37,10 +37,11 @@ class CheckCommand implements Command {
         ArgumentAcceptingOptionSpec<String> journal = parser.accepts(
                 "journal", "journal file")
                 .withRequiredArg().ofType(String.class).defaultsTo("journal.log");
-        ArgumentAcceptingOptionSpec<Long> deep = parser.accepts(
-                "deep", "enable deep consistency checking. An optional long " +
-                        "specifies the number of seconds between progress notifications")
-                .withOptionalArg().ofType(Long.class).defaultsTo(Long.MAX_VALUE);
+        OptionSpec deep = parser.accepts(
+                "deep", "enable deep consistency checking. ");
+        ArgumentAcceptingOptionSpec<Long> notify = parser.accepts(
+                "notify", "number of seconds between progress notifications")
+                .withRequiredArg().ofType(Long.class).defaultsTo(Long.MAX_VALUE);
         ArgumentAcceptingOptionSpec<Long> bin = parser.accepts(
                 "bin", "read the n first bytes from binary properties. -1 for all bytes.")
                 .withOptionalArg().ofType(Long.class).defaultsTo(0L);
@@ -57,7 +58,7 @@ class CheckCommand implements Command {
         File dir = isValidFileStoreOrFail(new File(path.value(options)));
         String journalFileName = journal.value(options);
         boolean fullTraversal = options.has(deep);
-        long debugLevel = deep.value(options);
+        long debugLevel = notify.value(options);
         long binLen = bin.value(options);
 
         if (options.has(segment)) {

Modified: jackrabbit/oak/branches/1.6/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Check.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.6/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Check.java?rev=1782303&r1=1782302&r2=1782303&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.6/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Check.java (original)
+++ jackrabbit/oak/branches/1.6/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Check.java Thu Feb  9 10:18:37 2017
@@ -98,11 +98,11 @@ public class Check implements Runnable {
          * parameter is not required and defaults to an arbitrary large number.
          *
          * @param debugInterval number of seconds between successive debug print
-         *                      statements. It must be strictly positive.
+         *                      statements. It must be positive.
          * @return this builder.
          */
         public Builder withDebugInterval(long debugInterval) {
-            checkArgument(debugInterval > 0);
+            checkArgument(debugInterval >= 0);
             this.debugInterval = debugInterval;
             return this;
         }