flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmetz...@apache.org
Subject flink git commit: [hotfix][examples] Remove System.exit() from Kafka example
Date Mon, 04 Apr 2016 13:31:13 GMT
Repository: flink
Updated Branches:
  refs/heads/master 0dbe05dce -> 93d9384a4


[hotfix][examples] Remove System.exit() from Kafka example


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/93d9384a
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/93d9384a
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/93d9384a

Branch: refs/heads/master
Commit: 93d9384a45a1e7d282216d69ead9048077126ce3
Parents: 0dbe05d
Author: Robert Metzger <rmetzger@apache.org>
Authored: Mon Apr 4 12:11:03 2016 +0200
Committer: Robert Metzger <rmetzger@apache.org>
Committed: Mon Apr 4 15:30:34 2016 +0200

----------------------------------------------------------------------
 .../flink/streaming/examples/kafka/ReadFromKafka.java       | 9 +++++----
 .../flink/streaming/examples/kafka/WriteIntoKafka.java      | 8 ++++----
 2 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/93d9384a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/kafka/ReadFromKafka.java
----------------------------------------------------------------------
diff --git a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/kafka/ReadFromKafka.java
b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/kafka/ReadFromKafka.java
index 0b6e7f7..2a8536e 100644
--- a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/kafka/ReadFromKafka.java
+++ b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/kafka/ReadFromKafka.java
@@ -30,7 +30,7 @@ import org.apache.flink.streaming.util.serialization.SimpleStringSchema;
  * Note: On a cluster, DataStream.print() will print to the TaskManager's .out file!
  *
  * Please pass the following arguments to run the example:
- * 	--topic test --bootstrap.servers localhost:9092 --group.id myconsumer
+ * 	--topic test --bootstrap.servers localhost:9092 --zookeeper.connect localhost:2181 --group.id
myconsumer
  *
  */
 public class ReadFromKafka {
@@ -39,9 +39,10 @@ public class ReadFromKafka {
 		// parse input arguments
 		final ParameterTool parameterTool = ParameterTool.fromArgs(args);
 
-		if(parameterTool.getNumberOfParameters() < 3) {
-			System.out.println("Missing parameters!\nUsage: Kafka --topic <topic> --bootstrap.servers
<kafka brokers> --group.id <some id>");
-			System.exit(1);
+		if(parameterTool.getNumberOfParameters() < 4) {
+			System.out.println("Missing parameters!\nUsage: Kafka --topic <topic> " +
+					"--bootstrap.servers <kafka brokers> --zookeeper.connect <zk quorum> --group.id
<some id>");
+			return;
 		}
 
 		StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

http://git-wip-us.apache.org/repos/asf/flink/blob/93d9384a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/kafka/WriteIntoKafka.java
----------------------------------------------------------------------
diff --git a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/kafka/WriteIntoKafka.java
b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/kafka/WriteIntoKafka.java
index a44cbd2..63b37c4 100644
--- a/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/kafka/WriteIntoKafka.java
+++ b/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/kafka/WriteIntoKafka.java
@@ -30,17 +30,17 @@ import org.apache.flink.streaming.util.serialization.SimpleStringSchema;
  * Generate a String every 500 ms and write it into a Kafka topic
  *
  * Please pass the following arguments to run the example:
- * 	--topic test --bootstrap.servers localhost:9092 --zookeeper.connect localhost:2181
+ * 	--topic test --bootstrap.servers localhost:9092
  *
  */
 public class WriteIntoKafka {
 
 	public static void main(String[] args) throws Exception {
 		ParameterTool parameterTool = ParameterTool.fromArgs(args);
-		if(parameterTool.getNumberOfParameters() < 3) {
+		if(parameterTool.getNumberOfParameters() < 2) {
 			System.out.println("Missing parameters!");
-			System.out.println("Usage: Kafka --topic <topic> --bootstrap.servers <kafka brokers>
--zookeeper.connect <zk quorum>");
-			System.exit(1);
+			System.out.println("Usage: Kafka --topic <topic> --bootstrap.servers <kafka brokers>");
+			return;
 		}
 
 		StreamExecutionEnvironment env =StreamExecutionEnvironment.getExecutionEnvironment();


Mime
View raw message