You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ju...@apache.org on 2013/03/06 18:26:02 UTC
git commit: Use withRequiredArg while parsing jopt options in all
tools; patched by Swapnil Ghike; reviewed by Jun Rao; kafka-786
Updated Branches:
refs/heads/0.8 a971a27b5 -> 2e64c6a5f
Use withRequiredArg while parsing jopt options in all tools; patched by Swapnil Ghike; reviewed by Jun Rao; kafka-786
Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/2e64c6a5
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/2e64c6a5
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/2e64c6a5
Branch: refs/heads/0.8
Commit: 2e64c6a5f221c616b2ac222fdadb96618f65e1ec
Parents: a971a27
Author: Swapnil Ghike <sg...@linkedin.com>
Authored: Wed Mar 6 09:21:56 2013 -0800
Committer: Jun Rao <ju...@gmail.com>
Committed: Wed Mar 6 09:21:56 2013 -0800
----------------------------------------------------------------------
.../main/scala/kafka/tools/DumpLogSegments.scala | 10 ----------
core/src/main/scala/kafka/tools/JmxTool.scala | 4 ++--
.../scala/kafka/tools/SimpleConsumerShell.scala | 8 ++------
.../kafka/perf/SimpleConsumerPerformance.scala | 2 +-
4 files changed, 5 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kafka/blob/2e64c6a5/core/src/main/scala/kafka/tools/DumpLogSegments.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/DumpLogSegments.scala b/core/src/main/scala/kafka/tools/DumpLogSegments.scala
index 31333e7..1bed554 100644
--- a/core/src/main/scala/kafka/tools/DumpLogSegments.scala
+++ b/core/src/main/scala/kafka/tools/DumpLogSegments.scala
@@ -30,17 +30,7 @@ object DumpLogSegments {
def main(args: Array[String]) {
val parser = new OptionParser
val printOpt = parser.accepts("print-data-log", "if set, printing the messages content when dumping data logs")
- .withOptionalArg
- .describedAs("print data log content")
- .ofType(classOf[java.lang.Boolean])
- .defaultsTo(false)
-
val verifyOpt = parser.accepts("verify-index-only", "if set, just verify the index log without printing its content")
- .withOptionalArg
- .describedAs("just verify the index log")
- .ofType(classOf[java.lang.Boolean])
- .defaultsTo(false)
-
val filesOpt = parser.accepts("files", "REQUIRED: The comma separated list of data and index log files to be dumped")
.withRequiredArg
.describedAs("file1, file2, ...")
http://git-wip-us.apache.org/repos/asf/kafka/blob/2e64c6a5/core/src/main/scala/kafka/tools/JmxTool.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/JmxTool.scala b/core/src/main/scala/kafka/tools/JmxTool.scala
index 4bfac53..7e424e7 100644
--- a/core/src/main/scala/kafka/tools/JmxTool.scala
+++ b/core/src/main/scala/kafka/tools/JmxTool.scala
@@ -43,7 +43,7 @@ object JmxTool extends Logging {
val attributesOpt =
parser.accepts("attributes", "The whitelist of attributes to query. This is a comma-separated list. If no " +
"attributes are specified all objects will be queried.")
- .withOptionalArg()
+ .withRequiredArg
.describedAs("name")
.ofType(classOf[String])
val reportingIntervalOpt = parser.accepts("reporting-interval", "Interval in MS with which to poll jmx stats.")
@@ -54,7 +54,7 @@ object JmxTool extends Logging {
val helpOpt = parser.accepts("help", "Print usage information.")
val dateFormatOpt = parser.accepts("date-format", "The date format to use for formatting the time field. " +
"See java.text.SimpleDateFormat for options.")
- .withOptionalArg()
+ .withRequiredArg
.describedAs("format")
.ofType(classOf[String])
val jmxServiceUrlOpt =
http://git-wip-us.apache.org/repos/asf/kafka/blob/2e64c6a5/core/src/main/scala/kafka/tools/SimpleConsumerShell.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/SimpleConsumerShell.scala b/core/src/main/scala/kafka/tools/SimpleConsumerShell.scala
index d8127a8..8cdbb00 100644
--- a/core/src/main/scala/kafka/tools/SimpleConsumerShell.scala
+++ b/core/src/main/scala/kafka/tools/SimpleConsumerShell.scala
@@ -54,12 +54,12 @@ object SimpleConsumerShell extends Logging {
.ofType(classOf[java.lang.Integer])
.defaultsTo(UseLeaderReplica)
val offsetOpt = parser.accepts("offset", "The offset id to consume from, default to -2 which means from beginning; while value -1 means from end")
- .withOptionalArg()
+ .withRequiredArg
.describedAs("consume offset")
.ofType(classOf[java.lang.Long])
.defaultsTo(OffsetRequest.EarliestTime)
val clientIdOpt = parser.accepts("clientId", "The ID of this client.")
- .withOptionalArg
+ .withRequiredArg
.describedAs("clientId")
.ofType(classOf[String])
.defaultsTo("SimpleConsumerShell")
@@ -78,10 +78,6 @@ object SimpleConsumerShell extends Logging {
.describedAs("prop")
.ofType(classOf[String])
val printOffsetOpt = parser.accepts("print-offsets", "Print the offsets returned by the iterator")
- .withOptionalArg
- .describedAs("print offsets")
- .ofType(classOf[java.lang.Boolean])
- .defaultsTo(false)
val maxWaitMsOpt = parser.accepts("max-wait-ms", "The max amount of time each fetch request waits.")
.withRequiredArg
.describedAs("ms")
http://git-wip-us.apache.org/repos/asf/kafka/blob/2e64c6a5/perf/src/main/scala/kafka/perf/SimpleConsumerPerformance.scala
----------------------------------------------------------------------
diff --git a/perf/src/main/scala/kafka/perf/SimpleConsumerPerformance.scala b/perf/src/main/scala/kafka/perf/SimpleConsumerPerformance.scala
index 9c9eead..c52ada0 100644
--- a/perf/src/main/scala/kafka/perf/SimpleConsumerPerformance.scala
+++ b/perf/src/main/scala/kafka/perf/SimpleConsumerPerformance.scala
@@ -134,7 +134,7 @@ object SimpleConsumerPerformance {
.ofType(classOf[java.lang.Integer])
.defaultsTo(1024*1024)
val clientIdOpt = parser.accepts("clientId", "The ID of this client.")
- .withOptionalArg
+ .withRequiredArg
.describedAs("clientId")
.ofType(classOf[String])
.defaultsTo("SimpleConsumerPerformanceClient")