18.3. Building Apache HBase

18.3.1. Basic Compile

Thanks to maven, building HBase is pretty easy. You can read about the various maven commands in Section 18.8, “Maven Build Commands”, but the simplest command to compile HBase from its java source code is:

mvn package -DskipTests
       

Or, to clean up before compiling:

mvn clean package -DskipTests
       

With Eclipse set up as explained above in Section 18.2.1, “Eclipse”, you can also simply use the build command in Eclipse. To create the full installable HBase package takes a little bit more work, so read on.

18.3.2. Build Protobuf

You may need to change the protobuf definitions that reside in the hbase-protocol module or other modules.

The protobuf files are located hbase-protocol/src/main/protobuf. For the change to be effective, you will need to regenerate the classes. You can use maven profile compile-protobuf to do this.

mvn compile -Dcompile-protobuf
or
mvn compile -Pcompile-protobuf
            

You may also want to define protoc.path for the protoc binary

mvn compile -Dcompile-protobuf -Dprotoc.path=/opt/local/bin/protoc
             

Read the hbase-protocol/README.txt for more details.

18.3.3. Build Gotchas

If you see Unable to find resource 'VM_global_library.vm', ignore it. Its not an error. It is officially ugly though.

18.3.4. Building in snappy compression support

Pass -Dsnappy to trigger the snappy maven profile for building snappy native libs into hbase. See also ???

comments powered by Disqus