java.lang.NumberFormatException 在嵌套文件夹中访问 HBase table 时?
java.lang.NumberFormatException when accessing HBase table in nested folders?
使用 apache Hue 在某些 HDFS 位置 /path/to/my/hbasetable 创建了一个 hbase table。但是,我在尝试通过 Hue 以外的任何方式访问它时遇到问题。在 Hue 中,我只是使用 hbase 数据浏览器导航到 table,但是当我尝试从命令行确认 table 存在时,会抛出一个错误:
[me@mapr001 example]$ curl -I -H \
"Accept: text/mxl" \
"http://node001:8080/etl/internal/example/raw-ingest/version-1/file-metastore/schema"
HTTP/1.1 500 java.lang.NumberFormatException: For input string: "raw-ingest"
Content-Type: text/html; charset=iso-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 9374
尝试访问示例行时出现类似错误(已添加到 Hue 中的 table)
[me@mapr001 example]$ curl -vi -X GET -H \
"Accept: text/mxl" \
"http://mapr001:8080/etl/internal/example/raw-ingest/version-1/file-metastore/customId001/cf:mainfamily"
* About to connect() to mapr001 port 8080 (#0)
* Trying 172.18.4.100...
* Connected to mapr001 (172.18.4.100) port 8080 (#0)
> GET /etl/internal/example/raw-ingest/version-1/file-metastore/ede3233777492e4a00442b61c7035820a55f16e669daaa29fc6baecf09b397f8X1525813886Xv1/cf:lineage HTTP/1.1
> User-Agent: curl/7.29.0
> Host: mapr001:8080
> Accept: text/mxl
>
< HTTP/1.1 500 java.lang.NumberFormatException: For input string: "raw-ingest"
HTTP/1.1 500 java.lang.NumberFormatException: For input string: "raw-ingest"
< Content-Type: text/html; charset=iso-8859-1
Content-Type: text/html; charset=iso-8859-1
< Cache-Control: must-revalidate,no-cache,no-store
Cache-Control: must-revalidate,no-cache,no-store
< Content-Length: 9457
Content-Length: 9457
<
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 java.lang.NumberFormatException: For input string: "raw-ingest"</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /etl/internal/example/raw-ingest/version-1/file-metastore/ede3233777492e4a00442b61c7035820a55f16e669daaa29fc6baecf09b397f8X1525813886Xv1/cf:lineage. Reason:
<pre> java.lang.NumberFormatException: For input string: "raw-ingest"</pre></p><h3>Caused by:</h3><pre>java.lang.IllegalArgumentException: java.lang.NumberFormatException: For input string: "raw-ingest"
at org.apache.hadoop.hbase.rest.RowSpec.parseTimestamp(RowSpec.java:170)
at org.apache.hadoop.hbase.rest.RowSpec.<init>(RowSpec.java:62)
....
(其中 hbase table 被称为 "file-metastore",前面路径的其余部分从 HDFS 根开始)你可以看到一些异常被引发,抱怨路径的某些部分。到目前为止从未使用过 hbase,但我怀疑存在比输入字符串更深层次的问题。 hbase 是否期望从某个预设根目录(即 hbase-site.xml 中的 hbase.rootdir
配置)或其他目录开始?如果有人知道这里发生了什么以及我该如何解决它,将不胜感激。谢谢。
REST api 期望请求的格式为
"http://<restserver>:<port>/<tablename>/schema"
但是因为我将 table 作为 table 的路径(使用 /
字符),它被解释为文字 /
而不是作为名称的一部分(参见 slashes in url variables)(在我不知道这是一回事之前从未使用过 REST api)。从
更改请求字符串
"http://node001:8080/etl/internal/example/raw-ingest/version-1/file-metastore/schema/"
与 /
s 编码为 %2f
s
"http://mapr001:8080/%2fetl%2finternal%2fexample%2fraw-ingest%2fversion-1%2ffilemetastore/schema/"
解决了问题。
使用 apache Hue 在某些 HDFS 位置 /path/to/my/hbasetable 创建了一个 hbase table。但是,我在尝试通过 Hue 以外的任何方式访问它时遇到问题。在 Hue 中,我只是使用 hbase 数据浏览器导航到 table,但是当我尝试从命令行确认 table 存在时,会抛出一个错误:
[me@mapr001 example]$ curl -I -H \
"Accept: text/mxl" \
"http://node001:8080/etl/internal/example/raw-ingest/version-1/file-metastore/schema"
HTTP/1.1 500 java.lang.NumberFormatException: For input string: "raw-ingest"
Content-Type: text/html; charset=iso-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 9374
尝试访问示例行时出现类似错误(已添加到 Hue 中的 table)
[me@mapr001 example]$ curl -vi -X GET -H \
"Accept: text/mxl" \
"http://mapr001:8080/etl/internal/example/raw-ingest/version-1/file-metastore/customId001/cf:mainfamily"
* About to connect() to mapr001 port 8080 (#0)
* Trying 172.18.4.100...
* Connected to mapr001 (172.18.4.100) port 8080 (#0)
> GET /etl/internal/example/raw-ingest/version-1/file-metastore/ede3233777492e4a00442b61c7035820a55f16e669daaa29fc6baecf09b397f8X1525813886Xv1/cf:lineage HTTP/1.1
> User-Agent: curl/7.29.0
> Host: mapr001:8080
> Accept: text/mxl
>
< HTTP/1.1 500 java.lang.NumberFormatException: For input string: "raw-ingest"
HTTP/1.1 500 java.lang.NumberFormatException: For input string: "raw-ingest"
< Content-Type: text/html; charset=iso-8859-1
Content-Type: text/html; charset=iso-8859-1
< Cache-Control: must-revalidate,no-cache,no-store
Cache-Control: must-revalidate,no-cache,no-store
< Content-Length: 9457
Content-Length: 9457
<
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 java.lang.NumberFormatException: For input string: "raw-ingest"</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /etl/internal/example/raw-ingest/version-1/file-metastore/ede3233777492e4a00442b61c7035820a55f16e669daaa29fc6baecf09b397f8X1525813886Xv1/cf:lineage. Reason:
<pre> java.lang.NumberFormatException: For input string: "raw-ingest"</pre></p><h3>Caused by:</h3><pre>java.lang.IllegalArgumentException: java.lang.NumberFormatException: For input string: "raw-ingest"
at org.apache.hadoop.hbase.rest.RowSpec.parseTimestamp(RowSpec.java:170)
at org.apache.hadoop.hbase.rest.RowSpec.<init>(RowSpec.java:62)
....
(其中 hbase table 被称为 "file-metastore",前面路径的其余部分从 HDFS 根开始)你可以看到一些异常被引发,抱怨路径的某些部分。到目前为止从未使用过 hbase,但我怀疑存在比输入字符串更深层次的问题。 hbase 是否期望从某个预设根目录(即 hbase-site.xml 中的 hbase.rootdir
配置)或其他目录开始?如果有人知道这里发生了什么以及我该如何解决它,将不胜感激。谢谢。
REST api 期望请求的格式为
"http://<restserver>:<port>/<tablename>/schema"
但是因为我将 table 作为 table 的路径(使用 /
字符),它被解释为文字 /
而不是作为名称的一部分(参见 slashes in url variables)(在我不知道这是一回事之前从未使用过 REST api)。从
"http://node001:8080/etl/internal/example/raw-ingest/version-1/file-metastore/schema/"
与 /
s 编码为 %2f
s
"http://mapr001:8080/%2fetl%2finternal%2fexample%2fraw-ingest%2fversion-1%2ffilemetastore/schema/"
解决了问题。