• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java NameValuePair类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ProgressMonitor类代码示例发布时间:2022-05-23
下一篇:
Java PropertyCellProvider类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap