Few minor improvements to Elephas stats demo - If zero arguments are passed show the usage summary - Upgrade airline to latest version which gives improved built-in help - Consistency corrections to long form options - Minor typos in option descriptions - Typo in command description
Project: http://git-wip-us.apache.org/repos/asf/jena/repo Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/00ff8780 Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/00ff8780 Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/00ff8780 Branch: refs/heads/eliminate-assignments Commit: 00ff87809c5dc0bfc61fe4993aceff628c75c3c0 Parents: 49fe906 Author: Rob Vesse <[email protected]> Authored: Tue Feb 17 12:17:47 2015 +0000 Committer: Rob Vesse <[email protected]> Committed: Tue Feb 17 12:17:47 2015 +0000 ---------------------------------------------------------------------- .../java/org/apache/jena/hadoop/rdf/stats/RdfStats.java | 12 ++++++++---- jena-elephas/pom.xml | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jena/blob/00ff8780/jena-elephas/jena-elephas-stats/src/main/java/org/apache/jena/hadoop/rdf/stats/RdfStats.java ---------------------------------------------------------------------- diff --git a/jena-elephas/jena-elephas-stats/src/main/java/org/apache/jena/hadoop/rdf/stats/RdfStats.java b/jena-elephas/jena-elephas-stats/src/main/java/org/apache/jena/hadoop/rdf/stats/RdfStats.java index e31c801..3c9e896 100644 --- a/jena-elephas/jena-elephas-stats/src/main/java/org/apache/jena/hadoop/rdf/stats/RdfStats.java +++ b/jena-elephas/jena-elephas-stats/src/main/java/org/apache/jena/hadoop/rdf/stats/RdfStats.java @@ -49,7 +49,7 @@ import org.apache.jena.hadoop.rdf.stats.jobs.JobFactory; * Entry point for the Hadoop job, handles launching all the relevant Hadoop * jobs */ -@Command(name = "bin/hadoop jar PATH_TO_JAR com.yarcdata.urika.hadoop.rdf.stats.RdfStats", description = "A command which computes statistics on RDF data using Hadoop") +@Command(name = "hadoop jar PATH_TO_JAR org.apache.jena.hadoop.rdf.stats.RdfStats", description = "A command which computes statistics on RDF data using Hadoop") public class RdfStats implements Tool { static final String ANSI_RED = "\u001B[31m"; @@ -84,7 +84,7 @@ public class RdfStats implements Tool { /** * Gets/Sets whether type counts will be calculated */ - @Option(name = { "-t", "--type-counts" }, description = "Requests that rdf:type usage counts be calculated") + @Option(name = { "-t", "--type-count" }, description = "Requests that rdf:type usage counts be calculated") public boolean typeCount = false; /** @@ -105,7 +105,7 @@ public class RdfStats implements Tool { /** * Gets/Sets the input data type used */ - @Option(name = { "--input-type" }, allowedValues = { DATA_TYPE_MIXED, DATA_TYPE_QUADS, DATA_TYPE_TRIPLES }, description = "Specifies whether the input data is a mixture of quads and triples, just quads or just triples. Using the most specific data type will yield the most accurrate statistics") + @Option(name = { "--input-type" }, allowedValues = { DATA_TYPE_MIXED, DATA_TYPE_QUADS, DATA_TYPE_TRIPLES }, description = "Specifies whether the input data is a mixture of quads and triples, just quads or just triples. Using the most specific data type will yield the most accurate statistics") public String inputType = DATA_TYPE_MIXED; /** @@ -165,12 +165,16 @@ public class RdfStats implements Tool { @Override public int run(String[] args) throws Exception { try { + if (args.length == 0) { + showUsage(); + } + // Parse custom arguments RdfStats cmd = SingleCommand.singleCommand(RdfStats.class).parse(args); // Copy Hadoop configuration across cmd.setConf(this.getConf()); - + // Show help if requested and exit with success if (cmd.helpOption.showHelpIfRequested()) { return 0; http://git-wip-us.apache.org/repos/asf/jena/blob/00ff8780/jena-elephas/pom.xml ---------------------------------------------------------------------- diff --git a/jena-elephas/pom.xml b/jena-elephas/pom.xml index 4d82b5f..eecaebc 100644 --- a/jena-elephas/pom.xml +++ b/jena-elephas/pom.xml @@ -38,7 +38,7 @@ <arq.version>2.13.0-SNAPSHOT</arq.version> <junit.version>4.11</junit.version> <mrunit.version>1.0.0</mrunit.version> - <airline.version>0.8</airline.version> + <airline.version>0.9.1</airline.version> </properties> <!-- Profiles to allow building for different Hadoop versions -->
