- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
1) 谁能帮助我了解“Remoteexception”的概念?一般是什么意思?
2) 另外,unwrapRemoteException 是什么意思?不确定它的意思是“如果这个远程异常包含一个 lookupTypes”
/**
* If this remote exception wraps up one of the lookupTypes
* then return this exception.
* <p>
* Unwraps any IOException.
*
* @param lookupTypes the desired exception class.
* @return IOException, which is either the lookupClass exception or this.
*/
public IOException unwrapRemoteException(Class<?>... lookupTypes) {
if(lookupTypes == null)
return this;
for(Class<?> lookupClass : lookupTypes) {
if(!lookupClass.getName().equals(getClassName()))
continue;
try {
return instantiateException(lookupClass.asSubclass(IOException.class));
} catch(Exception e) {
// cannot instantiate lookupClass, just return this
return this;
}
}
// wrapped up exception is not in lookupTypes, just return this
return this;
}
(Hadoop_HDFS_Open_Source:https://github.com/apache/hadoop)
提前致谢!任何帮助将不胜感激!
最佳答案
1) May anyone help me about the concept of "Remoteexception"? What does it mean in general?
服务器端抛出(创建)了远程异常。服务器抛出此类异常是因为客户端发送了无效请求,或者服务器有内部错误或其他原因。服务器端的 RPC 服务器序列化异常,并将其发送到客户端。客户端反序列化异常,获取异常。
2) Also what does it mean by unwrapRemoteException?
问题是“为什么我们需要包装异常”。首先,RemoteException 是一个包装器而不是真正的异常。服务器抛出的真正异常可能是AccessControlException(用户没有权限),FileNotFoundException(无效请求)。我们将它们包装在 RemoteException 中。但为什么?因为代码更清晰,更具可读性。
Was not sure it means by "if this remote exception wraps up one of the lookupTypes"
例如,在 DFSClient.java 中
public HdfsFileStatus getFileInfo(String src) throws IOException {
checkOpen();
try {
return namenode.getFileInfo(src);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
FileNotFoundException.class,
UnresolvedPathException.class);
}
}
如果 re
包装了一个 FileNotFoundException
,那么 getFileInfo
只返回 FileNotFoundException
。然后用户可以看到更短更清晰的异常消息。用户只需要知道文件没有找到,不关心是否远程。
但是如果 re
包装了一个 SafeModeException
或一些未知的异常。这可能是某些服务器的内部错误或配置错误。我们准确地抛出 re
(RemoteException)。所以用户可以知道错误来自远程(服务器端),即使用户不知道包装的 SafeModeException
(或一些未知的异常)。用户可以向技术支持寻求帮助。
关于hadoop - "RemoteException"在HDFS中一般是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38558641/
HDFS 是 Hadoop 中的逻辑文件系统,块大小为 64MB。 HDFS 上的文件依次保存在底层操作系统文件系统上,比如 ext4,块大小为 4KiB。 据我所知,对于本地文件系统上的文件,操作系
哪种工具最适合测量 HDFS 空间消耗? 当我总结“hdfs dfs -du/”的输出时,与“hdfs dfsadmin -report”(“DFS Used”行)相比,我总是消耗更少的空间。是否有
我正在尝试编写一个简单的脚本来验证 HDFS 和本地文件系统校验和。 在 HDFS 上我得到 - [m@x01tbipapp3a ~]$ hadoop fs -checksum /user/m/fil
我从 HDFS 中删除了一个文件夹,我在下面找到了它 /user/hdfs/.Trash/Current/ 但我无法恢复它。我查看了论坛,但没有找到好的解决方案。 请有人有解决方案我可以帮助我如何在最
在 5 个节点的集群上运行 Presto 大型扫描查询,看起来只有一个节点是查询协调器,并通过网络从 5 个 hdfs 节点读取数据。 所有 presto 进程都在数据节点上运行。 有没有办法让5个节
我有一个名为 file name(1).zip 的文件(里面有空格和括号),我想把这个文件放在 HDFS 上。但是每次我尝试通过 hadoop fs -put ... 放置它时,我都会遇到异常。 我什
在 5 个节点集群上运行 Presto 大扫描查询,看起来只有一个节点是查询协调器,并通过网络从 5 个 hdfs 节点读取数据。 所有presto进程都在数据节点上运行。 有没有办法让5个节点使用s
所以我在 CentOS 5 上通过 Cloudera Manager cdh3u5 安装了 Hadoop。当我运行 cmd 时 hadoop fs -ls/ 我希望看到 hdfs://localhos
我用命令在hadoop上运行flume flume-ng agent -c conf -f conf/flume-twitter.conf -n TwitterAgent 现在我无法保存推特数据。它显
我使用两台主机(hadoop-coc-1 和 hadoop-coc-2)尝试在其中配置 HDFS 联合。因此,我在两个主机(hadoop-coc-1 和 hadoop-coc-2)中配置了 $ cat
我需要将大量文件从一个 hdfs 目录移动(而不是复制)到同一集群中的另一个 hdfs 目录。 我可以使用 distcp,但它似乎有点矫枉过正,因为它正在复制文件(复制它)我只想移动它。两个问题: A
当我尝试将文件从我的 本地目录 复制到 HDFS 时,出现以下错误: [cloudera@localhost ~]$ hadoop fs -copyFromLocal hello.txt /user/
据我所知,在从一个 HDFS 位置移动到另一个位置时,没有直接选项可以覆盖 HDFS 中的文件,复制 cp 可以选择强制执行。我试图找出是否有任何黑客可以做到这一点? 我们能做的是 hdfs dfs
我有两个 HDFS 设置,想将一些表从 HDFS1 复制(而不是迁移或移动)到 HDFS2。如何将数据从一个 HDFS 复制到另一个 HDFS?是否可以通过 Sqoop 或其他命令行实现? 最佳答案
目前尚不清楚您是否可以像在 Flume 中那样在 Kafka 中进行扇出(复制)。 我想让 Kafka 将数据保存到 HDFS 或 S3,并将该数据的副本发送到 Storm 进行实时处理。 Storm
如何发出 hdfs 命令作为 EMR 集群中的一个步骤?将步骤添加为 script_runner.jar 任务似乎奇怪地失败了。 最佳答案 使用 command-runner.jar 并调出 bash
如何发出 hdfs 命令作为 EMR 集群中的一个步骤?将步骤添加为 script_runner.jar 任务似乎奇怪地失败了。 最佳答案 使用 command-runner.jar 并调出 bash
我是 Hadoop 和 HDFS 的新手,所以当我从本地 (Ubuntu 10.04) 复制到本地主机上单个节点上的 HDFS 时,可能是我做错了什么。初始副本工作正常,但当我修改我的本地输入文件夹并
根据我在 Hadoop HDFS 上的实践,我了解到在创建用户 say u1 并尝试将文件从本地文件系统放入 HDFS 时,它会搜索目录 /user/u1 (默认情况下)对 HDFS 文件系统具有写入
我想将一个 70G 的文件放入 hdfs,所以我使用“put”命令来完成此操作。但是,我得到以下异常。我用相同的命令尝试了小尺寸文件,它有效。有谁知道是什么问题?谢谢! WARN [DataStre
我是一名优秀的程序员,十分优秀!