Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
三久
DolphinScheduler
提交
06acbe5f
DolphinScheduler
项目概览
三久
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
06acbe5f
编写于
5月 13, 2019
作者:
L
lidongdai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.0.2文档发布
上级
5a8c8ef9
变更
15
显示空白变更内容
内联
并排
Showing
15 changed file
with
136 addition
and
24 deletion
+136
-24
escheduler-api/pom.xml
escheduler-api/pom.xml
+43
-7
escheduler-api/src/main/java/cn/escheduler/api/ApiApplicationServer.java
...src/main/java/cn/escheduler/api/ApiApplicationServer.java
+1
-0
escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java
...ava/cn/escheduler/api/configuration/AppConfiguration.java
+9
-1
escheduler-api/src/main/java/cn/escheduler/api/configuration/Swagger2.java
...c/main/java/cn/escheduler/api/configuration/Swagger2.java
+53
-0
escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java
...in/java/cn/escheduler/api/controller/LoginController.java
+8
-0
escheduler-api/src/main/java/cn/escheduler/api/service/SchedulerService.java
...main/java/cn/escheduler/api/service/SchedulerService.java
+2
-2
escheduler-common/src/main/java/cn/escheduler/common/queue/ITaskQueue.java
.../src/main/java/cn/escheduler/common/queue/ITaskQueue.java
+1
-1
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapperProvider.java
.../escheduler/dao/mapper/ProcessInstanceMapperProvider.java
+1
-1
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java
...ain/java/cn/escheduler/dao/mapper/UserMapperProvider.java
+1
-1
escheduler-dao/src/test/java/cn/escheduler/dao/mapper/UserMapperTest.java
...rc/test/java/cn/escheduler/dao/mapper/UserMapperTest.java
+6
-0
escheduler-server/pom.xml
escheduler-server/pom.xml
+1
-4
escheduler-server/src/main/java/cn/escheduler/server/master/MasterServer.java
...c/main/java/cn/escheduler/server/master/MasterServer.java
+2
-2
escheduler-server/src/main/java/cn/escheduler/server/quartz/ProcessScheduleJob.java
.../java/cn/escheduler/server/quartz/ProcessScheduleJob.java
+3
-3
escheduler-server/src/main/java/cn/escheduler/server/quartz/QuartzExecutors.java
...ain/java/cn/escheduler/server/quartz/QuartzExecutors.java
+1
-1
escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java
...a/cn/escheduler/server/worker/runner/FetchTaskThread.java
+4
-1
未找到文件。
escheduler-api/pom.xml
浏览文件 @
06acbe5f
<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"
>
<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"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
cn.analysys
</groupId>
...
...
@@ -10,13 +11,10 @@
<dependencies>
<dependency>
<groupId>
cn.analysys
</groupId>
<artifactId>
escheduler-dao
</artifactId>
</dependency>
<dependency>
<groupId>
cn.analysys
</groupId>
<artifactId>
escheduler-common
</artifactId>
<artifactId>
escheduler-server
</artifactId>
<exclusions>
<exclusion>
<groupId>
io.netty
</groupId>
...
...
@@ -37,6 +35,33 @@
</exclusions>
</dependency>
<!--<dependency>-->
<!--<groupId>cn.analysys</groupId>-->
<!--<artifactId>escheduler-dao</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>cn.analysys</groupId>-->
<!--<artifactId>escheduler-common</artifactId>-->
<!--<exclusions>-->
<!--<exclusion>-->
<!--<groupId>io.netty</groupId>-->
<!--<artifactId>netty</artifactId>-->
<!--</exclusion>-->
<!--<exclusion>-->
<!--<groupId>io.netty</groupId>-->
<!--<artifactId>netty-all</artifactId>-->
<!--</exclusion>-->
<!--<exclusion>-->
<!--<groupId>com.google</groupId>-->
<!--<artifactId>netty</artifactId>-->
<!--</exclusion>-->
<!--<exclusion>-->
<!--<artifactId>leveldbjni-all</artifactId>-->
<!--<groupId>org.fusesource.leveldbjni</groupId>-->
<!--</exclusion>-->
<!--</exclusions>-->
<!--</dependency>-->
<!--springboot-->
<dependency>
...
...
@@ -142,6 +167,17 @@
<artifactId>
quartz-jobs
</artifactId>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.8.0
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.8.0
</version>
</dependency>
<dependency>
<groupId>
cn.analysys
</groupId>
<artifactId>
escheduler-rpc
</artifactId>
...
...
escheduler-api/src/main/java/cn/escheduler/api/ApiApplicationServer.java
浏览文件 @
06acbe5f
...
...
@@ -20,6 +20,7 @@ import org.springframework.boot.SpringApplication;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.web.servlet.ServletComponentScan
;
import
org.springframework.context.annotation.ComponentScan
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@SpringBootApplication
@ServletComponentScan
...
...
escheduler-api/src/main/java/cn/escheduler/api/configuration/AppConfiguration.java
浏览文件 @
06acbe5f
...
...
@@ -33,8 +33,16 @@ public class AppConfiguration implements WebMvcConfigurer {
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
registry
.
addInterceptor
(
loginInterceptor
()).
addPathPatterns
(
LOGIN_INTERCEPTOR_PATH_PATTERN
).
excludePathPatterns
(
LOGIN_PATH_PATTERN
);
registry
.
addInterceptor
(
loginInterceptor
()).
addPathPatterns
(
LOGIN_INTERCEPTOR_PATH_PATTERN
).
excludePathPatterns
(
LOGIN_PATH_PATTERN
,
"/swagger-resources/**"
,
"/webjars/**"
,
"/v2/**"
,
"/swagger-ui.html"
);
}
//
// @Override
// public void addResourceHandlers(ResourceHandlerRegistry registry) {
// registry.addResourceHandler("swagger-ui.html")
// .addResourceLocations("classpath:/META-INF/resources/");
// registry.addResourceHandler("/webjars/**")
// .addResourceLocations("classpath:/META-INF/resources/webjars/");
// }
@Bean
public
LoginHandlerInterceptor
loginInterceptor
()
{
...
...
escheduler-api/src/main/java/cn/escheduler/api/configuration/Swagger2.java
0 → 100644
浏览文件 @
06acbe5f
/*
* 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
cn.escheduler.api.configuration
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
/**
*
* swager2 config class <br/>
*
*/
@Configuration
@EnableSwagger2
public
class
Swagger2
implements
WebMvcConfigurer
{
@Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
).
apiInfo
(
apiInfo
()).
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.escheduler.api.controller"
)).
paths
(
PathSelectors
.
any
())
.
build
();
}
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
().
title
(
"api docs"
).
description
(
"easy scheduler api docs"
)
.
termsOfServiceUrl
(
"https://www.analysys.com"
).
version
(
"1.0.0"
).
build
();
}
}
escheduler-api/src/main/java/cn/escheduler/api/controller/LoginController.java
浏览文件 @
06acbe5f
...
...
@@ -23,6 +23,9 @@ import cn.escheduler.api.service.UsersService;
import
cn.escheduler.api.utils.Constants
;
import
cn.escheduler.api.utils.Result
;
import
cn.escheduler.dao.model.User
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.httpclient.HttpStatus
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -60,6 +63,11 @@ public class LoginController extends BaseController {
* @param response
* @return
*/
@ApiOperation
(
value
=
"更新用户详细信息"
,
notes
=
"根据url的id来指定更新对象,并根据传过来的user信息来更新用户详细信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"userPassword"
,
value
=
"密码"
,
required
=
true
,
dataType
=
"String"
)
})
@RequestMapping
(
value
=
"/login"
)
public
Result
login
(
@RequestParam
(
value
=
"userName"
)
String
userName
,
@RequestParam
(
value
=
"userPassword"
)
String
userPassword
,
...
...
escheduler-api/src/main/java/cn/escheduler/api/service/SchedulerService.java
浏览文件 @
06acbe5f
...
...
@@ -19,8 +19,8 @@ package cn.escheduler.api.service;
import
cn.escheduler.api.dto.ScheduleParam
;
import
cn.escheduler.api.enums.Status
;
import
cn.escheduler.
api
.quartz.ProcessScheduleJob
;
import
cn.escheduler.
api
.quartz.QuartzExecutors
;
import
cn.escheduler.
server
.quartz.ProcessScheduleJob
;
import
cn.escheduler.
server
.quartz.QuartzExecutors
;
import
cn.escheduler.api.utils.Constants
;
import
cn.escheduler.api.utils.PageInfo
;
import
cn.escheduler.common.enums.FailureStrategy
;
...
...
escheduler-common/src/main/java/cn/escheduler/common/queue/ITaskQueue.java
浏览文件 @
06acbe5f
...
...
@@ -54,7 +54,7 @@ public interface ITaskQueue {
* an element pops out of the queue
*
* @param key queue name
* @param remove whe
re
remove the element
* @param remove whe
ther
remove the element
* @return
*/
String
poll
(
String
key
,
boolean
remove
);
...
...
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapperProvider.java
浏览文件 @
06acbe5f
...
...
@@ -220,7 +220,7 @@ public class ProcessInstanceMapperProvider {
public
String
queryDetailById
(
Map
<
String
,
Object
>
parameter
)
{
return
new
SQL
()
{
{
SELECT
(
"inst.*,q.queue_name as queue,t.tenant_code
as tenantCode
,UNIX_TIMESTAMP(inst.end_time)-UNIX_TIMESTAMP(inst.start_time) as duration"
);
SELECT
(
"inst.*,q.queue_name as queue,t.tenant_code,UNIX_TIMESTAMP(inst.end_time)-UNIX_TIMESTAMP(inst.start_time) as duration"
);
FROM
(
TABLE_NAME
+
" inst, t_escheduler_user u,t_escheduler_tenant t,t_escheduler_queue q"
);
...
...
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java
浏览文件 @
06acbe5f
...
...
@@ -208,7 +208,7 @@ public class UserMapperProvider {
public
String
queryDetailsById
(
Map
<
String
,
Object
>
parameter
)
{
return
new
SQL
()
{
{
SELECT
(
"u.*,q.queue_name
as queueName,t.tenant_name as tenantN
ame"
);
SELECT
(
"u.*,q.queue_name
,t.tenant_n
ame"
);
FROM
(
TABLE_NAME
+
" u,t_escheduler_tenant t,t_escheduler_queue q"
);
...
...
escheduler-dao/src/test/java/cn/escheduler/dao/mapper/UserMapperTest.java
浏览文件 @
06acbe5f
...
...
@@ -72,4 +72,10 @@ public class UserMapperTest {
Assert
.
assertEquals
(
user
.
getUserName
(),
"qiaozhanwei"
);
}
@Test
public
void
test
(){
User
user
=
userMapper
.
queryDetailsById
(
19
);
System
.
out
.
println
(
user
);
}
}
escheduler-server/pom.xml
浏览文件 @
06acbe5f
...
...
@@ -46,10 +46,7 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
cn.analysys
</groupId>
<artifactId>
escheduler-api
</artifactId>
</dependency>
<dependency>
<groupId>
cn.analysys
</groupId>
<artifactId>
escheduler-rpc
</artifactId>
...
...
escheduler-server/src/main/java/cn/escheduler/server/master/MasterServer.java
浏览文件 @
06acbe5f
...
...
@@ -16,8 +16,8 @@
*/
package
cn.escheduler.server.master
;
import
cn.escheduler.
api
.quartz.ProcessScheduleJob
;
import
cn.escheduler.
api
.quartz.QuartzExecutors
;
import
cn.escheduler.
server
.quartz.ProcessScheduleJob
;
import
cn.escheduler.
server
.quartz.QuartzExecutors
;
import
cn.escheduler.common.Constants
;
import
cn.escheduler.common.IStoppable
;
import
cn.escheduler.common.thread.Stopper
;
...
...
escheduler-
api/src/main/java/cn/escheduler/api
/quartz/ProcessScheduleJob.java
→
escheduler-
server/src/main/java/cn/escheduler/server
/quartz/ProcessScheduleJob.java
浏览文件 @
06acbe5f
...
...
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
cn.escheduler.
api
.quartz
;
package
cn.escheduler.
server
.quartz
;
import
cn.escheduler.common.Constants
;
...
...
@@ -31,8 +31,8 @@ import org.springframework.util.Assert;
import
java.util.Date
;
import
static
cn
.
escheduler
.
api
.
quartz
.
QuartzExecutors
.
buildJobGroupName
;
import
static
cn
.
escheduler
.
api
.
quartz
.
QuartzExecutors
.
buildJobName
;
import
static
cn
.
escheduler
.
server
.
quartz
.
QuartzExecutors
.
buildJobGroupName
;
import
static
cn
.
escheduler
.
server
.
quartz
.
QuartzExecutors
.
buildJobName
;
/**
* process schedule job
...
...
escheduler-
api/src/main/java/cn/escheduler/api
/quartz/QuartzExecutors.java
→
escheduler-
server/src/main/java/cn/escheduler/server
/quartz/QuartzExecutors.java
浏览文件 @
06acbe5f
...
...
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
cn.escheduler.
api
.quartz
;
package
cn.escheduler.
server
.quartz
;
import
cn.escheduler.common.Constants
;
import
cn.escheduler.common.utils.JSONUtils
;
...
...
escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java
浏览文件 @
06acbe5f
...
...
@@ -134,7 +134,7 @@ public class FetchTaskThread implements Runnable{
public
void
run
()
{
while
(
Stopper
.
isRunning
()){
long
start
=
System
.
currentTimeMillis
();
InterProcessMutex
mutex
=
null
;
try
{
if
(
OSUtils
.
checkResource
(
this
.
conf
,
false
))
{
...
...
@@ -221,7 +221,10 @@ public class FetchTaskThread implements Runnable{
logger
.
info
(
"task : {} ready to submit to task scheduler thread"
,
taskId
);
// submit task
workerExecService
.
submit
(
new
TaskScheduleThread
(
taskInstance
,
processDao
));
logger
.
info
(
"{} 耗时: {} ms"
,
taskQueueStr
,
System
.
currentTimeMillis
()
-
start
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录