Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
3b787e29
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,发现更多精彩内容 >>
提交
3b787e29
编写于
7月 14, 2014
作者:
G
gyfora
提交者:
Stephan Ewen
8月 18, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[streaming] api cleanup
上级
75431b7d
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
56 addition
and
59 deletion
+56
-59
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/JobGraphBuilder.java
...n/java/eu/stratosphere/streaming/api/JobGraphBuilder.java
+13
-0
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamcomponent/StreamInvokableComponent.java
...reaming/api/streamcomponent/StreamInvokableComponent.java
+5
-1
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamrecord/StreamRecord.java
...stratosphere/streaming/api/streamrecord/StreamRecord.java
+5
-1
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/basictopology/BasicTopology.java
...phere/streaming/examples/basictopology/BasicTopology.java
+12
-39
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/ml/IncrementalLearningSkeleton.java
...re/streaming/examples/ml/IncrementalLearningSkeleton.java
+5
-5
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/ml/IncrementalOLS.java
...eu/stratosphere/streaming/examples/ml/IncrementalOLS.java
+5
-5
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/wordcount/WordCountCounter.java
...sphere/streaming/examples/wordcount/WordCountCounter.java
+1
-0
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/wordcount/WordCountRemote.java
...osphere/streaming/examples/wordcount/WordCountRemote.java
+1
-0
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/wordcount/WordCountSink.java
...atosphere/streaming/examples/wordcount/WordCountSink.java
+1
-0
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/wordcount/WordCountSource.java
...osphere/streaming/examples/wordcount/WordCountSource.java
+1
-0
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/wordcount/WordCountSplitter.java
...phere/streaming/examples/wordcount/WordCountSplitter.java
+1
-0
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/rabbitmq/RMQSource.java
...in/java/eu/stratosphere/streaming/rabbitmq/RMQSource.java
+1
-1
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/rabbitmq/RMQTopology.java
.../java/eu/stratosphere/streaming/rabbitmq/RMQTopology.java
+1
-2
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/util/PerformanceTracker.java
...va/eu/stratosphere/streaming/util/PerformanceTracker.java
+4
-0
flink-addons/flink-streaming/src/test/java/eu/stratosphere/streaming/api/streamcomponent/StreamComponentTest.java
...re/streaming/api/streamcomponent/StreamComponentTest.java
+0
-5
未找到文件。
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/JobGraphBuilder.java
浏览文件 @
3b787e29
...
@@ -69,6 +69,8 @@ public class JobGraphBuilder {
...
@@ -69,6 +69,8 @@ public class JobGraphBuilder {
*
*
* @param jobGraphName
* @param jobGraphName
* Name of the JobGraph
* Name of the JobGraph
* @param faultToleranceType
* Fault tolerance type
*/
*/
public
JobGraphBuilder
(
String
jobGraphName
,
FaultToleranceType
faultToleranceType
)
{
public
JobGraphBuilder
(
String
jobGraphName
,
FaultToleranceType
faultToleranceType
)
{
jobGraph
=
new
JobGraph
(
jobGraphName
);
jobGraph
=
new
JobGraph
(
jobGraphName
);
...
@@ -81,6 +83,17 @@ public class JobGraphBuilder {
...
@@ -81,6 +83,17 @@ public class JobGraphBuilder {
this
.
faultToleranceType
=
faultToleranceType
;
this
.
faultToleranceType
=
faultToleranceType
;
}
}
/**
* Creates a new JobGraph with the given name with fault tolerance turned
* off
*
* @param jobGraphName
* Name of the JobGraph
*/
public
JobGraphBuilder
(
String
jobGraphName
)
{
this
(
jobGraphName
,
FaultToleranceType
.
NONE
);
}
/**
/**
* Adds a source component to the JobGraph with no parallelism
* Adds a source component to the JobGraph with no parallelism
*
*
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamcomponent/StreamInvokableComponent.java
浏览文件 @
3b787e29
...
@@ -52,6 +52,10 @@ public abstract class StreamInvokableComponent implements Serializable {
...
@@ -52,6 +52,10 @@ public abstract class StreamInvokableComponent implements Serializable {
this
.
useFaultTolerance
=
faultToleranceType
!=
FaultToleranceType
.
NONE
;
this
.
useFaultTolerance
=
faultToleranceType
!=
FaultToleranceType
.
NONE
;
}
}
public
final
void
setPerfCounterDir
(
String
dir
)
{
performanceCounter
.
setFname
(
dir
+
"/"
+
name
+
channelID
);
}
public
final
void
emit
(
StreamRecord
record
)
{
public
final
void
emit
(
StreamRecord
record
)
{
record
.
setId
(
channelID
);
record
.
setId
(
channelID
);
...
@@ -69,7 +73,7 @@ public abstract class StreamInvokableComponent implements Serializable {
...
@@ -69,7 +73,7 @@ public abstract class StreamInvokableComponent implements Serializable {
if
(
useFaultTolerance
)
{
if
(
useFaultTolerance
)
{
emittedRecords
.
failRecord
(
record
.
getId
());
emittedRecords
.
failRecord
(
record
.
getId
());
}
}
log
.
warn
(
"FAILED: "
+
record
.
getId
()
+
" -- "
+
name
+
" -- due to "
log
.
warn
(
"FAILED: "
+
record
.
getId
()
+
" -- "
+
name
+
" -- due to "
+
e
.
getClass
().
getSimpleName
());
+
e
.
getClass
().
getSimpleName
());
}
}
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamrecord/StreamRecord.java
浏览文件 @
3b787e29
...
@@ -1324,8 +1324,12 @@ public class StreamRecord implements IOReadableWritable, Serializable {
...
@@ -1324,8 +1324,12 @@ public class StreamRecord implements IOReadableWritable, Serializable {
public
String
toString
()
{
public
String
toString
()
{
StringBuilder
outputString
=
new
StringBuilder
(
"["
);
StringBuilder
outputString
=
new
StringBuilder
(
"["
);
String
prefix
=
""
;
for
(
Tuple
tuple
:
tupleBatch
)
{
for
(
Tuple
tuple
:
tupleBatch
)
{
outputString
.
append
(
tuple
+
","
);
outputString
.
append
(
prefix
);
prefix
=
","
;
outputString
.
append
(
tuple
.
toString
());
}
}
outputString
.
append
(
"]"
);
outputString
.
append
(
"]"
);
return
outputString
.
toString
();
return
outputString
.
toString
();
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/basictopology/BasicTopology.java
浏览文件 @
3b787e29
...
@@ -14,14 +14,9 @@
...
@@ -14,14 +14,9 @@
**********************************************************************************************************************/
**********************************************************************************************************************/
package
eu.stratosphere.streaming.examples.basictopology
;
package
eu.stratosphere.streaming.examples.basictopology
;
import
java.net.InetSocketAddress
;
import
org.apache.log4j.Level
;
import
org.apache.log4j.Level
;
import
eu.stratosphere.api.java.tuple.Tuple1
;
import
eu.stratosphere.api.java.tuple.Tuple1
;
import
eu.stratosphere.client.minicluster.NepheleMiniCluster
;
import
eu.stratosphere.client.program.Client
;
import
eu.stratosphere.configuration.Configuration
;
import
eu.stratosphere.nephele.jobgraph.JobGraph
;
import
eu.stratosphere.nephele.jobgraph.JobGraph
;
import
eu.stratosphere.streaming.api.JobGraphBuilder
;
import
eu.stratosphere.streaming.api.JobGraphBuilder
;
import
eu.stratosphere.streaming.api.invokable.UserSinkInvokable
;
import
eu.stratosphere.streaming.api.invokable.UserSinkInvokable
;
...
@@ -29,12 +24,14 @@ import eu.stratosphere.streaming.api.invokable.UserSourceInvokable;
...
@@ -29,12 +24,14 @@ import eu.stratosphere.streaming.api.invokable.UserSourceInvokable;
import
eu.stratosphere.streaming.api.invokable.UserTaskInvokable
;
import
eu.stratosphere.streaming.api.invokable.UserTaskInvokable
;
import
eu.stratosphere.streaming.api.streamrecord.StreamRecord
;
import
eu.stratosphere.streaming.api.streamrecord.StreamRecord
;
import
eu.stratosphere.streaming.faulttolerance.FaultToleranceType
;
import
eu.stratosphere.streaming.faulttolerance.FaultToleranceType
;
import
eu.stratosphere.streaming.util.ClusterUtil
;
import
eu.stratosphere.streaming.util.LogUtils
;
import
eu.stratosphere.streaming.util.LogUtils
;
public
class
BasicTopology
{
public
class
BasicTopology
{
public
static
class
BasicSource
extends
UserSourceInvokable
{
public
static
class
BasicSource
extends
UserSourceInvokable
{
private
static
final
long
serialVersionUID
=
1L
;
StreamRecord
record
=
new
StreamRecord
(
new
Tuple1
<
String
>(
"streaming"
));
StreamRecord
record
=
new
StreamRecord
(
new
Tuple1
<
String
>(
"streaming"
));
@Override
@Override
...
@@ -50,6 +47,7 @@ public class BasicTopology {
...
@@ -50,6 +47,7 @@ public class BasicTopology {
}
}
public
static
class
BasicTask
extends
UserTaskInvokable
{
public
static
class
BasicTask
extends
UserTaskInvokable
{
private
static
final
long
serialVersionUID
=
1L
;
@Override
@Override
public
void
invoke
(
StreamRecord
record
)
throws
Exception
{
public
void
invoke
(
StreamRecord
record
)
throws
Exception
{
...
@@ -61,19 +59,20 @@ public class BasicTopology {
...
@@ -61,19 +59,20 @@ public class BasicTopology {
}
}
public
static
class
BasicSink
extends
UserSinkInvokable
{
public
static
class
BasicSink
extends
UserSinkInvokable
{
private
static
final
long
serialVersionUID
=
1L
;
@Override
@Override
public
void
invoke
(
StreamRecord
record
)
throws
Exception
{
public
void
invoke
(
StreamRecord
record
)
throws
Exception
{
// do nothing
// do nothing
record
.
getField
(
0
);
System
.
out
.
println
(
record
.
getField
(
0
)
);
}
}
}
}
private
static
JobGraph
getJobGraph
()
throws
Exception
{
private
static
JobGraph
getJobGraph
()
{
JobGraphBuilder
graphBuilder
=
new
JobGraphBuilder
(
"BasicStreamingTopology"
,
FaultToleranceType
.
NONE
);
JobGraphBuilder
graphBuilder
=
new
JobGraphBuilder
(
"BasicStreamingTopology"
);
graphBuilder
.
setSource
(
"BasicSource"
,
BasicSource
.
class
,
1
,
1
);
graphBuilder
.
setSource
(
"BasicSource"
,
new
BasicSource
()
,
1
,
1
);
graphBuilder
.
setTask
(
"BasicTask"
,
BasicTask
.
class
,
1
,
1
);
graphBuilder
.
setTask
(
"BasicTask"
,
new
BasicTask
()
,
1
,
1
);
graphBuilder
.
setSink
(
"BasicSink"
,
BasicSink
.
class
,
1
,
1
);
graphBuilder
.
setSink
(
"BasicSink"
,
new
BasicSink
()
,
1
,
1
);
graphBuilder
.
shuffleConnect
(
"BasicSource"
,
"BasicTask"
);
graphBuilder
.
shuffleConnect
(
"BasicSource"
,
"BasicTask"
);
graphBuilder
.
shuffleConnect
(
"BasicTask"
,
"BasicSink"
);
graphBuilder
.
shuffleConnect
(
"BasicTask"
,
"BasicSink"
);
...
@@ -84,34 +83,8 @@ public class BasicTopology {
...
@@ -84,34 +83,8 @@ public class BasicTopology {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// set logging parameters for local run
// set logging parameters for local run
LogUtils
.
initializeDefaultConsoleLogger
(
Level
.
ERROR
,
Level
.
INFO
);
LogUtils
.
initializeDefaultConsoleLogger
(
Level
.
INFO
,
Level
.
INFO
);
try
{
// generate JobGraph
JobGraph
jG
=
getJobGraph
();
Configuration
configuration
=
jG
.
getJobConfiguration
();
if
(
args
.
length
==
0
||
args
[
0
].
equals
(
"local"
))
{
System
.
out
.
println
(
"Running in Local mode"
);
// start local cluster and submit JobGraph
NepheleMiniCluster
exec
=
new
NepheleMiniCluster
();
exec
.
start
();
Client
client
=
new
Client
(
new
InetSocketAddress
(
"localhost"
,
6498
),
configuration
);
client
.
run
(
jG
,
true
);
ClusterUtil
.
runOnMiniCluster
(
getJobGraph
());
exec
.
stop
();
}
else
if
(
args
[
0
].
equals
(
"cluster"
))
{
System
.
out
.
println
(
"Running in Cluster mode"
);
// submit JobGraph to the running cluster
Client
client
=
new
Client
(
new
InetSocketAddress
(
"dell150"
,
6123
),
configuration
);
client
.
run
(
jG
,
true
);
}
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
);
}
}
}
}
}
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/ml/IncrementalLearningSkeleton.java
浏览文件 @
3b787e29
...
@@ -154,11 +154,11 @@ public class IncrementalLearningSkeleton {
...
@@ -154,11 +154,11 @@ public class IncrementalLearningSkeleton {
JobGraphBuilder
graphBuilder
=
new
JobGraphBuilder
(
"IncrementalLearning"
,
JobGraphBuilder
graphBuilder
=
new
JobGraphBuilder
(
"IncrementalLearning"
,
FaultToleranceType
.
NONE
);
FaultToleranceType
.
NONE
);
graphBuilder
.
setSource
(
"NewData"
,
NewDataSource
.
class
,
1
,
1
);
graphBuilder
.
setSource
(
"NewData"
,
new
NewDataSource
()
,
1
,
1
);
graphBuilder
.
setSource
(
"TrainingData"
,
TrainingDataSource
.
class
,
1
,
1
);
graphBuilder
.
setSource
(
"TrainingData"
,
new
TrainingDataSource
()
,
1
,
1
);
graphBuilder
.
setTask
(
"PartialModelBuilder"
,
PartialModelBuilder
.
class
,
1
,
1
);
graphBuilder
.
setTask
(
"PartialModelBuilder"
,
new
PartialModelBuilder
()
,
1
,
1
);
graphBuilder
.
setTask
(
"Predictor"
,
Predictor
.
class
,
1
,
1
);
graphBuilder
.
setTask
(
"Predictor"
,
new
Predictor
()
,
1
,
1
);
graphBuilder
.
setSink
(
"Sink"
,
Sink
.
class
,
1
,
1
);
graphBuilder
.
setSink
(
"Sink"
,
new
Sink
()
,
1
,
1
);
graphBuilder
.
shuffleConnect
(
"TrainingData"
,
"PartialModelBuilder"
);
graphBuilder
.
shuffleConnect
(
"TrainingData"
,
"PartialModelBuilder"
);
graphBuilder
.
shuffleConnect
(
"NewData"
,
"Predictor"
);
graphBuilder
.
shuffleConnect
(
"NewData"
,
"Predictor"
);
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/ml/IncrementalOLS.java
浏览文件 @
3b787e29
...
@@ -180,11 +180,11 @@ public class IncrementalOLS {
...
@@ -180,11 +180,11 @@ public class IncrementalOLS {
JobGraphBuilder
graphBuilder
=
new
JobGraphBuilder
(
"IncrementalOLS"
,
JobGraphBuilder
graphBuilder
=
new
JobGraphBuilder
(
"IncrementalOLS"
,
FaultToleranceType
.
NONE
);
FaultToleranceType
.
NONE
);
graphBuilder
.
setSource
(
"NewData"
,
NewDataSource
.
class
,
1
,
1
);
graphBuilder
.
setSource
(
"NewData"
,
new
NewDataSource
()
,
1
,
1
);
graphBuilder
.
setSource
(
"TrainingData"
,
TrainingDataSource
.
class
,
1
,
1
);
graphBuilder
.
setSource
(
"TrainingData"
,
new
TrainingDataSource
()
,
1
,
1
);
graphBuilder
.
setTask
(
"PartialModelBuilder"
,
PartialModelBuilder
.
class
,
1
,
1
);
graphBuilder
.
setTask
(
"PartialModelBuilder"
,
new
PartialModelBuilder
()
,
1
,
1
);
graphBuilder
.
setTask
(
"Predictor"
,
Predictor
.
class
,
1
,
1
);
graphBuilder
.
setTask
(
"Predictor"
,
new
Predictor
()
,
1
,
1
);
graphBuilder
.
setSink
(
"Sink"
,
Sink
.
class
,
1
,
1
);
graphBuilder
.
setSink
(
"Sink"
,
new
Sink
()
,
1
,
1
);
graphBuilder
.
shuffleConnect
(
"TrainingData"
,
"PartialModelBuilder"
);
graphBuilder
.
shuffleConnect
(
"TrainingData"
,
"PartialModelBuilder"
);
graphBuilder
.
shuffleConnect
(
"NewData"
,
"Predictor"
);
graphBuilder
.
shuffleConnect
(
"NewData"
,
"Predictor"
);
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/wordcount/WordCountCounter.java
浏览文件 @
3b787e29
...
@@ -21,6 +21,7 @@ import eu.stratosphere.streaming.api.streamrecord.StreamRecord;
...
@@ -21,6 +21,7 @@ import eu.stratosphere.streaming.api.streamrecord.StreamRecord;
import
eu.stratosphere.streaming.state.MutableTableState
;
import
eu.stratosphere.streaming.state.MutableTableState
;
public
class
WordCountCounter
extends
UserTaskInvokable
{
public
class
WordCountCounter
extends
UserTaskInvokable
{
private
static
final
long
serialVersionUID
=
1L
;
private
MutableTableState
<
String
,
Integer
>
wordCounts
=
new
MutableTableState
<
String
,
Integer
>();
private
MutableTableState
<
String
,
Integer
>
wordCounts
=
new
MutableTableState
<
String
,
Integer
>();
private
String
word
=
""
;
private
String
word
=
""
;
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/wordcount/WordCountRemote.java
浏览文件 @
3b787e29
...
@@ -42,6 +42,7 @@ public class WordCountRemote {
...
@@ -42,6 +42,7 @@ public class WordCountRemote {
private
final
static
int
recordsEmitted
=
100000
;
private
final
static
int
recordsEmitted
=
100000
;
public
static
class
WordCountDebugSource
extends
UserSourceInvokable
{
public
static
class
WordCountDebugSource
extends
UserSourceInvokable
{
private
static
final
long
serialVersionUID
=
1L
;
private
PerformanceCounter
perf
=
new
PerformanceCounter
(
"SourceEmitCounter"
,
1000
,
10000
,
""
);
private
PerformanceCounter
perf
=
new
PerformanceCounter
(
"SourceEmitCounter"
,
1000
,
10000
,
""
);
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/wordcount/WordCountSink.java
浏览文件 @
3b787e29
...
@@ -19,6 +19,7 @@ import eu.stratosphere.streaming.api.invokable.UserSinkInvokable;
...
@@ -19,6 +19,7 @@ import eu.stratosphere.streaming.api.invokable.UserSinkInvokable;
import
eu.stratosphere.streaming.api.streamrecord.StreamRecord
;
import
eu.stratosphere.streaming.api.streamrecord.StreamRecord
;
public
class
WordCountSink
extends
UserSinkInvokable
{
public
class
WordCountSink
extends
UserSinkInvokable
{
private
static
final
long
serialVersionUID
=
1L
;
@Override
@Override
public
void
invoke
(
StreamRecord
record
)
throws
Exception
{
public
void
invoke
(
StreamRecord
record
)
throws
Exception
{
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/wordcount/WordCountSource.java
浏览文件 @
3b787e29
...
@@ -23,6 +23,7 @@ import eu.stratosphere.streaming.api.invokable.UserSourceInvokable;
...
@@ -23,6 +23,7 @@ import eu.stratosphere.streaming.api.invokable.UserSourceInvokable;
import
eu.stratosphere.streaming.api.streamrecord.StreamRecord
;
import
eu.stratosphere.streaming.api.streamrecord.StreamRecord
;
public
class
WordCountSource
extends
UserSourceInvokable
{
public
class
WordCountSource
extends
UserSourceInvokable
{
private
static
final
long
serialVersionUID
=
1L
;
private
BufferedReader
br
=
null
;
private
BufferedReader
br
=
null
;
private
String
line
=
new
String
();
private
String
line
=
new
String
();
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/wordcount/WordCountSplitter.java
浏览文件 @
3b787e29
...
@@ -22,6 +22,7 @@ import eu.stratosphere.streaming.util.PerformanceCounter;
...
@@ -22,6 +22,7 @@ import eu.stratosphere.streaming.util.PerformanceCounter;
import
eu.stratosphere.streaming.util.PerformanceTimer
;
import
eu.stratosphere.streaming.util.PerformanceTimer
;
public
class
WordCountSplitter
extends
UserTaskInvokable
{
public
class
WordCountSplitter
extends
UserTaskInvokable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
[]
words
=
new
String
[]
{};
private
String
[]
words
=
new
String
[]
{};
private
StreamRecord
outputRecord
=
new
StreamRecord
(
new
Tuple1
<
String
>());
private
StreamRecord
outputRecord
=
new
StreamRecord
(
new
Tuple1
<
String
>());
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/rabbitmq/RMQSource.java
浏览文件 @
3b787e29
...
@@ -87,7 +87,7 @@ public class RMQSource extends UserSourceInvokable {
...
@@ -87,7 +87,7 @@ public class RMQSource extends UserSourceInvokable {
message
=
new
String
(
delivery
.
getBody
());
message
=
new
String
(
delivery
.
getBody
());
if
(
message
.
equals
(
"q
uit
"
))
{
if
(
message
.
equals
(
"q"
))
{
break
;
break
;
}
}
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/rabbitmq/RMQTopology.java
浏览文件 @
3b787e29
...
@@ -27,7 +27,6 @@ import eu.stratosphere.streaming.util.LogUtils;
...
@@ -27,7 +27,6 @@ import eu.stratosphere.streaming.util.LogUtils;
public
class
RMQTopology
{
public
class
RMQTopology
{
public
static
class
Sink
extends
UserSinkInvokable
{
public
static
class
Sink
extends
UserSinkInvokable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -41,7 +40,7 @@ public class RMQTopology {
...
@@ -41,7 +40,7 @@ public class RMQTopology {
JobGraphBuilder
graphBuilder
=
new
JobGraphBuilder
(
"RMQ"
,
FaultToleranceType
.
NONE
);
JobGraphBuilder
graphBuilder
=
new
JobGraphBuilder
(
"RMQ"
,
FaultToleranceType
.
NONE
);
graphBuilder
.
setSource
(
"Source"
,
new
RMQSource
(
"localhost"
,
"hello"
),
1
,
1
);
graphBuilder
.
setSource
(
"Source"
,
new
RMQSource
(
"localhost"
,
"hello"
),
1
,
1
);
graphBuilder
.
setSink
(
"Sink"
,
Sink
.
class
,
1
,
1
);
graphBuilder
.
setSink
(
"Sink"
,
new
Sink
()
,
1
,
1
);
graphBuilder
.
shuffleConnect
(
"Source"
,
"Sink"
);
graphBuilder
.
shuffleConnect
(
"Source"
,
"Sink"
);
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/util/PerformanceTracker.java
浏览文件 @
3b787e29
...
@@ -148,4 +148,8 @@ public class PerformanceTracker {
...
@@ -148,4 +148,8 @@ public class PerformanceTracker {
}
}
public
void
setFname
(
String
fname
)
{
this
.
fname
=
fname
;
}
}
}
flink-addons/flink-streaming/src/test/java/eu/stratosphere/streaming/api/streamcomponent/StreamComponentTest.java
浏览文件 @
3b787e29
...
@@ -17,7 +17,6 @@ package eu.stratosphere.streaming.api.streamcomponent;
...
@@ -17,7 +17,6 @@ package eu.stratosphere.streaming.api.streamcomponent;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
java.net.InetSocketAddress
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -27,10 +26,6 @@ import org.junit.Test;
...
@@ -27,10 +26,6 @@ import org.junit.Test;
import
eu.stratosphere.api.java.tuple.Tuple1
;
import
eu.stratosphere.api.java.tuple.Tuple1
;
import
eu.stratosphere.api.java.tuple.Tuple2
;
import
eu.stratosphere.api.java.tuple.Tuple2
;
import
eu.stratosphere.client.minicluster.NepheleMiniCluster
;
import
eu.stratosphere.client.program.Client
;
import
eu.stratosphere.configuration.Configuration
;
import
eu.stratosphere.nephele.jobgraph.JobGraph
;
import
eu.stratosphere.streaming.api.JobGraphBuilder
;
import
eu.stratosphere.streaming.api.JobGraphBuilder
;
import
eu.stratosphere.streaming.api.invokable.UserSinkInvokable
;
import
eu.stratosphere.streaming.api.invokable.UserSinkInvokable
;
import
eu.stratosphere.streaming.api.invokable.UserSourceInvokable
;
import
eu.stratosphere.streaming.api.invokable.UserSourceInvokable
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录