为什么我不能从 hbase.io.hfile 包中导入 class

Why Cannot I import the class from hbase.io.hfile package

我有一个 HFile,我正在尝试 read/deserialize 使用 Java。 看起来这个 HFile.reader 很有前途,但是,我什至很难在 Maven 中导入库。

这是我的 POM 的样子:

<dependencies>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-client</artifactId>
        <version>1.0.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-common</artifactId>
        <version>1.0.0</version>
    </dependency>
 </dependencies>

不知何故,我在尝试导入时没有看到那么多 类 或对象。

这个 class 可以在 hbase-server 工件中找到,所以你需要依赖那个而不是 hbase-commonhbase-client:

<dependency>
    <groupId>org.apache.hbase</groupId>
    <artifactId>hbase-server</artifactId>
    <version>1.2.1</version>
</dependency>

但请注意,此 class 不打算供第 3 方使用。注释为@InterfaceAudience.Private,意思是:

Intended for use only within Hadoop itself.