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/02 12:38:26 UTC

svn commit: r1781379 - in /jackrabbit/oak/trunk: oak-doc/src/site/markdown/nodestore/segment/overview.md oak-run/src/main/java/org/apache/jackrabbit/oak/run/CheckCommand.java oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Check.java

Author: adulceanu
Date: Thu Feb  2 12:38:26 2017
New Revision: 1781379

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

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
    jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Check.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=1781379&r1=1781378&r2=1781379&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 Thu Feb  2 12:38:26 2017
@@ -531,7 +531,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. 
@@ -542,9 +542,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/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=1781379&r1=1781378&r2=1781379&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 Thu Feb  2 12:38:26 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/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Check.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Check.java?rev=1781379&r1=1781378&r2=1781379&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Check.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Check.java Thu Feb  2 12:38:26 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;
         }