public ClusterEntity(TimelineEntity entity) { super(entity); if (!entity.getType().equals(TimelineEntityType.YARN_CLUSTER.toString())) { throw new IllegalArgumentException("Incompatible entity type: " + getId()); } } }
client.init(conf); client.start(); ClusterEntity cluster = new ClusterEntity(); cluster.setId(YarnConfiguration.DEFAULT_RM_CLUSTER_ID); FlowRunEntity flow = new FlowRunEntity(); flow.setUser(UserGroupInformation.getCurrentUser().getShortUserName()); flow.setVersion("test_flow_version"); flow.setRunId(1L); flow.setParent(cluster.getType(), cluster.getId()); ApplicationEntity app = new ApplicationEntity(); app.setId(appId.toString());
ClusterEntity cluster = new ClusterEntity(); cluster.setId("test cluster id"); ApplicationId.newInstance(0, 1), 1), 1).toString()); cluster.addChild(TimelineEntityType.YARN_FLOW_RUN.toString(), flow1.getId()); flow1 .setParent(TimelineEntityType.YARN_CLUSTER.toString(), cluster.getId()); flow1.addChild(TimelineEntityType.YARN_FLOW_RUN.toString(), flow2.getId()); flow2.setParent(TimelineEntityType.YARN_FLOW_RUN.toString(), flow1.getId());