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
7a4bf38b
Unverified
Commit
7a4bf38b
authored
Nov 04, 2022
by
ZackYoung
Committed by
GitHub
Nov 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix][UDF]修复udf重构后,导致session模式无法使用udf (#1199)
* 修复udf重构后,导致session模式无法使用udf * 修复udf重构后,导致session模式无法使用udf * 修复udf重构后,导致session模式无法使用udf
parent
c7a7f2c4
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
163 additions
and
127 deletions
+163
-127
pom.xml
dlink-admin/pom.xml
+0
-4
UDFService.java
dlink-admin/src/main/java/com/dlink/service/UDFService.java
+1
-7
StudioServiceImpl.java
...c/main/java/com/dlink/service/impl/StudioServiceImpl.java
+14
-14
TaskServiceImpl.java
...src/main/java/com/dlink/service/impl/TaskServiceImpl.java
+2
-4
UDFServiceImpl.java
.../src/main/java/com/dlink/service/impl/UDFServiceImpl.java
+5
-67
Dialect.java
dlink-common/src/main/java/com/dlink/config/Dialect.java
+1
-1
pom.xml
dlink-core/pom.xml
+4
-0
JobConfig.java
dlink-core/src/main/java/com/dlink/job/JobConfig.java
+32
-16
JobManager.java
dlink-core/src/main/java/com/dlink/job/JobManager.java
+45
-2
pom.xml
dlink-function/pom.xml
+16
-7
FunctionFactory.java
...ion/src/main/java/com/dlink/function/FunctionFactory.java
+5
-4
JVMPackage.java
...src/main/java/com/dlink/function/compiler/JVMPackage.java
+1
-1
UDFPath.java
.../src/main/java/com/dlink/function/data/model/UDFPath.java
+4
-0
UDFUtil.java
...nction/src/main/java/com/dlink/function/util/UDFUtil.java
+33
-0
No files found.
dlink-admin/pom.xml
View file @
7a4bf38b
...
@@ -145,10 +145,6 @@
...
@@ -145,10 +145,6 @@
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<artifactId>
dlink-core
</artifactId>
<artifactId>
dlink-core
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
com.dlink
</groupId>
<artifactId>
dlink-function
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<artifactId>
dlink-common
</artifactId>
<artifactId>
dlink-common
</artifactId>
...
...
dlink-admin/src/main/java/com/dlink/service/UDFService.java
View file @
7a4bf38b
...
@@ -19,8 +19,6 @@
...
@@ -19,8 +19,6 @@
package
com
.
dlink
.
service
;
package
com
.
dlink
.
service
;
import
com.dlink.executor.Executor
;
import
com.dlink.gateway.GatewayType
;
import
com.dlink.job.JobConfig
;
import
com.dlink.job.JobConfig
;
/**
/**
...
@@ -30,12 +28,8 @@ import com.dlink.job.JobConfig;
...
@@ -30,12 +28,8 @@ import com.dlink.job.JobConfig;
public
interface
UDFService
{
public
interface
UDFService
{
/**
/**
*
* @param statement sql语句
* @param statement sql语句
* @param gatewayType flink 网关提交类型
* @param missionId 任务id
* @param executor flink执行器
* @param config job配置
* @param config job配置
*/
*/
void
init
UDF
(
String
statement
,
GatewayType
gatewayType
,
Integer
missionId
,
Executor
executor
,
JobConfig
config
);
void
init
(
String
statement
,
JobConfig
config
);
}
}
dlink-admin/src/main/java/com/dlink/service/impl/StudioServiceImpl.java
View file @
7a4bf38b
...
@@ -31,7 +31,6 @@ import com.dlink.dto.StudioExecuteDTO;
...
@@ -31,7 +31,6 @@ import com.dlink.dto.StudioExecuteDTO;
import
com.dlink.dto.StudioMetaStoreDTO
;
import
com.dlink.dto.StudioMetaStoreDTO
;
import
com.dlink.explainer.lineage.LineageBuilder
;
import
com.dlink.explainer.lineage.LineageBuilder
;
import
com.dlink.explainer.lineage.LineageResult
;
import
com.dlink.explainer.lineage.LineageResult
;
import
com.dlink.gateway.GatewayType
;
import
com.dlink.gateway.model.JobInfo
;
import
com.dlink.gateway.model.JobInfo
;
import
com.dlink.gateway.result.SavePointResult
;
import
com.dlink.gateway.result.SavePointResult
;
import
com.dlink.job.JobConfig
;
import
com.dlink.job.JobConfig
;
...
@@ -180,10 +179,10 @@ public class StudioServiceImpl implements StudioService {
...
@@ -180,10 +179,10 @@ public class StudioServiceImpl implements StudioService {
addFlinkSQLEnv
(
studioExecuteDTO
);
addFlinkSQLEnv
(
studioExecuteDTO
);
JobConfig
config
=
studioExecuteDTO
.
getJobConfig
();
JobConfig
config
=
studioExecuteDTO
.
getJobConfig
();
buildSession
(
config
);
buildSession
(
config
);
JobManager
jobManager
=
JobManager
.
build
(
config
);
// init UDF
udfService
.
init
(
studioExecuteDTO
.
getStatement
(),
config
);
// initUDF
JobManager
jobManager
=
JobManager
.
build
(
config
);
udfService
.
initUDF
(
studioExecuteDTO
.
getStatement
(),
GatewayType
.
get
(
config
.
getType
()),
studioExecuteDTO
.
getTaskId
(),
jobManager
.
getExecutor
(),
config
);
JobResult
jobResult
=
jobManager
.
executeSql
(
studioExecuteDTO
.
getStatement
());
JobResult
jobResult
=
jobManager
.
executeSql
(
studioExecuteDTO
.
getStatement
());
RunTimeUtil
.
recovery
(
jobManager
);
RunTimeUtil
.
recovery
(
jobManager
);
...
@@ -269,10 +268,10 @@ public class StudioServiceImpl implements StudioService {
...
@@ -269,10 +268,10 @@ public class StudioServiceImpl implements StudioService {
process
.
infoSuccess
();
process
.
infoSuccess
();
process
.
start
();
process
.
start
();
JobManager
jobManager
=
JobManager
.
buildPlanMode
(
config
);
// init UDF
udfService
.
init
(
studioExecuteDTO
.
getStatement
(),
config
);
// initUDF
JobManager
jobManager
=
JobManager
.
build
(
config
);
udfService
.
initUDF
(
studioExecuteDTO
.
getStatement
(),
GatewayType
.
get
(
config
.
getType
()),
studioExecuteDTO
.
getTaskId
(),
jobManager
.
getExecutor
(),
config
);
List
<
SqlExplainResult
>
sqlExplainResults
=
List
<
SqlExplainResult
>
sqlExplainResults
=
jobManager
.
explainSql
(
studioExecuteDTO
.
getStatement
()).
getSqlExplainResults
();
jobManager
.
explainSql
(
studioExecuteDTO
.
getStatement
()).
getSqlExplainResults
();
...
@@ -313,10 +312,10 @@ public class StudioServiceImpl implements StudioService {
...
@@ -313,10 +312,10 @@ public class StudioServiceImpl implements StudioService {
// If you are using explainSql | getStreamGraph | getJobPlan, make the dialect change to local.
// If you are using explainSql | getStreamGraph | getJobPlan, make the dialect change to local.
config
.
buildLocal
();
config
.
buildLocal
();
buildSession
(
config
);
buildSession
(
config
);
JobManager
jobManager
=
JobManager
.
buildPlanMode
(
config
);
// init UDF
udfService
.
init
(
studioExecuteDTO
.
getStatement
(),
config
);
// initUDF
JobManager
jobManager
=
JobManager
.
build
(
config
);
udfService
.
initUDF
(
studioExecuteDTO
.
getStatement
(),
GatewayType
.
get
(
config
.
getType
()),
studioExecuteDTO
.
getTaskId
(),
jobManager
.
getExecutor
(),
config
);
String
planJson
=
jobManager
.
getJobPlanJson
(
studioExecuteDTO
.
getStatement
());
String
planJson
=
jobManager
.
getJobPlanJson
(
studioExecuteDTO
.
getStatement
());
ObjectMapper
mapper
=
new
ObjectMapper
();
ObjectMapper
mapper
=
new
ObjectMapper
();
...
@@ -429,7 +428,8 @@ public class StudioServiceImpl implements StudioService {
...
@@ -429,7 +428,8 @@ public class StudioServiceImpl implements StudioService {
jobConfig
.
setType
(
cluster
.
getType
());
jobConfig
.
setType
(
cluster
.
getType
());
if
(
Asserts
.
isNotNull
(
cluster
.
getClusterConfigurationId
()))
{
if
(
Asserts
.
isNotNull
(
cluster
.
getClusterConfigurationId
()))
{
// 如果用户选择用dlink平台来托管集群信息 说明任务一定是从dlink发起提交的
// 如果用户选择用dlink平台来托管集群信息 说明任务一定是从dlink发起提交的
Map
<
String
,
Object
>
gatewayConfig
=
clusterConfigurationService
.
getGatewayConfig
(
cluster
.
getClusterConfigurationId
());
Map
<
String
,
Object
>
gatewayConfig
=
clusterConfigurationService
.
getGatewayConfig
(
cluster
.
getClusterConfigurationId
());
jobConfig
.
buildGatewayConfig
(
gatewayConfig
);
jobConfig
.
buildGatewayConfig
(
gatewayConfig
);
jobConfig
.
getGatewayConfig
().
getClusterConfig
().
setAppId
(
cluster
.
getName
());
jobConfig
.
getGatewayConfig
().
getClusterConfig
().
setAppId
(
cluster
.
getName
());
jobConfig
.
setTaskId
(
cluster
.
getTaskId
());
jobConfig
.
setTaskId
(
cluster
.
getTaskId
());
...
@@ -483,11 +483,11 @@ public class StudioServiceImpl implements StudioService {
...
@@ -483,11 +483,11 @@ public class StudioServiceImpl implements StudioService {
for
(
Map
<
String
,
Object
>
item
:
ddlResult
.
getRowData
())
{
for
(
Map
<
String
,
Object
>
item
:
ddlResult
.
getRowData
())
{
catalogs
.
add
(
Catalog
.
build
(
item
.
get
(
key
).
toString
()));
catalogs
.
add
(
Catalog
.
build
(
item
.
get
(
key
).
toString
()));
}
}
}
});
);
for
(
Catalog
catalog
:
catalogs
)
{
for
(
Catalog
catalog
:
catalogs
)
{
String
statement
=
FlinkQuery
.
useCatalog
(
catalog
.
getName
())
+
FlinkQuery
.
separator
()
+
FlinkQuery
.
showDatabases
();
String
statement
=
FlinkQuery
.
useCatalog
(
catalog
.
getName
())
+
FlinkQuery
.
separator
()
+
FlinkQuery
.
showDatabases
();
studioMetaStoreDTO
.
setStatement
(
statement
);
studioMetaStoreDTO
.
setStatement
(
statement
);
IResult
tableResult
=
executeMSFlinkSql
(
studioMetaStoreDTO
);
IResult
tableResult
=
executeMSFlinkSql
(
studioMetaStoreDTO
);
DDLResult
tableDDLResult
=
(
DDLResult
)
tableResult
;
DDLResult
tableDDLResult
=
(
DDLResult
)
tableResult
;
...
...
dlink-admin/src/main/java/com/dlink/service/impl/TaskServiceImpl.java
View file @
7a4bf38b
...
@@ -209,12 +209,10 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
...
@@ -209,12 +209,10 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
task
.
getDatabaseId
(),
null
));
task
.
getDatabaseId
(),
null
));
}
}
JobConfig
config
=
buildJobConfig
(
task
);
JobConfig
config
=
buildJobConfig
(
task
);
// init UDF
udfService
.
init
(
task
.
getStatement
(),
config
);
JobManager
jobManager
=
JobManager
.
build
(
config
);
JobManager
jobManager
=
JobManager
.
build
(
config
);
// initUDF
udfService
.
initUDF
(
task
.
getStatement
(),
GatewayType
.
get
(
config
.
getType
()),
id
,
jobManager
.
getExecutor
(),
config
);
if
(!
config
.
isJarTask
())
{
if
(!
config
.
isJarTask
())
{
return
jobManager
.
executeSql
(
task
.
getStatement
());
return
jobManager
.
executeSql
(
task
.
getStatement
());
}
else
{
}
else
{
...
...
dlink-admin/src/main/java/com/dlink/service/impl/UDFServiceImpl.java
View file @
7a4bf38b
...
@@ -19,32 +19,12 @@
...
@@ -19,32 +19,12 @@
package
com
.
dlink
.
service
.
impl
;
package
com
.
dlink
.
service
.
impl
;
import
com.dlink.exception.BusException
;
import
com.dlink.executor.Executor
;
import
com.dlink.function.FunctionFactory
;
import
com.dlink.function.data.model.Env
;
import
com.dlink.function.data.model.UDF
;
import
com.dlink.function.data.model.UDFPath
;
import
com.dlink.gateway.GatewayType
;
import
com.dlink.job.JobConfig
;
import
com.dlink.job.JobConfig
;
import
com.dlink.process.context.ProcessContextHolder
;
import
com.dlink.process.model.ProcessEntity
;
import
com.dlink.service.TaskService
;
import
com.dlink.service.UDFService
;
import
com.dlink.service.UDFService
;
import
com.dlink.utils.UDFUtils
;
import
com.dlink.utils.UDFUtils
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
javax.annotation.Resource
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.ArrayUtil
;
/**
/**
* @author ZackYoung
* @author ZackYoung
* @since 0.6.8
* @since 0.6.8
...
@@ -52,56 +32,14 @@ import cn.hutool.core.util.ArrayUtil;
...
@@ -52,56 +32,14 @@ import cn.hutool.core.util.ArrayUtil;
@Service
@Service
public
class
UDFServiceImpl
implements
UDFService
{
public
class
UDFServiceImpl
implements
UDFService
{
private
static
final
String
YARN
=
"YARN"
;
private
static
final
String
APPLICATION
=
"APPLICATION"
;
/**
* 网关类型 map
* 快速获取 session 与 application 等类型,为了减少判断
*/
private
static
final
Map
<
String
,
List
<
GatewayType
>>
GATEWAY_TYPE_MAP
=
MapUtil
.
builder
(
"session"
,
Arrays
.
asList
(
GatewayType
.
YARN_SESSION
,
GatewayType
.
KUBERNETES_SESSION
,
GatewayType
.
STANDALONE
))
.
put
(
YARN
,
Arrays
.
asList
(
GatewayType
.
YARN_APPLICATION
,
GatewayType
.
YARN_PER_JOB
))
.
put
(
APPLICATION
,
Arrays
.
asList
(
GatewayType
.
YARN_APPLICATION
,
GatewayType
.
KUBERNETES_APPLICATION
))
.
build
();
@Resource
TaskService
taskService
;
/**
/**
* 获取所有udf相关的代码
*
* @param statement sql语句
* @param statement sql语句
* @param gatewayType flink 网关提交类型
* @return jobManage
* @param missionId 任务id
* @param executor flink执行器
* @param config job配置
*/
*/
@Override
@Override
public
void
initUDF
(
String
statement
,
GatewayType
gatewayType
,
Integer
missionId
,
Executor
executor
,
public
void
init
(
String
statement
,
JobConfig
config
)
{
JobConfig
config
)
{
config
.
setUdfList
(
UDFUtils
.
getUDF
(
statement
));
ProcessEntity
process
=
ProcessContextHolder
.
getProcess
();
process
.
info
(
"Initializing Flink UDF...Start"
);
List
<
UDF
>
udf
=
UDFUtils
.
getUDF
(
statement
);
if
(
CollUtil
.
isNotEmpty
(
udf
))
{
if
(
gatewayType
==
GatewayType
.
KUBERNETES_APPLICATION
)
{
throw
new
BusException
(
"udf 暂不支持k8s application"
);
}
}
else
{
return
;
}
UDFPath
udfPath
=
FunctionFactory
.
initUDF
(
udf
,
missionId
,
executor
);
executor
.
initUDF
(
udfPath
.
getJarPaths
());
executor
.
initPyUDF
(
Env
.
getPath
(),
udfPath
.
getPyPaths
());
//
if
(
GATEWAY_TYPE_MAP
.
get
(
YARN
).
contains
(
gatewayType
))
{
config
.
getGatewayConfig
().
setJarPaths
(
ArrayUtil
.
append
(
udfPath
.
getJarPaths
(),
udfPath
.
getPyPaths
()));
}
process
.
info
(
"Initializing Flink UDF...Finish"
);
}
}
}
}
dlink-co
re
/src/main/java/com/dlink/config/Dialect.java
→
dlink-co
mmon
/src/main/java/com/dlink/config/Dialect.java
View file @
7a4bf38b
...
@@ -28,6 +28,7 @@ import com.dlink.assertion.Asserts;
...
@@ -28,6 +28,7 @@ import com.dlink.assertion.Asserts;
* @since 2021/12/13
* @since 2021/12/13
**/
**/
public
enum
Dialect
{
public
enum
Dialect
{
FLINKSQL
(
"FlinkSql"
),
FLINKSQL
(
"FlinkSql"
),
FLINKJAR
(
"FlinkJar"
),
FLINKJAR
(
"FlinkJar"
),
FLINKSQLENV
(
"FlinkSqlEnv"
),
FLINKSQLENV
(
"FlinkSqlEnv"
),
...
@@ -110,4 +111,3 @@ public enum Dialect {
...
@@ -110,4 +111,3 @@ public enum Dialect {
}
}
}
}
}
}
dlink-core/pom.xml
View file @
7a4bf38b
...
@@ -182,5 +182,9 @@
...
@@ -182,5 +182,9 @@
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<artifactId>
dlink-process
</artifactId>
<artifactId>
dlink-process
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
com.dlink
</groupId>
<artifactId>
dlink-function
</artifactId>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
dlink-core/src/main/java/com/dlink/job/JobConfig.java
View file @
7a4bf38b
...
@@ -21,6 +21,7 @@ package com.dlink.job;
...
@@ -21,6 +21,7 @@ package com.dlink.job;
import
com.dlink.assertion.Asserts
;
import
com.dlink.assertion.Asserts
;
import
com.dlink.executor.ExecutorSetting
;
import
com.dlink.executor.ExecutorSetting
;
import
com.dlink.function.data.model.UDF
;
import
com.dlink.gateway.GatewayType
;
import
com.dlink.gateway.GatewayType
;
import
com.dlink.gateway.config.AppConfig
;
import
com.dlink.gateway.config.AppConfig
;
import
com.dlink.gateway.config.ClusterConfig
;
import
com.dlink.gateway.config.ClusterConfig
;
...
@@ -64,6 +65,7 @@ public class JobConfig {
...
@@ -64,6 +65,7 @@ public class JobConfig {
private
boolean
isJarTask
=
false
;
private
boolean
isJarTask
=
false
;
private
String
address
;
private
String
address
;
private
Integer
taskId
;
private
Integer
taskId
;
private
List
<
UDF
>
udfList
;
private
String
[]
jarFiles
;
private
String
[]
jarFiles
;
private
String
[]
pyFiles
;
private
String
[]
pyFiles
;
private
String
jobName
;
private
String
jobName
;
...
@@ -82,7 +84,8 @@ public class JobConfig {
...
@@ -82,7 +84,8 @@ public class JobConfig {
public
JobConfig
()
{
public
JobConfig
()
{
}
}
public
JobConfig
(
String
type
,
boolean
useSession
,
boolean
useRemote
,
boolean
useSqlFragment
,
boolean
useStatementSet
,
Integer
parallelism
,
Map
<
String
,
String
>
config
)
{
public
JobConfig
(
String
type
,
boolean
useSession
,
boolean
useRemote
,
boolean
useSqlFragment
,
boolean
useStatementSet
,
Integer
parallelism
,
Map
<
String
,
String
>
config
)
{
this
.
type
=
type
;
this
.
type
=
type
;
this
.
useSession
=
useSession
;
this
.
useSession
=
useSession
;
this
.
useRemote
=
useRemote
;
this
.
useRemote
=
useRemote
;
...
@@ -92,10 +95,14 @@ public class JobConfig {
...
@@ -92,10 +95,14 @@ public class JobConfig {
this
.
config
=
config
;
this
.
config
=
config
;
}
}
public
JobConfig
(
String
type
,
boolean
useResult
,
boolean
useChangeLog
,
boolean
useAutoCancel
,
boolean
useSession
,
String
session
,
Integer
clusterId
,
public
JobConfig
(
String
type
,
boolean
useResult
,
boolean
useChangeLog
,
boolean
useAutoCancel
,
boolean
useSession
,
Integer
clusterConfigurationId
,
Integer
jarId
,
Integer
taskId
,
String
jobName
,
boolean
useSqlFragment
,
String
session
,
Integer
clusterId
,
boolean
useStatementSet
,
boolean
useBatchModel
,
Integer
maxRowNum
,
Integer
checkpoint
,
Integer
parallelism
,
Integer
clusterConfigurationId
,
Integer
jarId
,
Integer
taskId
,
String
jobName
,
Integer
savePointStrategyValue
,
String
savePointPath
,
Map
<
String
,
String
>
variables
,
Map
<
String
,
String
>
config
)
{
boolean
useSqlFragment
,
boolean
useStatementSet
,
boolean
useBatchModel
,
Integer
maxRowNum
,
Integer
checkpoint
,
Integer
parallelism
,
Integer
savePointStrategyValue
,
String
savePointPath
,
Map
<
String
,
String
>
variables
,
Map
<
String
,
String
>
config
)
{
this
.
type
=
type
;
this
.
type
=
type
;
this
.
useResult
=
useResult
;
this
.
useResult
=
useResult
;
this
.
useChangeLog
=
useChangeLog
;
this
.
useChangeLog
=
useChangeLog
;
...
@@ -120,10 +127,12 @@ public class JobConfig {
...
@@ -120,10 +127,12 @@ public class JobConfig {
this
.
config
=
config
;
this
.
config
=
config
;
}
}
public
JobConfig
(
String
type
,
boolean
useResult
,
boolean
useChangeLog
,
boolean
useAutoCancel
,
boolean
useSession
,
String
session
,
boolean
useRemote
,
String
address
,
public
JobConfig
(
String
type
,
boolean
useResult
,
boolean
useChangeLog
,
boolean
useAutoCancel
,
boolean
useSession
,
String
session
,
boolean
useRemote
,
String
address
,
String
jobName
,
boolean
useSqlFragment
,
String
jobName
,
boolean
useSqlFragment
,
boolean
useStatementSet
,
Integer
maxRowNum
,
Integer
checkpoint
,
Integer
parallelism
,
boolean
useStatementSet
,
Integer
maxRowNum
,
Integer
checkpoint
,
Integer
parallelism
,
Integer
savePointStrategyValue
,
String
savePointPath
,
Map
<
String
,
String
>
config
,
GatewayConfig
gatewayConfig
)
{
Integer
savePointStrategyValue
,
String
savePointPath
,
Map
<
String
,
String
>
config
,
GatewayConfig
gatewayConfig
)
{
this
.
type
=
type
;
this
.
type
=
type
;
this
.
useResult
=
useResult
;
this
.
useResult
=
useResult
;
this
.
useChangeLog
=
useChangeLog
;
this
.
useChangeLog
=
useChangeLog
;
...
@@ -144,7 +153,8 @@ public class JobConfig {
...
@@ -144,7 +153,8 @@ public class JobConfig {
this
.
gatewayConfig
=
gatewayConfig
;
this
.
gatewayConfig
=
gatewayConfig
;
}
}
public
JobConfig
(
String
type
,
boolean
useResult
,
boolean
useSession
,
String
session
,
boolean
useRemote
,
Integer
clusterId
,
Integer
maxRowNum
)
{
public
JobConfig
(
String
type
,
boolean
useResult
,
boolean
useSession
,
String
session
,
boolean
useRemote
,
Integer
clusterId
,
Integer
maxRowNum
)
{
this
.
type
=
type
;
this
.
type
=
type
;
this
.
useResult
=
useResult
;
this
.
useResult
=
useResult
;
this
.
useSession
=
useSession
;
this
.
useSession
=
useSession
;
...
@@ -154,9 +164,12 @@ public class JobConfig {
...
@@ -154,9 +164,12 @@ public class JobConfig {
this
.
maxRowNum
=
maxRowNum
;
this
.
maxRowNum
=
maxRowNum
;
}
}
public
JobConfig
(
String
type
,
Integer
step
,
boolean
useResult
,
boolean
useSession
,
boolean
useRemote
,
Integer
clusterId
,
public
JobConfig
(
String
type
,
Integer
step
,
boolean
useResult
,
boolean
useSession
,
boolean
useRemote
,
Integer
clusterConfigurationId
,
Integer
jarId
,
Integer
taskId
,
String
jobName
,
boolean
useSqlFragment
,
Integer
clusterId
,
boolean
useStatementSet
,
boolean
useBatchModel
,
Integer
checkpoint
,
Integer
parallelism
,
Integer
savePointStrategyValue
,
Integer
clusterConfigurationId
,
Integer
jarId
,
Integer
taskId
,
String
jobName
,
boolean
useSqlFragment
,
boolean
useStatementSet
,
boolean
useBatchModel
,
Integer
checkpoint
,
Integer
parallelism
,
Integer
savePointStrategyValue
,
String
savePointPath
,
Map
<
String
,
String
>
config
)
{
String
savePointPath
,
Map
<
String
,
String
>
config
)
{
this
.
type
=
type
;
this
.
type
=
type
;
this
.
step
=
step
;
this
.
step
=
step
;
...
@@ -179,7 +192,8 @@ public class JobConfig {
...
@@ -179,7 +192,8 @@ public class JobConfig {
}
}
public
ExecutorSetting
getExecutorSetting
()
{
public
ExecutorSetting
getExecutorSetting
()
{
return
new
ExecutorSetting
(
checkpoint
,
parallelism
,
useSqlFragment
,
useStatementSet
,
useBatchModel
,
savePointPath
,
jobName
,
config
);
return
new
ExecutorSetting
(
checkpoint
,
parallelism
,
useSqlFragment
,
useStatementSet
,
useBatchModel
,
savePointPath
,
jobName
,
config
);
}
}
public
void
setSessionConfig
(
SessionConfig
sessionConfig
)
{
public
void
setSessionConfig
(
SessionConfig
sessionConfig
)
{
...
@@ -202,11 +216,12 @@ public class JobConfig {
...
@@ -202,11 +216,12 @@ public class JobConfig {
AppConfig
appConfig
=
new
AppConfig
();
AppConfig
appConfig
=
new
AppConfig
();
if
(
config
.
containsKey
(
"userJarPath"
)
&&
Asserts
.
isNotNullString
((
String
)
config
.
get
(
"userJarPath"
)))
{
if
(
config
.
containsKey
(
"userJarPath"
)
&&
Asserts
.
isNotNullString
((
String
)
config
.
get
(
"userJarPath"
)))
{
appConfig
.
setUserJarPath
(
config
.
get
(
"userJarPath"
).
toString
());
appConfig
.
setUserJarPath
(
config
.
get
(
"userJarPath"
).
toString
());
if
(
config
.
containsKey
(
"userJarMainAppClass"
)
&&
Asserts
.
isNotNullString
((
String
)
config
.
get
(
"userJarMainAppClass"
)))
{
if
(
config
.
containsKey
(
"userJarMainAppClass"
)
&&
Asserts
.
isNotNullString
((
String
)
config
.
get
(
"userJarMainAppClass"
)))
{
appConfig
.
setUserJarMainAppClass
(
config
.
get
(
"userJarMainAppClass"
).
toString
());
appConfig
.
setUserJarMainAppClass
(
config
.
get
(
"userJarMainAppClass"
).
toString
());
}
}
if
(
config
.
containsKey
(
"userJarParas"
)
&&
Asserts
.
isNotNullString
((
String
)
config
.
get
(
"userJarParas"
)))
{
if
(
config
.
containsKey
(
"userJarParas"
)
&&
Asserts
.
isNotNullString
((
String
)
config
.
get
(
"userJarParas"
)))
{
//There may be multiple spaces between the parameter and value during user input,
//
There may be multiple spaces between the parameter and value during user input,
// which will directly lead to a parameter passing error and needs to be eliminated
// which will directly lead to a parameter passing error and needs to be eliminated
String
[]
temp
=
config
.
get
(
"userJarParas"
).
toString
().
split
(
" "
);
String
[]
temp
=
config
.
get
(
"userJarParas"
).
toString
().
split
(
" "
);
List
<
String
>
paraSplit
=
new
ArrayList
<>();
List
<
String
>
paraSplit
=
new
ArrayList
<>();
...
@@ -219,12 +234,13 @@ public class JobConfig {
...
@@ -219,12 +234,13 @@ public class JobConfig {
}
}
gatewayConfig
.
setAppConfig
(
appConfig
);
gatewayConfig
.
setAppConfig
(
appConfig
);
}
}
if
(
config
.
containsKey
(
"flinkConfig"
)
&&
Asserts
.
isNotNullMap
((
Map
<
String
,
String
>)
config
.
get
(
"flinkConfig"
)))
{
if
(
config
.
containsKey
(
"flinkConfig"
)
&&
Asserts
.
isNotNullMap
((
Map
<
String
,
String
>)
config
.
get
(
"flinkConfig"
)))
{
gatewayConfig
.
setFlinkConfig
(
FlinkConfig
.
build
((
Map
<
String
,
String
>)
config
.
get
(
"flinkConfig"
)));
gatewayConfig
.
setFlinkConfig
(
FlinkConfig
.
build
((
Map
<
String
,
String
>)
config
.
get
(
"flinkConfig"
)));
}
}
if
(
config
.
containsKey
(
"kubernetesConfig"
))
{
if
(
config
.
containsKey
(
"kubernetesConfig"
))
{
Map
<
String
,
Object
>
kubernetesConfig
=
(
Map
<
String
,
Object
>)
config
.
get
(
"kubernetesConfig"
);
Map
<
String
,
Object
>
kubernetesConfig
=
(
Map
<
String
,
Object
>)
config
.
get
(
"kubernetesConfig"
);
//构建GatewayConfig时,将k8s集群默认配置和自定义参数配置加载到FlinkConfig里
//
构建GatewayConfig时,将k8s集群默认配置和自定义参数配置加载到FlinkConfig里
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
kubernetesConfig
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
kubernetesConfig
.
entrySet
())
{
gatewayConfig
.
getFlinkConfig
().
getConfiguration
().
put
(
entry
.
getKey
(),
entry
.
getValue
().
toString
());
gatewayConfig
.
getFlinkConfig
().
getConfiguration
().
put
(
entry
.
getKey
(),
entry
.
getValue
().
toString
());
}
}
...
...
dlink-core/src/main/java/com/dlink/job/JobManager.java
View file @
7a4bf38b
...
@@ -19,6 +19,10 @@
...
@@ -19,6 +19,10 @@
package
com
.
dlink
.
job
;
package
com
.
dlink
.
job
;
import
static
com
.
dlink
.
function
.
util
.
UDFUtil
.
GATEWAY_TYPE_MAP
;
import
static
com
.
dlink
.
function
.
util
.
UDFUtil
.
SESSION
;
import
static
com
.
dlink
.
function
.
util
.
UDFUtil
.
YARN
;
import
com.dlink.api.FlinkAPI
;
import
com.dlink.api.FlinkAPI
;
import
com.dlink.assertion.Asserts
;
import
com.dlink.assertion.Asserts
;
import
com.dlink.constant.FlinkSQLConstant
;
import
com.dlink.constant.FlinkSQLConstant
;
...
@@ -26,6 +30,9 @@ import com.dlink.executor.EnvironmentSetting;
...
@@ -26,6 +30,9 @@ import com.dlink.executor.EnvironmentSetting;
import
com.dlink.executor.Executor
;
import
com.dlink.executor.Executor
;
import
com.dlink.executor.ExecutorSetting
;
import
com.dlink.executor.ExecutorSetting
;
import
com.dlink.explainer.Explainer
;
import
com.dlink.explainer.Explainer
;
import
com.dlink.function.data.model.Env
;
import
com.dlink.function.data.model.UDF
;
import
com.dlink.function.util.UDFUtil
;
import
com.dlink.gateway.Gateway
;
import
com.dlink.gateway.Gateway
;
import
com.dlink.gateway.GatewayType
;
import
com.dlink.gateway.GatewayType
;
import
com.dlink.gateway.config.ActionType
;
import
com.dlink.gateway.config.ActionType
;
...
@@ -39,6 +46,7 @@ import com.dlink.interceptor.FlinkInterceptorResult;
...
@@ -39,6 +46,7 @@ import com.dlink.interceptor.FlinkInterceptorResult;
import
com.dlink.model.SystemConfiguration
;
import
com.dlink.model.SystemConfiguration
;
import
com.dlink.parser.SqlType
;
import
com.dlink.parser.SqlType
;
import
com.dlink.process.context.ProcessContextHolder
;
import
com.dlink.process.context.ProcessContextHolder
;
import
com.dlink.process.model.ProcessEntity
;
import
com.dlink.result.ErrorResult
;
import
com.dlink.result.ErrorResult
;
import
com.dlink.result.ExplainResult
;
import
com.dlink.result.ExplainResult
;
import
com.dlink.result.IResult
;
import
com.dlink.result.IResult
;
...
@@ -78,6 +86,9 @@ import org.slf4j.LoggerFactory;
...
@@ -78,6 +86,9 @@ import org.slf4j.LoggerFactory;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.ArrayUtil
;
/**
/**
* JobManager
* JobManager
*
*
...
@@ -217,7 +228,7 @@ public class JobManager {
...
@@ -217,7 +228,7 @@ public class JobManager {
private
void
initEnvironmentSetting
()
{
private
void
initEnvironmentSetting
()
{
if
(
Asserts
.
isNotNullString
(
config
.
getAddress
()))
{
if
(
Asserts
.
isNotNullString
(
config
.
getAddress
()))
{
environmentSetting
=
EnvironmentSetting
.
build
(
config
.
getAddress
());
environmentSetting
=
EnvironmentSetting
.
build
(
config
.
getAddress
()
,
config
.
getJarFiles
()
);
}
}
}
}
...
@@ -234,11 +245,43 @@ public class JobManager {
...
@@ -234,11 +245,43 @@ public class JobManager {
useStatementSet
=
config
.
isUseStatementSet
();
useStatementSet
=
config
.
isUseStatementSet
();
useRestAPI
=
SystemConfiguration
.
getInstances
().
isUseRestAPI
();
useRestAPI
=
SystemConfiguration
.
getInstances
().
isUseRestAPI
();
sqlSeparator
=
SystemConfiguration
.
getInstances
().
getSqlSeparator
();
sqlSeparator
=
SystemConfiguration
.
getInstances
().
getSqlSeparator
();
initExecutorSetting
();
initExecutorSetting
();
createExecutorWithSession
();
initUDF
();
return
false
;
return
false
;
}
}
private
void
initUDF
()
{
ProcessEntity
process
=
ProcessContextHolder
.
getProcess
();
// 这里要分开
// 1. 得到jar包路径,注入remote环境
List
<
UDF
>
udfList
=
config
.
getUdfList
();
if
(
CollUtil
.
isEmpty
(
udfList
))
{
createExecutorWithSession
();
return
;
}
else
if
(
runMode
==
GatewayType
.
KUBERNETES_APPLICATION
)
{
throw
new
RuntimeException
(
"UDF 暂不支持k8s模式"
);
}
String
[]
jarPaths
=
UDFUtil
.
initJavaUDF
(
udfList
,
runMode
,
config
.
getTaskId
());
if
(
GATEWAY_TYPE_MAP
.
get
(
SESSION
).
contains
(
runMode
))
{
config
.
setJarFiles
(
jarPaths
);
}
// 2.实例化remote环境
createExecutorWithSession
();
// 3.编译python
String
[]
pyPaths
=
UDFUtil
.
initPythonUDF
(
udfList
,
runMode
,
config
.
getTaskId
(),
executor
.
getTableConfig
().
getConfiguration
());
executor
.
initUDF
(
jarPaths
);
executor
.
initPyUDF
(
Env
.
getPath
(),
pyPaths
);
if
(
GATEWAY_TYPE_MAP
.
get
(
YARN
).
contains
(
runMode
))
{
config
.
getGatewayConfig
().
setJarPaths
(
ArrayUtil
.
append
(
jarPaths
,
pyPaths
));
}
process
.
info
(
"Initializing Flink UDF...Finish"
);
}
private
boolean
ready
()
{
private
boolean
ready
()
{
return
handler
.
init
();
return
handler
.
init
();
}
}
...
...
dlink-function/pom.xml
View file @
7a4bf38b
...
@@ -15,16 +15,14 @@
...
@@ -15,16 +15,14 @@
~ See the License for the specific language governing permissions and
~ See the License for the specific language governing permissions and
~ limitations under the License.
~ limitations under the License.
-->
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<parent>
<artifactId>
dlink
</artifactId>
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<artifactId>
dlink
</artifactId>
<version>
0.6.8-SNAPSHOT
</version>
<version>
0.6.8-SNAPSHOT
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
dlink-function
</artifactId>
<artifactId>
dlink-function
</artifactId>
...
@@ -46,14 +44,25 @@
...
@@ -46,14 +44,25 @@
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<artifactId>
dlink-
core
</artifactId>
<artifactId>
dlink-
gateway
</artifactId>
<scope>
provided
</scope>
<scope>
provided
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<artifactId>
dlink-executor
</artifactId>
<artifactId>
dlink-process
</artifactId>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.codehaus.groovy
</groupId>
<artifactId>
groovy
</artifactId>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-context
</artifactId>
<scope>
provided
</scope>
<scope>
provided
</scope>
</dependency>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
dlink-function/src/main/java/com/dlink/function/FunctionFactory.java
View file @
7a4bf38b
...
@@ -19,12 +19,13 @@
...
@@ -19,12 +19,13 @@
package
com
.
dlink
.
function
;
package
com
.
dlink
.
function
;
import
com.dlink.executor.Executor
;
import
com.dlink.function.compiler.FunctionCompiler
;
import
com.dlink.function.compiler.FunctionCompiler
;
import
com.dlink.function.compiler.FunctionPackage
;
import
com.dlink.function.compiler.FunctionPackage
;
import
com.dlink.function.data.model.UDF
;
import
com.dlink.function.data.model.UDF
;
import
com.dlink.function.data.model.UDFPath
;
import
com.dlink.function.data.model.UDFPath
;
import
org.apache.flink.configuration.Configuration
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -35,15 +36,15 @@ public class FunctionFactory {
...
@@ -35,15 +36,15 @@ public class FunctionFactory {
/**
/**
* udf编译 & 打包 初始化
* udf编译 & 打包 初始化
*
* @param udfClassList udf列表
* @param udfClassList udf列表
* @param missionId 当前任务id
* @param missionId 当前任务id
* @param executor flink执行器
* @return 打包过后的路径
* @return 打包过后的路径
*/
*/
public
static
UDFPath
initUDF
(
List
<
UDF
>
udfClassList
,
Integer
missionId
,
Executor
executor
)
{
public
static
UDFPath
initUDF
(
List
<
UDF
>
udfClassList
,
Integer
missionId
,
Configuration
configuration
)
{
// 编译
// 编译
FunctionCompiler
.
getCompiler
(
udfClassList
,
executor
.
getTableConfig
().
getConfiguration
()
,
missionId
);
FunctionCompiler
.
getCompiler
(
udfClassList
,
configuration
,
missionId
);
// 打包
// 打包
return
FunctionPackage
.
bale
(
udfClassList
,
missionId
);
return
FunctionPackage
.
bale
(
udfClassList
,
missionId
);
...
...
dlink-function/src/main/java/com/dlink/function/compiler/JVMPackage.java
View file @
7a4bf38b
...
@@ -66,7 +66,7 @@ public class JVMPackage implements FunctionPackage {
...
@@ -66,7 +66,7 @@ public class JVMPackage implements FunctionPackage {
fileInputStreams
[
i
]
=
FileUtil
.
getInputStream
(
absoluteFilePath
);
fileInputStreams
[
i
]
=
FileUtil
.
getInputStream
(
absoluteFilePath
);
}
}
String
jarPath
=
PathConstant
.
getUdfPackagePath
(
missionId
,
PathConstant
.
UDF_JAR_NAME
)
;
String
jarPath
=
PathConstant
.
getUdfPackagePath
(
missionId
)
+
PathConstant
.
UDF_JAR_NAME
;
// 编译好的文件打包jar
// 编译好的文件打包jar
File
file
=
FileUtil
.
file
(
jarPath
);
File
file
=
FileUtil
.
file
(
jarPath
);
FileUtil
.
del
(
file
);
FileUtil
.
del
(
file
);
...
...
dlink-function/src/main/java/com/dlink/function/data/model/UDFPath.java
View file @
7a4bf38b
...
@@ -19,8 +19,10 @@
...
@@ -19,8 +19,10 @@
package
com
.
dlink
.
function
.
data
.
model
;
package
com
.
dlink
.
function
.
data
.
model
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.Setter
;
/**
/**
...
@@ -30,6 +32,8 @@ import lombok.Setter;
...
@@ -30,6 +32,8 @@ import lombok.Setter;
@Getter
@Getter
@Setter
@Setter
@Builder
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
UDFPath
{
public
class
UDFPath
{
String
[]
jarPaths
;
String
[]
jarPaths
;
...
...
dlink-function/src/main/java/com/dlink/function/util/UDFUtil.java
View file @
7a4bf38b
...
@@ -21,13 +21,16 @@ package com.dlink.function.util;
...
@@ -21,13 +21,16 @@ package com.dlink.function.util;
import
com.dlink.assertion.Asserts
;
import
com.dlink.assertion.Asserts
;
import
com.dlink.config.Dialect
;
import
com.dlink.config.Dialect
;
import
com.dlink.function.FunctionFactory
;
import
com.dlink.function.compiler.CustomStringJavaCompiler
;
import
com.dlink.function.compiler.CustomStringJavaCompiler
;
import
com.dlink.function.compiler.CustomStringScalaCompiler
;
import
com.dlink.function.compiler.CustomStringScalaCompiler
;
import
com.dlink.function.constant.PathConstant
;
import
com.dlink.function.constant.PathConstant
;
import
com.dlink.function.data.model.UDF
;
import
com.dlink.function.data.model.UDF
;
import
com.dlink.gateway.GatewayType
;
import
com.dlink.pool.ClassEntity
;
import
com.dlink.pool.ClassEntity
;
import
com.dlink.pool.ClassPool
;
import
com.dlink.pool.ClassPool
;
import
org.apache.flink.configuration.Configuration
;
import
org.apache.flink.table.catalog.FunctionLanguage
;
import
org.apache.flink.table.catalog.FunctionLanguage
;
import
java.io.InputStream
;
import
java.io.InputStream
;
...
@@ -65,6 +68,23 @@ import groovy.lang.GroovyClassLoader;
...
@@ -65,6 +68,23 @@ import groovy.lang.GroovyClassLoader;
*/
*/
public
class
UDFUtil
{
public
class
UDFUtil
{
public
static
final
String
SESSION
=
"SESSION"
;
public
static
final
String
YARN
=
"YARN"
;
public
static
final
String
APPLICATION
=
"APPLICATION"
;
/**
* 网关类型 map
* 快速获取 session 与 application 等类型,为了减少判断
*/
public
static
final
Map
<
String
,
List
<
GatewayType
>>
GATEWAY_TYPE_MAP
=
MapUtil
.
builder
(
SESSION
,
Arrays
.
asList
(
GatewayType
.
YARN_SESSION
,
GatewayType
.
KUBERNETES_SESSION
,
GatewayType
.
STANDALONE
))
.
put
(
YARN
,
Arrays
.
asList
(
GatewayType
.
YARN_APPLICATION
,
GatewayType
.
YARN_PER_JOB
))
.
put
(
APPLICATION
,
Arrays
.
asList
(
GatewayType
.
YARN_APPLICATION
,
GatewayType
.
KUBERNETES_APPLICATION
))
.
build
();
protected
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
UDFUtil
.
class
);
protected
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
UDFUtil
.
class
);
/**
/**
* 存放 udf md5与版本对应的k,v值
* 存放 udf md5与版本对应的k,v值
...
@@ -108,6 +128,19 @@ public class UDFUtil {
...
@@ -108,6 +128,19 @@ public class UDFUtil {
}
}
}
}
public
static
String
[]
initJavaUDF
(
List
<
UDF
>
udf
,
GatewayType
gatewayType
,
Integer
missionId
)
{
return
FunctionFactory
.
initUDF
(
CollUtil
.
newArrayList
(
CollUtil
.
filterNew
(
udf
,
x
->
x
.
getFunctionLanguage
()
!=
FunctionLanguage
.
PYTHON
)),
missionId
,
null
).
getJarPaths
();
}
public
static
String
[]
initPythonUDF
(
List
<
UDF
>
udf
,
GatewayType
gatewayType
,
Integer
missionId
,
Configuration
configuration
)
{
return
FunctionFactory
.
initUDF
(
CollUtil
.
newArrayList
(
CollUtil
.
filterNew
(
udf
,
x
->
x
.
getFunctionLanguage
()
==
FunctionLanguage
.
PYTHON
)),
missionId
,
configuration
).
getPyPaths
();
}
public
static
String
getPyFileName
(
String
className
)
{
public
static
String
getPyFileName
(
String
className
)
{
Asserts
.
checkNullString
(
className
,
"类名不能为空"
);
Asserts
.
checkNullString
(
className
,
"类名不能为空"
);
return
StrUtil
.
split
(
className
,
"."
).
get
(
0
);
return
StrUtil
.
split
(
className
,
"."
).
get
(
0
);
...
...
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