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
722e38fc
Unverified
Commit
722e38fc
authored
Jan 12, 2024
by
aiwenmo
Committed by
GitHub
Jan 12, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Feature-2989][dolphinscheduler] Dolphinscheduler supports common sql and variables (#2999)
Co-authored-by:
wenmo
<
32723967+wenmo@users.noreply.github.com
>
parent
2b71dfec
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
22 deletions
+37
-22
APIController.java
...min/src/main/java/org/dinky/controller/APIController.java
+15
-12
TaskSubmitDto.java
...admin/src/main/java/org/dinky/data/dto/TaskSubmitDto.java
+15
-0
SystemInit.java
dinky-admin/src/main/java/org/dinky/init/SystemInit.java
+1
-3
AbstractJdbcDriver.java
...in/java/org/dinky/metadata/driver/AbstractJdbcDriver.java
+2
-1
DinkyTaskParams.java
.../main/java/org/dinky/scheduler/model/DinkyTaskParams.java
+2
-1
function.tsx
dinky-web/src/pages/DataStudio/HeaderContainer/function.tsx
+0
-1
index.tsx
dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx
+1
-3
pom.xml
pom.xml
+1
-1
No files found.
dinky-admin/src/main/java/org/dinky/controller/APIController.java
View file @
722e38fc
...
@@ -19,7 +19,9 @@
...
@@ -19,7 +19,9 @@
package
org
.
dinky
.
controller
;
package
org
.
dinky
.
controller
;
import
org.dinky.DinkyVersion
;
import
org.dinky.data.annotations.Log
;
import
org.dinky.data.annotations.Log
;
import
org.dinky.data.dto.APISavePointTaskDTO
;
import
org.dinky.data.dto.TaskDTO
;
import
org.dinky.data.dto.TaskDTO
;
import
org.dinky.data.dto.TaskSubmitDto
;
import
org.dinky.data.dto.TaskSubmitDto
;
import
org.dinky.data.enums.BusinessType
;
import
org.dinky.data.enums.BusinessType
;
...
@@ -65,18 +67,10 @@ public class APIController {
...
@@ -65,18 +67,10 @@ public class APIController {
private
final
TaskService
taskService
;
private
final
TaskService
taskService
;
private
final
JobInstanceService
jobInstanceService
;
private
final
JobInstanceService
jobInstanceService
;
// Interface compatible with DolphinScheduler
@GetMapping
(
"/version"
)
@GetMapping
(
"/submitTask"
)
@ApiOperation
(
value
=
"Query Service Version"
,
notes
=
"Query Dinky Service Version Number"
)
@ApiOperation
(
"Submit Task"
)
public
Result
<
String
>
getVersionInfo
()
{
public
Result
<
JobResult
>
submitTask
(
@RequestParam
Integer
id
)
throws
Exception
{
return
Result
.
succeed
(
DinkyVersion
.
getVersion
(),
"Get success"
);
taskService
.
initTenantByTaskId
(
id
);
JobResult
jobResult
=
taskService
.
submitTask
(
TaskSubmitDto
.
builder
().
id
(
id
).
build
());
if
(
jobResult
.
isSuccess
())
{
return
Result
.
succeed
(
jobResult
,
Status
.
EXECUTE_SUCCESS
);
}
else
{
return
Result
.
failed
(
jobResult
,
jobResult
.
getError
());
}
}
}
@PostMapping
(
"/submitTask"
)
@PostMapping
(
"/submitTask"
)
...
@@ -92,6 +86,15 @@ public class APIController {
...
@@ -92,6 +86,15 @@ public class APIController {
}
}
}
}
@PostMapping
(
"/savepointTask"
)
public
Result
savepointTask
(
@RequestBody
APISavePointTaskDTO
apiSavePointTaskDTO
)
{
return
Result
.
succeed
(
taskService
.
savepointTaskJob
(
taskService
.
getTaskInfoById
(
apiSavePointTaskDTO
.
getTaskId
()),
SavePointType
.
get
(
apiSavePointTaskDTO
.
getType
())),
Status
.
EXECUTE_SUCCESS
);
}
@GetMapping
(
"/cancel"
)
@GetMapping
(
"/cancel"
)
// @Log(title = "Cancel Flink Job", businessType = BusinessType.TRIGGER)
// @Log(title = "Cancel Flink Job", businessType = BusinessType.TRIGGER)
@ApiOperation
(
"Cancel Flink Job"
)
@ApiOperation
(
"Cancel Flink Job"
)
...
...
dinky-admin/src/main/java/org/dinky/data/dto/TaskSubmitDto.java
View file @
722e38fc
...
@@ -28,10 +28,25 @@ import lombok.Data;
...
@@ -28,10 +28,25 @@ import lombok.Data;
@Data
@Data
@Builder
@Builder
public
class
TaskSubmitDto
{
public
class
TaskSubmitDto
{
public
TaskSubmitDto
()
{}
public
TaskSubmitDto
(
Integer
id
,
Boolean
isOnline
,
String
savePointPath
,
Map
<
String
,
String
>
variables
)
{
this
.
id
=
id
;
this
.
isOnline
=
isOnline
;
this
.
savePointPath
=
savePointPath
;
this
.
variables
=
variables
;
}
@ApiModelProperty
(
value
=
"ID"
,
dataType
=
"Integer"
,
example
=
"6"
,
notes
=
"The identifier of the execution"
)
@ApiModelProperty
(
value
=
"ID"
,
dataType
=
"Integer"
,
example
=
"6"
,
notes
=
"The identifier of the execution"
)
private
Integer
id
;
private
Integer
id
;
@ApiModelProperty
(
value
=
"Is online"
,
dataType
=
"Boolean"
,
example
=
"true"
,
notes
=
"Online dinky task, and only one job is allowed to execute"
)
private
Boolean
isOnline
;
@ApiModelProperty
(
@ApiModelProperty
(
value
=
"Save Point Path"
,
value
=
"Save Point Path"
,
dataType
=
"String"
,
dataType
=
"String"
,
...
...
dinky-admin/src/main/java/org/dinky/init/SystemInit.java
View file @
722e38fc
...
@@ -202,9 +202,7 @@ public class SystemInit implements ApplicationRunner {
...
@@ -202,9 +202,7 @@ public class SystemInit implements ApplicationRunner {
project
=
projectClient
.
createDinkyProject
();
project
=
projectClient
.
createDinkyProject
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"Error in DolphinScheduler: "
,
e
);
log
.
warn
(
"Get or create DolphinScheduler project failed, please check the config of DolphinScheduler!"
);
log
.
error
(
"get or create DolphinScheduler project failed, please check the config of DolphinScheduler!"
);
}
}
}
}
}
}
...
...
dinky-metadata/dinky-metadata-base/src/main/java/org/dinky/metadata/driver/AbstractJdbcDriver.java
View file @
722e38fc
...
@@ -600,8 +600,9 @@ public abstract class AbstractJdbcDriver extends AbstractDriver<AbstractJdbcConf
...
@@ -600,8 +600,9 @@ public abstract class AbstractJdbcDriver extends AbstractDriver<AbstractJdbcConf
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
result
.
error
(
LogUtil
.
getError
(
e
));
result
.
error
(
LogUtil
.
getError
(
e
));
log
.
error
(
"Query failed"
,
e
);
log
.
error
(
"Query failed"
,
e
);
}
finally
{
close
(
preparedStatement
,
results
);
}
}
close
(
preparedStatement
,
results
);
result
.
setRowData
(
datas
);
result
.
setRowData
(
datas
);
return
result
;
return
result
;
}
}
...
...
dinky-scheduler/src/main/java/org/dinky/scheduler/model/DinkyTaskParams.java
View file @
722e38fc
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
package
org
.
dinky
.
scheduler
.
model
;
package
org
.
dinky
.
scheduler
.
model
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -28,7 +29,7 @@ import lombok.Data;
...
@@ -28,7 +29,7 @@ import lombok.Data;
public
class
DinkyTaskParams
{
public
class
DinkyTaskParams
{
@ApiModelProperty
(
value
=
"自定义参数"
)
@ApiModelProperty
(
value
=
"自定义参数"
)
private
List
<
Property
>
localParams
;
private
List
<
Property
>
localParams
=
new
ArrayList
<>()
;
@ApiModelProperty
(
value
=
"dinky地址"
)
@ApiModelProperty
(
value
=
"dinky地址"
)
private
String
address
;
private
String
address
;
...
...
dinky-web/src/pages/DataStudio/HeaderContainer/function.tsx
View file @
722e38fc
...
@@ -46,7 +46,6 @@ export const isOnline = (data: TaskDataType | undefined) => {
...
@@ -46,7 +46,6 @@ export const isOnline = (data: TaskDataType | undefined) => {
export
const
isCanPushDolphin
=
(
data
:
TaskDataType
|
undefined
)
=>
{
export
const
isCanPushDolphin
=
(
data
:
TaskDataType
|
undefined
)
=>
{
return
data
return
data
?
JOB_LIFE_CYCLE
.
PUBLISH
===
data
.
step
&&
?
JOB_LIFE_CYCLE
.
PUBLISH
===
data
.
step
&&
!
isSql
(
data
?.
dialect
)
&&
data
?.
dialect
?.
toLowerCase
()
!==
DIALECT
.
FLINKSQLENV
&&
data
?.
dialect
?.
toLowerCase
()
!==
DIALECT
.
FLINKSQLENV
&&
data
?.
dialect
?.
toLowerCase
()
!==
DIALECT
.
SCALA
&&
data
?.
dialect
?.
toLowerCase
()
!==
DIALECT
.
SCALA
&&
data
?.
dialect
?.
toLowerCase
()
!==
DIALECT
.
JAVA
&&
data
?.
dialect
?.
toLowerCase
()
!==
DIALECT
.
JAVA
&&
...
...
dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx
View file @
722e38fc
...
@@ -367,9 +367,7 @@ const HeaderContainer = (props: connect) => {
...
@@ -367,9 +367,7 @@ const HeaderContainer = (props: connect) => {
icon
:
isOnline
(
currentData
)
?
<
MergeCellsOutlined
/>
:
<
FundOutlined
/>,
icon
:
isOnline
(
currentData
)
?
<
MergeCellsOutlined
/>
:
<
FundOutlined
/>,
title
:
isOnline
(
currentData
)
?
l
(
'button.offline'
)
:
l
(
'button.publish'
),
title
:
isOnline
(
currentData
)
?
l
(
'button.offline'
)
:
l
(
'button.publish'
),
isShow
:
isShow
:
(
currentTab
?.
type
==
TabsPageType
.
project
&&
(
currentTab
?.
type
==
TabsPageType
.
project
),
currentTab
?.
subType
?.
toLowerCase
()
===
DIALECT
.
FLINK_SQL
)
||
currentTab
?.
subType
?.
toLowerCase
()
===
DIALECT
.
FLINKJAR
,
click
:
()
=>
handleChangeJobLife
()
click
:
()
=>
handleChangeJobLife
()
},
},
{
{
...
...
pom.xml
View file @
722e38fc
...
@@ -607,7 +607,7 @@
...
@@ -607,7 +607,7 @@
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.dinky
</groupId>
<groupId>
org.dinky
</groupId>
<artifactId>
dinky-cdc-
dori
s
</artifactId>
<artifactId>
dinky-cdc-
plu
s
</artifactId>
<version>
${project.version}
</version>
<version>
${project.version}
</version>
</dependency>
</dependency>
<dependency>
<dependency>
...
...
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