|
|
@ -14,12 +14,12 @@ |
|
|
|
* See the License for the specific language governing permissions and |
|
|
|
* See the License for the specific language governing permissions and |
|
|
|
* limitations under the License. |
|
|
|
* limitations under the License. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.common.task.flink; |
|
|
|
package org.apache.dolphinscheduler.common.task.flink; |
|
|
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.common.enums.ProgramType; |
|
|
|
import org.apache.dolphinscheduler.common.enums.ProgramType; |
|
|
|
import org.apache.dolphinscheduler.common.process.ResourceInfo; |
|
|
|
import org.apache.dolphinscheduler.common.process.ResourceInfo; |
|
|
|
import org.apache.dolphinscheduler.common.task.AbstractParameters; |
|
|
|
import org.apache.dolphinscheduler.common.task.AbstractParameters; |
|
|
|
import org.apache.dolphinscheduler.common.utils.CollectionUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
@ -29,201 +29,213 @@ import java.util.List; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class FlinkParameters extends AbstractParameters { |
|
|
|
public class FlinkParameters extends AbstractParameters { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* major jar |
|
|
|
* major jar |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private ResourceInfo mainJar; |
|
|
|
private ResourceInfo mainJar; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* major class
|
|
|
|
* major class
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String mainClass; |
|
|
|
private String mainClass; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* deploy mode yarn-cluster yarn-client yarn-local |
|
|
|
* deploy mode yarn-cluster yarn-local |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String deployMode; |
|
|
|
private String deployMode; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* arguments |
|
|
|
* arguments |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String mainArgs; |
|
|
|
private String mainArgs; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* slot count |
|
|
|
* slot count |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private int slot; |
|
|
|
private int slot; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
*Yarn application name |
|
|
|
* parallelism |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
private int parallelism; |
|
|
|
private String appName; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* yarn application name |
|
|
|
* taskManager count |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String appName; |
|
|
|
private int taskManager; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* taskManager count |
|
|
|
* job manager memory |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private int taskManager; |
|
|
|
private String jobManagerMemory ; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* job manager memory |
|
|
|
* task manager memory |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String jobManagerMemory; |
|
|
|
private String taskManagerMemory; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* task manager memory |
|
|
|
* resource list |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String taskManagerMemory; |
|
|
|
private List<ResourceInfo> resourceList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* resource list |
|
|
|
* The YARN queue to submit to |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private List<ResourceInfo> resourceList = new ArrayList<>(); |
|
|
|
private String queue; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* The YARN queue to submit to |
|
|
|
* other arguments |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String queue; |
|
|
|
private String others; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* other arguments |
|
|
|
* flink version |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String others; |
|
|
|
private String flinkVersion; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* flink version |
|
|
|
* program type |
|
|
|
*/ |
|
|
|
* 0 JAVA,1 SCALA,2 PYTHON |
|
|
|
private String flinkVersion; |
|
|
|
*/ |
|
|
|
|
|
|
|
private ProgramType programType; |
|
|
|
/** |
|
|
|
|
|
|
|
* program type |
|
|
|
public ResourceInfo getMainJar() { |
|
|
|
* 0 JAVA,1 SCALA,2 PYTHON |
|
|
|
return mainJar; |
|
|
|
*/ |
|
|
|
} |
|
|
|
private ProgramType programType; |
|
|
|
|
|
|
|
|
|
|
|
public void setMainJar(ResourceInfo mainJar) { |
|
|
|
public ResourceInfo getMainJar() { |
|
|
|
this.mainJar = mainJar; |
|
|
|
return mainJar; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getMainClass() { |
|
|
|
public void setMainJar(ResourceInfo mainJar) { |
|
|
|
return mainClass; |
|
|
|
this.mainJar = mainJar; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setMainClass(String mainClass) { |
|
|
|
public String getMainClass() { |
|
|
|
this.mainClass = mainClass; |
|
|
|
return mainClass; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getDeployMode() { |
|
|
|
public void setMainClass(String mainClass) { |
|
|
|
return deployMode; |
|
|
|
this.mainClass = mainClass; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setDeployMode(String deployMode) { |
|
|
|
public String getDeployMode() { |
|
|
|
this.deployMode = deployMode; |
|
|
|
return deployMode; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getMainArgs() { |
|
|
|
public void setDeployMode(String deployMode) { |
|
|
|
return mainArgs; |
|
|
|
this.deployMode = deployMode; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setMainArgs(String mainArgs) { |
|
|
|
public String getMainArgs() { |
|
|
|
this.mainArgs = mainArgs; |
|
|
|
return mainArgs; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int getSlot() { |
|
|
|
public void setMainArgs(String mainArgs) { |
|
|
|
return slot; |
|
|
|
this.mainArgs = mainArgs; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setSlot(int slot) { |
|
|
|
public int getSlot() { |
|
|
|
this.slot = slot; |
|
|
|
return slot; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getAppName() { |
|
|
|
public void setSlot(int slot) { |
|
|
|
return appName; |
|
|
|
this.slot = slot; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setAppName(String appName) { |
|
|
|
public int getParallelism() { |
|
|
|
this.appName = appName; |
|
|
|
return parallelism; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int getTaskManager() { |
|
|
|
public void setParallelism(int parallelism) { |
|
|
|
return taskManager; |
|
|
|
this.parallelism = parallelism; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setTaskManager(int taskManager) { |
|
|
|
public String getAppName() { |
|
|
|
this.taskManager = taskManager; |
|
|
|
return appName; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getJobManagerMemory() { |
|
|
|
public void setAppName(String appName) { |
|
|
|
return jobManagerMemory; |
|
|
|
this.appName = appName; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setJobManagerMemory(String jobManagerMemory) { |
|
|
|
public int getTaskManager() { |
|
|
|
this.jobManagerMemory = jobManagerMemory; |
|
|
|
return taskManager; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getTaskManagerMemory() { |
|
|
|
|
|
|
|
return taskManagerMemory; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setTaskManagerMemory(String taskManagerMemory) { |
|
|
|
|
|
|
|
this.taskManagerMemory = taskManagerMemory; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getQueue() { |
|
|
|
|
|
|
|
return queue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setQueue(String queue) { |
|
|
|
|
|
|
|
this.queue = queue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<ResourceInfo> getResourceList() { |
|
|
|
|
|
|
|
return resourceList; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setResourceList(List<ResourceInfo> resourceList) { |
|
|
|
public void setTaskManager(int taskManager) { |
|
|
|
this.resourceList = resourceList; |
|
|
|
this.taskManager = taskManager; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getOthers() { |
|
|
|
public String getJobManagerMemory() { |
|
|
|
return others; |
|
|
|
return jobManagerMemory; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setJobManagerMemory(String jobManagerMemory) { |
|
|
|
|
|
|
|
this.jobManagerMemory = jobManagerMemory; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setOthers(String others) { |
|
|
|
public String getTaskManagerMemory() { |
|
|
|
this.others = others; |
|
|
|
return taskManagerMemory; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ProgramType getProgramType() { |
|
|
|
public void setTaskManagerMemory(String taskManagerMemory) { |
|
|
|
return programType; |
|
|
|
this.taskManagerMemory = taskManagerMemory; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setProgramType(ProgramType programType) { |
|
|
|
public String getQueue() { |
|
|
|
this.programType = programType; |
|
|
|
return queue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getFlinkVersion() { |
|
|
|
public void setQueue(String queue) { |
|
|
|
return flinkVersion; |
|
|
|
this.queue = queue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setFlinkVersion(String flinkVersion) { |
|
|
|
public List<ResourceInfo> getResourceList() { |
|
|
|
this.flinkVersion = flinkVersion; |
|
|
|
return resourceList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void setResourceList(List<ResourceInfo> resourceList) { |
|
|
|
public boolean checkParameters() { |
|
|
|
this.resourceList = resourceList; |
|
|
|
return mainJar != null && programType != null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getOthers() { |
|
|
|
|
|
|
|
return others; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void setOthers(String others) { |
|
|
|
public List<ResourceInfo> getResourceFilesList() { |
|
|
|
this.others = others; |
|
|
|
if (mainJar != null && !resourceList.contains(mainJar)) { |
|
|
|
|
|
|
|
resourceList.add(mainJar); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return resourceList; |
|
|
|
|
|
|
|
} |
|
|
|
public ProgramType getProgramType() { |
|
|
|
|
|
|
|
return programType; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setProgramType(ProgramType programType) { |
|
|
|
|
|
|
|
this.programType = programType; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getFlinkVersion() { |
|
|
|
|
|
|
|
return flinkVersion; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setFlinkVersion(String flinkVersion) { |
|
|
|
|
|
|
|
this.flinkVersion = flinkVersion; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean checkParameters() { |
|
|
|
|
|
|
|
return mainJar != null && programType != null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<ResourceInfo> getResourceFilesList() { |
|
|
|
|
|
|
|
if (mainJar != null && !resourceList.contains(mainJar)) { |
|
|
|
|
|
|
|
resourceList.add(mainJar); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return resourceList; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|