gpt4 book ai didi

org.apache.flink.yarn.YarnClusterClient.getJobManagerGateway()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 17:55:31 26 4
gpt4 key购买 nike

本文整理了Java中org.apache.flink.yarn.YarnClusterClient.getJobManagerGateway()方法的一些代码示例,展示了YarnClusterClient.getJobManagerGateway()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnClusterClient.getJobManagerGateway()方法的具体详情如下:
包路径:org.apache.flink.yarn.YarnClusterClient
类名称:YarnClusterClient
方法名:getJobManagerGateway

YarnClusterClient.getJobManagerGateway介绍

暂无

代码示例

代码示例来源:origin: apache/flink

/**
 * This method is only available if the cluster hasn't been started in detached mode.
 */
@Override
public GetClusterStatusResponse getClusterStatus() {
  try {
    final Future<Object> clusterStatusOption =
      getJobManagerGateway().ask(
        GetClusterStatus.getInstance(),
        akkaDuration);
    return (GetClusterStatusResponse) Await.result(clusterStatusOption, akkaDuration);
  } catch (Exception e) {
    throw new RuntimeException("Unable to get ClusterClient status from Application Client", e);
  }
}

代码示例来源:origin: apache/flink

private void stopAfterJob(JobID jobID) {
  Preconditions.checkNotNull(jobID, "The job id must not be null");
  try {
    Future<Object> replyFuture =
      getJobManagerGateway().ask(
        new ShutdownClusterAfterJob(jobID),
        akkaDuration);
    Await.ready(replyFuture, akkaDuration);
  } catch (Exception e) {
    throw new RuntimeException("Unable to tell application master to stop once the specified job has been finised", e);
  }
}

代码示例来源:origin: uber/AthenaX

@Test
 public void testDeployerWithIsolatedConfiguration() throws Exception {
  YarnClusterConfiguration clusterConf = mock(YarnClusterConfiguration.class);
  doReturn(new YarnConfiguration()).when(clusterConf).conf();
  ScheduledExecutorService executor = mock(ScheduledExecutorService.class);
  Configuration flinkConf = new Configuration();
  YarnClient client = mock(YarnClient.class);
  JobDeployer deploy = new JobDeployer(clusterConf, client, executor, flinkConf);
  AthenaXYarnClusterDescriptor desc = mock(AthenaXYarnClusterDescriptor.class);

  YarnClusterClient clusterClient = mock(YarnClusterClient.class);
  doReturn(clusterClient).when(desc).deploy();

  ActorGateway actorGateway = mock(ActorGateway.class);
  doReturn(actorGateway).when(clusterClient).getJobManagerGateway();
  doReturn(Future$.MODULE$.successful(null)).when(actorGateway).ask(any(), any());

  JobGraph jobGraph = mock(JobGraph.class);
  doReturn(JobID.generate()).when(jobGraph).getJobID();
  deploy.start(desc, jobGraph);

  verify(clusterClient).runDetached(jobGraph, null);
 }
}

代码示例来源:origin: org.apache.flink/flink-yarn_2.11

/**
 * This method is only available if the cluster hasn't been started in detached mode.
 */
@Override
public GetClusterStatusResponse getClusterStatus() {
  try {
    final Future<Object> clusterStatusOption =
      getJobManagerGateway().ask(
        GetClusterStatus.getInstance(),
        akkaDuration);
    return (GetClusterStatusResponse) Await.result(clusterStatusOption, akkaDuration);
  } catch (Exception e) {
    throw new RuntimeException("Unable to get ClusterClient status from Application Client", e);
  }
}

代码示例来源:origin: org.apache.flink/flink-yarn

/**
 * This method is only available if the cluster hasn't been started in detached mode.
 */
@Override
public GetClusterStatusResponse getClusterStatus() {
  try {
    final Future<Object> clusterStatusOption =
      getJobManagerGateway().ask(
        GetClusterStatus.getInstance(),
        akkaDuration);
    return (GetClusterStatusResponse) Await.result(clusterStatusOption, akkaDuration);
  } catch (Exception e) {
    throw new RuntimeException("Unable to get ClusterClient status from Application Client", e);
  }
}

代码示例来源:origin: org.apache.flink/flink-yarn_2.11

private void stopAfterJob(JobID jobID) {
  Preconditions.checkNotNull(jobID, "The job id must not be null");
  try {
    Future<Object> replyFuture =
      getJobManagerGateway().ask(
        new ShutdownClusterAfterJob(jobID),
        akkaDuration);
    Await.ready(replyFuture, akkaDuration);
  } catch (Exception e) {
    throw new RuntimeException("Unable to tell application master to stop once the specified job has been finised", e);
  }
}

代码示例来源:origin: org.apache.flink/flink-yarn

private void stopAfterJob(JobID jobID) {
  Preconditions.checkNotNull(jobID, "The job id must not be null");
  try {
    Future<Object> replyFuture =
      getJobManagerGateway().ask(
        new ShutdownClusterAfterJob(jobID),
        akkaDuration);
    Await.ready(replyFuture, akkaDuration);
  } catch (Exception e) {
    throw new RuntimeException("Unable to tell application master to stop once the specified job has been finised", e);
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com