Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
9c2eaa8d
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,发现更多精彩内容 >>
提交
9c2eaa8d
编写于
9月 10, 2015
作者:
M
mjsax
提交者:
Fabian Hueske
9月 10, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[FLINK-2632] [client] Fix web client to respect the class loader of submitted jobs
This closes #1114
上级
79a7bb21
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
15 deletion
+15
-15
flink-clients/src/main/java/org/apache/flink/client/CliFrontend.java
...ts/src/main/java/org/apache/flink/client/CliFrontend.java
+4
-5
flink-clients/src/main/java/org/apache/flink/client/web/JobSubmissionServlet.java
...ava/org/apache/flink/client/web/JobSubmissionServlet.java
+11
-10
未找到文件。
flink-clients/src/main/java/org/apache/flink/client/CliFrontend.java
浏览文件 @
9c2eaa8d
...
...
@@ -70,7 +70,6 @@ import org.apache.flink.runtime.util.EnvironmentInformation;
import
org.apache.flink.runtime.util.LeaderRetrievalUtils
;
import
org.apache.flink.runtime.yarn.AbstractFlinkYarnClient
;
import
org.apache.flink.api.common.JobID
;
import
org.apache.flink.runtime.jobgraph.JobGraph
;
import
org.apache.flink.runtime.jobgraph.JobStatus
;
import
org.apache.flink.runtime.messages.JobManagerMessages.CancelJob
;
import
org.apache.flink.runtime.messages.JobManagerMessages.RunningJobsStatus
;
...
...
@@ -137,7 +136,7 @@ public class CliFrontend {
private
FlinkPlan
optimizedPlan
;
private
JobGraph
jobGraph
;
private
PackagedProgram
packagedProgram
;
/**
*
...
...
@@ -401,7 +400,7 @@ public class CliFrontend {
if
(
webFrontend
)
{
this
.
optimizedPlan
=
flinkPlan
;
this
.
jobGraph
=
client
.
getJobGraph
(
program
,
flinkPlan
)
;
this
.
packagedProgram
=
program
;
}
else
{
String
jsonPlan
=
new
PlanJSONDumpGenerator
()
.
getOptimizerPlanAsJSON
((
OptimizedPlan
)
flinkPlan
);
...
...
@@ -980,8 +979,8 @@ public class CliFrontend {
return
this
.
optimizedPlan
;
}
public
JobGraph
getJobGraph
()
{
return
this
.
jobGraph
;
public
PackagedProgram
getPackagedProgram
()
{
return
this
.
packagedProgram
;
}
public
void
shutdown
()
{
...
...
flink-clients/src/main/java/org/apache/flink/client/web/JobSubmissionServlet.java
浏览文件 @
9c2eaa8d
...
...
@@ -36,9 +36,11 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang3.StringEscapeUtils
;
import
org.apache.flink.api.java.tuple.Tuple2
;
import
org.apache.flink.client.CliFrontend
;
import
org.apache.flink.client.cli.CliFrontendParser
;
import
org.apache.flink.client.program.Client
;
import
org.apache.flink.client.program.PackagedProgram
;
import
org.apache.flink.client.program.ProgramInvocationException
;
import
org.apache.flink.optimizer.CompilerException
;
import
org.apache.flink.optimizer.plan.FlinkPlan
;
...
...
@@ -46,7 +48,6 @@ import org.apache.flink.optimizer.plan.OptimizedPlan;
import
org.apache.flink.optimizer.plan.StreamingPlan
;
import
org.apache.flink.optimizer.plandump.PlanJSONDumpGenerator
;
import
org.apache.flink.configuration.GlobalConfiguration
;
import
org.apache.flink.runtime.jobgraph.JobGraph
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -86,13 +87,13 @@ public class JobSubmissionServlet extends HttpServlet {
// ------------------------------------------------------------------------
private
final
File
jobStoreDirectory
;
// the directory containing the uploaded jobs
private
final
File
jobStoreDirectory
;
// the directory containing the uploaded jobs
private
final
File
planDumpDirectory
;
// the directory to dump the optimizer plans to
private
final
File
planDumpDirectory
;
// the directory to dump the optimizer plans to
private
final
Map
<
Long
,
JobGraph
>
submittedJobs
;
// map from UIDs to the running
jobs
private
final
Map
<
Long
,
Tuple2
<
PackagedProgram
,
FlinkPlan
>>
submittedJobs
;
// map from UIDs to the submitted
jobs
private
final
Random
rand
;
// random number generator for UID
private
final
Random
rand
;
// random number generator for UID
private
final
CliFrontend
cli
;
...
...
@@ -103,7 +104,7 @@ public class JobSubmissionServlet extends HttpServlet {
this
.
jobStoreDirectory
=
jobDir
;
this
.
planDumpDirectory
=
planDir
;
this
.
submittedJobs
=
Collections
.
synchronizedMap
(
new
HashMap
<
Long
,
JobGraph
>());
this
.
submittedJobs
=
Collections
.
synchronizedMap
(
new
HashMap
<
Long
,
Tuple2
<
PackagedProgram
,
FlinkPlan
>
>());
this
.
rand
=
new
Random
(
System
.
currentTimeMillis
());
}
...
...
@@ -263,7 +264,7 @@ public class JobSubmissionServlet extends HttpServlet {
}
}
else
{
this
.
submittedJobs
.
put
(
uid
,
this
.
cli
.
getJobGraph
(
));
this
.
submittedJobs
.
put
(
uid
,
new
Tuple2
<
PackagedProgram
,
FlinkPlan
>(
this
.
cli
.
getPackagedProgram
(),
optPlan
));
}
// redirect to the plan display page
...
...
@@ -304,7 +305,7 @@ public class JobSubmissionServlet extends HttpServlet {
}
// get the retained job
JobGraph
job
=
submittedJobs
.
remove
(
uid
);
Tuple2
<
PackagedProgram
,
FlinkPlan
>
job
=
submittedJobs
.
remove
(
uid
);
if
(
job
==
null
)
{
resp
.
sendError
(
HttpServletResponse
.
SC_BAD_REQUEST
,
"No job with the given uid was retained for later submission."
);
...
...
@@ -313,8 +314,8 @@ public class JobSubmissionServlet extends HttpServlet {
// submit the job
try
{
Client
client
=
new
Client
(
GlobalConfiguration
.
getConfiguration
(),
getClass
().
get
ClassLoader
());
client
.
run
(
job
,
false
);
Client
client
=
new
Client
(
GlobalConfiguration
.
getConfiguration
(),
job
.
f0
.
getUserCode
ClassLoader
());
client
.
run
(
client
.
getJobGraph
(
job
.
f0
,
job
.
f1
)
,
false
);
}
catch
(
Exception
ex
)
{
LOG
.
error
(
"Error submitting job to the job-manager."
,
ex
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录