本文整理汇总了Java中azkaban.project.Project.setFlows方法的典型用法代码示例。如果您正苦于以下问题:Java Project.setFlows方法的具体用法?Java Project.setFlows怎么用?Java Project.setFlows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类azkaban.project.Project
的用法示例。
在下文中一共展示了Project.setFlows方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createExecutableFlow
import azkaban.project.Project; //导入方法依赖的package包/类
public static ExecutableFlow createExecutableFlow(String projectName,
String flowName) throws IOException {
File jsonFlowFile = getFlowDir(projectName, flowName);
@SuppressWarnings("unchecked")
HashMap<String, Object> flowObj =
(HashMap<String, Object>) JSONUtils.parseJSONFromFile(jsonFlowFile);
Flow flow = Flow.flowFromObject(flowObj);
Project project = new Project(1, "flow");
HashMap<String, Flow> flowMap = new HashMap<String, Flow>();
flowMap.put(flow.getId(), flow);
project.setFlows(flowMap);
ExecutableFlow execFlow = new ExecutableFlow(project, flow);
return execFlow;
}
示例2: createExecutablePair
import azkaban.project.Project; //导入方法依赖的package包/类
private Pair<ExecutionReference, ExecutableFlow> createExecutablePair(
String flowName, int execId) throws IOException {
File jsonFlowFile = getFlowDir(flowName);
@SuppressWarnings("unchecked")
HashMap<String, Object> flowObj =
(HashMap<String, Object>) JSONUtils.parseJSONFromFile(jsonFlowFile);
Flow flow = Flow.flowFromObject(flowObj);
Project project = new Project(1, "flow");
HashMap<String, Flow> flowMap = new HashMap<String, Flow>();
flowMap.put(flow.getId(), flow);
project.setFlows(flowMap);
ExecutableFlow execFlow = new ExecutableFlow(project, flow);
execFlow.setExecutionId(execId);
ExecutionReference ref = new ExecutionReference(execId);
return new Pair<ExecutionReference, ExecutableFlow>(ref, execFlow);
}
示例3: prepareProject
import azkaban.project.Project; //导入方法依赖的package包/类
private void prepareProject(Project project, File directory)
throws ProjectManagerException, IOException {
DirectoryFlowLoader loader = new DirectoryFlowLoader(new Props(), logger);
loader.loadProjectFlow(project, directory);
if (!loader.getErrors().isEmpty()) {
for (String error: loader.getErrors()) {
System.out.println(error);
}
throw new RuntimeException("Errors found in setup");
}
flowMap = loader.getFlowMap();
project.setFlows(flowMap);
FileUtils.copyDirectory(directory, workingDir);
}
示例4: prepareProject
import azkaban.project.Project; //导入方法依赖的package包/类
private void prepareProject(Project project, File directory) throws ProjectManagerException,
IOException {
DirectoryFlowLoader loader = new DirectoryFlowLoader(new Props(), logger);
loader.loadProjectFlow(project, directory);
if (!loader.getErrors().isEmpty()) {
for (String error : loader.getErrors()) {
System.out.println(error);
}
throw new RuntimeException("Errors found in setup");
}
flowMap = loader.getFlowMap();
project.setFlows(flowMap);
FileUtils.copyDirectory(directory, workingDir);
}
示例5: setUp
import azkaban.project.Project; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
project = new Project(11, "myTestProject");
Logger logger = Logger.getLogger(this.getClass());
DirectoryFlowLoader loader = new DirectoryFlowLoader(new Props(), logger);
loader.loadProjectFlow(project, TestExecutions.getFlowDir("embedded"));
Assert.assertEquals(0, loader.getErrors().size());
project.setFlows(loader.getFlowMap());
project.setVersion(123);
}
示例6: createExecutableFlow
import azkaban.project.Project; //导入方法依赖的package包/类
private ExecutableFlow createExecutableFlow(int executionId, String flowName) throws IOException {
File jsonFlowFile = new File(flowDir, flowName + ".flow");
@SuppressWarnings("unchecked")
HashMap<String, Object> flowObj = (HashMap<String, Object>) JSONUtils.parseJSONFromFile(jsonFlowFile);
Flow flow = Flow.flowFromObject(flowObj);
Project project = new Project(1, "flow");
HashMap<String, Flow> flowMap = new HashMap<String, Flow>();
flowMap.put(flow.getId(), flow);
project.setFlows(flowMap);
ExecutableFlow execFlow = new ExecutableFlow(project, flow);
execFlow.setExecutionId(executionId);
return execFlow;
}
示例7: setUp
import azkaban.project.Project; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
Logger logger = Logger.getLogger(this.getClass());
DirectoryFlowLoader loader = new DirectoryFlowLoader(logger);
loader.loadProjectFlow(new File("unit/executions/embedded"));
Assert.assertEquals(0, loader.getErrors().size());
project = new Project(11, "myTestProject");
project.setFlows(loader.getFlowMap());
project.setVersion(123);
}