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

Java ContainerPBImpl类代码示例

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

本文整理汇总了Java中org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl的典型用法代码示例。如果您正苦于以下问题:Java ContainerPBImpl类的具体用法?Java ContainerPBImpl怎么用?Java ContainerPBImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ContainerPBImpl类属于org.apache.hadoop.yarn.api.records.impl.pb包,在下文中一共展示了ContainerPBImpl类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: storeAttempt

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
protected ContainerId storeAttempt(RMStateStore store,
    ApplicationAttemptId attemptId,
    String containerIdStr, Token<AMRMTokenIdentifier> appToken,
    SecretKey clientTokenMasterKey, TestDispatcher dispatcher)
    throws Exception {

  RMAppAttemptMetrics mockRmAppAttemptMetrics = 
      mock(RMAppAttemptMetrics.class);
  Container container = new ContainerPBImpl();
  container.setId(ConverterUtils.toContainerId(containerIdStr));
  RMAppAttempt mockAttempt = mock(RMAppAttempt.class);
  when(mockAttempt.getAppAttemptId()).thenReturn(attemptId);
  when(mockAttempt.getMasterContainer()).thenReturn(container);
  when(mockAttempt.getAMRMToken()).thenReturn(appToken);
  when(mockAttempt.getClientTokenMasterKey())
      .thenReturn(clientTokenMasterKey);
  when(mockAttempt.getRMAppAttemptMetrics())
      .thenReturn(mockRmAppAttemptMetrics);
  when(mockRmAppAttemptMetrics.getAggregateAppResourceUsage())
      .thenReturn(new AggregateAppResourceUsage(0, 0, 0));
  dispatcher.attemptId = attemptId;
  store.storeNewApplicationAttempt(mockAttempt);
  waitNotify(dispatcher);
  return container.getId();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:RMStateStoreTestBase.java


示例2: storeAttempt

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
protected ContainerId storeAttempt(RMStateStore store,
    ApplicationAttemptId attemptId,
    String containerIdStr, Token<AMRMTokenIdentifier> appToken,
    SecretKey clientTokenMasterKey, TestDispatcher dispatcher)
    throws Exception {

  RMAppAttemptMetrics mockRmAppAttemptMetrics = 
      mock(RMAppAttemptMetrics.class);
  Container container = new ContainerPBImpl();
  container.setId(ConverterUtils.toContainerId(containerIdStr));
  RMAppAttempt mockAttempt = mock(RMAppAttempt.class);
  when(mockAttempt.getAppAttemptId()).thenReturn(attemptId);
  when(mockAttempt.getMasterContainer()).thenReturn(container);
  when(mockAttempt.getAMRMToken()).thenReturn(appToken);
  when(mockAttempt.getClientTokenMasterKey())
      .thenReturn(clientTokenMasterKey);
  when(mockAttempt.getRMAppAttemptMetrics())
      .thenReturn(mockRmAppAttemptMetrics);
  when(mockRmAppAttemptMetrics.getAggregateAppResourceUsage())
      .thenReturn(new AggregateAppResourceUsage(0, 0));
  dispatcher.attemptId = attemptId;
  store.storeNewApplicationAttempt(mockAttempt);
  waitNotify(dispatcher);
  return container.getId();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:26,代码来源:RMStateStoreTestBase.java


示例3: storeAttempt

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
ContainerId storeAttempt(RMStateStore store, ApplicationAttemptId attemptId,
    String containerIdStr, Token<AMRMTokenIdentifier> appToken,
    SecretKey clientTokenMasterKey, TestDispatcher dispatcher)
    throws Exception {

  RMAppAttemptMetrics mockRmAppAttemptMetrics = 
      mock(RMAppAttemptMetrics.class);
  Container container = new ContainerPBImpl();
  container.setId(ConverterUtils.toContainerId(containerIdStr));
  RMAppAttempt mockAttempt = mock(RMAppAttempt.class);
  when(mockAttempt.getAppAttemptId()).thenReturn(attemptId);
  when(mockAttempt.getMasterContainer()).thenReturn(container);
  when(mockAttempt.getAMRMToken()).thenReturn(appToken);
  when(mockAttempt.getClientTokenMasterKey())
      .thenReturn(clientTokenMasterKey);
  when(mockAttempt.getRMAppAttemptMetrics())
      .thenReturn(mockRmAppAttemptMetrics);
  when(mockRmAppAttemptMetrics.getAggregateAppResourceUsage())
      .thenReturn(new AggregateAppResourceUsage(0,0));
  dispatcher.attemptId = attemptId;
  store.storeNewApplicationAttempt(mockAttempt);
  waitNotify(dispatcher);
  return container.getId();
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:25,代码来源:RMStateStoreTestBase.java


示例4: storeAttempt

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
ContainerId storeAttempt(RMStateStore store, ApplicationAttemptId attemptId,
    String containerIdStr, Token<AMRMTokenIdentifier> appToken,
    Token<ClientToAMTokenIdentifier> clientToAMToken, TestDispatcher dispatcher)
    throws Exception {

  Container container = new ContainerPBImpl();
  container.setId(ConverterUtils.toContainerId(containerIdStr));
  RMAppAttempt mockAttempt = mock(RMAppAttempt.class);
  when(mockAttempt.getAppAttemptId()).thenReturn(attemptId);
  when(mockAttempt.getMasterContainer()).thenReturn(container);
  when(mockAttempt.getAMRMToken()).thenReturn(appToken);
  when(mockAttempt.getClientToAMToken()).thenReturn(clientToAMToken);
  dispatcher.attemptId = attemptId;
  dispatcher.storedException = null;
  store.storeApplicationAttempt(mockAttempt);
  waitNotify(dispatcher);
  return container.getId();
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:19,代码来源:TestRMStateStore.java


示例5: storeAttempt

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
protected ContainerId storeAttempt(RMStateStore store,
    ApplicationAttemptId attemptId,
    String containerIdStr, Token<AMRMTokenIdentifier> appToken,
    SecretKey clientTokenMasterKey, TestDispatcher dispatcher)
    throws Exception {

  RMAppAttemptMetrics mockRmAppAttemptMetrics = 
      mock(RMAppAttemptMetrics.class);
  Container container = new ContainerPBImpl();
  container.setId(ContainerId.fromString(containerIdStr));
  RMAppAttempt mockAttempt = mock(RMAppAttempt.class);
  when(mockAttempt.getAppAttemptId()).thenReturn(attemptId);
  when(mockAttempt.getMasterContainer()).thenReturn(container);
  when(mockAttempt.getAMRMToken()).thenReturn(appToken);
  when(mockAttempt.getClientTokenMasterKey())
      .thenReturn(clientTokenMasterKey);
  when(mockAttempt.getRMAppAttemptMetrics())
      .thenReturn(mockRmAppAttemptMetrics);
  when(mockRmAppAttemptMetrics.getAggregateAppResourceUsage())
      .thenReturn(new AggregateAppResourceUsage(0, 0, 0));
  dispatcher.attemptId = attemptId;
  store.storeNewApplicationAttempt(mockAttempt);
  waitNotify(dispatcher);
  return container.getId();
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:26,代码来源:RMStateStoreTestBase.java


示例6: storeAttempt

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
ContainerId storeAttempt(RMStateStore store, ApplicationAttemptId attemptId,
    String containerIdStr, Token<AMRMTokenIdentifier> appToken,
    SecretKey clientTokenMasterKey, TestDispatcher dispatcher)
    throws Exception {

  Container container = new ContainerPBImpl();
  container.setId(ConverterUtils.toContainerId(containerIdStr));
  RMAppAttempt mockAttempt = mock(RMAppAttempt.class);
  when(mockAttempt.getAppAttemptId()).thenReturn(attemptId);
  when(mockAttempt.getMasterContainer()).thenReturn(container);
  when(mockAttempt.getAMRMToken()).thenReturn(appToken);
  when(mockAttempt.getClientTokenMasterKey())
      .thenReturn(clientTokenMasterKey);
  dispatcher.attemptId = attemptId;
  dispatcher.storedException = null;
  store.storeApplicationAttempt(mockAttempt);
  waitNotify(dispatcher);
  return container.getId();
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:20,代码来源:TestRMStateStore.java


示例7: buildAppMasterNode

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
/**
 * build up the special master node, which lives
 * in the live node set but has a lifecycle bonded to the AM
 * @param containerId the AM master
 * @param host hostname
 * @param amPort port
 * @param nodeHttpAddress http address: may be null
 */
public void buildAppMasterNode(ContainerId containerId,
                               String host,
                               int amPort,
                               String nodeHttpAddress) {
  Container container = new ContainerPBImpl();
  container.setId(containerId);
  NodeId nodeId = NodeId.newInstance(host, amPort);
  container.setNodeId(nodeId);
  container.setNodeHttpAddress(nodeHttpAddress);
  RoleInstance am = new RoleInstance(container);
  am.role = SliderKeys.COMPONENT_AM;
  appMasterNode = am;
  //it is also added to the set of live nodes
  getLiveNodes().put(containerId, am);
  
  // patch up the role status
  RoleStatus roleStatus = roleStatusMap.get(
      (SliderKeys.ROLE_AM_PRIORITY_INDEX));
  roleStatus.setDesired(1);
  roleStatus.incActual();
  roleStatus.incStarted();
}
 
开发者ID:apache,项目名称:incubator-slider,代码行数:31,代码来源:AppState.java


示例8: storeAttempt

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
ContainerId storeAttempt(RMStateStore store, ApplicationAttemptId attemptId,
    String containerIdStr, Token<AMRMTokenIdentifier> appToken,
    SecretKey clientTokenMasterKey, TestDispatcher dispatcher)
    throws Exception {

  Container container = new ContainerPBImpl();
  container.setId(ConverterUtils.toContainerId(containerIdStr));
  RMAppAttempt mockAttempt = mock(RMAppAttempt.class);
  when(mockAttempt.getAppAttemptId()).thenReturn(attemptId);
  when(mockAttempt.getMasterContainer()).thenReturn(container);
  when(mockAttempt.getAMRMToken()).thenReturn(appToken);
  when(mockAttempt.getClientTokenMasterKey())
      .thenReturn(clientTokenMasterKey);
  dispatcher.attemptId = attemptId;
  dispatcher.storedException = null;
  store.storeNewApplicationAttempt(mockAttempt);
  waitNotify(dispatcher);
  return container.getId();
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:20,代码来源:RMStateStoreTestBase.java


示例9: mergeLocalToBuilder

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
private void mergeLocalToBuilder() {
  if (this.attemptId != null) {
    builder.setAttemptId(((ApplicationAttemptIdPBImpl)attemptId).getProto());
  }
  if(this.masterContainer != null) {
    builder.setMasterContainer(((ContainerPBImpl)masterContainer).getProto());
  }
  if(this.appAttemptTokens != null) {
    builder.setAppAttemptTokens(ProtoUtils.convertToProtoFormat(
        this.appAttemptTokens));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:ApplicationAttemptStateDataPBImpl.java


示例10: mergeLocalToBuilder

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
private void mergeLocalToBuilder() {
  if (this.attemptId != null) {
    builder.setAttemptId(((ApplicationAttemptIdPBImpl)attemptId).getProto());
  }
  if(this.masterContainer != null) {
    builder.setMasterContainer(((ContainerPBImpl)masterContainer).getProto());
  }
  if(this.appAttemptTokens != null) {
    builder.setAppAttemptTokens(convertToProtoFormat(this.appAttemptTokens));
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:12,代码来源:ApplicationAttemptStateDataPBImpl.java


示例11: convertFromProtoFormat

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
private ContainerPBImpl convertFromProtoFormat(ContainerProto p) {
  return new ContainerPBImpl(p);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:RegisterApplicationMasterResponsePBImpl.java


示例12: convertToProtoFormat

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
private ContainerProto convertToProtoFormat(Container t) {
  return ((ContainerPBImpl) t).getProto();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:RegisterApplicationMasterResponsePBImpl.java


示例13: convertFromProtoFormat

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
private synchronized ContainerPBImpl convertFromProtoFormat(
    ContainerProto p) {
  return new ContainerPBImpl(p);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:AllocateResponsePBImpl.java


示例14: convertToProtoFormat

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
private synchronized ContainerProto convertToProtoFormat(
    Container t) {
  return ((ContainerPBImpl)t).getProto();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:AllocateResponsePBImpl.java


示例15: testContainerPBImpl

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
@Test
public void testContainerPBImpl() throws Exception {
  validatePBImplRecord(ContainerPBImpl.class, ContainerProto.class);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:5,代码来源:TestPBImplRecords.java


示例16: convertFromProtoFormat

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
private ContainerPBImpl convertFromProtoFormat(
    ContainerProto c) {
  return new ContainerPBImpl(c);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:5,代码来源:NodeStatusPBImpl.java


示例17: convertToProtoFormat

import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl; //导入依赖的package包/类
private ContainerProto convertToProtoFormat(
    Container c) {
  return ((ContainerPBImpl)c).getProto();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:5,代码来源:NodeStatusPBImpl.java



注:本文中的org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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