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
6b8d51b5
Unverified
Commit
6b8d51b5
authored
Jan 25, 2024
by
gaoyan
Committed by
GitHub
Jan 25, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix]Fixed the JAR task could not use set (#3057)
parent
ed1e6951
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
28 deletions
+23
-28
WebExceptionHandler.java
...ain/java/org/dinky/aop/exception/WebExceptionHandler.java
+0
-5
BusException.java
.../src/main/java/org/dinky/data/exception/BusException.java
+16
-19
JobManager.java
dinky-core/src/main/java/org/dinky/job/JobManager.java
+5
-4
flink_sql_task_devlop.md
docs/docs/user_guide/studio/flink_sql_task_devlop.md
+2
-0
No files found.
dinky-admin/src/main/java/org/dinky/aop/exception/WebExceptionHandler.java
View file @
6b8d51b5
...
@@ -22,7 +22,6 @@ package org.dinky.aop.exception;
...
@@ -22,7 +22,6 @@ package org.dinky.aop.exception;
import
org.dinky.data.enums.Status
;
import
org.dinky.data.enums.Status
;
import
org.dinky.data.exception.BusException
;
import
org.dinky.data.exception.BusException
;
import
org.dinky.data.result.Result
;
import
org.dinky.data.result.Result
;
import
org.dinky.utils.I18n
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -47,7 +46,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
...
@@ -47,7 +46,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import
cn.dev33.satoken.exception.NotLoginException
;
import
cn.dev33.satoken.exception.NotLoginException
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.StrUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
/**
/**
...
@@ -64,9 +62,6 @@ public class WebExceptionHandler {
...
@@ -64,9 +62,6 @@ public class WebExceptionHandler {
@ResponseBody
@ResponseBody
public
Result
<
Void
>
busException
(
BusException
e
)
{
public
Result
<
Void
>
busException
(
BusException
e
)
{
log
.
error
(
"BusException:"
,
e
);
log
.
error
(
"BusException:"
,
e
);
if
(
StrUtil
.
isEmpty
(
e
.
getMsg
()))
{
return
Result
.
failed
(
I18n
.
getMessage
(
e
.
getCode
(),
e
.
getMessage
()));
}
return
Result
.
failed
(
e
.
getMsg
());
return
Result
.
failed
(
e
.
getMsg
());
}
}
...
...
dinky-common/src/main/java/org/dinky/data/exception/BusException.java
View file @
6b8d51b5
...
@@ -21,7 +21,6 @@ package org.dinky.data.exception;
...
@@ -21,7 +21,6 @@ package org.dinky.data.exception;
import
org.dinky.data.enums.Status
;
import
org.dinky.data.enums.Status
;
import
cn.hutool.core.exceptions.ExceptionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
...
@@ -43,14 +42,14 @@ public class BusException extends RuntimeException {
...
@@ -43,14 +42,14 @@ public class BusException extends RuntimeException {
private
static
final
long
serialVersionUID
=
-
2955156471454043812L
;
private
static
final
long
serialVersionUID
=
-
2955156471454043812L
;
/** 异常信息的code码 */
/** 异常信息的code码 */
private
String
code
;
private
Status
code
;
/** 如果有值得话,将不会取i18n里面的错误信息 */
private
String
msg
;
/** 异常信息的参数 */
/** 异常信息的参数 */
private
Object
[]
errorArgs
;
private
Object
[]
errorArgs
;
/** 如果有值得话,将不会取i18n里面的错误信息 */
private
String
msg
;
public
BusException
(
String
message
)
{
public
BusException
(
String
message
)
{
super
(
message
);
super
(
message
);
setMsg
(
message
);
setMsg
(
message
);
...
@@ -58,32 +57,30 @@ public class BusException extends RuntimeException {
...
@@ -58,32 +57,30 @@ public class BusException extends RuntimeException {
public
BusException
(
Status
status
)
{
public
BusException
(
Status
status
)
{
super
(
status
.
getMessage
());
super
(
status
.
getMessage
());
setCode
(
String
.
valueOf
(
status
.
getCode
())
);
setCode
(
status
);
setMsg
(
status
.
getMessage
());
setMsg
(
status
.
getMessage
());
}
}
public
BusException
(
Status
status
,
Object
...
errorArgs
)
{
public
BusException
(
Status
status
,
Object
...
errorArgs
)
{
super
(
status
.
getMessage
());
super
(
status
.
getMessage
());
setCode
(
String
.
valueOf
(
status
.
getCode
())
);
setCode
(
status
);
setMsg
(
StrUtil
.
format
(
status
.
getMessage
(),
errorArgs
));
setMsg
(
StrUtil
.
format
(
status
.
getMessage
(),
errorArgs
));
}
}
public
BusException
(
String
message
,
Object
...
args
)
{
super
();
setCode
(
message
);
setErrorArgs
(
args
);
}
/**
/**
* An exception that gets the error message through i 18n
* An exception that gets the error message through i 18n
*
*
* @param
cod
e code
* @param
messag
e code
* @param e e
* @param e e
* @return {@link BusException}
* @return {@link BusException}
*/
*/
public
static
BusException
valueOf
(
String
code
,
Throwable
e
)
{
public
static
BusException
valueOf
(
String
message
,
Throwable
e
)
{
String
errMsg
=
ExceptionUtil
.
stacktraceToString
(
e
);
log
.
error
(
message
,
e
);
log
.
error
(
errMsg
);
return
new
BusException
(
message
+
e
.
getMessage
());
}
public
static
BusException
valueOf
(
Status
code
,
Throwable
e
)
{
log
.
error
(
code
.
getMessage
(),
e
);
return
new
BusException
(
code
,
e
.
getMessage
());
return
new
BusException
(
code
,
e
.
getMessage
());
}
}
...
@@ -94,7 +91,7 @@ public class BusException extends RuntimeException {
...
@@ -94,7 +91,7 @@ public class BusException extends RuntimeException {
* @param errorArgs errorArgs
* @param errorArgs errorArgs
* @return {@link BusException}
* @return {@link BusException}
*/
*/
public
static
BusException
valueOf
(
St
ring
code
,
Object
...
errorArgs
)
{
public
static
BusException
valueOf
(
St
atus
code
,
Object
...
errorArgs
)
{
return
new
BusException
(
code
,
errorArgs
);
return
new
BusException
(
code
,
errorArgs
);
}
}
...
@@ -104,7 +101,7 @@ public class BusException extends RuntimeException {
...
@@ -104,7 +101,7 @@ public class BusException extends RuntimeException {
* @param msg msg
* @param msg msg
* @return {@link BusException}
* @return {@link BusException}
*/
*/
public
static
BusException
valueOf
Msg
(
String
msg
)
{
public
static
BusException
valueOf
(
String
msg
)
{
return
new
BusException
(
msg
);
return
new
BusException
(
msg
);
}
}
}
}
dinky-core/src/main/java/org/dinky/job/JobManager.java
View file @
6b8d51b5
...
@@ -65,6 +65,7 @@ import org.dinky.utils.LogUtil;
...
@@ -65,6 +65,7 @@ import org.dinky.utils.LogUtil;
import
org.dinky.utils.SqlUtil
;
import
org.dinky.utils.SqlUtil
;
import
org.dinky.utils.URLUtils
;
import
org.dinky.utils.URLUtils
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.configuration.CoreOptions
;
import
org.apache.flink.configuration.CoreOptions
;
import
org.apache.flink.configuration.DeploymentOptions
;
import
org.apache.flink.configuration.DeploymentOptions
;
import
org.apache.flink.configuration.PipelineOptions
;
import
org.apache.flink.configuration.PipelineOptions
;
...
@@ -256,12 +257,12 @@ public class JobManager {
...
@@ -256,12 +257,12 @@ public class JobManager {
ready
();
ready
();
JobJarStreamGraphBuilder
jobJarStreamGraphBuilder
=
JobJarStreamGraphBuilder
.
build
(
this
);
JobJarStreamGraphBuilder
jobJarStreamGraphBuilder
=
JobJarStreamGraphBuilder
.
build
(
this
);
StreamGraph
streamGraph
=
jobJarStreamGraphBuilder
.
getJarStreamGraph
(
statement
,
getDinkyClassLoader
());
StreamGraph
streamGraph
=
jobJarStreamGraphBuilder
.
getJarStreamGraph
(
statement
,
getDinkyClassLoader
());
Configuration
configuration
=
executor
.
getCustomTableEnvironment
().
getConfig
().
getConfiguration
();
if
(
Asserts
.
isNotNullString
(
config
.
getSavePointPath
()))
{
if
(
Asserts
.
isNotNullString
(
config
.
getSavePointPath
()))
{
streamGraph
.
setSavepointRestoreSettings
(
SavepointRestoreSettings
.
forPath
(
streamGraph
.
setSavepointRestoreSettings
(
SavepointRestoreSettings
.
forPath
(
config
.
getSavePointPath
(),
config
.
getSavePointPath
(),
executor
.
getStreamExecutionEnvironment
()
configuration
.
get
(
SavepointConfigOptions
.
SAVEPOINT_IGNORE_UNCLAIMED_STATE
)));
.
getConfiguration
()
.
get
(
SavepointConfigOptions
.
SAVEPOINT_IGNORE_UNCLAIMED_STATE
)));
}
}
try
{
try
{
if
(!
useGateway
)
{
if
(!
useGateway
)
{
...
@@ -282,7 +283,7 @@ public class JobManager {
...
@@ -282,7 +283,7 @@ public class JobManager {
}
}
}
else
{
}
else
{
GatewayResult
gatewayResult
;
GatewayResult
gatewayResult
;
config
.
addGatewayConfig
(
executor
.
getSetConfig
()
);
config
.
addGatewayConfig
(
configuration
);
if
(
runMode
.
isApplicationMode
())
{
if
(
runMode
.
isApplicationMode
())
{
gatewayResult
=
Gateway
.
build
(
config
.
getGatewayConfig
()).
submitJar
(
getUdfPathContextHolder
());
gatewayResult
=
Gateway
.
build
(
config
.
getGatewayConfig
()).
submitJar
(
getUdfPathContextHolder
());
}
else
{
}
else
{
...
...
docs/docs/user_guide/studio/flink_sql_task_devlop.md
View file @
6b8d51b5
...
@@ -170,6 +170,8 @@ EXECUTE JAR WITH (
...
@@ -170,6 +170,8 @@ EXECUTE JAR WITH (
**样例代码**
**样例代码**
```
sql
```
sql
set
'execution.checkpointing.interval'
=
'21 s'
;
EXECUTE
JAR
WITH
(
EXECUTE
JAR
WITH
(
'uri'
=
'rs:/jar/flink/demo/SocketWindowWordCount.jar'
,
'uri'
=
'rs:/jar/flink/demo/SocketWindowWordCount.jar'
,
'main-class'
=
'org.apache.flink.streaming.examples.socket'
,
'main-class'
=
'org.apache.flink.streaming.examples.socket'
,
...
...
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