use of com.flink.platform.common.model.JobVertex in project flink-platform-backend by itinycheng.
the class JobFlowDagHelperTest method before.
@Before
public void before() {
dag = new DAG<>();
JobVertex jobVertex1 = new JobVertex(1L, 1L);
JobVertex jobVertex2 = new JobVertex(2L, 2L);
JobVertex jobVertex3 = new JobVertex(3L, 3L);
JobVertex jobVertex4 = new JobVertex(4L, 4L);
JobVertex jobVertex5 = new JobVertex(5L, 5L);
JobVertex jobVertex6 = new JobVertex(6L, 6L);
jobVertex6.setPrecondition(OR);
dag.addVertex(jobVertex1);
dag.addVertex(jobVertex2);
dag.addVertex(jobVertex3);
dag.addVertex(jobVertex4);
dag.addVertex(jobVertex5);
dag.addVertex(jobVertex6);
JobEdge jobEdge1 = new JobEdge(1L, 3L, SUCCESS);
JobEdge jobEdge2 = new JobEdge(2L, 3L, SUCCESS);
JobEdge jobEdge3 = new JobEdge(2L, 4L, SUCCESS);
JobEdge jobEdge4 = new JobEdge(3L, 5L, SUCCESS);
JobEdge jobEdge5 = new JobEdge(4L, 5L, SUCCESS);
JobEdge jobEdge6 = new JobEdge(1L, 6L, FAILURE);
JobEdge jobEdge7 = new JobEdge(2L, 6L, FAILURE);
JobEdge jobEdge8 = new JobEdge(3L, 6L, FAILURE);
JobEdge jobEdge9 = new JobEdge(4L, 6L, FAILURE);
JobEdge jobEdge10 = new JobEdge(5L, 6L, FAILURE);
dag.addEdge(jobEdge1);
dag.addEdge(jobEdge2);
dag.addEdge(jobEdge3);
dag.addEdge(jobEdge4);
dag.addEdge(jobEdge5);
dag.addEdge(jobEdge6);
dag.addEdge(jobEdge7);
dag.addEdge(jobEdge8);
dag.addEdge(jobEdge9);
dag.addEdge(jobEdge10);
}
use of com.flink.platform.common.model.JobVertex in project flink-platform-backend by itinycheng.
the class JobFlowDagHelperTest method test7.
@Test
public void test7() {
JobVertex vertex = dag.getVertex(2L);
vertex.setJobRunStatus(SUCCESS);
vertex = dag.getVertex(1L);
vertex.setJobRunStatus(SUCCESS);
vertex = dag.getVertex(3L);
vertex.setJobRunStatus(SUCCESS);
Set<JobVertex> executableVertices = JobFlowDagHelper.getExecutableVertices(dag);
System.out.println(executableVertices);
}
use of com.flink.platform.common.model.JobVertex in project flink-platform-backend by itinycheng.
the class JobFlowDagHelperTest method test12.
@Test
public void test12() {
JobVertex vertex = dag.getVertex(2L);
vertex.setJobRunStatus(FAILURE);
vertex = dag.getVertex(1L);
vertex.setJobRunStatus(SUCCESS);
Set<JobVertex> executableVertices = JobFlowDagHelper.getExecutableVertices(dag);
System.out.println(executableVertices);
}
use of com.flink.platform.common.model.JobVertex in project flink-platform-backend by itinycheng.
the class JobFlowTest method test1.
@Test
public void test1() {
JobFlowDag dag = new JobFlowDag();
JobVertex jobVertex1 = new JobVertex(19L, 19L);
JobVertex jobVertex2 = new JobVertex(20L, 20L);
dag.addVertex(jobVertex1);
dag.addVertex(jobVertex2);
JobEdge jobEdge = new JobEdge(19L, 20L, SUCCESS);
dag.addEdge(jobEdge);
JobFlowRequest jobFlowRequest = new JobFlowRequest();
jobFlowRequest.setCode(UuidGenerator.generateShortUuid());
jobFlowRequest.setName("test_1");
jobFlowRequest.setUserId(0L);
jobFlowRequest.setDescription("description");
jobFlowRequest.setCronExpr("0 0/10 * * * ?");
jobFlowRequest.setFlow(dag);
jobFlowRequest.setPriority(8);
jobFlowRequest.setAlerts(new LongArrayList());
jobFlowRequest.setStatus(OFFLINE);
String json = JsonUtil.toJsonString(jobFlowRequest.getJobFlow());
System.out.println(json);
}
Aggregations