gpt4 book ai didi

org.apache.hadoop.yarn.exceptions.YarnException.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 16:34:40 29 4
gpt4 key购买 nike

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

YarnException.<init>介绍

暂无

代码示例

代码示例来源:origin: alibaba/jstorm

void startTimelineClient(final Configuration conf)
    throws YarnException, IOException, InterruptedException {
  try {
    appSubmitterUgi.doAs(new PrivilegedExceptionAction<Void>() {
      @Override
      public Void run() throws Exception {
        if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED,
            YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) {
          // Creating the Timeline Client
          timelineClient = TimelineClient.createTimelineClient();
          timelineClient.init(conf);
          timelineClient.start();
        } else {
          timelineClient = null;
          LOG.warn("Timeline service is not enabled");
        }
        return null;
      }
    });
  } catch (UndeclaredThrowableException e) {
    throw new YarnException(e.getCause());
  }
}

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

@VisibleForTesting
void startTimelineClient(final Configuration conf)
    throws YarnException, IOException, InterruptedException {
 try {
  appSubmitterUgi.doAs(new PrivilegedExceptionAction<Void>() {
   @Override
   public Void run() throws Exception {
    if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED,
        YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) {
     // Creating the Timeline Client
     timelineClient = TimelineClient.createTimelineClient();
     timelineClient.init(conf);
     timelineClient.start();
    } else {
     timelineClient = null;
     LOG.warn("Timeline service is not enabled");
    }
    return null;
   }
  });
 } catch (UndeclaredThrowableException e) {
  throw new YarnException(e.getCause());
 }
}

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

/**
 * Returns an instance of {@link YarnException}
 */
public static YarnException getRemoteException(Throwable t) {
 return new YarnException(t);
}

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

/**
 * Returns an instance of {@link YarnException}
 */
public static YarnException getRemoteException(String message) {
 return new YarnException(message);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager

private void validateConfOrThrowException() throws YarnException {
 if (conf == null) {
  throw new YarnException("Please initialize (call initialize) before use "
    + GpuDiscoverer.class.getSimpleName());
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private static <V> V getChecked(Future<V> future) throws YarnException {
 try {
  return future.get();
 } catch (InterruptedException e) {
  Thread.currentThread().interrupt();
  throw new YarnException(e);
 } catch (ExecutionException e) {
  throw new YarnException(e);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Override
public void setEntitlement(String queue, QueueEntitlement entitlement)
  throws YarnException {
 throw new YarnException(getClass().getSimpleName()
   + " does not support this operation");
}

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

@Override
public TimelinePutResponse putEntities(ApplicationAttemptId appAttemptId,
  TimelineEntityGroupId groupId, TimelineEntity... entities)
  throws IOException, YarnException {
 if (!timelineServiceV15Enabled) {
  throw new YarnException(
   "This API is not supported under current Timeline Service Version:");
 }
 return timelineWriter.putEntities(appAttemptId, groupId, entities);
}

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

@Override
public void putDomain(ApplicationAttemptId appAttemptId,
  TimelineDomain domain) throws IOException, YarnException {
 if (!timelineServiceV15Enabled) {
  throw new YarnException(
   "This API is not supported under current Timeline Service Version:");
 }
 timelineWriter.putDomain(appAttemptId, domain);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Override
public synchronized SignalContainerResponse signalToContainer(
  SignalContainerRequest request) throws YarnException, IOException {
 throw new YarnException("Not supported yet!");
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Override
public String moveApplication(ApplicationId appId, String newQueue)
  throws YarnException {
 if (failMove) {
  throw new YarnException("Move not supported");
 }
 return newQueue;
}

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

@Override
public StartContainersResponse startContainers(
  StartContainersRequest requests) throws YarnException, IOException {
 try {
  // make the thread sleep to look like its not going to respond
  Thread.sleep(10000);
 } catch (Exception e) {
  LOG.error(e);
  throw new YarnException(e);
 }
 throw new YarnException("Shouldn't happen!!");
}

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

@Override
 protected void putObjects(URI base, String path,
   MultivaluedMap<String, String> params, Object obj)
     throws IOException, YarnException {
  if (throwYarnException) {
   throw new YarnException(EXCEPTION_MSG);
  } else {
   throw new IOException(
     "Failed to get the response from the timeline server.");
  }
 }
}

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

@Override
public GetContainerStatusesResponse getContainerStatuses(
  GetContainerStatusesRequest request) throws YarnException, IOException {
 Exception e = new Exception("Dummy function", new Exception(
   "Dummy function cause"));
 throw new YarnException(e);
}

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

@Override
public StopContainersResponse
  stopContainers(StopContainersRequest requests) throws YarnException,
    IOException {
 Exception e = new Exception("Dummy function", new Exception(
   "Dummy function cause"));
 throw new YarnException(e);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-common

@Override
public StopContainersResponse stopContainers(StopContainersRequest request)
throws YarnException {
 Exception e = new Exception(EXCEPTION_MSG,
   new Exception(EXCEPTION_CAUSE));
 throw new YarnException(e);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-common

@Override
public SignalContainerResponse signalToContainer(
  SignalContainerRequest request) throws YarnException {
 final Exception e = new Exception(EXCEPTION_MSG,
   new Exception(EXCEPTION_CAUSE));
 throw new YarnException(e);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-common

@Override
public RegisterNodeManagerResponse registerNodeManager(
  RegisterNodeManagerRequest request) throws YarnException, IOException {
 if (exception) {
  throw new YarnException("testMessage");
 }
 return recordFactory.newRecordInstance(RegisterNodeManagerResponse.class);
}

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

public TimelinePutResponse putEntities(
  TimelineEntity... entities) throws IOException, YarnException {
 TimelineEntities entitiesContainer = new TimelineEntities();
 for (TimelineEntity entity : entities) {
  if (entity.getEntityId() == null || entity.getEntityType() == null) {
   throw new YarnException("Incomplete entity without entity id/type");
  }
  entitiesContainer.addEntity(entity);
 }
 ClientResponse resp = doPosting(entitiesContainer, null);
 return resp.getEntity(TimelinePutResponse.class);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-common

@Test
public void testFacadeYarnException() throws Exception {
 RetryPolicy policy = FederationStateStoreFacade.createRetryPolicy(conf);
 RetryAction action = policy.shouldRetry(new YarnException(), 0, 0, false);
 Assert.assertEquals(RetryAction.FAIL.action, action.action);
}

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