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


Java NMClientAsync类代码示例

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


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

示例1: init

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
public void init(ContainerLaunchContextFactory factory) throws IOException {
  this.nodeManager = NMClientAsync.createNMClientAsync(this);
  nodeManager.init(conf);
  nodeManager.start();

  this.ctxt = factory.create(params);
  LOG.info("Init CTXT: " + ctxt.getLocalResources());
  LOG.info("Init CTXT: " + ctxt.getCommands());
  
  this.resource = factory.createResource(params);
  this.priority = factory.createPriority(params.getPriority());
  AMRMClient.ContainerRequest containerRequest = new AMRMClient.ContainerRequest(
      resource,
      null, // nodes
      null, // racks
      priority);
  int numInstances = params.getNumInstances();
  for (int j = 0; j < numInstances; j++) {
    resourceManager.addContainerRequest(containerRequest);
  }
  needed.set(numInstances);
}
 
开发者ID:project-asap,项目名称:IReS-Platform,代码行数:23,代码来源:ApplicationMasterServiceImpl1.java

示例2: init

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
public void init(ContainerLaunchContextFactory factory) throws IOException {
  this.nodeManager = NMClientAsync.createNMClientAsync(this);
  nodeManager.init(conf);
  nodeManager.start();

  this.ctxt = factory.create(parameters);
  this.resource = factory.createResource(parameters);
  this.priority = factory.createPriority(parameters.getPriority());
  AMRMClient.ContainerRequest containerRequest = new AMRMClient.ContainerRequest(
      resource,
      null, // nodes
      null, // racks
      priority);
  int numInstances = parameters.getNumInstances();
  for (int j = 0; j < numInstances; j++) {
    resourceManager.addContainerRequest(containerRequest);
  }
  needed.set(numInstances);
  totalRequested.addAndGet(numInstances);
}
 
开发者ID:project-asap,项目名称:IReS-Platform,代码行数:21,代码来源:ApplicationMasterServiceImpl.java

示例3: LaunchContainer

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
public LaunchContainer( Configuration conf
        , String zkQuorum
        , String zkRoot
        , NMClientAsync nmClientAsync
        , ModelRequest request
        , Container container
        , ByteBuffer allTokens
        , Path appJarLocation
)
{
  this.allTokens = allTokens;
  this.zkQuorum = zkQuorum;
  this.zkRoot = zkRoot;
  this.request = request;
  this.container = container;
  this.conf = conf;
  this.nmClientAsync = nmClientAsync;
  this.appJarLocation = appJarLocation;
}
 
开发者ID:apache,项目名称:metron,代码行数:20,代码来源:LaunchContainer.java

示例4: StatefulContainer

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
public StatefulContainer(NMClientAsync client, ContainerId containerId) {
  this.nmClientAsync = client;
  this.containerId = containerId;
  stateMachine = stateMachineFactory.make(this);
  ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
  readLock = lock.readLock();
  writeLock = lock.writeLock();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:NMClientAsyncImpl.java

示例5: LaunchContainerRunnable

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
/**
 * @param lcontainer Allocated container
 * @param nmClient
 * @param sca
 * @param tokens
 */
public LaunchContainerRunnable(Container lcontainer, NMClientAsync nmClient, StreamingContainerAgent sca, ByteBuffer tokens)
{
  this.container = lcontainer;
  this.nmClient = nmClient;
  this.dag = sca.getContainer().getPlan().getLogicalPlan();
  this.tokens = tokens;
  this.sca = sca;
}
 
开发者ID:apache,项目名称:apex-core,代码行数:15,代码来源:LaunchContainerRunnable.java

示例6: stop

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
public void stop(NMClientAsync nmClient)
{
  if (stop == Long.MAX_VALUE) {
    nmClient.stopContainerAsync(container.getId(), container.getNodeId());
    LOG.info("Requested stop container {}", container.getId().toString());
    stop = System.currentTimeMillis();
  }
}
 
开发者ID:apache,项目名称:apex-core,代码行数:9,代码来源:StreamingAppMasterService.java

示例7: YarnService

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
public YarnService(Config config, String applicationName, ApplicationId applicationId, FileSystem fs,
    EventBus eventBus, String containerJvmArgs) throws Exception {
  this.applicationName = applicationName;
  this.applicationId = applicationId;

  this.config = config;

  this.yarnConfiguration = new YarnConfiguration();
  this.amrmClientAsync = closer.register(
      AMRMClientAsync.createAMRMClientAsync(1000, new AMRMClientCallbackHandler()));
  this.amrmClientAsync.init(this.yarnConfiguration);
  this.nmClientAsync = closer.register(NMClientAsync.createNMClientAsync(new NMClientCallbackHandler()));
  this.nmClientAsync.init(this.yarnConfiguration);

  this.containerLaunchExecutor = Executors.newFixedThreadPool(10,
      ExecutorsUtils.newThreadFactory(Optional.of(LOGGER), Optional.of("ContainerLaunchExecutor")));

  this.fs = fs;

  this.eventBus = eventBus;

  this.initialContainers = config.getInt(GobblinYarnConfigurationKeys.INITIAL_CONTAINERS_KEY);
  this.requestedContainerMemoryMbs = config.getInt(GobblinYarnConfigurationKeys.CONTAINER_MEMORY_MBS_KEY);
  this.requestedContainerCores = config.getInt(GobblinYarnConfigurationKeys.CONTAINER_CORES_KEY);

  this.containerJvmArgs = containerJvmArgs;

  this.tokens = getSecurityTokens();
}
 
开发者ID:Hanmourang,项目名称:Gobblin,代码行数:30,代码来源:YarnService.java

示例8: initialize

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
public void initialize(AMRMClientAsync<AMRMClient.ContainerRequest> amRMClient
                      , NMClientAsync nmClient
                      , ServiceDiscoverer serviceDiscoverer
                      )
{
  this.nmClient = nmClient;
  this.amRMClient = amRMClient;
  this.serviceDiscoverer = serviceDiscoverer;
}
 
开发者ID:apache,项目名称:metron,代码行数:10,代码来源:ContainerRequestListener.java

示例9: YarnService

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
public YarnService(Config config, String applicationName, String applicationId, YarnConfiguration yarnConfiguration,
    FileSystem fs, EventBus eventBus) throws Exception {
  this.applicationName = applicationName;
  this.applicationId = applicationId;

  this.config = config;

  this.eventBus = eventBus;

  this.gobblinMetrics = config.getBoolean(ConfigurationKeys.METRICS_ENABLED_KEY) ?
      Optional.of(buildGobblinMetrics()) : Optional.<GobblinMetrics>absent();

  this.eventSubmitter = config.getBoolean(ConfigurationKeys.METRICS_ENABLED_KEY) ?
      Optional.of(buildEventSubmitter()) : Optional.<EventSubmitter>absent();

  this.yarnConfiguration = yarnConfiguration;
  this.fs = fs;

  this.amrmClientAsync = closer.register(
      AMRMClientAsync.createAMRMClientAsync(1000, new AMRMClientCallbackHandler()));
  this.amrmClientAsync.init(this.yarnConfiguration);
  this.nmClientAsync = closer.register(NMClientAsync.createNMClientAsync(new NMClientCallbackHandler()));
  this.nmClientAsync.init(this.yarnConfiguration);

  this.initialContainers = config.getInt(GobblinYarnConfigurationKeys.INITIAL_CONTAINERS_KEY);
  this.requestedContainerMemoryMbs = config.getInt(GobblinYarnConfigurationKeys.CONTAINER_MEMORY_MBS_KEY);
  this.requestedContainerCores = config.getInt(GobblinYarnConfigurationKeys.CONTAINER_CORES_KEY);
  this.containerHostAffinityEnabled = config.getBoolean(GobblinYarnConfigurationKeys.CONTAINER_HOST_AFFINITY_ENABLED);

  this.helixInstanceMaxRetries = config.getInt(GobblinYarnConfigurationKeys.HELIX_INSTANCE_MAX_RETRIES);

  this.containerJvmArgs = config.hasPath(GobblinYarnConfigurationKeys.CONTAINER_JVM_ARGS_KEY) ?
      Optional.of(config.getString(GobblinYarnConfigurationKeys.CONTAINER_JVM_ARGS_KEY)) :
      Optional.<String>absent();

  this.containerLaunchExecutor = Executors.newFixedThreadPool(10,
      ExecutorsUtils.newThreadFactory(Optional.of(LOGGER), Optional.of("ContainerLaunchExecutor")));

  this.tokens = getSecurityTokens();
}
 
开发者ID:apache,项目名称:incubator-gobblin,代码行数:41,代码来源:YarnService.java

示例10: initialize

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
@Override
protected void initialize() throws Exception {
  super.initialize();
  transitionTaskStateQueue = new SystemTaskQueue(this::handleException);

  // Initialize AM NoDependenceConfig
  conf.initializeNoDependenceConfig();

  // Start RMClient to Register AM ASAP in case AM expired by RM
  rmClient = AMRMClientAsync.createAMRMClientAsync(
      conf.getAmRmHeartbeatIntervalSec() * 1000,
      new RMClientCallbackHandler(this));
  rmClient.init(conf.getYarnConfig());
  rmClient.start();
  conf.initializeDependOnRMResponseConfig(registerToRM());

  // Start NMClient
  nmClient = NMClientAsync.createNMClientAsync(
      new NMClientCallbackHandler(this));
  nmClient.init(conf.getYarnConfig());
  nmClient.start();

  // Start YarnClient
  yarnClient = YarnClient.createYarnClient();
  yarnClient.init(conf.getYarnConfig());
  yarnClient.start();
  conf.initializeDependOnYarnClientConfig(yarnClient);

  // Initialize Launcher Store
  zkStore = new ZookeeperStore(conf.getZkConnectString(), conf.getZkRootDir());
  conf.initializeDependOnZKStoreConfig(zkStore);
  hdfsStore = new HdfsStore(conf.getLauncherConfig().getHdfsRootDir());
  hdfsStore.makeFrameworkRootDir(conf.getFrameworkName());
  hdfsStore.makeAMStoreRootDir(conf.getFrameworkName());

  // Initialize other components
  launcherClient = new LauncherClientInternal(
      conf.getLauncherConfig().getWebServerAddress(), 30, 10,
      LaunchClientType.APPLICATION_MASTER);

  gpuAllocationManager = new GpuAllocationManager(this);
  rmResyncHandler = new RMResyncHandler(this, conf);
}
 
开发者ID:Microsoft,项目名称:pai,代码行数:44,代码来源:ApplicationMaster.java

示例11: getNMClientAsync

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
NMClientAsync getNMClientAsync() {
  return nmClientAsync;
}
 
开发者ID:Intel-bigdata,项目名称:TensorFlowOnYARN,代码行数:4,代码来源:ApplicationMaster.java

示例12: NMClientAsyncImpl

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
public NMClientAsyncImpl(CallbackHandler callbackHandler) {
  this(NMClientAsync.class.getName(), callbackHandler);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:NMClientAsyncImpl.java

示例13: NMClientAsyncImpl

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
public NMClientAsyncImpl(AbstractCallbackHandler callbackHandler) {
  this(NMClientAsync.class.getName(), callbackHandler);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:4,代码来源:NMClientAsyncImpl.java

示例14: createNMClientAsync

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
protected NMClientAsync createNMClientAsync() {
  launchListener = new NMCallback();
  nmClientAsync = NMClientAsync.createNMClientAsync(launchListener);
  nmClientAsync.init(context.getConf());
  return nmClientAsync;
}
 
开发者ID:intel-hadoop,项目名称:yacop,代码行数:7,代码来源:ContainerLauncher.java

示例15: mockNMClientAsync

import org.apache.hadoop.yarn.client.api.async.NMClientAsync; //导入依赖的package包/类
private void mockNMClientAsync() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
  nmClientAsync = mock(NMClientAsync.class);
  Field nmClientAsyncField = containerLauncher.getClass().getDeclaredField("nmClientAsync");
  nmClientAsyncField.setAccessible(true);
  nmClientAsyncField.set(containerLauncher, nmClientAsync);
}
 
开发者ID:intel-hadoop,项目名称:yacop,代码行数:7,代码来源:TestContainerLauncher.java


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