Browse Source

Merge remote-tracking branch 'remotes/upstream/1.3.2-release' into 1.3.2-release

pull/3/MERGE
qiaozhanwei 4 years ago
parent
commit
27b4083229
  1. 16
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ResourceInfo.java
  2. 2
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java
  3. 4
      dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
  4. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
  5. 11
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js
  6. 16
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/util.js
  7. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue
  8. 4
      dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js
  9. 1
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  10. 2
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

16
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ResourceInfo.java

@ -43,5 +43,21 @@ public class ResourceInfo {
this.res = res;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ResourceInfo that = (ResourceInfo) o;
if (id != that.id) return false;
return res.equals(that.res);
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + res.hashCode();
return result;
}
}

2
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java

@ -385,7 +385,7 @@ public class TaskPriorityQueueConsumer extends Thread{
// get the resource id in order to get the resource names in batch
Stream<Integer> resourceIdStream = projectResourceFiles.stream().map(resourceInfo -> resourceInfo.getId());
Set<Integer> resourceIdsSet = resourceIdStream.collect(Collectors.toSet());
Set<Integer> resourceIdsSet = resourceIdStream.filter(resId-> resId != 0).collect(Collectors.toSet());
if (CollectionUtils.isNotEmpty(resourceIdsSet)) {
Integer[] resourceIds = resourceIdsSet.toArray(new Integer[resourceIdsSet.size()]);

4
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java

@ -1554,7 +1554,9 @@ public class ProcessService {
* @return tenant code
*/
public String queryTenantCodeByResName(String resName,ResourceType resourceType){
return resourceMapper.queryTenantCodeByResourceName(resName, resourceType.ordinal());
// in order to query tenant code successful although the version is older
String fullName = resName.startsWith("/") ? resName : String.format("/%s",resName);
return resourceMapper.queryTenantCodeByResourceName(fullName, resourceType.ordinal());
}
/**

2
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue

@ -38,7 +38,7 @@
type="text"
v-model="name"
:disabled="isDetails"
:placeholder="$t('Please enter name(required)')"
:placeholder="$t('Please enter name (required)')"
maxlength="100"
@on-blur="_verifName()"
autocomplete="off">

11
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js

@ -478,9 +478,9 @@ JSP.prototype.handleEventRemove = function () {
JSP.prototype.removeNodes = function ($id) {
// Delete node processing(data-targetarr)
_.map(tasksAll(), v => {
const targetarr = v.targetarr.split(',')
let targetarr = v.targetarr.split(',')
if (targetarr.length) {
const newArr = _.filter(targetarr, v1 => v1 !== $id)
let newArr = _.filter(targetarr, v1 => v1 !== $id)
$(`#${v.id}`).attr('data-targetarr', newArr.toString())
}
})
@ -496,8 +496,7 @@ JSP.prototype.removeNodes = function ($id) {
_.map(this.JspInstance.getConnections(), v => {
connects.push({
endPointSourceId: v.sourceId,
endPointTargetId: v.targetId,
label: v._jsPlumb.overlays.label.canvas.innerText
endPointTargetId: v.targetId
})
})
// Storage line dependence
@ -512,8 +511,8 @@ JSP.prototype.removeConnect = function ($connect) {
return
}
// Remove connections and remove node and node dependencies
const targetId = $connect.targetId
const sourceId = $connect.sourceId
let targetId = $connect.targetId
let sourceId = $connect.sourceId
let targetarr = rtTargetarrArr(targetId)
if (targetarr.length) {
targetarr = _.filter(targetarr, v => v !== sourceId)

16
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/plugIn/util.js

@ -23,7 +23,7 @@ import store from '@/conf/home/store'
* Node, to array
*/
const rtTargetarrArr = (id) => {
const ids = $(`#${id}`).attr('data-targetarr')
let ids = $(`#${id}`).attr('data-targetarr')
return ids ? ids.split(',') : []
}
@ -31,8 +31,8 @@ const rtTargetarrArr = (id) => {
* Store node id to targetarr
*/
const saveTargetarr = (valId, domId) => {
const $target = $(`#${domId}`)
const targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}`
let $target = $(`#${domId}`)
let targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}`
$target.attr('data-targetarr', targetStr)
}
@ -66,9 +66,9 @@ const rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType, runFlag
* Get all tasks nodes
*/
const tasksAll = () => {
const a = []
let a = []
$('#canvas .w').each(function (idx, elem) {
const e = $(elem)
let e = $(elem)
a.push({
id: e.attr('id'),
name: e.find('.name-p').text(),
@ -117,10 +117,10 @@ const setSvgColor = (e, color) => {
* Get all node ids
*/
const allNodesId = () => {
const idArr = []
let idArr = []
$('.w').each((i, o) => {
const $obj = $(o)
const $span = $obj.find('.name-p').text()
let $obj = $(o)
let $span = $obj.find('.name-p').text()
if ($span) {
idArr.push({
id: $obj.attr('id'),

2
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue

@ -26,7 +26,7 @@
type="text"
v-model="name"
:disabled="router.history.current.name === 'projects-instance-details'"
:placeholder="$t('Please enter name(required)')">
:placeholder="$t('Please enter name (required)')">
</x-input>
</div>

4
dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js

@ -120,7 +120,7 @@ export default {
* object {}
*/
addTasks (state, payload) {
const i = _.findIndex(state.tasks, v => v.id === payload.id)
let i = _.findIndex(state.tasks, v => v.id === payload.id)
if (i !== -1) {
state.tasks[i] = Object.assign(state.tasks[i], {}, payload)
} else {
@ -131,7 +131,7 @@ export default {
} else {
state.cacheTasks[payload.id] = payload
}
const dom = $(`#${payload.id}`)
let dom = $(`#${payload.id}`)
state.locations[payload.id] = _.assign(state.locations[payload.id], {
name: dom.find('.name-p').text(),
targetarr: dom.attr('data-targetarr'),

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

@ -34,7 +34,6 @@ export default {
'View log': 'View log',
'Enter this child node': 'Enter this child node',
'Node name': 'Node name',
'Please enter name(required)': 'Please enter name(required)',
'Run flag': 'Run flag',
Normal: 'Normal',
'Prohibition execution': 'Prohibition execution',

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

@ -34,7 +34,7 @@ export default {
'View log': '查看日志',
'Enter this child node': '进入该子节点',
'Node name': '节点名称',
'Please enter name(required)': '请输入名称(必填)',
'Please enter name (required)': '请输入名称(必填)',
'Run flag': '运行标志',
Normal: '正常',
'Prohibition execution': '禁止执行',

Loading…
Cancel
Save