public QueueEntity() { super(TimelineEntityType.YARN_QUEUE.toString()); }
public ContainerEntity() { super(TimelineEntityType.YARN_CONTAINER.toString()); }
public UserEntity() { super(TimelineEntityType.YARN_USER.toString()); }
public ClusterEntity() { super(TimelineEntityType.YARN_CLUSTER.toString()); }
public ApplicationAttemptEntity() { super(TimelineEntityType.YARN_APPLICATION_ATTEMPT.toString()); }
/** * Whether the type of this entity matches the type indicated by the input * argument. * * @param typeString entity type represented as a string. * @return true, if string representation of this entity type matches the * entity type passed. */ public boolean matches(String typeString) { return toString().equals(typeString); } }
/** * Checks if the input TimelineEntity object is an ApplicationEntity. * * @param te TimelineEntity object. * @return true if input is an ApplicationEntity, false otherwise */ public static boolean isApplicationEntity(TimelineEntity te) { return (te == null ? false : te.getType().equals(TimelineEntityType.YARN_APPLICATION.toString())); }
public FlowRunEntity() { super(TimelineEntityType.YARN_FLOW_RUN.toString()); // set config to null setConfigs(null); }
public FlowActivityEntity() { super(TimelineEntityType.YARN_FLOW_ACTIVITY.toString()); // set config to null setConfigs(null); }
public QueueEntity(TimelineEntity entity) { super(entity); if (!entity.getType().equals(TimelineEntityType.YARN_QUEUE.toString())) { throw new IllegalArgumentException("Incompatible entity type: " + getId()); } } }
public ClusterEntity(TimelineEntity entity) { super(entity); if (!entity.getType().equals(TimelineEntityType.YARN_CLUSTER.toString())) { throw new IllegalArgumentException("Incompatible entity type: " + getId()); } } }
public ApplicationAttemptEntity(TimelineEntity entity) { super(entity); if (!entity.getType().equals( TimelineEntityType.YARN_APPLICATION_ATTEMPT.toString())) { throw new IllegalArgumentException("Incompatible entity type: " + getId()); } } }
public ApplicationEntity(TimelineEntity entity) { super(entity); if (!entity.getType().equals( TimelineEntityType.YARN_APPLICATION.toString())) { throw new IllegalArgumentException("Incompatible entity type: " + getId()); } }
public UserEntity(TimelineEntity entity) { super(entity); if (!entity.getType().equals(TimelineEntityType.YARN_USER.toString())) { throw new IllegalArgumentException("Incompatible entity type: " + getId()); } } }
public ContainerEntity(TimelineEntity entity) { super(entity); if (!entity.getType().equals( TimelineEntityType.YARN_CONTAINER.toString())) { throw new IllegalArgumentException("Incompatible entity type: " + getId()); } } }
public FlowRunEntity(TimelineEntity entity) { super(entity); if (!entity.getType().equals( TimelineEntityType.YARN_FLOW_RUN.toString())) { throw new IllegalArgumentException("Incompatible entity type: " + getId()); } // set config to null setConfigs(null); }
private void createAppEntities() { TimelineEntity timelineEntity = generateEntity(TimelineEntityType.YARN_CONTAINER.toString(), cId.toString()); timelineEntity .addInfo(ContainerMetricsConstants.ALLOCATED_HOST_HTTP_ADDRESS_INFO, nodeHttpAddress); entities.put(cId.toString(), timelineEntity); }
@Test public void testQueue() throws Exception { QueueEntity queue = new QueueEntity(); queue.setId("test queue id"); queue.addInfo("test info key 1", "test info value 1"); queue.addInfo("test info key 2", "test info value 2"); queue.setParent(TimelineEntityType.YARN_QUEUE.toString(), "test parent queue id"); queue.addChild(TimelineEntityType.YARN_QUEUE.toString(), "test child queue id 1"); queue.addChild(TimelineEntityType.YARN_QUEUE.toString(), "test child queue id 2"); LOG.info(TimelineUtils.dumpTimelineRecordtoJSON(queue, true)); } }
private void createContainerEntities() { TimelineEntity timelineEntity = generateEntity(TimelineEntityType.YARN_APPLICATION.toString(), appId.toString()); timelineEntity.addInfo(ApplicationMetricsConstants.USER_ENTITY_INFO, user); timelineEntity .addInfo(ApplicationMetricsConstants.STATE_EVENT_INFO, "RUNNING"); entities.put(appId.toString(), timelineEntity); }
@Test public void testIsApplicationEntity() { TimelineEntity te = new TimelineEntity(); te.setType(TimelineEntityType.YARN_APPLICATION.toString()); assertTrue(ApplicationEntity.isApplicationEntity(te)); te = null; assertEquals(false, ApplicationEntity.isApplicationEntity(te)); te = new TimelineEntity(); te.setType(TimelineEntityType.YARN_CLUSTER.toString()); assertEquals(false, ApplicationEntity.isApplicationEntity(te)); }