Revision GC command line tool
Log exception when the command fails
@@ -52,6 +52,7 @@ import org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector.Versio
import org.apache.jackrabbit.oak.run.commons.Command;
import org.apache.jackrabbit.oak.plugins.document.VersionGCOptions;
import org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector;
+import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static java.util.concurrent.TimeUnit.SECONDS;
@@ -68,6 +69,8 @@ import static org.apache.jackrabbit.oak.run.Utils.createDocumentMKBuilder;
*/
public class RevisionsCommand implements Command {
+ private static final Logger LOG = LoggerFactory.getLogger(RevisionsCommand.class);
+
private static final String USAGE = Joiner.on(System.lineSeparator()).join(
"revisions {<jdbc-uri> | <mongodb-uri>} <sub-command> [options]",
"where sub-command is one of",
@@ -181,6 +184,7 @@ public class RevisionsCommand implements Command {
System.err.println("unknown revisions command: " + subCmd);
}
} catch (Throwable e) {
+ LOG.error("Command failed", e);
throw closer.rethrow(e);
} finally {
closer.close();
