Java 类org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl 实例源码

项目:hadoop    文件:RMStateStoreTestBase.java   
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();
}
项目:aliyun-oss-hadoop-fs    文件:RMStateStoreTestBase.java   
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();
}
项目:big-c    文件:RMStateStoreTestBase.java   
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();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:RMStateStoreTestBase.java   
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();
}
项目:hadoop-plus    文件:TestRMStateStore.java   
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();
}
项目:hops    文件:RMStateStoreTestBase.java   
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();
}
项目:hadoop-TCP    文件:TestRMStateStore.java   
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();
}
项目:incubator-slider    文件:AppState.java   
/**
 * 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();
}
项目:hardfs    文件:TestRMStateStore.java   
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();
}
项目:hadoop-on-lustre2    文件:RMStateStoreTestBase.java   
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();
}
项目:hadoop    文件:ApplicationAttemptStateDataPBImpl.java   
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));
  }
}
项目:aliyun-oss-hadoop-fs    文件:ApplicationAttemptStateDataPBImpl.java   
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));
  }
}
项目:big-c    文件:ApplicationAttemptStateDataPBImpl.java   
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));
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ApplicationAttemptStateDataPBImpl.java   
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));
  }
}
项目:hadoop-plus    文件:ApplicationAttemptStateDataPBImpl.java   
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));
  }
}
项目:hops    文件:ApplicationAttemptStateDataPBImpl.java   
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));
  }
}
项目:hadoop-TCP    文件:ApplicationAttemptStateDataPBImpl.java   
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));
  }
}
项目:hardfs    文件:ApplicationAttemptStateDataPBImpl.java   
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));
  }
}
项目:hadoop-on-lustre2    文件:ApplicationAttemptStateDataPBImpl.java   
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));
  }
}
项目:hadoop    文件:RegisterApplicationMasterResponsePBImpl.java   
private ContainerPBImpl convertFromProtoFormat(ContainerProto p) {
  return new ContainerPBImpl(p);
}
项目:hadoop    文件:RegisterApplicationMasterResponsePBImpl.java   
private ContainerProto convertToProtoFormat(Container t) {
  return ((ContainerPBImpl) t).getProto();
}
项目:hadoop    文件:AllocateResponsePBImpl.java   
private synchronized ContainerPBImpl convertFromProtoFormat(
    ContainerProto p) {
  return new ContainerPBImpl(p);
}
项目:hadoop    文件:AllocateResponsePBImpl.java   
private synchronized ContainerProto convertToProtoFormat(
    Container t) {
  return ((ContainerPBImpl)t).getProto();
}
项目:aliyun-oss-hadoop-fs    文件:RegisterApplicationMasterResponsePBImpl.java   
private ContainerPBImpl convertFromProtoFormat(ContainerProto p) {
  return new ContainerPBImpl(p);
}
项目:aliyun-oss-hadoop-fs    文件:RegisterApplicationMasterResponsePBImpl.java   
private ContainerProto convertToProtoFormat(Container t) {
  return ((ContainerPBImpl) t).getProto();
}
项目:aliyun-oss-hadoop-fs    文件:AllocateResponsePBImpl.java   
private synchronized ContainerPBImpl convertFromProtoFormat(
    ContainerProto p) {
  return new ContainerPBImpl(p);
}
项目:aliyun-oss-hadoop-fs    文件:AllocateResponsePBImpl.java   
private synchronized ContainerProto convertToProtoFormat(
    Container t) {
  return ((ContainerPBImpl)t).getProto();
}
项目:aliyun-oss-hadoop-fs    文件:TestPBImplRecords.java   
@Test
public void testContainerPBImpl() throws Exception {
  validatePBImplRecord(ContainerPBImpl.class, ContainerProto.class);
}
项目:aliyun-oss-hadoop-fs    文件:NodeHeartbeatResponsePBImpl.java   
private ContainerPBImpl convertFromProtoFormat(ContainerProto p) {
  return new ContainerPBImpl(p);
}
项目:aliyun-oss-hadoop-fs    文件:NodeHeartbeatResponsePBImpl.java   
private ContainerProto convertToProtoFormat(Container t) {
  return ((ContainerPBImpl) t).getProto();
}
项目:aliyun-oss-hadoop-fs    文件:NodeStatusPBImpl.java   
private ContainerPBImpl convertFromProtoFormat(
    ContainerProto c) {
  return new ContainerPBImpl(c);
}
项目:aliyun-oss-hadoop-fs    文件:NodeStatusPBImpl.java   
private ContainerProto convertToProtoFormat(
    Container c) {
  return ((ContainerPBImpl)c).getProto();
}
项目:big-c    文件:RegisterApplicationMasterResponsePBImpl.java   
private ContainerPBImpl convertFromProtoFormat(ContainerProto p) {
  return new ContainerPBImpl(p);
}
项目:big-c    文件:RegisterApplicationMasterResponsePBImpl.java   
private ContainerProto convertToProtoFormat(Container t) {
  return ((ContainerPBImpl) t).getProto();
}
项目:big-c    文件:AllocateResponsePBImpl.java   
private synchronized ContainerPBImpl convertFromProtoFormat(
    ContainerProto p) {
  return new ContainerPBImpl(p);
}
项目:big-c    文件:AllocateResponsePBImpl.java   
private synchronized ContainerProto convertToProtoFormat(
    Container t) {
  return ((ContainerPBImpl)t).getProto();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:RegisterApplicationMasterResponsePBImpl.java   
private ContainerPBImpl convertFromProtoFormat(ContainerProto p) {
  return new ContainerPBImpl(p);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:RegisterApplicationMasterResponsePBImpl.java   
private ContainerProto convertToProtoFormat(Container t) {
  return ((ContainerPBImpl) t).getProto();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateResponsePBImpl.java   
private synchronized ContainerPBImpl convertFromProtoFormat(
    ContainerProto p) {
  return new ContainerPBImpl(p);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateResponsePBImpl.java   
private synchronized ContainerProto convertToProtoFormat(
    Container t) {
  return ((ContainerPBImpl)t).getProto();
}