Search in sources :

Example 6 with TimelineEntityGroupId

use of org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId in project tez by apache.

the class TestTimelineCachePluginImpl method testGetTimelineEntityGroupIdByIdWithOldGroupIdsSingle.

@Test
public void testGetTimelineEntityGroupIdByIdWithOldGroupIdsSingle() {
    TimelineCachePluginImpl plugin = createPlugin(100, "50");
    for (Entry<String, String> entry : typeIdMap2.entrySet()) {
        Set<TimelineEntityGroupId> groupIds = plugin.getTimelineEntityGroupId(entry.getValue(), entry.getKey());
        if (entry.getKey().equals(EntityTypes.TEZ_DAG_ID.name())) {
            Assert.assertNull(groupIds);
            continue;
        }
        Assert.assertEquals(3, groupIds.size());
        Iterator<TimelineEntityGroupId> iter = groupIds.iterator();
        while (iter.hasNext()) {
            TimelineEntityGroupId groupId = iter.next();
            Assert.assertEquals(appId2, groupId.getApplicationId());
            Assert.assertTrue(getGroupIds(dagID2, 100, 50).contains(groupId.getTimelineEntityGroupId()));
        }
    }
}
Also used : TimelineEntityGroupId(org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId) Test(org.junit.Test)

Example 7 with TimelineEntityGroupId

use of org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId in project tez by apache.

the class TestTimelineCachePluginImpl method testGetTimelineEntityGroupIdByIdDefaultConfig.

@Test
public void testGetTimelineEntityGroupIdByIdDefaultConfig() {
    TimelineCachePluginImpl plugin = createPlugin(-1, null);
    for (Entry<String, String> entry : typeIdMap1.entrySet()) {
        Set<TimelineEntityGroupId> groupIds = plugin.getTimelineEntityGroupId(entry.getValue(), entry.getKey());
        if (entry.getKey().equals(EntityTypes.TEZ_DAG_ID.name())) {
            Assert.assertNull(groupIds);
            continue;
        }
        Assert.assertEquals(1, groupIds.size());
        Iterator<TimelineEntityGroupId> iter = groupIds.iterator();
        while (iter.hasNext()) {
            TimelineEntityGroupId groupId = iter.next();
            Assert.assertEquals(appId1, groupId.getApplicationId());
            Assert.assertTrue(getGroupIds(dagID1).contains(groupId.getTimelineEntityGroupId()));
        }
    }
}
Also used : TimelineEntityGroupId(org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId) Test(org.junit.Test)

Example 8 with TimelineEntityGroupId

use of org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId in project tez by apache.

the class TestTimelineCachePluginImpl method testGetTimelineEntityGroupIdByIdWithOldGroupIdsMultiple.

@Test
public void testGetTimelineEntityGroupIdByIdWithOldGroupIdsMultiple() {
    TimelineCachePluginImpl plugin = createPlugin(100, "25, 50");
    for (Entry<String, String> entry : typeIdMap2.entrySet()) {
        Set<TimelineEntityGroupId> groupIds = plugin.getTimelineEntityGroupId(entry.getValue(), entry.getKey());
        if (entry.getKey().equals(EntityTypes.TEZ_DAG_ID.name())) {
            Assert.assertNull(groupIds);
            continue;
        }
        Assert.assertEquals(4, groupIds.size());
        Iterator<TimelineEntityGroupId> iter = groupIds.iterator();
        while (iter.hasNext()) {
            TimelineEntityGroupId groupId = iter.next();
            Assert.assertEquals(appId2, groupId.getApplicationId());
            Assert.assertTrue(getGroupIds(dagID2, 100, 25, 50).contains(groupId.getTimelineEntityGroupId()));
        }
    }
}
Also used : TimelineEntityGroupId(org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId) Test(org.junit.Test)

Example 9 with TimelineEntityGroupId

use of org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId in project tez by apache.

the class TestTimelineCachePluginImpl method testGetTimelineEntityGroupIdByIdNoGroupingConf.

@Test
public void testGetTimelineEntityGroupIdByIdNoGroupingConf() {
    TimelineCachePluginImpl plugin = createPlugin(1, null);
    for (Entry<String, String> entry : typeIdMap1.entrySet()) {
        Set<TimelineEntityGroupId> groupIds = plugin.getTimelineEntityGroupId(entry.getValue(), entry.getKey());
        if (entry.getKey().equals(EntityTypes.TEZ_DAG_ID.name())) {
            Assert.assertNull(groupIds);
            continue;
        }
        Assert.assertEquals(1, groupIds.size());
        Iterator<TimelineEntityGroupId> iter = groupIds.iterator();
        while (iter.hasNext()) {
            TimelineEntityGroupId groupId = iter.next();
            Assert.assertEquals(appId1, groupId.getApplicationId());
            Assert.assertTrue(getGroupIds(dagID1).contains(groupId.getTimelineEntityGroupId()));
        }
    }
}
Also used : TimelineEntityGroupId(org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId) Test(org.junit.Test)

Example 10 with TimelineEntityGroupId

use of org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId in project tez by apache.

the class ATSV15HistoryLoggingService method handleEvents.

private void handleEvents(DAGHistoryEvent event) {
    String domainId = getDomainForEvent(event);
    // skippedDags is updated in the above call so check again.
    if (event.getDagID() != null && skippedDAGs.contains(event.getDagID())) {
        return;
    }
    TimelineEntityGroupId groupId = getGroupId(event);
    List<TimelineEntity> entities = HistoryEventTimelineConversion.convertToTimelineEntities(event.getHistoryEvent());
    for (TimelineEntity entity : entities) {
        logEntity(groupId, entity, domainId);
    }
}
Also used : TimelineEntityGroupId(org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId) TimelineEntity(org.apache.hadoop.yarn.api.records.timeline.TimelineEntity)

Aggregations

TimelineEntityGroupId (org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId)17 Test (org.junit.Test)12 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)5 TreeSet (java.util.TreeSet)2 Path (org.apache.hadoop.fs.Path)2 TimelineEntity (org.apache.hadoop.yarn.api.records.timeline.TimelineEntity)2 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1 ApplicationAttemptId (org.apache.hadoop.yarn.api.records.ApplicationAttemptId)1 NameValuePair (org.apache.hadoop.yarn.server.timeline.NameValuePair)1 AppContext (org.apache.tez.dag.app.AppContext)1 DAGHistoryEvent (org.apache.tez.dag.history.DAGHistoryEvent)1 HistoryEvent (org.apache.tez.dag.history.HistoryEvent)1 HistoryEventType (org.apache.tez.dag.history.HistoryEventType)1 ATSV15HistoryLoggingService (org.apache.tez.dag.history.logging.ats.ATSV15HistoryLoggingService)1