本文整理匯總了Java中azkaban.flow.Flow.initialize方法的典型用法代碼示例。如果您正苦於以下問題:Java Flow.initialize方法的具體用法?Java Flow.initialize怎麽用?Java Flow.initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類azkaban.flow.Flow
的用法示例。
在下文中一共展示了Flow.initialize方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createExecutableFlow
import azkaban.flow.Flow; //導入方法依賴的package包/類
/**
* Creates a linear executable flow with the specified nodes.
*
* @param nodes
* @return
*/
private ExecutableFlow createExecutableFlow(List<Node> nodes) {
if (nodes == null || nodes.size() == 0) {
return new ExecutableFlow();
}
Flow flow = new Flow("flow1");
Node prevNode = nodes.get(0);
flow.addNode(prevNode);
for (int i = 1; i < nodes.size(); i++) {
Node nextNode = nodes.get(i);
flow.addNode(nextNode);
Edge edge = new Edge(prevNode.getId(), nextNode.getId());
flow.addEdge(edge);
prevNode = nextNode;
}
flow.initialize();
Project project = new Project(1, "project1");
return new ExecutableFlow(project, flow);
}
示例2: testFlowUpload
import azkaban.flow.Flow; //導入方法依賴的package包/類
@Ignore @Test
public void testFlowUpload() throws ProjectManagerException {
ProjectLoader loader = createLoader();
((JdbcProjectLoader) loader)
.setDefaultEncodingType(JdbcProjectLoader.EncodingType.GZIP);
String projectName = "mytestFlowUpload1";
String projectDescription = "This is my new project";
User user = new User("testUser");
String group = "";
Project project =
loader.createNewProject(projectName, projectDescription, user, group);
Flow flow = new Flow("MyNewFlow");
flow.addNode(new Node("A"));
flow.addNode(new Node("B"));
flow.addNode(new Node("C"));
flow.addNode(new Node("D"));
flow.addEdge(new Edge("A", "B"));
flow.addEdge(new Edge("A", "C"));
flow.addEdge(new Edge("B", "D"));
flow.addEdge(new Edge("C", "D"));
flow.initialize();
loader.uploadFlow(project, 4, flow);
project.setVersion(4);
Flow newFlow = loader.fetchFlow(project, flow.getId());
Assert.assertTrue(newFlow != null);
Assert.assertEquals(flow.getId(), newFlow.getId());
Assert.assertEquals(flow.getEdges().size(), newFlow.getEdges().size());
Assert.assertEquals(flow.getNodes().size(), newFlow.getNodes().size());
}
示例3: testFlowUploadPlain
import azkaban.flow.Flow; //導入方法依賴的package包/類
@Ignore @Test
public void testFlowUploadPlain() throws ProjectManagerException {
ProjectLoader loader = createLoader();
((JdbcProjectLoader) loader)
.setDefaultEncodingType(JdbcProjectLoader.EncodingType.PLAIN);
String projectName = "mytestFlowUpload2";
String projectDescription = "This is my new project";
User user = new User("testUser");
String group = "";
Project project =
loader.createNewProject(projectName, projectDescription, user, group);
Flow flow = new Flow("MyNewFlow2");
flow.addNode(new Node("A1"));
flow.addNode(new Node("B1"));
flow.addNode(new Node("C1"));
flow.addNode(new Node("D1"));
flow.addEdge(new Edge("A1", "B1"));
flow.addEdge(new Edge("A1", "C1"));
flow.addEdge(new Edge("B1", "D1"));
flow.addEdge(new Edge("C1", "D1"));
flow.initialize();
loader.uploadFlow(project, 4, flow);
project.setVersion(4);
Flow newFlow = loader.fetchFlow(project, flow.getId());
Assert.assertTrue(newFlow != null);
Assert.assertEquals(flow.getId(), newFlow.getId());
Assert.assertEquals(flow.getEdges().size(), newFlow.getEdges().size());
Assert.assertEquals(flow.getNodes().size(), newFlow.getNodes().size());
List<Flow> flows = loader.fetchAllProjectFlows(project);
Assert.assertTrue(flows.size() == 1);
}
示例4: testFlowUpload
import azkaban.flow.Flow; //導入方法依賴的package包/類
@Test
public void testFlowUpload() throws ProjectManagerException {
ProjectLoader loader = createLoader();
((JdbcProjectLoader)loader).setDefaultEncodingType(JdbcProjectLoader.EncodingType.GZIP);
String projectName = "mytestFlowUpload1";
String projectDescription = "This is my new project";
User user = new User("testUser");
Project project = loader.createNewProject(projectName, projectDescription, user);
Flow flow = new Flow("MyNewFlow");
flow.addNode(new Node("A"));
flow.addNode(new Node("B"));
flow.addNode(new Node("C"));
flow.addNode(new Node("D"));
flow.addEdge(new Edge("A", "B"));
flow.addEdge(new Edge("A", "C"));
flow.addEdge(new Edge("B", "D"));
flow.addEdge(new Edge("C", "D"));
flow.initialize();
loader.uploadFlow(project, 4, flow);
project.setVersion(4);
Flow newFlow = loader.fetchFlow(project, flow.getId());
Assert.assertTrue(newFlow != null);
Assert.assertEquals(flow.getId(), newFlow.getId());
Assert.assertEquals(flow.getEdges().size(), newFlow.getEdges().size());
Assert.assertEquals(flow.getNodes().size(), newFlow.getNodes().size());
}
示例5: testFlowUploadPlain
import azkaban.flow.Flow; //導入方法依賴的package包/類
@Test
public void testFlowUploadPlain() throws ProjectManagerException {
ProjectLoader loader = createLoader();
((JdbcProjectLoader)loader).setDefaultEncodingType(JdbcProjectLoader.EncodingType.PLAIN);
String projectName = "mytestFlowUpload2";
String projectDescription = "This is my new project";
User user = new User("testUser");
Project project = loader.createNewProject(projectName, projectDescription, user);
Flow flow = new Flow("MyNewFlow2");
flow.addNode(new Node("A1"));
flow.addNode(new Node("B1"));
flow.addNode(new Node("C1"));
flow.addNode(new Node("D1"));
flow.addEdge(new Edge("A1", "B1"));
flow.addEdge(new Edge("A1", "C1"));
flow.addEdge(new Edge("B1", "D1"));
flow.addEdge(new Edge("C1", "D1"));
flow.initialize();
loader.uploadFlow(project, 4, flow);
project.setVersion(4);
Flow newFlow = loader.fetchFlow(project, flow.getId());
Assert.assertTrue(newFlow != null);
Assert.assertEquals(flow.getId(), newFlow.getId());
Assert.assertEquals(flow.getEdges().size(), newFlow.getEdges().size());
Assert.assertEquals(flow.getNodes().size(), newFlow.getNodes().size());
List<Flow> flows = loader.fetchAllProjectFlows(project);
Assert.assertTrue(flows.size() == 1);
}