Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
1511cac9
Unverified
Commit
1511cac9
authored
Aug 15, 2023
by
seawenc
Committed by
GitHub
Aug 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in new code (#2205)
Co-authored-by:
chengsheng
<
chengsheng@travelsky.com.cn
>
parent
1fe0d107
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
KubernetesApplicationGateway.java
...inky/gateway/kubernetes/KubernetesApplicationGateway.java
+5
-4
No files found.
dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java
View file @
1511cac9
...
@@ -27,7 +27,6 @@ import org.dinky.gateway.enums.GatewayType;
...
@@ -27,7 +27,6 @@ import org.dinky.gateway.enums.GatewayType;
import
org.dinky.gateway.result.GatewayResult
;
import
org.dinky.gateway.result.GatewayResult
;
import
org.dinky.gateway.result.KubernetesResult
;
import
org.dinky.gateway.result.KubernetesResult
;
import
org.dinky.utils.LogUtil
;
import
org.dinky.utils.LogUtil
;
import
org.dinky.utils.ThreadUtil
;
import
org.apache.flink.client.deployment.ClusterSpecification
;
import
org.apache.flink.client.deployment.ClusterSpecification
;
import
org.apache.flink.client.deployment.application.ApplicationConfiguration
;
import
org.apache.flink.client.deployment.application.ApplicationConfiguration
;
...
@@ -42,6 +41,7 @@ import java.util.Collection;
...
@@ -42,6 +41,7 @@ import java.util.Collection;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.ExecutionException
;
import
cn.hutool.core.thread.ThreadUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.http.HttpUtil
;
...
@@ -135,24 +135,25 @@ public class KubernetesApplicationGateway extends KubernetesGateway {
...
@@ -135,24 +135,25 @@ public class KubernetesApplicationGateway extends KubernetesGateway {
}
}
/**
/**
*
等待tm完成,若不等待,则后续步骤可能会查询不到状态,报 NullPointerException
*
Waiting for TaskManager to successfully start,if skip this step, may obtain an NullPointerException in the next step
*
*
* @param apiPath
* @param apiPath
* @param jobId
* @param jobId
*/
*/
static
void
waitForTaskManagerToBeReady
(
String
apiPath
,
String
jobId
)
{
static
void
waitForTaskManagerToBeReady
(
String
apiPath
,
String
jobId
)
{
int
jobIdWait
=
SystemConfiguration
.
getInstances
().
getJobIdWait
();
int
jobIdWait
=
SystemConfiguration
.
getInstances
().
getJobIdWait
();
String
fullPath
=
String
.
format
(
"
http://
%s/jobs/%s"
,
apiPath
,
jobId
);
String
fullPath
=
String
.
format
(
"%s/jobs/%s"
,
apiPath
,
jobId
);
for
(
int
i
=
1
;
i
<=
jobIdWait
;
i
++)
{
for
(
int
i
=
1
;
i
<=
jobIdWait
;
i
++)
{
try
{
try
{
// 不抛异常,就为成功
// 不抛异常,就为成功
String
result
=
HttpUtil
.
get
(
fullPath
,
NetConstant
.
SERVER_TIME_OUT_ACTIVE
);
String
result
=
HttpUtil
.
get
(
fullPath
,
NetConstant
.
SERVER_TIME_OUT_ACTIVE
);
logger
.
info
(
"get job status success,jobPath:{},result: {}"
,
fullPath
,
result
);
logger
.
info
(
"get job status success,jobPath:{},result: {}"
,
fullPath
,
result
);
break
;
return
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
"Unable to connect to Flink JobManager: {},wait count:{}"
,
fullPath
,
i
);
logger
.
info
(
"Unable to connect to Flink JobManager: {},wait count:{}"
,
fullPath
,
i
);
ThreadUtil
.
sleep
(
1000
);
ThreadUtil
.
sleep
(
1000
);
}
}
}
}
logger
.
error
(
"wait for taskManager to be ready timeout,path="
+
fullPath
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment