Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
ef76b59c
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,发现更多精彩内容 >>
提交
ef76b59c
编写于
7月 14, 2014
作者:
G
Gyula Fora
提交者:
Stephan Ewen
8月 18, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[streaming] wordcount cluster settings updated
上级
98e087fd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
41 deletion
+34
-41
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/test/wordcount/WordCountCluster.java
...ratosphere/streaming/test/wordcount/WordCountCluster.java
+18
-19
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/test/wordcount/WordCountLocal.java
...stratosphere/streaming/test/wordcount/WordCountLocal.java
+16
-22
未找到文件。
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/test/wordcount/WordCountCluster.java
浏览文件 @
ef76b59c
...
@@ -15,13 +15,18 @@
...
@@ -15,13 +15,18 @@
package
eu.stratosphere.streaming.test.wordcount
;
package
eu.stratosphere.streaming.test.wordcount
;
import
java.io.File
;
import
java.net.InetSocketAddress
;
import
org.apache.log4j.BasicConfigurator
;
import
org.apache.log4j.BasicConfigurator
;
import
org.apache.log4j.Level
;
import
org.apache.log4j.Level
;
import
eu.stratosphere.client.minicluster.NepheleMiniCluster
;
import
eu.stratosphere.client.minicluster.NepheleMiniCluster
;
import
eu.stratosphere.client.program.Client
;
import
eu.stratosphere.client.program.JobWithJars
;
import
eu.stratosphere.client.program.JobWithJars
;
import
eu.stratosphere.configuration.ConfigConstants
;
import
eu.stratosphere.configuration.ConfigConstants
;
import
eu.stratosphere.configuration.Configuration
;
import
eu.stratosphere.configuration.Configuration
;
import
eu.stratosphere.core.fs.Path
;
import
eu.stratosphere.nephele.client.JobClient
;
import
eu.stratosphere.nephele.client.JobClient
;
import
eu.stratosphere.nephele.jobgraph.JobGraph
;
import
eu.stratosphere.nephele.jobgraph.JobGraph
;
import
eu.stratosphere.streaming.api.JobGraphBuilder
;
import
eu.stratosphere.streaming.api.JobGraphBuilder
;
...
@@ -30,10 +35,8 @@ import eu.stratosphere.util.LogUtils;
...
@@ -30,10 +35,8 @@ import eu.stratosphere.util.LogUtils;
public
class
WordCountCluster
{
public
class
WordCountCluster
{
protected
final
Configuration
config
;
protected
final
Configuration
config
;
public
WordCountCluster
()
{
public
WordCountCluster
()
{
this
(
new
Configuration
());
this
(
new
Configuration
());
}
}
...
@@ -60,29 +63,25 @@ public class WordCountCluster {
...
@@ -60,29 +63,25 @@ public class WordCountCluster {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
try
{
try
{
File
file
=
new
File
(
"target/stratosphere-streaming-0.5-SNAPSHOT.jar"
);
JobWithJars
.
checkJarFile
(
file
);
JobGraph
jG
=
getJobGraph
();
JobGraph
jG
=
getJobGraph
();
int
jobManagerRpcPort
=
6123
;
jG
.
addJar
(
new
Path
(
file
.
getAbsolutePath
()));
Configuration
configuration
=
jG
.
getJobConfiguration
();
Configuration
configuration
=
jG
.
getJobConfiguration
();
configuration
.
setString
(
ConfigConstants
.
JOB_MANAGER_IPC_ADDRESS_KEY
,
"hadoop02.ilab.sztaki.hu"
);
configuration
.
setInteger
(
ConfigConstants
.
JOB_MANAGER_IPC_PORT_KEY
,
jobManagerRpcPort
);
Client
client
=
new
Client
(
new
InetSocketAddress
(
configuration
.
setInteger
(
ConfigConstants
.
TASK_MANAGER_IPC_PORT_KEY
,
6122
);
"hadoop02.ilab.sztaki.hu"
,
6123
),
configuration
);
// configuration.setInteger(ConfigConstants.TASK_MANAGER_DATA_PORT_KEY, 7501);
client
.
run
(
null
,
jG
,
true
);
JobClient
client
=
new
JobClient
(
jG
,
configuration
);
ClassLoader
userClassLoader
;
client
.
submitJobAndWait
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
System
.
out
.
println
(
e
);
}
}
}
}
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/test/wordcount/WordCountLocal.java
浏览文件 @
ef76b59c
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
package
eu.stratosphere.streaming.test.wordcount
;
package
eu.stratosphere.streaming.test.wordcount
;
import
java.io.File
;
import
java.net.InetSocketAddress
;
import
java.net.InetSocketAddress
;
import
org.apache.hadoop.fs.FileSystem
;
import
org.apache.hadoop.fs.FileSystem
;
...
@@ -22,10 +23,12 @@ import org.apache.log4j.BasicConfigurator;
...
@@ -22,10 +23,12 @@ import org.apache.log4j.BasicConfigurator;
import
org.apache.log4j.Level
;
import
org.apache.log4j.Level
;
import
org.junit.Assert
;
import
org.junit.Assert
;
import
eu.stratosphere.api.common.JobExecutionResult
;
import
eu.stratosphere.client.minicluster.NepheleMiniCluster
;
import
eu.stratosphere.client.minicluster.NepheleMiniCluster
;
import
eu.stratosphere.client.program.Client
;
import
eu.stratosphere.client.program.Client
;
import
eu.stratosphere.c
onfiguration.ConfigConstant
s
;
import
eu.stratosphere.c
lient.program.JobWithJar
s
;
import
eu.stratosphere.configuration.Configuration
;
import
eu.stratosphere.configuration.Configuration
;
import
eu.stratosphere.core.fs.Path
;
import
eu.stratosphere.nephele.client.JobClient
;
import
eu.stratosphere.nephele.client.JobClient
;
import
eu.stratosphere.nephele.jobgraph.JobGraph
;
import
eu.stratosphere.nephele.jobgraph.JobGraph
;
import
eu.stratosphere.streaming.api.JobGraphBuilder
;
import
eu.stratosphere.streaming.api.JobGraphBuilder
;
...
@@ -40,7 +43,6 @@ public class WordCountLocal {
...
@@ -40,7 +43,6 @@ public class WordCountLocal {
private
NepheleMiniCluster
executor
;
private
NepheleMiniCluster
executor
;
public
WordCountLocal
()
{
public
WordCountLocal
()
{
this
(
new
Configuration
());
this
(
new
Configuration
());
}
}
...
@@ -107,7 +109,7 @@ public class WordCountLocal {
...
@@ -107,7 +109,7 @@ public class WordCountLocal {
private
static
JobGraph
getJobGraph
()
throws
Exception
{
private
static
JobGraph
getJobGraph
()
throws
Exception
{
JobGraphBuilder
graphBuilder
=
new
JobGraphBuilder
(
"testGraph"
);
JobGraphBuilder
graphBuilder
=
new
JobGraphBuilder
(
"testGraph"
);
graphBuilder
.
setSource
(
"WordCountSource"
,
WordCountSource
.
class
);
graphBuilder
.
setSource
(
"WordCountSource"
,
WordCount
Dummy
Source
.
class
);
graphBuilder
.
setTask
(
"WordCountSplitter"
,
WordCountSplitter
.
class
,
2
);
graphBuilder
.
setTask
(
"WordCountSplitter"
,
WordCountSplitter
.
class
,
2
);
graphBuilder
.
setTask
(
"WordCountCounter"
,
WordCountCounter
.
class
,
2
);
graphBuilder
.
setTask
(
"WordCountCounter"
,
WordCountCounter
.
class
,
2
);
graphBuilder
.
setSink
(
"WordCountSink"
,
WordCountSink
.
class
);
graphBuilder
.
setSink
(
"WordCountSink"
,
WordCountSink
.
class
);
...
@@ -121,33 +123,25 @@ public class WordCountLocal {
...
@@ -121,33 +123,25 @@ public class WordCountLocal {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
WordCountLocal
wC
=
new
WordCountLocal
();
BasicConfigurator
.
configure
();
NepheleMiniCluster
exec
=
new
NepheleMiniCluster
();
NepheleMiniCluster
exec
=
new
NepheleMiniCluster
();
try
{
try
{
File
file
=
new
File
(
"target/stratosphere-streaming-0.5-SNAPSHOT.jar"
);
JobWithJars
.
checkJarFile
(
file
);
JobGraph
jG
=
getJobGraph
();
JobGraph
jG
=
getJobGraph
();
jG
.
addJar
(
new
Path
(
file
.
getAbsolutePath
()));
Configuration
configuration
=
jG
.
getJobConfiguration
();
Configuration
configuration
=
jG
.
getJobConfiguration
();
Client
client
=
new
Client
(
new
InetSocketAddress
(
"localhost"
,
6498
),
configuration
);
Client
client
=
new
Client
(
new
InetSocketAddress
(
"localhost"
,
6498
),
configuration
);
// int jobManagerRpcPort = 6498;
//
// configuration.setString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, "localhost");
// configuration.setInteger(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, jobManagerRpcPort);
//
//
// JobClient client= new JobClient(jG, configuration);
exec
.
start
();
exec
.
start
();
//JobClient client = exec.getJobClient(jG);
// client.run(null, jG, true);
// client.submitJobAndWait(
);
client
.
run
(
null
,
jG
,
true
);
exec
.
stop
();
exec
.
stop
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录