Browse Source

Implements the spark and flink type task, now they can be cache the previous input. (#1795)

pull/2/head
zhukai 5 years ago committed by qiaozhanwei
parent
commit
289ae6ac96
  1. 4
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
  2. 7
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue
  3. 35
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
  4. 36
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue

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

@ -152,12 +152,14 @@
<m-spark <m-spark
v-if="taskType === 'SPARK'" v-if="taskType === 'SPARK'"
@on-params="_onParams" @on-params="_onParams"
@on-cache-params="_onCacheParams"
ref="SPARK" ref="SPARK"
:backfill-item="backfillItem"> :backfill-item="backfillItem">
</m-spark> </m-spark>
<m-flink <m-flink
v-if="taskType === 'FLINK'" v-if="taskType === 'FLINK'"
@on-params="_onParams" @on-params="_onParams"
@on-cache-params="_onCacheParams"
ref="FLINK" ref="FLINK"
:backfill-item="backfillItem"> :backfill-item="backfillItem">
</m-flink> </m-flink>
@ -511,6 +513,8 @@
this.workerGroupId = o.workerGroupId this.workerGroupId = o.workerGroupId
} }
this.params = o.params || {};
} }
this.isContentBox = true this.isContentBox = true
}, },

7
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue

@ -66,6 +66,13 @@
// Listening data source // Listening data source
resourceList (a) { resourceList (a) {
this.value = _.map(_.cloneDeep(a), v => v.res) this.value = _.map(_.cloneDeep(a), v => v.res)
},
value (val) {
this.$emit('on-cache-resourcesData', _.map(val, v => {
return {
res: v
}
}))
} }
}, },
created () { created () {

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

@ -154,6 +154,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>
@ -193,6 +194,8 @@
deployMode: 'cluster', deployMode: 'cluster',
// Resource(list) // Resource(list)
resourceList: [], resourceList: [],
// Cache ResourceList
cacheResourceList: [],
// Custom function // Custom function
localParams: [], localParams: [],
// Driver Number of cores // Driver Number of cores
@ -232,6 +235,12 @@
_onResourcesData (a) { _onResourcesData (a) {
this.resourceList = a this.resourceList = a
}, },
/**
* cache resourceList
*/
_onCacheResourcesData (a) {
this.cacheResourceList = a
},
/** /**
* verification * verification
*/ */
@ -336,6 +345,31 @@
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
},
deployMode: this.deployMode,
resourceList: this.cacheResourceList,
localParams: this.localParams,
slot: this.slot,
taskManager: this.taskManager,
jobManagerMemory: this.jobManagerMemory,
taskManagerMemory: this.taskManagerMemory,
executorCores: this.executorCores,
mainArgs: this.mainArgs,
others: this.others,
programType: this.programType
}
} }
}, },
created () { created () {
@ -360,6 +394,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

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

@ -182,6 +182,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>
@ -221,6 +222,8 @@
deployMode: 'cluster', deployMode: 'cluster',
// Resource(list) // Resource(list)
resourceList: [], resourceList: [],
// Cache ResourceList
cacheResourceList: [],
// Custom function // Custom function
localParams: [], localParams: [],
// Driver Number of cores // Driver Number of cores
@ -264,6 +267,12 @@
_onResourcesData (a) { _onResourcesData (a) {
this.resourceList = a this.resourceList = a
}, },
/**
* cache resourceList
*/
_onCacheResourcesData (a) {
this.cacheResourceList = a
},
/** /**
* verification * verification
*/ */
@ -368,6 +377,32 @@
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
},
deployMode: this.deployMode,
resourceList: this.cacheResourceList,
localParams: this.localParams,
driverCores: this.driverCores,
driverMemory: this.driverMemory,
numExecutors: this.numExecutors,
executorMemory: this.executorMemory,
executorCores: this.executorCores,
mainArgs: this.mainArgs,
others: this.others,
programType: this.programType,
sparkVersion: this.sparkVersion
}
} }
}, },
created () { created () {
@ -393,6 +428,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

Loading…
Cancel
Save