Example usage for org.apache.hadoop.yarn.server.timeline NameValuePair NameValuePair

List of usage examples for org.apache.hadoop.yarn.server.timeline NameValuePair NameValuePair

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.server.timeline NameValuePair NameValuePair.

Prototype

public NameValuePair(String name, Object value) 

Source Link

Usage

From source file:org.apache.tez.dag.history.logging.ats.TestTimelineCachePluginImpl.java

License:Apache License

@Test
public void testGetTimelineEntityGroupIdByPrimaryFilter() {
    for (Entry<String, String> entry : typeIdMap1.entrySet()) {
        NameValuePair primaryFilter = new NameValuePair(entry.getKey(), entry.getValue());
        Assert.assertNull(/*from   ww  w  . ja va 2s  .c  o  m*/
                plugin.getTimelineEntityGroupId(EntityTypes.TEZ_APPLICATION.name(), primaryFilter, null));
        Set<TimelineEntityGroupId> groupIds = plugin.getTimelineEntityGroupId(entry.getKey(), primaryFilter,
                null);
        if (entry.getKey().equals(EntityTypes.TEZ_DAG_ID.name())) {
            Assert.assertNull(groupIds);
            continue;
        }
        Assert.assertEquals(2, groupIds.size());
        Iterator<TimelineEntityGroupId> iter = groupIds.iterator();
        while (iter.hasNext()) {
            TimelineEntityGroupId groupId = iter.next();
            Assert.assertEquals(appId1, groupId.getApplicationId());
            Assert.assertTrue((dagID1.toString().equals(groupId.getTimelineEntityGroupId()))
                    || (appId1.toString().equals(groupId.getTimelineEntityGroupId())));
        }
    }
}