Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
cad38ede
F
flink
项目概览
doujutun3207
/
flink
与 Fork 源项目一致
从无法访问的项目Fork
通知
24
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flink
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cad38ede
编写于
8月 25, 2014
作者:
J
jfeher
提交者:
Stephan Ewen
8月 29, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[streaming] connectors logging and deploy update
上级
0b721125
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
68 addition
and
9 deletion
+68
-9
flink-addons/flink-streaming/flink-streaming-connectors/pom.xml
...addons/flink-streaming/flink-streaming-connectors/pom.xml
+16
-0
flink-addons/flink-streaming/flink-streaming-connectors/src/main/java/org/apache/flink/streaming/connectors/flume/FlumeTopology.java
...pache/flink/streaming/connectors/flume/FlumeTopology.java
+16
-2
flink-addons/flink-streaming/flink-streaming-connectors/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTopology.java
...pache/flink/streaming/connectors/kafka/KafkaTopology.java
+15
-2
flink-addons/flink-streaming/flink-streaming-connectors/src/main/java/org/apache/flink/streaming/connectors/rabbitmq/RMQTopology.java
...ache/flink/streaming/connectors/rabbitmq/RMQTopology.java
+21
-5
未找到文件。
flink-addons/flink-streaming/flink-streaming-connectors/pom.xml
浏览文件 @
cad38ede
...
...
@@ -107,6 +107,22 @@ under the License.
</execution>
</executions>
</plugin>
<plugin>
<artifactId>
maven-assembly-plugin
</artifactId>
<executions>
<execution>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
...
...
flink-addons/flink-streaming/flink-streaming-connectors/src/main/java/org/apache/flink/streaming/connectors/flume/FlumeTopology.java
浏览文件 @
cad38ede
...
...
@@ -18,11 +18,14 @@
package
org.apache.flink.streaming.connectors.flume
;
import
org.apache.commons.lang.SerializationUtils
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.flink.streaming.api.datastream.DataStream
;
import
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
;
import
org.apache.flink.streaming.api.function.sink.SinkFunction
;
public
class
FlumeTopology
{
private
static
final
Log
LOG
=
LogFactory
.
getLog
(
FlumeTopology
.
class
);
public
static
class
MyFlumeSink
extends
FlumeSink
<
String
>
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -45,6 +48,17 @@ public class FlumeTopology {
}
public
static
final
class
MyFlumePrintSink
implements
SinkFunction
<
String
>
{
private
static
final
long
serialVersionUID
=
1L
;
@Override
public
void
invoke
(
String
value
)
{
LOG
.
info
(
"String: <"
+
value
+
"> arrived from Flume"
);
}
}
public
static
class
MyFlumeSource
extends
FlumeSource
<
String
>
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -70,7 +84,7 @@ public class FlumeTopology {
@SuppressWarnings
(
"unused"
)
DataStream
<
String
>
dataStream1
=
env
.
addSource
(
new
MyFlumeSource
(
"localhost"
,
41414
))
.
print
(
);
.
addSink
(
new
MyFlumePrintSink
()
);
@SuppressWarnings
(
"unused"
)
DataStream
<
String
>
dataStream2
=
env
...
...
flink-addons/flink-streaming/flink-streaming-connectors/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTopology.java
浏览文件 @
cad38ede
...
...
@@ -18,13 +18,17 @@
package
org.apache.flink.streaming.connectors.kafka
;
import
org.apache.flink.api.java.tuple.Tuple1
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.flink.streaming.api.datastream.DataStream
;
import
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
;
import
org.apache.flink.streaming.api.function.source.SourceFunction
;
import
org.apache.flink.util.Collector
;
import
org.apache.flink.streaming.api.function.sink.SinkFunction
;
public
class
KafkaTopology
{
private
static
final
Log
LOG
=
LogFactory
.
getLog
(
KafkaTopology
.
class
);
public
static
final
class
MySource
implements
SourceFunction
<
Tuple1
<
String
>>
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -72,6 +76,15 @@ public class KafkaTopology {
}
}
public
static
final
class
MyKafkaPrintSink
implements
SinkFunction
<
Tuple1
<
String
>>
{
private
static
final
long
serialVersionUID
=
1L
;
@Override
public
void
invoke
(
Tuple1
<
String
>
value
)
{
LOG
.
info
(
"String: "
+
value
+
" arrived from Kafka"
);
}
}
private
static
final
int
SOURCE_PARALELISM
=
1
;
...
...
@@ -82,7 +95,7 @@ public class KafkaTopology {
@SuppressWarnings
(
"unused"
)
DataStream
<
Tuple1
<
String
>>
stream1
=
env
.
addSource
(
new
MyKafkaSource
(
"localhost:2181"
,
"group"
,
"test"
,
1
),
SOURCE_PARALELISM
)
.
print
(
);
.
addSink
(
new
MyKafkaPrintSink
()
);
@SuppressWarnings
(
"unused"
)
DataStream
<
Tuple1
<
String
>>
stream2
=
env
...
...
flink-addons/flink-streaming/flink-streaming-connectors/src/main/java/org/apache/flink/streaming/connectors/rabbitmq/RMQTopology.java
浏览文件 @
cad38ede
...
...
@@ -17,12 +17,17 @@
package
org.apache.flink.streaming.connectors.rabbitmq
;
import
org.apache.commons.lang.SerializationUtils
;
import
org.apache.commons.lang.SerializationUtils
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.flink.streaming.api.datastream.DataStream
;
import
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
;
import
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
;
import
org.apache.flink.streaming.api.function.sink.SinkFunction
;
import
org.apache.flink.streaming.connectors.kafka.KafkaTopology
;
public
class
RMQTopology
{
private
static
final
Log
LOG
=
LogFactory
.
getLog
(
KafkaTopology
.
class
);
public
static
final
class
MyRMQSink
extends
RMQSink
<
String
>
{
public
MyRMQSink
(
String
HOST_NAME
,
String
QUEUE_NAME
)
{
super
(
HOST_NAME
,
QUEUE_NAME
);
...
...
@@ -39,7 +44,18 @@ public class RMQTopology {
}
}
public
static
final
class
MyRMQPrintSink
implements
SinkFunction
<
String
>
{
private
static
final
long
serialVersionUID
=
1L
;
@Override
public
void
invoke
(
String
value
)
{
LOG
.
info
(
"String: <"
+
value
+
"> arrived from RMQ"
);
}
}
public
static
final
class
MyRMQSource
extends
RMQSource
<
String
>
{
public
MyRMQSource
(
String
HOST_NAME
,
String
QUEUE_NAME
)
{
...
...
@@ -66,7 +82,7 @@ public class RMQTopology {
@SuppressWarnings
(
"unused"
)
DataStream
<
String
>
dataStream1
=
env
.
addSource
(
new
MyRMQSource
(
"localhost"
,
"hello"
))
.
print
(
);
.
addSink
(
new
MyRMQPrintSink
()
);
@SuppressWarnings
(
"unused"
)
DataStream
<
String
>
dataStream2
=
env
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录