- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我在运行 hadoop fs api 删除目录时遇到问题。即使我有适当的配置,程序也会抛出异常。需要帮助解决问题。
我正在使用下面的 maven 依赖项
hadoop-common 2.4.1-mapr-1408hadoop-核心 2.4.1-mapr-1408hadoop 客户端 2.7.1
repo :http://repository.mapr.com/maven/
package com.cisco.installbase.hiveconnector;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.log4j.Logger;
public class ShellUtilities {
private static final Logger LOGGER = Logger.getLogger(ShellUtilities.class);
String target_dir = ReadProperties.getInstance().getProperty("target_dir");
String tablename = "";
Configuration conf = new Configuration();
FileSystem fs = null;
String dir = " ";
public void DeleteDirectory(String tablename) {
String fullpath = target_dir + tablename;
try {
LOGGER.info("Deleting the HDFS directory " + fullpath);
fs = FileSystem.get(conf);
} catch (IOException e) {
LOGGER.error(e.getMessage());
} catch (Exception e) {
LOGGER.error(e.getMessage());
}
Path directory = new Path(fullpath);
try {
if (fs.exists(directory)) {
fs.delete(directory, true);
}
} catch (IOException e) {
LOGGER.error(e.getMessage());
} catch (Exception e) {
LOGGER.error(e.getMessage());
}
}
}
堆栈跟踪:
16/02/19 23:04:33 ERROR cldbutils.CLDBRpcCommonUtils: File is not found: /opt/mapr/conf/mapr-clusters.conf
java.io.FileNotFoundException: \opt\mapr\conf\mapr-clusters.conf (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at java.io.FileInputStream.<init>(FileInputStream.java:101)
at java.io.FileReader.<init>(FileReader.java:58)
at com.mapr.baseutils.cldbutils.CLDBRpcCommonUtils.init(CLDBRpcCommonUtils.java:144)
at com.mapr.baseutils.cldbutils.CLDBRpcCommonUtils.<init>(CLDBRpcCommonUtils.java:72)
at com.mapr.baseutils.cldbutils.CLDBRpcCommonUtils.<clinit>(CLDBRpcCommonUtils.java:63)
at org.apache.hadoop.conf.CoreDefaultProperties.<clinit>(CoreDefaultProperties.java:68)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.hadoop.conf.Configuration.getClassByNameOrNull(Configuration.java:1847)
at org.apache.hadoop.conf.Configuration.getProperties(Configuration.java:2062)
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2272)
at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2224)
at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2141)
at org.apache.hadoop.conf.Configuration.get(Configuration.java:1081)
at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:177)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:169)
at com.cisco.installbase.hiveconnector.ShellUtilities.DeleteDirectory(ShellUtilities.java:24)
at com.cisco.installbase.hiveconnector.MainApp.importTables(MainApp.java:66)
at com.cisco.installbase.hiveconnector.MainApp.startTimeLogger(MainApp.java:51)
at com.cisco.installbase.hiveconnector.MainApp.main(MainApp.java:40)
16/02/19 23:04:35 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/02/19 23:04:35 ERROR util.Shell: Failed to locate the winutils binary in the hadoop binary path
java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:318)
at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:333)
at org.apache.hadoop.util.Shell.<clinit>(Shell.java:326)
at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:76)
at org.apache.hadoop.security.Groups.parseStaticMapping(Groups.java:93)
at org.apache.hadoop.security.Groups.<init>(Groups.java:77)
at org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Groups.java:240)
at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:279)
at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:185)
at org.apache.hadoop.security.UserGroupInformation.loginUserFromSubject(UserGroupInformation.java:621)
at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:606)
at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:519)
at org.apache.hadoop.fs.FileSystem$Cache$Key.<init>(FileSystem.java:2590)
at org.apache.hadoop.fs.FileSystem$Cache$Key.<init>(FileSystem.java:2582)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2448)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:404)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:169)
at com.cisco.installbase.hiveconnector.ShellUtilities.DeleteDirectory(ShellUtilities.java:24)
at com.cisco.installbase.hiveconnector.MainApp.importTables(MainApp.java:66)
at com.cisco.installbase.hiveconnector.MainApp.startTimeLogger(MainApp.java:51)
at com.cisco.installbase.hiveconnector.MainApp.main(MainApp.java:40)
16/02/19 23:04:36 WARN fs.MapRFileSystem: Could not find any cluster, defaulting to localhost
Some error on socket 1472
2016-02-19 23:04:37,3423 ERROR Client fs/client/fileclient/cc/client.cc:394 Thread: 4332 Failed to initialize client for cluster 127.0.0.1:7222, error Cannot send after transport endpoint shutdown(108)
16/02/19 23:04:37 ERROR hiveconnector.ShellUtilities: Could not create FileClient
16/02/19 23:04:37 INFO hiveconnector.ShellUtilities: Deleting the HDFS directory /app/dev/SmartAnalytics/sqoop_temp/XXCCS_DS_CVDPRDLINE_DETAIL
Some error on socket 1488
2016-02-19 23:04:38,3434 ERROR Client fs/client/fileclient/cc/client.cc:394 Thread: 4332 Failed to initialize client for cluster 127.0.0.1:7222, error Cannot send after transport endpoint shutdown(108)
16/02/19 23:04:38 ERROR hiveconnector.ShellUtilities: Could not create FileClient
16/02/19 23:04:38 INFO hiveconnector.ShellUtilities: Deleting the HDFS directory /app/dev/SmartAnalytics/sqoop_temp/XXCCS_DS_INSTANCE_DETAIL
Some error on socket 1488
2016-02-19 23:04:39,3424 ERROR Client fs/client/fileclient/cc/client.cc:394 Thread: 4332 Failed to initialize client for cluster 127.0.0.1:7222, error Cannot send after transport endpoint shutdown(108)
16/02/19 23:04:39 ERROR hiveconnector.ShellUtilities: Could not create FileClient
16/02/19 23:04:39 INFO hiveconnector.ShellUtilities: Deleting the HDFS directory /app/dev/SmartAnalytics/sqoop_temp/XXCCS_DS_CVDPRDLINE_DETAIL
Some error on socket 1488
2016-02-19 23:04:40,3445 ERROR Client fs/client/fileclient/cc/client.cc:394 Thread: 4332 Failed to initialize client for cluster 127.0.0.1:7222, error Cannot send after transport endpoint shutdown(108)
16/02/19 23:04:40 ERROR hiveconnector.ShellUtilities: Could not create FileClient
16/02/19 23:04:40 INFO hiveconnector.ShellUtilities: Deleting the HDFS directory /app/dev/SmartAnalytics/sqoop_temp/XXCCS_DS_SAHDR_CORE
Some error on socket 1488
2016-02-19 23:04:41,3525 ERROR Client fs/client/fileclient/cc/client.cc:394 Thread: 4332 Failed to initialize client for cluster 127.0.0.1:7222, error Cannot send after transport endpoint shutdown(108)
16/02/19 23:04:41 ERROR hiveconnector.ShellUtilities: Could not create FileClient
最佳答案
当您从一台移除机器上使用 MapR 时,您必须安装“MapR 客户端”,它包含运行时的所有依赖项。
这是对允许您编译的 Maven 依赖项的补充。 MapR Client是一组Java库,也是用于以最有效的方式访问MapR Cluster的本地库。
我邀请您按照此处记录的步骤进行操作:
这将允许您:
/opt/mapr/..
文件夹关于java - 在 MAPR 中找不到 Hadoop FS API 文件问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35521488/
我正在尝试在 Windows 上运行的小于 1GB 的 VM 上设置 YouTrack 和 TeamCity。使用率将非常低(用户和请求)。这是一个 POC 环境,如果它有效,我可能会将它推送到一个超
所以我在尝试使用 FORFILES 解决这个问题时遇到了麻烦。我正在尝试获取不超过 4 天的文件。所以基本上少于 4 天。然而,这似乎不太可能,因为/d -4 获取所有 4 天或更早的项目。 以下是我
如何从下面的 events 表中选择小于 15 分钟前创建的 events? CREATE TABLE events ( created_at timestamp NOT NULL DEFAU
Google Analytics Realtime提供 rt:minutesAgo ,可以过滤查询。 然而,它是一个维度而不是一个度量标准,<=不能在过滤器中使用。 假设我想在最后 n 分钟内获得一些
iOS 核心数据 - 严重的应用程序错误 - 尝试插入 nil 你好, 我的应用程序实际上运行稳定,但在极少数情况下它会崩溃并显示此错误消息... 2019-04-02 20:48:52.437172
我想制作一个 html div 以快速向右移动(例如不到 1 秒)并消失。然后1秒后再次直接出现在这个过程最开始div的位置。此过程将由单击按钮并重复 10 次触发。 我试图在 CSS 中使用过渡属性
我发现使用 TimeTrigger 是 Windows 10 (UWP) 上计划后台任务的方式。但是看起来我们需要给出的最小数字是 15 分钟。只是想知道,即使我们安排它在接下来的 1 分钟内运行,警
我必须在 1 秒内在屏幕上打印 2^20 行整数 printf 不够快,还有其他易于使用的快速输出替代方法吗? 每一行只包含 1 个整数。 我要求它用于竞争性编程问题,我必须将其源代码提交给法官。 最
我是一名优秀的程序员,十分优秀!