0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

HBase の開発をはじめたいのですが、どこから始めればいいでしょうか?

Posted at

質問

HBase の開発をはじめたいのですが、どこから始めればいいでしょうか?

  • ソースはどこからダウンロードすればいいんでしょうか?
  • コンパイル・ビルドはどのように行えばいいのでしょうか?
  • テストはどのように行えばいいのでしょうか?
  • レビューはどのように行えばいいのでしょうか?
  • パッチの投稿はどのように行えばいいのでしょうか?

回答

HBase開発環境構築[完了]

参考サイト

http://hbase.apache.org/book.html#developer
上記サイトの通り作業を行えば大体問題ない(上記では不十分な点は以下を見れば解決できる)

リポジトリ

SVN

svn co http://svn.apache.org/repos/asf/hbase/trunk hbase-core-trunk

Git

git clone git://git.apache.org/hbase.git

HBaseのリポジトリはSVNがオリジナルらしく、参考サイトもSVNでの環境構築方法が記載しているので、GitではなくSVNで作業を実施した

Eclipseプラグイン

以下を予めインストールしておく

  • subversive
  • m2ecliplse

Eclipse Code Formatting の設定

https://issues.apache.org/jira/browse/HBASE-3678 参照
CodeFormatのインポートだけでなくJava EditorのSave Actionの設定も忘れずに

SVNチェックアウト

Eclipse上から以下に相当する処理を行う(subversive管理下にしたかったので)

svn co http://svn.apache.org/repos/asf/hbase/trunk hbase-core-trunk

ターミナルより以下を実行

mvn eclipse:eclipse

参考サイトではM2_REPOのクラスパス変数が必要とあるが、すでに定義済みであった
また、以下の対処は既に行われているようであった

------ 抜粋Start ------
If you install the m2eclipse and import the HBase pom.xml in your workspace, you will have to fix your eclipse Build Path. Remove target folder, add target/generated-jamon and target/generated-sources/java folders. You may also remove from your Build Path the exclusions on the src/main/resources and src/test/resources to avoid error message in the console 'Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (default) on project hbase: 'An Ant BuildException has occured: Replace: source file .../target/classes/hbase-default.xml doesn't exist'. This will also reduce the eclipse build cycles and make your life easier when developing.
------ 抜粋End ------

Eclipse固有の問題

Bytes.java,ResourceChecker.java でsunパッケージのクラスでAccess restrictionが発生
参考サイトでは回避不能とあったが、以下で解決できる

Preference -> Java -> Compiler -> Errors/Warnings
Deprecated and restricted API Forbidden reference を Error から Warning に変更する

HBase tarballのビルド

参考サイトどおり以下のコマンドを実行してもうまくいかない

MAVEN_OPTS="-Xmx2g" mvn clean site install assembly:single -Dmaven.test.skip -Prelease
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.SmallTests
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

以下のコマンドでテストをスキップして実行が成功する(pom.xmlより勘で判明)

MAVEN_OPTS="-Xmx2g" mvn clean site install assembly:single -Dmaven.test.skip -Dmaven.test.skip.exec -Prelease

Adding an HBase release to Apache's Maven Repository

Mavenレポジトリにリリースする方法は今必要ないので省略

Publishing a new version of hbase.apache.org

これも恐れ多いのでもちろん省略

JUnit実行方法

SmallTestとMediumTestを実行(デフォルト)

mvn test

セキュリティプロファイルを有効にしてテスト
mvn test -P security

全テスト実行

mvn test -P runAllTests

個別テストの実行例

mvn test -P localTests -Dtest=MyTest
mvn test -P localTests -Dtest=MyTest1,MyTest2,MyTest3
mvn test -P localTests -Dtest=org.apache.hadoop.hbase.client.*
mvn test -P security,localTests -Dtest=TestGet

hbasetests.shから実行

./dev-support/hbasetests.sh
./dev-support/hbasetests.sh runAllTests
./dev-support/hbasetests.sh replayFailed

JIRAチケット調査[作業中]

まず、JIRAに慣れるべくJIRAを巡回してまわった。
自分が着手できそうなJIRAを選別中 以下候補

https://issues.apache.org/jira/browse/HBASE-5960
https://issues.apache.org/jira/browse/HBASE-5921
https://issues.apache.org/jira/browse/HBASE-5659
https://issues.apache.org/jira/browse/HBASE-5273
https://issues.apache.org/jira/browse/HBASE-5164
https://issues.apache.org/jira/browse/HBASE-4113

注意

この投稿は、Hadoop Hackathon in Tokyo の QA サイト閉鎖に伴う移行作業により作成されたものです。
移行元URL: http://glowing-moon-7493.herokuapp.com/questions/191/hbase

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?