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

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

@ -131,6 +131,9 @@
setTimeout(() => {
this.isLoading = false
}, 600)
},
cacheDependence (val) {
this.$emit('on-cache-dependent', val)
}
},
beforeCreate () {
@ -151,7 +154,19 @@
},
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 }
}
</script>

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

@ -379,7 +379,7 @@
// Non-null objects represent backfill
if (!_.isEmpty(o)) {
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.slot = o.params.slot || 1
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
ref="refResources"
@on-resourcesData="_onResourcesData"
@on-cache-resourcesData="_onCacheResourcesData"
:resource-list="resourceList">
</m-resources>
</div>
@ -127,6 +128,8 @@
mainJarList: [],
// Resource(list)
resourceList: [],
// Cache ResourceList
cacheResourceList: [],
// Custom parameter
localParams: [],
// Command line argument
@ -156,6 +159,12 @@
_onResourcesData (a) {
this.resourceList = a
},
/**
* cache resourceList
*/
_onCacheResourcesData (a) {
this.cacheResourceList = a
},
/**
* verification
*/
@ -220,6 +229,25 @@
if (type === 'PYTHON') {
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 () {
@ -238,6 +266,7 @@
let resourceList = o.params.resourceList || []
if (resourceList.length) {
this.resourceList = resourceList
this.cacheResourceList = resourceList
}
// backfill localParams

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

@ -70,7 +70,9 @@
// Data source type
type: '',
// data source
datasource: ''
datasource: '',
// Return to the selected data source
rtDatasource: ''
}
},
mixins: [disabledState],
@ -83,7 +85,7 @@
*/
_onDsData (o) {
this.type = o.type
this.datasource = o.datasource
this.rtDatasource = o.datasource
},
/**
* return udp
@ -112,14 +114,29 @@
// storage
this.$emit('on-params', {
type: this.type,
datasource: this.datasource,
datasource: this.rtDatasource,
method: this.method,
localParams: this.localParams
})
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 () {
let o = this.backfillItem

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

@ -31,6 +31,7 @@
<m-resources
ref="refResources"
@on-resourcesData="_onResourcesData"
@on-cache-resourcesData="_onCacheResourcesData"
:resource-list="resourceList">
</m-resources>
</div>
@ -69,7 +70,9 @@
// Custom parameter
localParams: [],
// resource(list)
resourceList: []
resourceList: [],
// Cache ResourceList
cacheResourceList: []
}
},
mixins: [disabledState],
@ -89,6 +92,12 @@
_onResourcesData (a) {
this.resourceList = a
},
/**
* cache resourceList
*/
_onCacheResourcesData (a) {
this.cacheResourceList = a
},
/**
* verification
*/
@ -142,18 +151,33 @@
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 () {
let o = this.backfillItem
// Non-null objects represent backfill
if (!_.isEmpty(o)) {
this.rawScript = o.params.rawScript
this.rawScript = o.params.rawScript || ''
// backfill resourceList
let resourceList = o.params.resourceList || []
if (resourceList.length) {
this.resourceList = resourceList
this.cacheResourceList = resourceList
}
// backfill localParams
@ -174,4 +198,4 @@
},
components: { mLocalParams, mListBox, mResources }
}
</script>
</script>

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

@ -37,6 +37,7 @@
<m-resources
ref="refResources"
@on-resourcesData="_onResourcesData"
@on-cache-resourcesData="_onCacheResourcesData"
:resource-list="resourceList">
</m-resources>
</div>
@ -75,7 +76,9 @@
// Custom parameter
localParams: [],
// resource(list)
resourceList: []
resourceList: [],
// Cache ResourceList
cacheResourceList: []
}
},
mixins: [disabledState],
@ -119,11 +122,17 @@
},
/**
* return resourceList
*
*
*/
_onResourcesData (a) {
this.resourceList = a
},
/**
* cache resourceList
*/
_onCacheResourcesData (a) {
this.cacheResourceList = a
},
/**
* verification
*/
@ -175,18 +184,33 @@
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 () {
let o = this.backfillItem
// Non-null objects represent backfill
if (!_.isEmpty(o)) {
this.rawScript = o.params.rawScript
this.rawScript = o.params.rawScript || ''
// backfill resourceList
let resourceList = o.params.resourceList || []
if (resourceList.length) {
this.resourceList = resourceList
this.cacheResourceList = resourceList
}
// backfill localParams
@ -229,5 +253,5 @@
right: -12px;
top: -16px;
}
</style>

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

@ -412,7 +412,7 @@
// Non-null objects represent backfill
if (!_.isEmpty(o)) {
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.driverCores = o.params.driverCores || 1
this.driverMemory = o.params.driverMemory || '512M'

10
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
}
},
watch: {},
watch: {
wdiCurr (val) {
this.$emit('on-cache-params', {
processDefinitionId: this.wdiCurr
})
}
},
created () {
let processListS = _.cloneDeep(this.store.state.dag.processListS)
let id = this.router.history.current.params.id || null
@ -115,4 +121,4 @@
mounted () {
}
}
</script>
</script>

Loading…
Cancel
Save