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

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

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

RemoteException.getLocalizedMessage介绍

暂无

代码示例

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

try {
 String[] content;
 content = e.getLocalizedMessage().split("\n");
 LOG.error(cmd + ": " + content[0]);
} catch (Exception ex) {

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

try {
 String[] content;
 content = e.getLocalizedMessage().split("\n");
 System.err.println(cmd.substring(1) + ": "
           + content[0]);

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

/** Write the object to XML format */
public void writeXml(String path, XMLOutputter doc) throws IOException {
 doc.startTag(RemoteException.class.getSimpleName());
 doc.attribute("path", path);
 doc.attribute("class", getClassName());
 String msg = getLocalizedMessage();
 int i = msg.indexOf("\n");
 if (i >= 0) {
  msg = msg.substring(0, i);
 }
 doc.attribute("message", msg.substring(msg.indexOf(":") + 1).trim());
 doc.endTag();
}

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

/** Write the object to XML format */
public void writeXml(String path, XMLOutputter doc) throws IOException {
 doc.startTag(RemoteException.class.getSimpleName());
 doc.attribute("path", path);
 doc.attribute("class", getClassName());
 String msg = getLocalizedMessage();
 int i = msg.indexOf("\n");
 if (i >= 0) {
  msg = msg.substring(0, i);
 }
 doc.attribute("message", msg.substring(msg.indexOf(":") + 1).trim());
 doc.endTag();
}

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

String content = re.getLocalizedMessage();
int eol = content.indexOf('\n');
if (eol>=0) {

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

try {
 String[] content;
 content = e.getLocalizedMessage().split("\n");
 System.err.println(cmd.substring(1) + ": " +
           content[0]);

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

try {
 String[] content;
 content = e.getLocalizedMessage().split("\n");
 System.err.println(cmd.substring(1) + ": " + content[0]);
} catch (Exception ex) {

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

try {
 String[] content;
 content = e.getLocalizedMessage().split("\n");
 System.err.println(cmd.substring(1) + ": " + content[0]);
} catch (Exception ex) {

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

content = e.getLocalizedMessage().split("\n");
System.err.println(cmd.substring(1) + ": "
          + content[0]);

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

content = e.getLocalizedMessage().split("\n");
System.err.println(cmd.substring(1) + ": "
          + content[0]);

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

content = e.getLocalizedMessage().split("\n");
System.err.println(cmd.substring(1) + ": "
          + content[0]);

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

content = e.getLocalizedMessage().split("\n");
System.err.println(cmd.substring(1) + ": "
          + content[0]);

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

@Test
public void testErrorMessage() throws Exception {
 BadTokenSecretManager sm = new BadTokenSecretManager();
 final Server server = RPC.getServer(TestSaslProtocol.class,
   new TestSaslImpl(), ADDRESS, 0, 5, true, conf, sm);
 boolean succeeded = false;
 try {
  doDigestRpc(server, sm);
 } catch (RemoteException e) {
  LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage());
  assertTrue(ERROR_MESSAGE.equals(e.getLocalizedMessage()));
  assertTrue(e.unwrapRemoteException() instanceof InvalidToken);
  succeeded = true;
 }
 assertTrue(succeeded);
}

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

try {
 String[] content;
 content = e.getLocalizedMessage().split("\n");
 LOG.error(cmd + ": " + content[0]);
} catch (Exception ex) {

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

try {
 String[] content;
 content = e.getLocalizedMessage().split("\n");
 LOG.error(cmd + ": " + content[0]);
} catch (Exception ex) {

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

TestProtocol.versionID, addr, conf);
} catch (RemoteException e) {
 LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage());
 assertTrue(e.unwrapRemoteException() instanceof AccessControlException);
 succeeded = true;
   TestProtocol.versionID, mulitServerAddr, conf);
} catch (RemoteException e) {
 LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage());
 assertTrue(e.unwrapRemoteException() instanceof AccessControlException);
 succeeded = true;

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

@Test
public void testErrorMessage() throws Exception {
 BadTokenSecretManager sm = new BadTokenSecretManager();
 final Server server = new RPC.Builder(conf)
   .setProtocol(TestSaslProtocol.class).setInstance(new TestSaslImpl())
   .setBindAddress(ADDRESS).setPort(0).setNumHandlers(5).setVerbose(true)
   .setSecretManager(sm).build();
 boolean succeeded = false;
 try {
  doDigestRpc(server, sm);
 } catch (RemoteException e) {
  LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage());
  assertEquals(ERROR_MESSAGE, e.getLocalizedMessage());
  assertTrue(e.unwrapRemoteException() instanceof InvalidToken);
  succeeded = true;
 }
 assertTrue(succeeded);
}

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

@Test
public void testErrorMessage() throws Exception {
 BadTokenSecretManager sm = new BadTokenSecretManager();
 final Server server = new RPC.Builder(conf)
   .setProtocol(TestSaslProtocol.class).setInstance(new TestSaslImpl())
   .setBindAddress(ADDRESS).setPort(0).setNumHandlers(5).setVerbose(true)
   .setSecretManager(sm).build();
 boolean succeeded = false;
 try {
  doDigestRpc(server, sm);
 } catch (RemoteException e) {
  LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage());
  assertEquals(ERROR_MESSAGE, e.getLocalizedMessage());
  assertTrue(e.unwrapRemoteException() instanceof InvalidToken);
  succeeded = true;
 }
 assertTrue(succeeded);
}

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

proxy.echo("");
} catch (RemoteException e) {
 LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage());
 assertTrue(e.unwrapRemoteException() instanceof AccessControlException);
 succeeded = true;
 proxy.echo("");
} catch (RemoteException e) {
 LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage());
 assertTrue(e.unwrapRemoteException() instanceof AccessControlException);
 succeeded = true;

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

proxy.echo("");
} catch (RemoteException e) {
 LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage());
 assertTrue(e.unwrapRemoteException() instanceof AccessControlException);
 succeeded = true;
 proxy.echo("");
} catch (RemoteException e) {
 LOG.info("LOGGING MESSAGE: " + e.getLocalizedMessage());
 assertTrue(e.unwrapRemoteException() instanceof AccessControlException);
 succeeded = true;

相关文章