当前位置: 首页>>代码示例>>Java>>正文


Java ApplicationAttemptIdPBImpl类代码示例

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


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

示例1: NMTokenIdentifier

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
public NMTokenIdentifier(ApplicationAttemptId appAttemptId, 
    NodeId nodeId, String applicationSubmitter, int masterKeyId) {
  NMTokenIdentifierProto.Builder builder = NMTokenIdentifierProto.newBuilder();
  if (appAttemptId != null) {
    builder.setAppAttemptId(
        ((ApplicationAttemptIdPBImpl)appAttemptId).getProto());
  }
  if (nodeId != null) {
    builder.setNodeId(((NodeIdPBImpl)nodeId).getProto());
  }
  builder.setAppSubmitter(applicationSubmitter);
  builder.setKeyId(masterKeyId);
  proto = builder.build();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:NMTokenIdentifier.java

示例2: getUser

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
@Override
public UserGroupInformation getUser() {
  String appAttemptId = null;
  if (proto.hasAppAttemptId()) {
    appAttemptId = new ApplicationAttemptIdPBImpl(
        proto.getAppAttemptId()).toString();
  }
  return UserGroupInformation.createRemoteUser(appAttemptId);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:NMTokenIdentifier.java

示例3: AMRMTokenIdentifier

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
public AMRMTokenIdentifier(ApplicationAttemptId appAttemptId,
    int masterKeyId) {
  AMRMTokenIdentifierProto.Builder builder = 
      AMRMTokenIdentifierProto.newBuilder();
  if (appAttemptId != null) {
    builder.setAppAttemptId(
        ((ApplicationAttemptIdPBImpl)appAttemptId).getProto());
  }
  builder.setKeyId(masterKeyId);
  proto = builder.build();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:AMRMTokenIdentifier.java

示例4: getApplicationAttemptId

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
@Private
public ApplicationAttemptId getApplicationAttemptId() {
  if (!proto.hasAppAttemptId()) {
    return null;
  }
  return new ApplicationAttemptIdPBImpl(proto.getAppAttemptId());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:AMRMTokenIdentifier.java

示例5: getUser

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
@Override
public UserGroupInformation getUser() {
  String appAttemptId = null;
  if (proto.hasAppAttemptId()) {
    appAttemptId = 
        new ApplicationAttemptIdPBImpl(proto.getAppAttemptId()).toString();
  }
  return UserGroupInformation.createRemoteUser(appAttemptId);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:AMRMTokenIdentifier.java

示例6: ClientToAMTokenIdentifier

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
public ClientToAMTokenIdentifier(ApplicationAttemptId id, String client) {
  ClientToAMTokenIdentifierProto.Builder builder = 
      ClientToAMTokenIdentifierProto.newBuilder();
  if (id != null) {
    builder.setAppAttemptId(((ApplicationAttemptIdPBImpl)id).getProto());
  }
  if (client != null) {
    builder.setClientName(client);
  }
  proto = builder.build();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:ClientToAMTokenIdentifier.java

示例7: writeLog

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
private void writeLog(Configuration configuration, String user)
    throws Exception {
  ApplicationId appId =  ApplicationIdPBImpl.newInstance(0, 1);
  ApplicationAttemptId appAttemptId =  ApplicationAttemptIdPBImpl.newInstance(appId, 1);
  ContainerId containerId = ContainerIdPBImpl.newContainerId(appAttemptId, 1);

  String path = "target/logs/" + user
      + "/logs/application_0_0001/localhost_1234";
  File f = new File(path);
  if (!f.getParentFile().exists()) {
   assertTrue(f.getParentFile().mkdirs());
  }
  List<String> rootLogDirs = Arrays.asList("target/logs/logs");
  UserGroupInformation ugi = UserGroupInformation.getCurrentUser();

  AggregatedLogFormat.LogWriter writer = new AggregatedLogFormat.LogWriter(
      configuration, new Path(path), ugi);
  writer.writeApplicationOwner(ugi.getUserName());

  Map<ApplicationAccessType, String> appAcls = new HashMap<ApplicationAccessType, String>();
  appAcls.put(ApplicationAccessType.VIEW_APP, ugi.getUserName());
  writer.writeApplicationACLs(appAcls);

  writer.append(new AggregatedLogFormat.LogKey("container_0_0001_01_000001"),
      new AggregatedLogFormat.LogValue(rootLogDirs, containerId,UserGroupInformation.getCurrentUser().getShortUserName()));
  writer.close();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:28,代码来源:TestAggregatedLogsBlock.java

示例8: testLogDirWithDriveLetter

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
@Test
public void testLogDirWithDriveLetter() throws Exception {
  //To verify that logs paths which include drive letters (Windows)
  //do not lose their drive letter specification
  LocalDirsHandlerService localDirs = mock(LocalDirsHandlerService.class);
  List<String> logDirs = new ArrayList<String>();
  logDirs.add("F:/nmlogs");
  when(localDirs.getLogDirsForRead()).thenReturn(logDirs);
  
  ApplicationIdPBImpl appId = mock(ApplicationIdPBImpl.class);
  when(appId.toString()).thenReturn("app_id_1");
  
  ApplicationAttemptIdPBImpl appAttemptId =
             mock(ApplicationAttemptIdPBImpl.class);
  when(appAttemptId.getApplicationId()).thenReturn(appId);
  
  ContainerId containerId = mock(ContainerIdPBImpl.class);
  when(containerId.getApplicationAttemptId()).thenReturn(appAttemptId);
  
  List<File> logDirFiles = ContainerLogsUtils.getContainerLogDirs(
    containerId, localDirs);
  
  Assert.assertTrue("logDir lost drive letter " +
    logDirFiles.get(0),
    logDirFiles.get(0).toString().indexOf("F:" + File.separator +
      "nmlogs") > -1);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:28,代码来源:TestContainerLogsPage.java

示例9: mergeLocalToBuilder

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的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.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
private void mergeLocalToBuilder() {
  if (this.applicationAttemptId != null
      && !((ApplicationAttemptIdPBImpl) this.applicationAttemptId).getProto()
        .equals(builder.getApplicationAttemptId())) {
    builder
      .setApplicationAttemptId(convertToProtoFormat(this.applicationAttemptId));
  }
  if (this.masterContainerId != null
      && !((ContainerIdPBImpl) this.masterContainerId).getProto().equals(
        builder.getMasterContainerId())) {
    builder
      .setMasterContainerId(convertToProtoFormat(this.masterContainerId));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:ApplicationAttemptStartDataPBImpl.java

示例11: mergeLocalToBuilder

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
private void mergeLocalToBuilder() {
  if (this.applicationAttemptId != null
      && !((ApplicationAttemptIdPBImpl) this.applicationAttemptId).getProto()
        .equals(builder.getApplicationAttemptId())) {
    builder
      .setApplicationAttemptId(convertToProtoFormat(this.applicationAttemptId));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:ApplicationAttemptFinishDataPBImpl.java

示例12: mergeLocalToBuilder

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
private synchronized void mergeLocalToBuilder() {
  if (this.appAttemptId != null
      && !((ApplicationAttemptIdPBImpl) this.appAttemptId).getProto().equals(
          builder.getApplicationAttemptId())) {
    builder.setApplicationAttemptId(convertToProtoFormat(this.appAttemptId));
  }
  if (this.getContainerId() != null
      && !((ContainerIdPBImpl) this.containerId).getProto().equals(
          builder.getContainerId())) {
    builder.setContainerId(convertToProtoFormat(this.containerId));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:AMInfoPBImpl.java

示例13: testApplicationAttemptIdPBImpl

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
@Test
@Ignore
// ignore cause ApplicationIdPBImpl is immutable
public void testApplicationAttemptIdPBImpl() throws Exception {
  validatePBImplRecord(ApplicationAttemptIdPBImpl.class,
      ApplicationAttemptIdProto.class);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:8,代码来源:TestPBImplRecords.java

示例14: testLogDirWithDriveLetter

import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; //导入依赖的package包/类
@Test
public void testLogDirWithDriveLetter() throws Exception {
  //To verify that logs paths which include drive letters (Windows)
  //do not lose their drive letter specification
  LocalDirsHandlerService localDirs = mock(LocalDirsHandlerService.class);
  List<String> logDirs = new ArrayList<String>();
  logDirs.add("F:/nmlogs");
  when(localDirs.getLogDirs()).thenReturn(logDirs);
  
  ApplicationIdPBImpl appId = mock(ApplicationIdPBImpl.class);
  when(appId.toString()).thenReturn("app_id_1");
  
  ApplicationAttemptIdPBImpl appAttemptId =
             mock(ApplicationAttemptIdPBImpl.class);
  when(appAttemptId.getApplicationId()).thenReturn(appId);
  
  ContainerId containerId = mock(ContainerIdPBImpl.class);
  when(containerId.getApplicationAttemptId()).thenReturn(appAttemptId);
  
  List<File> logDirFiles = ContainerLogsUtils.getContainerLogDirs(
    containerId, localDirs);
  
  Assert.assertTrue("logDir lost drive letter " +
    logDirFiles.get(0),
    logDirFiles.get(0).toString().indexOf("F:" + File.separator +
      "nmlogs") > -1);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:28,代码来源:TestContainerLogsPage.java


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