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


Java Application.getUser方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application.getUser方法的典型用法代码示例。如果您正苦于以下问题:Java Application.getUser方法的具体用法?Java Application.getUser怎么用?Java Application.getUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application的用法示例。


在下文中一共展示了Application.getUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleInitApplicationResources

import org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application; //导入方法依赖的package包/类
/**
 * Handle event received the first time any container is scheduled
 * by a given application.
 */
@SuppressWarnings("unchecked")
private void handleInitApplicationResources(Application app) {
  // 0) Create application tracking structs
  String userName = app.getUser();
  privateRsrc.putIfAbsent(userName, new LocalResourcesTrackerImpl(userName,
      null, dispatcher, true, super.getConfig(), stateStore));
  String appIdStr = ConverterUtils.toString(app.getAppId());
  appRsrc.putIfAbsent(appIdStr, new LocalResourcesTrackerImpl(app.getUser(),
      app.getAppId(), dispatcher, false, super.getConfig(), stateStore));
  // 1) Signal container init
  //
  // This is handled by the ApplicationImpl state machine and allows
  // containers to proceed with launching.
  dispatcher.getEventHandler().handle(new ApplicationInitedEvent(
        app.getAppId()));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:ResourceLocalizationService.java

示例2: addAppContainers

import org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application; //导入方法依赖的package包/类
private HashMap<String, String> addAppContainers(Application app) 
    throws IOException {
  Dispatcher dispatcher = new AsyncDispatcher();
  ApplicationAttemptId appAttemptId = BuilderUtils.newApplicationAttemptId(
      app.getAppId(), 1);
  Container container1 = new MockContainer(appAttemptId, dispatcher, conf,
      app.getUser(), app.getAppId(), 1);
  Container container2 = new MockContainer(appAttemptId, dispatcher, conf,
      app.getUser(), app.getAppId(), 2);
  nmContext.getContainers()
      .put(container1.getContainerId(), container1);
  nmContext.getContainers()
      .put(container2.getContainerId(), container2);

  app.getContainers().put(container1.getContainerId(), container1);
  app.getContainers().put(container2.getContainerId(), container2);
  HashMap<String, String> hash = new HashMap<String, String>();
  hash.put(container1.getContainerId().toString(), container1
      .getContainerId().toString());
  hash.put(container2.getContainerId().toString(), container2
      .getContainerId().toString());
  return hash;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:TestNMWebServicesApps.java

示例3: AppInfo

import org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application; //导入方法依赖的package包/类
public AppInfo(final Application app) {
  this.id = ConverterUtils.toString(app.getAppId());
  this.state = app.getApplicationState().toString();
  this.user = app.getUser();

  this.containerids = new ArrayList<String>();
  Map<ContainerId, Container> appContainers = app.getContainers();
  for (ContainerId containerId : appContainers.keySet()) {
    String containerIdStr = ConverterUtils.toString(containerId);
    containerids.add(containerIdStr);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:AppInfo.java

示例4: handleDestroyApplicationResources

import org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked"})
private void handleDestroyApplicationResources(Application application) {
  String userName = application.getUser();
  ApplicationId appId = application.getAppId();
  String appIDStr = application.toString();
  LocalResourcesTracker appLocalRsrcsTracker =
    appRsrc.remove(ConverterUtils.toString(appId));
  if (appLocalRsrcsTracker != null) {
    for (LocalizedResource rsrc : appLocalRsrcsTracker ) {
      Path localPath = rsrc.getLocalPath();
      if (localPath != null) {
        try {
          stateStore.removeLocalizedResource(userName, appId, localPath);
        } catch (IOException e) {
          LOG.error("Unable to remove resource " + rsrc + " for " + appIDStr
              + " from state store", e);
        }
      }
    }
  } else {
    LOG.warn("Removing uninitialized application " + application);
  }

  // Delete the application directories
  userName = application.getUser();
  appIDStr = application.toString();

  for (String localDir : dirsHandler.getLocalDirsForCleanup()) {

    // Delete the user-owned app-dir
    Path usersdir = new Path(localDir, ContainerLocalizer.USERCACHE);
    Path userdir = new Path(usersdir, userName);
    Path allAppsdir = new Path(userdir, ContainerLocalizer.APPCACHE);
    Path appDir = new Path(allAppsdir, appIDStr);
    submitDirForDeletion(userName, appDir);

    // Delete the nmPrivate app-dir
    Path sysDir = new Path(localDir, NM_PRIVATE_DIR);
    Path appSysDir = new Path(sysDir, appIDStr);
    submitDirForDeletion(null, appSysDir);
  }

  // TODO: decrement reference counts of all resources associated with this
  // app

  dispatcher.getEventHandler().handle(new ApplicationEvent(
        application.getAppId(),
        ApplicationEventType.APPLICATION_RESOURCES_CLEANEDUP));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:50,代码来源:ResourceLocalizationService.java


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