本文整理汇总了Java中org.apache.hadoop.yarn.server.timeline.NameValuePair类的典型用法代码示例。如果您正苦于以下问题:Java NameValuePair类的具体用法?Java NameValuePair怎么用?Java NameValuePair使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NameValuePair类属于org.apache.hadoop.yarn.server.timeline包,在下文中一共展示了NameValuePair类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getApplicationAttempts
import org.apache.hadoop.yarn.server.timeline.NameValuePair; //导入依赖的package包/类
@Override
public Map<ApplicationAttemptId, ApplicationAttemptReport>
getApplicationAttempts(ApplicationId appId)
throws YarnException, IOException {
ApplicationReportExt app = getApplication(
appId, ApplicationReportField.USER_AND_ACLS);
checkAccess(app);
TimelineEntities entities = timelineDataManager.getEntities(
AppAttemptMetricsConstants.ENTITY_TYPE,
new NameValuePair(
AppAttemptMetricsConstants.PARENT_PRIMARY_FILTER, appId
.toString()), null, null, null, null, null,
Long.MAX_VALUE, EnumSet.allOf(Field.class),
UserGroupInformation.getLoginUser());
Map<ApplicationAttemptId, ApplicationAttemptReport> appAttempts =
new LinkedHashMap<ApplicationAttemptId, ApplicationAttemptReport>();
for (TimelineEntity entity : entities.getEntities()) {
ApplicationAttemptReport appAttempt =
convertToApplicationAttemptReport(entity);
appAttempts.put(appAttempt.getApplicationAttemptId(), appAttempt);
}
return appAttempts;
}
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:ApplicationHistoryManagerOnTimelineStore.java
示例2: getContainers
import org.apache.hadoop.yarn.server.timeline.NameValuePair; //导入依赖的package包/类
@Override
public Map<ContainerId, ContainerReport> getContainers(
ApplicationAttemptId appAttemptId) throws YarnException, IOException {
ApplicationReportExt app = getApplication(
appAttemptId.getApplicationId(), ApplicationReportField.USER_AND_ACLS);
checkAccess(app);
TimelineEntities entities = timelineDataManager.getEntities(
ContainerMetricsConstants.ENTITY_TYPE,
new NameValuePair(
ContainerMetricsConstants.PARENT_PRIMARIY_FILTER,
appAttemptId.toString()), null, null, null,
null, null, Long.MAX_VALUE, EnumSet.allOf(Field.class),
UserGroupInformation.getLoginUser());
Map<ContainerId, ContainerReport> containers =
new LinkedHashMap<ContainerId, ContainerReport>();
if (entities != null && entities.getEntities() != null) {
for (TimelineEntity entity : entities.getEntities()) {
ContainerReport container = convertToContainerReport(
entity, serverHttpAddress, app.appReport.getUser());
containers.put(container.getContainerId(), container);
}
}
return containers;
}
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:ApplicationHistoryManagerOnTimelineStore.java
示例3: testGetTimelineEntityGroupIdByPrimaryFilter
import org.apache.hadoop.yarn.server.timeline.NameValuePair; //导入依赖的package包/类
@Test
public void testGetTimelineEntityGroupIdByPrimaryFilter() {
TimelineCachePluginImpl plugin = createPlugin(100, null);
for (Entry<String, String> entry : typeIdMap1.entrySet()) {
NameValuePair primaryFilter = new NameValuePair(entry.getKey(), entry.getValue());
Assert.assertNull(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(getGroupIds(dagID1, 100).contains(groupId.getTimelineEntityGroupId()));
}
}
}
开发者ID:apache,项目名称:tez,代码行数:22,代码来源:TestTimelineCachePluginImpl.java
示例4: testInvalidTypeRequests
import org.apache.hadoop.yarn.server.timeline.NameValuePair; //导入依赖的package包/类
@Test
public void testInvalidTypeRequests() {
TimelineCachePluginImpl plugin = createPlugin(-1, null);
Assert.assertNull(plugin.getTimelineEntityGroupId(EntityTypes.TEZ_APPLICATION.name(),
appId1.toString()));
Assert.assertNull(plugin.getTimelineEntityGroupId(EntityTypes.TEZ_APPLICATION_ATTEMPT.name(),
appAttemptId1.toString()));
Assert.assertNull(plugin.getTimelineEntityGroupId(EntityTypes.TEZ_CONTAINER_ID.name(),
appId1.toString()));
Assert.assertNull(plugin.getTimelineEntityGroupId(EntityTypes.TEZ_TASK_ID.name(), null,
new HashSet<String>()));
Assert.assertNull(plugin.getTimelineEntityGroupId(EntityTypes.TEZ_TASK_ID.name(), null,
new HashSet<NameValuePair>()));
}
开发者ID:apache,项目名称:tez,代码行数:17,代码来源:TestTimelineCachePluginImpl.java
示例5: parsePairStr
import org.apache.hadoop.yarn.server.timeline.NameValuePair; //导入依赖的package包/类
private static NameValuePair parsePairStr(String str, String delimiter) {
if (str == null) {
return null;
}
String[] strs = str.split(delimiter, 2);
try {
return new NameValuePair(strs[0].trim(),
GenericObjectMapper.OBJECT_READER.readValue(strs[1].trim()));
} catch (Exception e) {
// didn't work as an Object, keep it as a String
return new NameValuePair(strs[0].trim(), strs[1].trim());
}
}
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:TimelineWebServices.java
示例6: parsePairsStr
import org.apache.hadoop.yarn.server.timeline.NameValuePair; //导入依赖的package包/类
private static Collection<NameValuePair> parsePairsStr(
String str, String aDelimiter, String pDelimiter) {
if (str == null) {
return null;
}
String[] strs = str.split(aDelimiter);
Set<NameValuePair> pairs = new HashSet<NameValuePair>();
for (String aStr : strs) {
pairs.add(parsePairStr(aStr, pDelimiter));
}
return pairs;
}
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:TimelineWebServices.java
示例7: getTimelineEntityGroupId
import org.apache.hadoop.yarn.server.timeline.NameValuePair; //导入依赖的package包/类
@Override
public Set<TimelineEntityGroupId> getTimelineEntityGroupId(String entityType,
NameValuePair primaryFilter, Collection<NameValuePair> secondaryFilters) {
if (ApplicationMaster.DSEntity.DS_CONTAINER.toString().equals(entityType)) {
if (primaryFilter == null) {
return null;
}
return toEntityGroupId(primaryFilter.getValue().toString());
}
return null;
}
开发者ID:hopshadoop,项目名称:hops,代码行数:12,代码来源:DistributedShellTimelinePlugin.java
示例8: getTimelineEntityGroupId
import org.apache.hadoop.yarn.server.timeline.NameValuePair; //导入依赖的package包/类
@Override
public Set<TimelineEntityGroupId> getTimelineEntityGroupId(String entityType,
NameValuePair primaryFilter,
Collection<NameValuePair> secondaryFilters) {
if (!knownEntityTypes.contains(entityType)
|| primaryFilter == null
|| !knownEntityTypes.contains(primaryFilter.getName())
|| summaryEntityTypes.contains(entityType)) {
return null;
}
return convertToTimelineEntityGroupIds(primaryFilter.getName(), primaryFilter.getValue().toString());
}
开发者ID:apache,项目名称:tez,代码行数:13,代码来源:TimelineCachePluginImpl.java
示例9: testDeleteEntitiesPrimaryFilters
import org.apache.hadoop.yarn.server.timeline.NameValuePair; //导入依赖的package包/类
@Test
public void testDeleteEntitiesPrimaryFilters()
throws IOException, InterruptedException {
Map<String, Set<Object>> primaryFilter =
Collections.singletonMap("user", Collections.singleton(
(Object) "otheruser"));
TimelineEntities atsEntities = new TimelineEntities();
atsEntities.setEntities(Collections.singletonList(createEntity(entityId1b,
entityType1, 789l, Collections.singletonList(ev2), null, primaryFilter,
null, domainId1)));
TimelinePutResponse response = store.put(atsEntities);
assertEquals(0, response.getErrors().size());
NameValuePair pfPair = new NameValuePair("user", "otheruser");
List<TimelineEntity> entities = getEntitiesWithPrimaryFilter("type_1",
pfPair);
assertEquals(1, entities.size());
verifyEntityInfo(entityId1b, entityType1, Collections.singletonList(ev2),
EMPTY_REL_ENTITIES, primaryFilter, EMPTY_MAP, entities.get(0),
domainId1);
entities = getEntitiesWithPrimaryFilter("type_1", userFilter);
assertEquals(3, entities.size());
verifyEntityInfo(entityId1, entityType1, events1, EMPTY_REL_ENTITIES,
primaryFilters, otherInfo, entities.get(0), domainId1);
verifyEntityInfo(entityId1b, entityType1, events1, EMPTY_REL_ENTITIES,
primaryFilters, otherInfo, entities.get(1), domainId1);
verifyEntityInfo(entityId6, entityType1, EMPTY_EVENTS, EMPTY_REL_ENTITIES,
primaryFilters, otherInfo, entities.get(2), domainId2);
((LeveldbTimelineStore)store).discardOldEntities(-123l);
assertEquals(1, getEntitiesWithPrimaryFilter("type_1", pfPair).size());
assertEquals(3, getEntitiesWithPrimaryFilter("type_1", userFilter).size());
((LeveldbTimelineStore)store).discardOldEntities(123l);
assertEquals(0, getEntities("type_1").size());
assertEquals(0, getEntities("type_2").size());
assertEquals(0, ((LeveldbTimelineStore)store).getEntityTypes().size());
assertEquals(0, getEntitiesWithPrimaryFilter("type_1", pfPair).size());
assertEquals(0, getEntitiesWithPrimaryFilter("type_1", userFilter).size());
}
开发者ID:naver,项目名称:hadoop,代码行数:43,代码来源:TestLeveldbTimelineStore.java
注:本文中的org.apache.hadoop.yarn.server.timeline.NameValuePair类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论