Developing HBaseThis chapter will be of interest only to those developing HBase (i.e., as opposed to using it).
+ See the HBase wiki How To Contribute
+
+ HBase Repositories
+
+ SVN
+
+svn co http://svn.apache.org/repos/asf/hbase/trunk hbase-core-trunk
+
+
+
+ Git
+
+git clone git://git.apache.org/hbase.git
+
+
+ IDEsEclipse
- See HBASE-3678 Add Eclipse-based Apache Formatter to HBase Wiki
+
+ Code Formatting
+ See HBASE-3678 Add Eclipse-based Apache Formatter to HBase Wiki
for an Eclipse formatter to help ensure your code conforms to HBase'y coding conventsion.
- The issue includes instructions for loading the attached formatter.
-
+ The issue includes instructions for loading the attached formatter.
+
+
+ Subversive Plugin
+ Download and install the Subversive plugin.
+ Set up an SVN Repository target from , then check out the code.
+
+
+ HBase Project Setup
+ To set up your Eclipse environment for HBase, close Eclipse and execute...
+
+mvn eclipse:eclipse
+
+ ... from your local HBase project directory in your workspace to generate a new .project file. Then reopen Eclipse.
+
+
+ Maven Plugin
+ Download and install the Maven plugin. For example, Help -> Install New Software -> (search for Maven Plugin)
+
+
+ Maven Classpath Variable
+ The M2_REPO classpath variable needs to be set up for the project. This needs to be set to
+ your local Maven repository, which is usually ~/.m2/repository
+ If this classpath variable is not configured, you will see compile errors in Eclipse like this...
+
+Description Resource Path Location Type
+The project cannot be built until build path errors are resolved hbase Unknown Java Problem
+Unbound classpath variable: 'M2_REPO/asm/asm/3.1/asm-3.1.jar' in project 'hbase' hbase Build path Build Path Problem
+Unbound classpath variable: 'M2_REPO/com/github/stephenc/high-scale-lib/high-scale-lib/1.1.1/high-scale-lib-1.1.1.jar' in project 'hbase' hbase Build path Build Path Problem
+Unbound classpath variable: 'M2_REPO/com/google/guava/guava/r09/guava-r09.jar' in project 'hbase' hbase Build path Build Path Problem
+Unbound classpath variable: 'M2_REPO/com/google/protobuf/protobuf-java/2.3.0/protobuf-java-2.3.0.jar' in project 'hbase' hbase Build path Build Path Problem Unbound classpath variable:
+
+
+
+ Eclipse Known Issues
+ Eclipse will currently complain about Bytes.java. It is not possible to turn these errors off.
+
+Description Resource Path Location Type
+Access restriction: The method arrayBaseOffset(Class) from the type Unsafe is not accessible due to restriction on required library /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar Bytes.java /hbase/src/main/java/org/apache/hadoop/hbase/util line 1061 Java Problem
+Access restriction: The method arrayIndexScale(Class) from the type Unsafe is not accessible due to restriction on required library /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar Bytes.java /hbase/src/main/java/org/apache/hadoop/hbase/util line 1064 Java Problem
+Access restriction: The method getLong(Object, long) from the type Unsafe is not accessible due to restriction on required library /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar Bytes.java /hbase/src/main/java/org/apache/hadoop/hbase/util line 1111 Java Problem
+
+
+
+ Maven Build Commands
+ All commands executed from the local HBase project directory.
+
+
+ Compile
+
+mvn compile
+
+
+
+ Run all Unit Tests
+
+mvn test
+
+
+
+ Run a Single Unit Test
+
+mvn test -Dtest=TestXYZ
+
+
+
+ Unit TestsIn HBase we use JUnit 4.