Browse Source

Newfeature for #1675. (#1908)

Continue to finish the rest works, add the cache feature for dependence,mr,python,sub_process,procedure and shell.
pull/2/head
zhukai 5 years ago committed by GitHub
parent
commit
bcc734713b
  1. 20
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
  2. 17
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue
  3. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
  4. 29
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue
  5. 25
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue
  6. 30
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
  7. 30
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
  8. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue
  9. 8
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue

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

@ -121,6 +121,7 @@
<m-shell <m-shell
v-if="taskType === 'SHELL'" v-if="taskType === 'SHELL'"
@on-params="_onParams" @on-params="_onParams"
@on-cache-params="_onCacheParams"
ref="SHELL" ref="SHELL"
:backfill-item="backfillItem"> :backfill-item="backfillItem">
</m-shell> </m-shell>
@ -128,6 +129,7 @@
<m-sub-process <m-sub-process
v-if="taskType === 'SUB_PROCESS'" v-if="taskType === 'SUB_PROCESS'"
@on-params="_onParams" @on-params="_onParams"
@on-cache-params="_onCacheParams"
@on-set-process-name="_onSetProcessName" @on-set-process-name="_onSetProcessName"
ref="SUB_PROCESS" ref="SUB_PROCESS"
:backfill-item="backfillItem"> :backfill-item="backfillItem">
@ -136,6 +138,7 @@
<m-procedure <m-procedure
v-if="taskType === 'PROCEDURE'" v-if="taskType === 'PROCEDURE'"
@on-params="_onParams" @on-params="_onParams"
@on-cache-params="_onCacheParams"
ref="PROCEDURE" ref="PROCEDURE"
:backfill-item="backfillItem"> :backfill-item="backfillItem">
</m-procedure> </m-procedure>
@ -167,6 +170,7 @@
<m-mr <m-mr
v-if="taskType === 'MR'" v-if="taskType === 'MR'"
@on-params="_onParams" @on-params="_onParams"
@on-cache-params="_onCacheParams"
ref="MR" ref="MR"
:backfill-item="backfillItem"> :backfill-item="backfillItem">
</m-mr> </m-mr>
@ -174,6 +178,7 @@
<m-python <m-python
v-if="taskType === 'PYTHON'" v-if="taskType === 'PYTHON'"
@on-params="_onParams" @on-params="_onParams"
@on-cache-params="_onCacheParams"
ref="PYTHON" ref="PYTHON"
:backfill-item="backfillItem"> :backfill-item="backfillItem">
</m-python> </m-python>
@ -181,6 +186,7 @@
<m-dependent <m-dependent
v-if="taskType === 'DEPENDENT'" v-if="taskType === 'DEPENDENT'"
@on-dependent="_onDependent" @on-dependent="_onDependent"
@on-cache-dependent="_onCacheDependent"
ref="DEPENDENT" ref="DEPENDENT"
:backfill-item="backfillItem"> :backfill-item="backfillItem">
</m-dependent> </m-dependent>
@ -248,6 +254,8 @@
resourcesList: [], resourcesList: [],
// dependence // dependence
dependence: {}, dependence: {},
// cache dependence
cacheDependence: {},
// Current node params data // Current node params data
params: {}, params: {},
// Running sign // Running sign
@ -283,6 +291,12 @@
_onDependent (o) { _onDependent (o) {
this.dependence = Object.assign(this.dependence, {}, o) this.dependence = Object.assign(this.dependence, {}, o)
}, },
/**
* cache dependent
*/
_onCacheDependent (o) {
this.cacheDependence = Object.assign(this.cacheDependence, {}, o)
},
/** /**
* Task timeout alarm * Task timeout alarm
*/ */
@ -356,9 +370,10 @@
type: this.taskType, type: this.taskType,
id: this.id, id: this.id,
name: this.name, name: this.name,
params: this.params,
description: this.description, description: this.description,
runFlag: this.runFlag, runFlag: this.runFlag,
dependence: this.dependence, dependence: this.cacheDependence,
maxRetryTimes: this.maxRetryTimes, maxRetryTimes: this.maxRetryTimes,
retryInterval: this.retryInterval, retryInterval: this.retryInterval,
timeout: this.timeout, timeout: this.timeout,
@ -522,6 +537,7 @@
this.params = o.params || {} this.params = o.params || {}
this.dependence = o.dependence || {} this.dependence = o.dependence || {}
this.cacheDependence = o.dependence || {}
} }
this.isContentBox = true this.isContentBox = true
@ -551,7 +567,7 @@
name: this.name, name: this.name,
description: this.description, description: this.description,
runFlag: this.runFlag, runFlag: this.runFlag,
dependence: this.dependence, dependence: this.cacheDependence,
maxRetryTimes: this.maxRetryTimes, maxRetryTimes: this.maxRetryTimes,
retryInterval: this.retryInterval, retryInterval: this.retryInterval,
timeout: this.timeout, timeout: this.timeout,

17
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue

@ -131,6 +131,9 @@
setTimeout(() => { setTimeout(() => {
this.isLoading = false this.isLoading = false
}, 600) }, 600)
},
cacheDependence (val) {
this.$emit('on-cache-dependent', val)
} }
}, },
beforeCreate () { beforeCreate () {
@ -151,7 +154,19 @@
}, },
destroyed () { destroyed () {
}, },
computed: {}, computed: {
cacheDependence () {
return {
relation: this.relation,
dependTaskList: _.map(this.dependTaskList, v => {
return {
relation: v.relation,
dependItemList: _.map(v.dependItemList, v1 => _.omit(v1, ['depTasksList', 'state', 'dateValueList']))
}
})
}
}
},
components: { mListBox, mDependItemList } components: { mListBox, mDependItemList }
} }
</script> </script>

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

@ -379,7 +379,7 @@
// Non-null objects represent backfill // Non-null objects represent backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
this.mainClass = o.params.mainClass || '' this.mainClass = o.params.mainClass || ''
this.mainJar = o.params.mainJar.res || '' this.mainJar = o.params.mainJar && o.params.mainJar.res ? o.params.mainJar.res : ''
this.deployMode = o.params.deployMode || '' this.deployMode = o.params.deployMode || ''
this.slot = o.params.slot || 1 this.slot = o.params.slot || 1
this.taskManager = o.params.taskManager || '2' this.taskManager = o.params.taskManager || '2'

29
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue

@ -91,6 +91,7 @@
<m-resources <m-resources
ref="refResources" ref="refResources"
@on-resourcesData="_onResourcesData" @on-resourcesData="_onResourcesData"
@on-cache-resourcesData="_onCacheResourcesData"
:resource-list="resourceList"> :resource-list="resourceList">
</m-resources> </m-resources>
</div> </div>
@ -127,6 +128,8 @@
mainJarList: [], mainJarList: [],
// Resource(list) // Resource(list)
resourceList: [], resourceList: [],
// Cache ResourceList
cacheResourceList: [],
// Custom parameter // Custom parameter
localParams: [], localParams: [],
// Command line argument // Command line argument
@ -156,6 +159,12 @@
_onResourcesData (a) { _onResourcesData (a) {
this.resourceList = a this.resourceList = a
}, },
/**
* cache resourceList
*/
_onCacheResourcesData (a) {
this.cacheResourceList = a
},
/** /**
* verification * verification
*/ */
@ -220,6 +229,25 @@
if (type === 'PYTHON') { if (type === 'PYTHON') {
this.mainClass = '' this.mainClass = ''
} }
},
//Watch the cacheParams
cacheParams (val) {
this.$emit('on-cache-params', val);
}
},
computed: {
cacheParams () {
return {
mainClass: this.mainClass,
mainJar: {
res: this.mainJar
},
resourceList: this.cacheResourceList,
localParams: this.localParams,
mainArgs: this.mainArgs,
others: this.others,
programType: this.programType
}
} }
}, },
created () { created () {
@ -238,6 +266,7 @@
let resourceList = o.params.resourceList || [] let resourceList = o.params.resourceList || []
if (resourceList.length) { if (resourceList.length) {
this.resourceList = resourceList this.resourceList = resourceList
this.cacheResourceList = resourceList
} }
// backfill localParams // backfill localParams

25
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue

@ -70,7 +70,9 @@
// Data source type // Data source type
type: '', type: '',
// data source // data source
datasource: '' datasource: '',
// Return to the selected data source
rtDatasource: ''
} }
}, },
mixins: [disabledState], mixins: [disabledState],
@ -83,7 +85,7 @@
*/ */
_onDsData (o) { _onDsData (o) {
this.type = o.type this.type = o.type
this.datasource = o.datasource this.rtDatasource = o.datasource
}, },
/** /**
* return udp * return udp
@ -112,14 +114,29 @@
// storage // storage
this.$emit('on-params', { this.$emit('on-params', {
type: this.type, type: this.type,
datasource: this.datasource, datasource: this.rtDatasource,
method: this.method, method: this.method,
localParams: this.localParams localParams: this.localParams
}) })
return true return true
} }
}, },
watch: {}, watch: {
//Watch the cacheParams
cacheParams (val) {
this.$emit('on-cache-params', val);
}
},
computed: {
cacheParams () {
return {
type: this.type,
datasource: this.rtDatasource,
method: this.method,
localParams: this.localParams
}
}
},
created () { created () {
let o = this.backfillItem let o = this.backfillItem

30
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue

@ -31,6 +31,7 @@
<m-resources <m-resources
ref="refResources" ref="refResources"
@on-resourcesData="_onResourcesData" @on-resourcesData="_onResourcesData"
@on-cache-resourcesData="_onCacheResourcesData"
:resource-list="resourceList"> :resource-list="resourceList">
</m-resources> </m-resources>
</div> </div>
@ -69,7 +70,9 @@
// Custom parameter // Custom parameter
localParams: [], localParams: [],
// resource(list) // resource(list)
resourceList: [] resourceList: [],
// Cache ResourceList
cacheResourceList: []
} }
}, },
mixins: [disabledState], mixins: [disabledState],
@ -89,6 +92,12 @@
_onResourcesData (a) { _onResourcesData (a) {
this.resourceList = a this.resourceList = a
}, },
/**
* cache resourceList
*/
_onCacheResourcesData (a) {
this.cacheResourceList = a
},
/** /**
* verification * verification
*/ */
@ -142,18 +151,33 @@
return editor return editor
} }
}, },
watch: {}, watch: {
//Watch the cacheParams
cacheParams (val) {
this.$emit('on-cache-params', val);
}
},
computed: {
cacheParams () {
return {
resourceList: this.cacheResourceList,
localParams: this.localParams,
rawScript: editor ? editor.getValue() : ''
}
}
},
created () { created () {
let o = this.backfillItem let o = this.backfillItem
// Non-null objects represent backfill // Non-null objects represent backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
this.rawScript = o.params.rawScript this.rawScript = o.params.rawScript || ''
// backfill resourceList // backfill resourceList
let resourceList = o.params.resourceList || [] let resourceList = o.params.resourceList || []
if (resourceList.length) { if (resourceList.length) {
this.resourceList = resourceList this.resourceList = resourceList
this.cacheResourceList = resourceList
} }
// backfill localParams // backfill localParams

30
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue

@ -37,6 +37,7 @@
<m-resources <m-resources
ref="refResources" ref="refResources"
@on-resourcesData="_onResourcesData" @on-resourcesData="_onResourcesData"
@on-cache-resourcesData="_onCacheResourcesData"
:resource-list="resourceList"> :resource-list="resourceList">
</m-resources> </m-resources>
</div> </div>
@ -75,7 +76,9 @@
// Custom parameter // Custom parameter
localParams: [], localParams: [],
// resource(list) // resource(list)
resourceList: [] resourceList: [],
// Cache ResourceList
cacheResourceList: []
} }
}, },
mixins: [disabledState], mixins: [disabledState],
@ -124,6 +127,12 @@
_onResourcesData (a) { _onResourcesData (a) {
this.resourceList = a this.resourceList = a
}, },
/**
* cache resourceList
*/
_onCacheResourcesData (a) {
this.cacheResourceList = a
},
/** /**
* verification * verification
*/ */
@ -175,18 +184,33 @@
return editor return editor
} }
}, },
watch: {}, watch: {
//Watch the cacheParams
cacheParams (val) {
this.$emit('on-cache-params', val);
}
},
computed: {
cacheParams () {
return {
resourceList: this.cacheResourceList,
localParams: this.localParams,
rawScript: editor ? editor.getValue() : ''
}
}
},
created () { created () {
let o = this.backfillItem let o = this.backfillItem
// Non-null objects represent backfill // Non-null objects represent backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
this.rawScript = o.params.rawScript this.rawScript = o.params.rawScript || ''
// backfill resourceList // backfill resourceList
let resourceList = o.params.resourceList || [] let resourceList = o.params.resourceList || []
if (resourceList.length) { if (resourceList.length) {
this.resourceList = resourceList this.resourceList = resourceList
this.cacheResourceList = resourceList
} }
// backfill localParams // backfill localParams

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

@ -412,7 +412,7 @@
// Non-null objects represent backfill // Non-null objects represent backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
this.mainClass = o.params.mainClass || '' this.mainClass = o.params.mainClass || ''
this.mainJar = o.params.mainJar.res || '' this.mainJar = o.params.mainJar && o.params.mainJar.res ? o.params.mainJar.res : ''
this.deployMode = o.params.deployMode || '' this.deployMode = o.params.deployMode || ''
this.driverCores = o.params.driverCores || 1 this.driverCores = o.params.driverCores || 1
this.driverMemory = o.params.driverMemory || '512M' this.driverMemory = o.params.driverMemory || '512M'

8
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue

@ -86,7 +86,13 @@
return _.filter(this.processDefinitionList, v => id === v.id)[0].code return _.filter(this.processDefinitionList, v => id === v.id)[0].code
} }
}, },
watch: {}, watch: {
wdiCurr (val) {
this.$emit('on-cache-params', {
processDefinitionId: this.wdiCurr
})
}
},
created () { created () {
let processListS = _.cloneDeep(this.store.state.dag.processListS) let processListS = _.cloneDeep(this.store.state.dag.processListS)
let id = this.router.history.current.params.id || null let id = this.router.history.current.params.id || null

Loading…
Cancel
Save