HBASE-9299 Generate the protobuf classes with hadoop-maven-plugin
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1518312 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e0e38c4e2f
commit
b821c20689
|
@ -2,12 +2,13 @@ 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
|
classes are generated into src/main/java/org/apache/hadoop/hbase/protobuf/generated
|
||||||
and then checked in. The reasoning is that they change infrequently.
|
and then checked in. The reasoning is that they change infrequently.
|
||||||
|
|
||||||
To regnerate the classes after making definition file changes, ensure first that
|
To regenerate the classes after making definition file changes, ensure first that
|
||||||
the protobuf protoc tool is in your $PATH (You may need to download it and build
|
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:
|
it first; its part of the protobuf package obtainable from here:
|
||||||
http://code.google.com/p/protobuf/downloads/list). Then run the following (You
|
http://code.google.com/p/protobuf/downloads/list).
|
||||||
should be able to just copy and paste the below into a terminal and hit return
|
|
||||||
-- the protoc compiler runs fast):
|
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):
|
||||||
|
|
||||||
UNIX_PROTO_DIR=src/main/protobuf
|
UNIX_PROTO_DIR=src/main/protobuf
|
||||||
JAVA_DIR=src/main/java/
|
JAVA_DIR=src/main/java/
|
||||||
|
@ -18,10 +19,17 @@ should be able to just copy and paste the below into a terminal and hit return
|
||||||
else
|
else
|
||||||
PROTO_DIR=$UNIX_PROTO_DIR
|
PROTO_DIR=$UNIX_PROTO_DIR
|
||||||
fi
|
fi
|
||||||
|
# uncomment the next line if you want to remove before generating
|
||||||
|
# rm -fr $JAVA_DIR/org/apache/hadoop/hbase/protobuf/generated
|
||||||
for PROTO_FILE in $UNIX_PROTO_DIR/*.proto
|
for PROTO_FILE in $UNIX_PROTO_DIR/*.proto
|
||||||
do
|
do
|
||||||
protoc -I$PROTO_DIR --java_out=$JAVA_DIR $PROTO_FILE
|
protoc -I$PROTO_DIR --java_out=$JAVA_DIR $PROTO_FILE
|
||||||
done
|
done
|
||||||
|
ll $JAVA_DIR/org/apache/hadoop/hbase/protobuf/generated
|
||||||
|
|
||||||
After you've done the above, check it in and then check it in (or post a patch
|
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).
|
on a JIRA with your definition file changes and the generated files).
|
||||||
|
|
||||||
|
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)
|
|
@ -55,8 +55,7 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<!-- Always skip the second part executions, since we only run
|
<!-- Always skip the second part executions, since we only run simple unit tests in this module -->
|
||||||
simple unit tests in this module -->
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>secondPartTestsExecution</id>
|
<id>secondPartTestsExecution</id>
|
||||||
|
@ -70,7 +69,93 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<!--
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.hadoop</groupId>
|
||||||
|
<artifactId>hadoop-maven-plugins</artifactId>
|
||||||
|
<version>2.0.5-alpha</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>compile-protoc</id>
|
||||||
|
<phase>generate-sources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>protoc</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<protocVersion>${protobuf.version}</protocVersion>
|
||||||
|
<protocCommand>${protoc.path}</protocCommand>
|
||||||
|
<imports>
|
||||||
|
<param>${basedir}/src/main/protobuf</param>
|
||||||
|
</imports>
|
||||||
|
<source>
|
||||||
|
<directory>${basedir}/src/main/protobuf</directory>
|
||||||
|
<includes>
|
||||||
|
<include>AccessControl.proto</include>
|
||||||
|
<include>Admin.proto</include>
|
||||||
|
<include>Aggregate.proto</include>
|
||||||
|
<include>Authentication.proto</include>
|
||||||
|
<include>Cell.proto</include>
|
||||||
|
<include>Client.proto</include>
|
||||||
|
<include>ClusterId.proto</include>
|
||||||
|
<include>ClusterStatus.proto</include>
|
||||||
|
<include>Comparator.proto</include>
|
||||||
|
<include>ErrorHandling.proto</include>
|
||||||
|
<include>Filter.proto</include>
|
||||||
|
<include>FS.proto</include>
|
||||||
|
<include>hbase.proto</include>
|
||||||
|
<include>HFile.proto</include>
|
||||||
|
<include>LoadBalancer.proto</include>
|
||||||
|
<include>MapReduce.proto</include>
|
||||||
|
<include>MasterAdmin.proto</include>
|
||||||
|
<include>MasterMonitor.proto</include>
|
||||||
|
<include>Master.proto</include>
|
||||||
|
<include>MultiRowMutationProcessorMessages.proto</include>
|
||||||
|
<include>MultiRowMutation.proto</include>
|
||||||
|
<include>RegionServerStatus.proto</include>
|
||||||
|
<include>RowProcessor.proto</include>
|
||||||
|
<include>RPC.proto</include>
|
||||||
|
<include>SecureBulkLoad.proto</include>
|
||||||
|
<include>Tracing.proto</include>
|
||||||
|
<include>WAL.proto</include>
|
||||||
|
<include>ZooKeeper.proto</include>
|
||||||
|
</includes>
|
||||||
|
</source>
|
||||||
|
<output>${project.build.directory}/generated-sources/java</output>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
-->
|
||||||
</plugins>
|
</plugins>
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.eclipse.m2e</groupId>
|
||||||
|
<artifactId>lifecycle-mapping</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<configuration>
|
||||||
|
<lifecycleMappingMetadata>
|
||||||
|
<pluginExecutions>
|
||||||
|
<pluginExecution>
|
||||||
|
<pluginExecutionFilter>
|
||||||
|
<groupId>org.apache.hadoop</groupId>
|
||||||
|
<artifactId>hadoop-maven-plugins</artifactId>
|
||||||
|
<versionRange>[2.0.5-alpha,)</versionRange>
|
||||||
|
<goals>
|
||||||
|
<goal>protoc</goal>
|
||||||
|
</goals>
|
||||||
|
</pluginExecutionFilter>
|
||||||
|
<action>
|
||||||
|
<ignore></ignore>
|
||||||
|
</action>
|
||||||
|
</pluginExecution>
|
||||||
|
</pluginExecutions>
|
||||||
|
</lifecycleMappingMetadata>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -100,4 +185,5 @@
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -202,11 +202,20 @@ $ MAVEN_OPTS="-Xmx2g" mvn clean install deploy -DskipTests -Dhadoop.profile=2.0
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
<section xml:id="build.protobuf"><title>Build Protobuf</title>
|
||||||
|
<para>You may need to change the protobuf definitions that reside in the hbase-protocol module.</para>
|
||||||
|
<para>
|
||||||
|
The protobuf files are located in It is <link xlink:href="https://svn.apache.org/repos/asf/hbase/trunk/hbase-protocol/src/main/protobuf">hbase-protocol/src/main/protobuf</link>.
|
||||||
|
For the change to be effective, you will need to regenerate the classes (read the <link xlink:href="https://svn.apache.org/repos/asf/hbase/trunk/hbase-protocol/README.txt">hbase-protocol/README.txt</link> for more details).
|
||||||
|
</para>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section xml:id="build.gotchas"><title>Build Gotchas</title>
|
<section xml:id="build.gotchas"><title>Build Gotchas</title>
|
||||||
<para>If you see <code>Unable to find resource 'VM_global_library.vm'</code>, ignore it.
|
<para>If you see <code>Unable to find resource 'VM_global_library.vm'</code>, ignore it.
|
||||||
Its not an error. It is <link xlink:href="http://jira.codehaus.org/browse/MSITE-286">officially ugly</link> though.
|
Its not an error. It is <link xlink:href="http://jira.codehaus.org/browse/MSITE-286">officially ugly</link> though.
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</section> <!-- build -->
|
</section> <!-- build -->
|
||||||
<section xml:id="mvn_repo">
|
<section xml:id="mvn_repo">
|
||||||
<title>Adding an Apache HBase release to Apache's Maven Repository</title>
|
<title>Adding an Apache HBase release to Apache's Maven Repository</title>
|
||||||
|
|
Loading…
Reference in New Issue