2012-03-30 17:38:44 -04:00
|
|
|
These are the protobuf definition files used by hbase. The produced java
|
|
|
|
classes are generated into src/main/java/org/apache/hadoop/hbase/protobuf/generated
|
|
|
|
and then checked in. The reasoning is that they change infrequently.
|
|
|
|
|
2013-08-28 14:15:20 -04:00
|
|
|
To regenerate the classes after making definition file changes, ensure first that
|
2012-03-30 17:38:44 -04:00
|
|
|
the protobuf protoc tool is in your $PATH (You may need to download it and build
|
|
|
|
it first; its part of the protobuf package obtainable from here:
|
2013-08-28 14:15:20 -04:00
|
|
|
http://code.google.com/p/protobuf/downloads/list).
|
|
|
|
|
|
|
|
Then run the following (You should be able to just copy and paste the below into a
|
|
|
|
terminal and hit return -- the protoc compiler runs fast):
|
2012-03-30 17:38:44 -04:00
|
|
|
|
|
|
|
UNIX_PROTO_DIR=src/main/protobuf
|
|
|
|
JAVA_DIR=src/main/java/
|
|
|
|
mkdir -p $JAVA_DIR 2> /dev/null
|
|
|
|
if which cygpath 2> /dev/null; then
|
|
|
|
PROTO_DIR=`cygpath --windows $UNIX_PROTO_DIR`
|
|
|
|
JAVA_DIR=`cygpath --windows $JAVA_DIR`
|
|
|
|
else
|
|
|
|
PROTO_DIR=$UNIX_PROTO_DIR
|
|
|
|
fi
|
2013-08-28 14:15:20 -04:00
|
|
|
# uncomment the next line if you want to remove before generating
|
|
|
|
# rm -fr $JAVA_DIR/org/apache/hadoop/hbase/protobuf/generated
|
2012-03-30 17:38:44 -04:00
|
|
|
for PROTO_FILE in $UNIX_PROTO_DIR/*.proto
|
|
|
|
do
|
|
|
|
protoc -I$PROTO_DIR --java_out=$JAVA_DIR $PROTO_FILE
|
|
|
|
done
|
2013-08-28 14:15:20 -04:00
|
|
|
ll $JAVA_DIR/org/apache/hadoop/hbase/protobuf/generated
|
2012-03-30 17:38:44 -04:00
|
|
|
|
|
|
|
After you've done the above, check it in and then check it in (or post a patch
|
|
|
|
on a JIRA with your definition file changes and the generated files).
|
2013-08-28 14:15:20 -04:00
|
|
|
|
|
|
|
Optionally, you can uncomment the hadoop-maven-plugins plugin in hbase-protocol/pom.xml.
|
|
|
|
This plugin will generate for the classes during the build. Once again, you will need protocol buffers
|
|
|
|
to be installed on your build machine (https://developers.google.com/protocol-buffers)
|