Browse Source

merge from dev

pull/3/MERGE
lenboo 5 years ago
parent
commit
ea1c653e08
  1. 3
      dolphinscheduler-api/src/main/resources/application-api.properties
  2. 4
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/DependentUtils.java
  3. 11
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/IpUtils.java
  4. 10
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/SchemaUtils.java
  5. 13
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
  6. 4
      dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java
  7. 2
      dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue
  8. 1
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  9. 1
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

3
dolphinscheduler-api/src/main/resources/application-api.properties

@ -23,6 +23,9 @@ server.servlet.session.timeout=7200
server.servlet.context-path=/dolphinscheduler/
# Set time zone
spring.jackson.time-zone=GMT+8
# file size limit for upload
spring.servlet.multipart.max-file-size=1024MB
spring.servlet.multipart.max-request-size=1024MB

4
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/DependentUtils.java

@ -40,10 +40,8 @@ public class DependentUtils {
case AND:
if(dependResultList.contains(DependResult.FAILED)){
dependResult = DependResult.FAILED;
}else if(dependResultList.contains(DependResult.WAITING)){
} if(dependResultList.contains(DependResult.WAITING)){
dependResult = DependResult.WAITING;
}else{
dependResult = DependResult.SUCCESS;
}
break;
case OR:

11
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/IpUtils.java

@ -49,12 +49,11 @@ public class IpUtils {
ipNumbers[2] = ipLong >> 8 & tmp;
ipNumbers[3] = ipLong & tmp;
StringBuilder sb = new StringBuilder(16);
sb.append(ipNumbers[0]).append(DOT)
.append(ipNumbers[1]).append(DOT)
.append(ipNumbers[2]).append(DOT)
.append(ipNumbers[3]);
return sb.toString();
String sb = ipNumbers[0] + DOT +
ipNumbers[1] + DOT +
ipNumbers[2] + DOT +
ipNumbers[3];
return sb;
}
}

10
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/SchemaUtils.java

@ -22,7 +22,6 @@ import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@ -96,11 +95,11 @@ public class SchemaUtils {
String[] schemaVersionArr = schemaVersion.split("\\.");
String[] versionArr = version.split("\\.");
int arrLength = schemaVersionArr.length < versionArr.length ? schemaVersionArr.length : versionArr.length;
int arrLength = Math.min(schemaVersionArr.length, versionArr.length);
for(int i = 0 ; i < arrLength ; i++) {
if(Integer.valueOf(schemaVersionArr[i]) > Integer.valueOf(versionArr[i])) {
if(Integer.parseInt(schemaVersionArr[i]) > Integer.parseInt(versionArr[i])) {
return true;
}else if(Integer.valueOf(schemaVersionArr[i]) < Integer.valueOf(versionArr[i])) {
}else if(Integer.parseInt(schemaVersionArr[i]) < Integer.parseInt(versionArr[i])) {
return false;
}
}
@ -121,9 +120,6 @@ public class SchemaUtils {
} catch (FileNotFoundException e) {
logger.error(e.getMessage(),e);
throw new RuntimeException("Failed to get the product version description file. The file could not be found", e);
} catch (IOException e) {
logger.error(e.getMessage(),e);
throw new RuntimeException("Failed to get product version number description file, failed to read the file", e);
}
return soft_version;
}

13
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java

@ -270,16 +270,9 @@ public class SqlTask extends AbstractTask {
String result = JSONUtils.toJsonString(resultJSONArray);
logger.debug("execute sql : {}", result);
// if there is a result set
if (!resultJSONArray.isEmpty(null) ) {
if (StringUtils.isNotEmpty(sqlParameters.getTitle())) {
sendAttachment(sqlParameters.getTitle(),
JSONUtils.toJsonString(resultJSONArray));
}else{
sendAttachment(taskExecutionContext.getTaskName() + " query resultsets ",
JSONUtils.toJsonString(resultJSONArray));
}
}
sendAttachment(StringUtils.isNotEmpty(sqlParameters.getTitle()) ?
sqlParameters.getTitle(): taskExecutionContext.getTaskName() + " query result sets",
JSONUtils.toJsonString(resultJSONArray));
}
/**

4
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumerTest.java

@ -32,7 +32,6 @@ import org.apache.dolphinscheduler.server.zk.SpringZKServer;
import org.apache.dolphinscheduler.service.bean.SpringApplicationContext;
import org.apache.dolphinscheduler.service.process.ProcessService;
import org.apache.dolphinscheduler.service.queue.TaskPriorityQueue;
import org.apache.dolphinscheduler.service.queue.TaskPriorityQueueImpl;
import org.apache.dolphinscheduler.service.zk.ZookeeperCachedOperator;
import org.apache.dolphinscheduler.service.zk.ZookeeperConfig;
import org.junit.Before;
@ -233,8 +232,7 @@ public class TaskPriorityQueueConsumerTest {
dataSource.setConnectionParams("{\"address\":\"jdbc:mysql://192.168.221.185:3306\",\"database\":\"dolphinscheduler_qiaozhanwei\",\"jdbcUrl\":\"jdbc:mysql://192.168.221.185:3306/dolphinscheduler_qiaozhanwei\",\"user\":\"root\",\"password\":\"root@123\"}");
dataSource.setCreateTime(new Date());
dataSource.setUpdateTime(new Date());
Mockito.when(processService.findDataSourceById(1)).thenReturn(dataSource);
Mockito.doReturn(dataSource).when(processService).findDataSourceById(1);
Thread.sleep(10000);
}

2
dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue

@ -26,7 +26,7 @@
<span>{{$t('User Name')}}</span>
</th>
<th>
<span>用户类型</span>
<span>{{$t('User Type')}}</span>
</th>
<th>
<span>{{$t('Tenant')}}</span>

1
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js

@ -181,6 +181,7 @@ export default {
Tenant: 'Tenant',
Email: 'Email',
Phone: 'Phone',
'User Type':'User Type',
'Please enter phone number': 'Please enter phone number',
'Please enter main class': 'Please enter main class',
'Please enter email': 'Please enter email',

1
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -184,6 +184,7 @@ export default {
Tenant: '租户',
Email: '邮件',
Phone: '手机',
'User Type':'用户类型',
'Please enter phone number': '请输入手机',
'Please enter email': '请输入邮箱',
'Please enter the correct email format': '请输入正确的邮箱格式',

Loading…
Cancel
Save