java.lang.IllegalArgumentException:java.net.URISyntaxException:绝对 URI 中的相对路径:用于 Talend 中的 Hbase
Posted
技术标签:
【中文标题】java.lang.IllegalArgumentException:java.net.URISyntaxException:绝对 URI 中的相对路径:用于 Talend 中的 Hbase【英文标题】:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: for Hbase in Talend 【发布时间】:2017-02-07 10:54:00 【问题描述】:我一直在尝试使用大数据批处理中的 HbaseInput 组件从 Hbase 表中获取数据。如下所示。
我没有在 tMap 中进行任何转换,只是试图从 Hbase 表中读取数据。我检查了所有连接,它们连接正常。 所以,最后我建立了一个工作,复制它并在集群中运行。 这份工作给了我以下例外,
[WARN ]: org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum=zk:5181, exception=org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
Running job: job_1472265299867_10046
map 0% reduce 0%
Task Id : attempt_1472265299867_10046_m_000001_0, Status : FAILED
Error: java.lang.RuntimeException: Error in configuring object
at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
at org.talend.hadoop.mapred.lib.DelegatingInputFormat.getRecordReader(DelegatingInputFormat.java:58)
at org.apache.hadoop.mapred.MapTask$TrackedRecordReader.<init>(MapTask.java:172)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:414)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:347)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1566)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
... 11 more
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: namespace1:table_name
at local_project.hbasepilot_0_1.HbasePilot$tHBaseInput_1InputFormat.configure(HbasePilot.java:308)
... 16 more
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: namespace1:table_name
at org.apache.hadoop.fs.Path.initialize(Path.java:218)
at org.apache.hadoop.fs.Path.<init>(Path.java:184)
at org.apache.hadoop.fs.Path.<init>(Path.java:93)
at com.mapr.fs.hbase.MapRTableMappingRules.makePath(MapRTableMappingRules.java:296)
at com.mapr.fs.hbase.MapRTableMappingRules.getTablePath(MapRTableMappingRules.java:277)
at com.mapr.fs.hbase.MapRTableMappingRules.getMaprTablePath(MapRTableMappingRules.java:248)
at com.mapr.fs.hbase.MapRTableMappingRules.isMapRTable(MapRTableMappingRules.java:201)
at org.apache.hadoop.hbase.client.mapr.BaseTableMappingRules.isMapRTable(BaseTableMappingRules.java:96)
at org.apache.hadoop.hbase.client.HTable.initIfMapRTable(HTable.java:440)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:204)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:172)
at local_project.hbasepilot_0_1.HbasePilot$tHBaseInput_1InputFormat.configure(HbasePilot.java:306)
... 16 more
Caused by: java.net.URISyntaxException: Relative path in absolute URI: namespace1:table_name
at java.net.URI.checkPath(URI.java:1823)
at java.net.URI.<init>(URI.java:745)
at org.apache.hadoop.fs.Path.initialize(Path.java:215)
... 27 more
map 50% reduce 0%
map 100% reduce 0%
Job complete: job_1472265299867_10046
Counters: 34
File System Counters
FILE: Number of bytes read=0
FILE: Number of bytes written=188744
FILE: Number of read operations=0
FILE: Number of large read operations=0
FILE: Number of write operations=0
MAPRFS: Number of bytes read=652
MAPRFS: Number of bytes written=100535043
MAPRFS: Number of read operations=34
MAPRFS: Number of large read operations=0
MAPRFS: Number of write operations=12998
Job Counters
Failed map tasks=1
Killed map tasks=1
Launched map tasks=4
Other local map tasks=1
Rack-local map tasks=3
Total time spent by all maps in occupied slots (ms)=8052096
Total time spent by all reduces in occupied slots (ms)=0
Total time spent by all map tasks (ms)=4026048
Total vcore-seconds taken by all map tasks=4026048
Total megabyte-seconds taken by all map tasks=8245346304
DISK_MILLIS_MAPS=2013025
Map-Reduce Framework
Map input records=4299826
Map output records=4299826
Input split bytes=652
Spilled Records=0
Failed Shuffles=0
Merged Map outputs=0
GC time elapsed (ms)=43365
CPU time spent (ms)=3716080
Physical memory (bytes) snapshot=2017206272
Virtual memory (bytes) snapshot=7506382848
Total committed heap usage (bytes)=2491416576
File Input Format Counters
Bytes Read=0
File Output Format Counters
Bytes Written=100535043
这是表名,
它已经编写了行键,我在组件中进行了硬编码。 其余字段为空。 是的,我在表中有数据,它有数百万行。 我认为 talend 无法从我的表中获取数据,它没有与它通信,因为异常说 "Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: 绝对 URI 中的相对路径: namespace1:table_name"
**这是指定表名的正确方法吗?
为什么我没有从表中挑选数据?**
【问题讨论】:
试着只放“table_name”。 如果我没有指定命名空间,它会抛出与此类似的错误。路径 /table_name 不存在。我应该查看多个区域。我会及时通知您 抱歉回复晚了,如果我们没有启用“设置表命名空间映射”,我们必须指定像“namespace:table_name”这样的值。 【参考方案1】:您使用的是 MAPR 发行版,它与其他 Hadoop 发行版略有不同。
在talend中,您可以进入tHbaseInput
组件的高级设置并设置以下属性:
hbase.table.namespace.mappings
或选中Set table Namspace mappings
框并将您的映射放到表格中。见here。
【讨论】:
以上是关于java.lang.IllegalArgumentException:java.net.URISyntaxException:绝对 URI 中的相对路径:用于 Talend 中的 Hbase的主要内容,如果未能解决你的问题,请参考以下文章