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
a1df9234
Unverified
Commit
a1df9234
authored
Jan 14, 2023
by
aiwenmo
Committed by
GitHub
Jan 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix-1556] [core] Fix job submission succeeded but failed (#1558)
Co-authored-by:
wenmo
<
32723967+wenmo@users.noreply.github.com
>
parent
9312abd4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
36 deletions
+28
-36
Job.java
dinky-core/src/main/java/org/dinky/job/Job.java
+4
-0
JobManager.java
dinky-core/src/main/java/org/dinky/job/JobManager.java
+14
-2
BatchTest.java
dinky-core/src/test/java/org/dinky/core/BatchTest.java
+2
-0
FlinkRestAPITest.java
...y-core/src/test/java/org/dinky/core/FlinkRestAPITest.java
+2
-0
FlinkSqlPlusTest.java
...y-core/src/test/java/org/dinky/core/FlinkSqlPlusTest.java
+2
-0
JobManagerTest.java
dinky-core/src/test/java/org/dinky/core/JobManagerTest.java
+2
-0
LineageTest.java
dinky-core/src/test/java/org/dinky/core/LineageTest.java
+2
-0
MapParseUtilsTest.java
...core/src/test/java/org/dinky/utils/MapParseUtilsTest.java
+0
-34
No files found.
dinky-core/src/main/java/org/dinky/job/Job.java
View file @
a1df9234
...
@@ -114,4 +114,8 @@ public class Job {
...
@@ -114,4 +114,8 @@ public class Job {
startTime
,
startTime
,
endTime
);
endTime
);
}
}
public
boolean
isFailed
()
{
return
status
.
equals
(
JobStatus
.
FAILED
);
}
}
}
dinky-core/src/main/java/org/dinky/job/JobManager.java
View file @
a1df9234
...
@@ -463,6 +463,12 @@ public class JobManager {
...
@@ -463,6 +463,12 @@ public class JobManager {
job
.
setJobId
(
gatewayResult
.
getAppId
());
job
.
setJobId
(
gatewayResult
.
getAppId
());
job
.
setJids
(
gatewayResult
.
getJids
());
job
.
setJids
(
gatewayResult
.
getJids
());
job
.
setJobManagerAddress
(
formatAddress
(
gatewayResult
.
getWebURL
()));
job
.
setJobManagerAddress
(
formatAddress
(
gatewayResult
.
getWebURL
()));
if
(
gatewayResult
.
isSucess
())
{
job
.
setStatus
(
Job
.
JobStatus
.
SUCCESS
);
}
else
{
job
.
setStatus
(
Job
.
JobStatus
.
FAILED
);
job
.
setError
(
gatewayResult
.
getError
());
}
}
else
if
(
useStatementSet
&&
!
useGateway
)
{
}
else
if
(
useStatementSet
&&
!
useGateway
)
{
List
<
String
>
inserts
=
new
ArrayList
<>();
List
<
String
>
inserts
=
new
ArrayList
<>();
for
(
StatementParam
item
:
jobParam
.
getTrans
())
{
for
(
StatementParam
item
:
jobParam
.
getTrans
())
{
...
@@ -510,6 +516,12 @@ public class JobManager {
...
@@ -510,6 +516,12 @@ public class JobManager {
job
.
setJobId
(
gatewayResult
.
getAppId
());
job
.
setJobId
(
gatewayResult
.
getAppId
());
job
.
setJids
(
gatewayResult
.
getJids
());
job
.
setJids
(
gatewayResult
.
getJids
());
job
.
setJobManagerAddress
(
formatAddress
(
gatewayResult
.
getWebURL
()));
job
.
setJobManagerAddress
(
formatAddress
(
gatewayResult
.
getWebURL
()));
if
(
gatewayResult
.
isSucess
())
{
job
.
setStatus
(
Job
.
JobStatus
.
SUCCESS
);
}
else
{
job
.
setStatus
(
Job
.
JobStatus
.
FAILED
);
job
.
setError
(
gatewayResult
.
getError
());
}
}
else
{
}
else
{
for
(
StatementParam
item
:
jobParam
.
getTrans
())
{
for
(
StatementParam
item
:
jobParam
.
getTrans
())
{
currentSql
=
item
.
getValue
();
currentSql
=
item
.
getValue
();
...
@@ -627,13 +639,13 @@ public class JobManager {
...
@@ -627,13 +639,13 @@ public class JobManager {
.
getResult
(
null
);
.
getResult
(
null
);
job
.
setResult
(
result
);
job
.
setResult
(
result
);
}
}
job
.
setStatus
(
Job
.
JobStatus
.
SUCCESS
);
}
}
}
}
job
.
setEndTime
(
LocalDateTime
.
now
());
job
.
setEndTime
(
LocalDateTime
.
now
());
if
(
job
.
getStatus
().
name
().
equals
(
Job
.
JobStatus
.
FAILED
.
name
()
))
{
if
(
job
.
isFailed
(
))
{
failed
();
failed
();
}
else
{
}
else
{
job
.
setStatus
(
Job
.
JobStatus
.
SUCCESS
);
success
();
success
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
dinky-core/src/test/java/org/dinky/core/BatchTest.java
View file @
a1df9234
...
@@ -23,6 +23,7 @@ import org.apache.flink.table.api.EnvironmentSettings;
...
@@ -23,6 +23,7 @@ import org.apache.flink.table.api.EnvironmentSettings;
import
org.apache.flink.table.api.TableEnvironment
;
import
org.apache.flink.table.api.TableEnvironment
;
import
org.apache.flink.table.api.TableResult
;
import
org.apache.flink.table.api.TableResult
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.junit.Test
;
/**
/**
...
@@ -33,6 +34,7 @@ import org.junit.Test;
...
@@ -33,6 +34,7 @@ import org.junit.Test;
*/
*/
public
class
BatchTest
{
public
class
BatchTest
{
@Ignore
@Test
@Test
public
void
batchTest
()
{
public
void
batchTest
()
{
String
source
=
String
source
=
...
...
dinky-core/src/test/java/org/dinky/core/FlinkRestAPITest.java
View file @
a1df9234
...
@@ -24,6 +24,7 @@ import org.dinky.gateway.result.SavePointResult;
...
@@ -24,6 +24,7 @@ import org.dinky.gateway.result.SavePointResult;
import
java.util.List
;
import
java.util.List
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.junit.Test
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.JsonNode
;
...
@@ -34,6 +35,7 @@ import com.fasterxml.jackson.databind.JsonNode;
...
@@ -34,6 +35,7 @@ import com.fasterxml.jackson.databind.JsonNode;
* @author wenmo
* @author wenmo
* @since 2021/6/24 14:24
* @since 2021/6/24 14:24
*/
*/
@Ignore
public
class
FlinkRestAPITest
{
public
class
FlinkRestAPITest
{
// private String address = "192.168.123.157:8081";
// private String address = "192.168.123.157:8081";
...
...
dinky-core/src/test/java/org/dinky/core/FlinkSqlPlusTest.java
View file @
a1df9234
...
@@ -23,6 +23,7 @@ import org.dinky.plus.FlinkSqlPlus;
...
@@ -23,6 +23,7 @@ import org.dinky.plus.FlinkSqlPlus;
import
org.apache.flink.runtime.rest.messages.JobPlanInfo
;
import
org.apache.flink.runtime.rest.messages.JobPlanInfo
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.junit.Test
;
/**
/**
...
@@ -33,6 +34,7 @@ import org.junit.Test;
...
@@ -33,6 +34,7 @@ import org.junit.Test;
*/
*/
public
class
FlinkSqlPlusTest
{
public
class
FlinkSqlPlusTest
{
@Ignore
@Test
@Test
public
void
getJobPlanInfo
()
{
public
void
getJobPlanInfo
()
{
String
sql
=
String
sql
=
...
...
dinky-core/src/test/java/org/dinky/core/JobManagerTest.java
View file @
a1df9234
...
@@ -27,6 +27,7 @@ import org.dinky.result.SelectResult;
...
@@ -27,6 +27,7 @@ import org.dinky.result.SelectResult;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.junit.Test
;
/**
/**
...
@@ -37,6 +38,7 @@ import org.junit.Test;
...
@@ -37,6 +38,7 @@ import org.junit.Test;
*/
*/
public
class
JobManagerTest
{
public
class
JobManagerTest
{
@Ignore
@Test
@Test
public
void
cancelJobSelect
()
{
public
void
cancelJobSelect
()
{
...
...
dinky-core/src/test/java/org/dinky/core/LineageTest.java
View file @
a1df9234
...
@@ -22,6 +22,7 @@ package org.dinky.core;
...
@@ -22,6 +22,7 @@ package org.dinky.core;
import
org.dinky.explainer.lineage.LineageBuilder
;
import
org.dinky.explainer.lineage.LineageBuilder
;
import
org.dinky.explainer.lineage.LineageResult
;
import
org.dinky.explainer.lineage.LineageResult
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.junit.Test
;
/**
/**
...
@@ -32,6 +33,7 @@ import org.junit.Test;
...
@@ -32,6 +33,7 @@ import org.junit.Test;
*/
*/
public
class
LineageTest
{
public
class
LineageTest
{
@Ignore
@Test
@Test
public
void
sumTest
()
{
public
void
sumTest
()
{
String
sql
=
String
sql
=
...
...
dinky-core/src/test/java/org/dinky/utils/MapParseUtilsTest.java
deleted
100644 → 0
View file @
9312abd4
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org
.
dinky
.
utils
;
import
org.junit.jupiter.api.Assertions
;
import
org.junit.jupiter.params.ParameterizedTest
;
import
org.junit.jupiter.params.provider.CsvSource
;
/** */
class
MapParseUtilsTest
{
@ParameterizedTest
@CsvSource
({
"[3], false"
,
"[[2], true"
,
"[1]], false"
})
void
getStrIsNest
(
String
in
,
boolean
result
)
{
Assertions
.
assertEquals
(
MapParseUtils
.
getStrIsNest
(
in
),
result
);
}
}
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