Skip to content

Commit 8226c26

Browse files
authored
Merge pull request #178 from InterestingLab/rickyhuo.enhance.kafka
Rickyhuo.enhance.kafka
2 parents 738353c + 048abad commit 8226c26

File tree

6 files changed

+6
-20
lines changed

6 files changed

+6
-20
lines changed

build.sbt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ assemblyMergeStrategy in assembly := {
1616
case "META-INF/ECLIPSEF.RSA" => MergeStrategy.last
1717
case "META-INF/mailcap" => MergeStrategy.last
1818
case "META-INF/mimetypes.default" => MergeStrategy.last
19-
case "SimpleLog.class" => MergeStrategy.last
2019
case PathList(ps @ _*) if ps.last endsWith ".html" => MergeStrategy.first
21-
case "UnusedStubClass.class" => MergeStrategy.last
20+
case PathList(ps @ _*) if ps.last endsWith ".class" => MergeStrategy.first
2221
case x =>
2322
val oldStrategy = (assemblyMergeStrategy in assembly).value
2423
oldStrategy(x)

docs/en/configuration/_sidebar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- [Fake](/en/configuration/input-plugins/Fake)
88
- [File](/en/configuration/input-plugins/File)
99
- [Hdfs](/en/configuration/input-plugins/Hdfs)
10-
- [Kafka](/en/configuration/input-plugins/Kafka)
10+
- [KafkaStream](/en/configuration/input-plugins/KafkaStream)
1111
- [S3](/en/configuration/input-plugins/S3)
1212
- [Socket](/en/configuration/input-plugins/Socket)
1313
- [Filter Plugin](/en/configuration/filter-plugin)

docs/en/configuration/input-plugins/Kafka.md renamed to docs/en/configuration/input-plugins/KafkaStream.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ This plugin uses Kafka Old Consumer. Supporting Kafka >= 0.8.2.X
1717
| --- | --- | --- | --- |
1818
| [topics](#topics-string) | string | yes | - |
1919
| [consumer.group.id](#consumergroupid-string) | string | yes | - |
20-
| [consumer.zookeeper.connect](#consumerzookeeperconnect-string) | string | yes | - |
2120
| [consumer.bootstrap.servers](#consumerbootstrapservers-string) | string | yes | - |
2221
| [consumer.*](#consumer-string) | string | no | - |
2322

@@ -29,10 +28,6 @@ Kafka topic. Multiple topics separated by commas. For example, "tpc1,tpc2".
2928

3029
Kafka consumer group id, a unique string that identifies the consumer group this consumer belongs to.
3130

32-
##### consumer.zookeeper.connect [string]
33-
34-
Specifies the ZooKeeper connection string in the form `hostname:port` where host and port are the host and port of a ZooKeeper server
35-
3631
##### consumer.bootstrap.servers [string]
3732

3833
A list of host/port pairs to use for establishing the initial connection to the Kafka cluster.This string should be in the form `host1:port1,host2:port2,.... `
@@ -50,7 +45,6 @@ The way to specify parameters is to use the prefix "consumer" before the paramet
5045
kafka {
5146
topics = "waterdrop"
5247
consumer.bootstrap.servers = "localhost:9092"
53-
consumer.zookeeper.connect = "localhost:2181"
5448
consumer.group.id = "waterdrop_group"
5549
consumer.rebalance.max.retries = 100
5650
}

docs/zh-cn/configuration/input-plugins/KafkaStream.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Kafka Input实现Kafka的Old Consumer客户端, 从Kafka消费数据。支持的
1515
| --- | --- | --- | --- |
1616
| [topics](#topics-string) | string | yes | - |
1717
| [consumer.group.id](#consumergroupid-string) | string | yes | - |
18-
| [consumer.zookeeper.connect](#consumerzookeeperconnect-string) | string | yes | - |
1918
| [consumer.bootstrap.servers](#consumerbootstrapservers-string) | string | yes | - |
2019
| [consumer.*](#consumer-string) | string | no | - |
2120

@@ -27,10 +26,6 @@ Kafka topic名称。如果有多个topic,用","分割,例如: "tpc1,tpc2"。
2726

2827
Kafka consumer group id,用于区分不同的消费组。
2928

30-
##### consumer.zookeeper.connect [string]
31-
32-
Kafka集群的Zookeeper地址
33-
3429
##### consumer.bootstrap.servers [string]
3530

3631
Kafka集群地址,多个用","隔开
@@ -47,7 +42,6 @@ Kafka集群地址,多个用","隔开
4742
kafkaStream {
4843
topics = "waterdrop"
4944
consumer.bootstrap.servers = "localhost:9092"
50-
consumer.zookeeper.connect = "localhost:2181"
5145
consumer.group.id = "waterdrop_group"
5246
consumer.rebalance.max.retries = 100
5347
}

waterdrop-core/build.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ providedDeps match {
3030
libraryDependencies ++= Seq(
3131

3232
"org.apache.spark" %% "spark-streaming-kafka-0-10" % sparkVersion
33-
exclude("org.spark-project.spark", "unused"),
33+
exclude("org.spark-project.spark", "unused")
34+
exclude("net.jpountz.lz4", "unused"),
3435
"com.typesafe" % "config" % "1.3.1",
3536
"com.alibaba" % "QLExpress" % "3.2.0",
3637
"com.alibaba" % "fastjson" % "1.2.47",

waterdrop-core/src/main/scala/io/github/interestinglab/waterdrop/input/KafkaStream.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,11 @@ class KafkaStream extends BaseStreamingInput {
3535
config.hasPath("topics") match {
3636
case true => {
3737
val consumerConfig = config.getConfig(consumerPrefix)
38-
consumerConfig.hasPath("zookeeper.connect") &&
39-
!consumerConfig.getString("zookeeper.connect").trim.isEmpty &&
40-
consumerConfig.hasPath("group.id") &&
38+
consumerConfig.hasPath("group.id") &&
4139
!consumerConfig.getString("group.id").trim.isEmpty match {
4240
case true => (true, "")
4341
case false =>
44-
(false, "please specify [consumer.zookeeper.connect] and [consumer.group.id] as non-empty string")
42+
(false, "please specify [consumer.group.id] as non-empty string")
4543
}
4644
}
4745
case false => (false, "please specify [topics] as non-empty string, multiple topics separated by \",\"")

0 commit comments

Comments
 (0)