org.apache.hadoop.ipc.RemoteException.getMessage()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(108)

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

RemoteException.getMessage介绍

暂无

代码示例

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

@Override
 public String toString() {
  return getClass().getName() + "(" + className + "): " + getMessage();
 }
}

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

private IOException instantiateException(Class<? extends IOException> cls)
  throws Exception {
 Constructor<? extends IOException> cn = cls.getConstructor(String.class);
 cn.setAccessible(true);
 IOException ex = cn.newInstance(this.getMessage());
 ex.initCause(this);
 return ex;
}

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

consoleMessage("Unexpected error:" + eCreate.getMessage());
consoleMessage("Unexpected error:" + eAppend.getMessage());

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

consoleMessage("Unexpected error:" + eCreate.getMessage());
consoleMessage("Unexpected error:" + eAppend.getMessage());

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

if (e.getMessage().indexOf(NotServingRegionException.class.getName()) >= 0) {
 if (LOG.isDebugEnabled()) {
  LOG.debug("Trying to get compaction state of " + loc.getRegion() + ": " +

代码示例来源:origin: org.apache.hbase/hbase-client

if (e.getMessage().indexOf(NotServingRegionException.class.getName()) >= 0) {
 if (LOG.isDebugEnabled()) {
  LOG.debug("Trying to get compaction state of " + loc.getRegion() + ": " +

代码示例来源:origin: ch.cern.hadoop/hadoop-common

@Override
 public String toString() {
  return getClass().getName() + "(" + className + "): " + getMessage();
 }
}

代码示例来源:origin: io.hops/hadoop-common

@Override
 public String toString() {
  return getClass().getName() + "(" + className + "): " + getMessage();
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

@Override
 public String toString() {
  return getClass().getName() + "(" + className + "): " + getMessage();
 }
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

@Override
 public String toString() {
  return getClass().getName() + "(" + className + "): " + getMessage();
 }
}

代码示例来源:origin: io.hops/hadoop-common

private IOException instantiateException(Class<? extends IOException> cls)
  throws Exception {
 Constructor<? extends IOException> cn = cls.getConstructor(String.class);
 cn.setAccessible(true);
 IOException ex = cn.newInstance(this.getMessage());
 ex.initCause(this);
 return ex;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

private IOException instantiateException(Class<? extends IOException> cls)
  throws Exception {
 Constructor<? extends IOException> cn = cls.getConstructor(String.class);
 cn.setAccessible(true);
 IOException ex = cn.newInstance(this.getMessage());
 ex.initCause(this);
 return ex;
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

private IOException instantiateException(Class<? extends IOException> cls)
  throws Exception {
 Constructor<? extends IOException> cn = cls.getConstructor(String.class);
 cn.setAccessible(true);
 IOException ex = cn.newInstance(this.getMessage());
 ex.initCause(this);
 return ex;
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

private IOException instantiateException(Class<? extends IOException> cls)
  throws Exception {
 Constructor<? extends IOException> cn = cls.getConstructor(String.class);
 cn.setAccessible(true);
 IOException ex = cn.newInstance(this.getMessage());
 ex.initCause(this);
 return ex;
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

private IOException instantiateException(Class<? extends IOException> cls)
  throws Exception {
 Constructor<? extends IOException> cn = cls.getConstructor(String.class);
 cn.setAccessible(true);
 String firstLine = this.getMessage();
 int eol = firstLine.indexOf('\n');
 if (eol>=0) {
  firstLine = firstLine.substring(0, eol);
 }
 IOException ex = cn.newInstance(firstLine);
 ex.initCause(this);
 return ex;
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

private IOException instantiateException(Class<? extends IOException> cls)
  throws Exception {
 Constructor<? extends IOException> cn = cls.getConstructor(String.class);
 cn.setAccessible(true);
 String firstLine = this.getMessage();
 int eol = firstLine.indexOf('\n');
 if (eol>=0) {
  firstLine = firstLine.substring(0, eol);
 }
 IOException ex = cn.newInstance(firstLine);
 ex.initCause(this);
 return ex;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

private static <T extends Throwable> T instantiateException(
  Class<? extends T> cls, RemoteException re) throws RemoteException {
 try {
  Constructor<? extends T> cn = cls.getConstructor(String.class);
  cn.setAccessible(true);
  T ex = cn.newInstance(re.getMessage());
  ex.initCause(re);
  return ex;
  // RemoteException contains useful information as against the
  // java.lang.reflect exceptions.
 } catch (NoSuchMethodException e) {
  throw re;
 } catch (IllegalArgumentException e) {
  throw re;
 } catch (SecurityException e) {
  throw re;
 } catch (InstantiationException e) {
  throw re;
 } catch (IllegalAccessException e) {
  throw re;
 } catch (InvocationTargetException e) {
  throw re;
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs-test

private void getBlocksWithException(NamenodeProtocol namenode,
                  DatanodeInfo datanode,
                  long size) throws IOException {
 boolean getException = false;
 try {
   namenode.getBlocks(new DatanodeInfo(), 2);
 } catch(RemoteException e) {
  getException = true;
  assertTrue(e.getMessage().contains("IllegalArgumentException"));
 }
 assertTrue(getException);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

@Test (timeout=5000)
public void testProtoBufRandomException() throws Exception {
 TestRpcService client = getClient();
 EmptyRequestProto emptyRequest = EmptyRequestProto.newBuilder().build();
 try {
  client.error2(null, emptyRequest);
 } catch (ServiceException se) {
  Assert.assertTrue(se.getCause() instanceof RemoteException);
  RemoteException re = (RemoteException) se.getCause();
  Assert.assertTrue(re.getClassName().equals(
    URISyntaxException.class.getName()));
  Assert.assertTrue(re.getMessage().contains("testException"));
  Assert.assertTrue(
    re.getErrorCode().equals(RpcErrorCodeProto.ERROR_APPLICATION));
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

@Test (timeout=5000)
public void testProtoBufRandomException() throws Exception {
 TestRpcService client = getClient();
 EmptyRequestProto emptyRequest = EmptyRequestProto.newBuilder().build();
 try {
  client.error2(null, emptyRequest);
 } catch (ServiceException se) {
  Assert.assertTrue(se.getCause() instanceof RemoteException);
  RemoteException re = (RemoteException) se.getCause();
  Assert.assertTrue(re.getClassName().equals(
    URISyntaxException.class.getName()));
  Assert.assertTrue(re.getMessage().contains("testException"));
  Assert.assertTrue(
    re.getErrorCode().equals(RpcErrorCodeProto.ERROR_APPLICATION));
 }
}

相关文章