kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkr...@apache.org
Subject [27/30] git commit: remove ProducerShell; patched by Jun Rao; reviewed by Neha Narkhede; KAFKA-638
Date Tue, 18 Dec 2012 17:44:12 GMT
remove ProducerShell; patched by Jun Rao; reviewed by Neha Narkhede; KAFKA-638

git-svn-id: https://svn.apache.org/repos/asf/kafka/branches/0.8@1415002 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/7b2d9c33
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/7b2d9c33
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/7b2d9c33

Branch: refs/heads/trunk
Commit: 7b2d9c33126f21efa06d2b2f9f275c66fbaac078
Parents: bdb04bb
Author: Jun Rao <junrao@apache.org>
Authored: Thu Nov 29 00:03:13 2012 +0000
Committer: Jun Rao <junrao@apache.org>
Committed: Thu Nov 29 00:03:13 2012 +0000

----------------------------------------------------------------------
 bin/kafka-producer-shell.sh                        |   17 ----
 .../src/main/scala/kafka/tools/ProducerShell.scala |   71 ---------------
 2 files changed, 0 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/7b2d9c33/bin/kafka-producer-shell.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-producer-shell.sh b/bin/kafka-producer-shell.sh
deleted file mode 100755
index 3f75a34..0000000
--- a/bin/kafka-producer-shell.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-# 
-#    http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-$(dirname $0)/kafka-run-class.sh kafka.tools.ProducerShell $@

http://git-wip-us.apache.org/repos/asf/kafka/blob/7b2d9c33/core/src/main/scala/kafka/tools/ProducerShell.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/ProducerShell.scala b/core/src/main/scala/kafka/tools/ProducerShell.scala
deleted file mode 100644
index 09b279f..0000000
--- a/core/src/main/scala/kafka/tools/ProducerShell.scala
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package kafka.tools
-
-import java.io._
-import joptsimple._
-import kafka.producer._
-import kafka.utils.Utils
-
-/**
- * Interactive shell for producing messages from the command line
- */
-object ProducerShell {
-
-  def main(args: Array[String]) {
-    
-    val parser = new OptionParser
-    val producerPropsOpt = parser.accepts("props", "REQUIRED: Properties file with the producer
properties.")
-                           .withRequiredArg
-                           .describedAs("properties")
-                           .ofType(classOf[String])
-    val topicOpt = parser.accepts("topic", "REQUIRED: The topic to produce to.")
-                           .withRequiredArg
-                           .describedAs("topic")
-                           .ofType(classOf[String])
-    
-    val options = parser.parse(args : _*)
-    
-    for(arg <- List(producerPropsOpt, topicOpt)) {
-      if(!options.has(arg)) {
-        System.err.println("Missing required argument \"" + arg + "\"") 
-        parser.printHelpOn(System.err)
-        System.exit(1)
-      }
-    }
-    
-    val propsFile = options.valueOf(producerPropsOpt)
-    val producerConfig = new ProducerConfig(Utils.loadProps(propsFile))
-    val topic = options.valueOf(topicOpt)
-    val producer = new Producer[String, String](producerConfig)
-
-    val input = new BufferedReader(new InputStreamReader(System.in))
-    var done = false
-    while(!done) {
-      val line = input.readLine()
-      if(line == null) {
-        done = true
-      } else {
-        val message = line.trim
-        producer.send(new KeyedMessage[String, String](topic, message))
-        println("Sent: %s (%d bytes)".format(line, message.getBytes.length))
-      }
-    }
-    producer.close()
-  }
-}


Mime
View raw message