2014-10-07 18:08:54 -04:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
|
|
<!--
|
|
|
|
/**
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
* or more contributor license agreements. See the NOTICE file
|
|
|
|
* distributed with this work for additional information
|
|
|
|
* regarding copyright ownership. The ASF licenses this file
|
|
|
|
* to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance
|
|
|
|
* with the License. You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
-->
|
|
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<parent>
|
|
|
|
<artifactId>hbase</artifactId>
|
|
|
|
<groupId>org.apache.hbase</groupId>
|
2017-06-07 01:04:39 -04:00
|
|
|
<version>3.0.0-SNAPSHOT</version>
|
2014-10-07 18:08:54 -04:00
|
|
|
<relativePath>..</relativePath>
|
|
|
|
</parent>
|
|
|
|
<artifactId>hbase-rest</artifactId>
|
2015-07-15 06:12:36 -04:00
|
|
|
<name>Apache HBase - Rest</name>
|
2014-10-07 18:08:54 -04:00
|
|
|
<description>HBase Rest Server</description>
|
|
|
|
|
|
|
|
<build>
|
|
|
|
<!-- Makes sure the resources get added before they are processed
|
|
|
|
by placing this first -->
|
|
|
|
<resources>
|
|
|
|
<!-- Add the build webabpps to the classpth -->
|
|
|
|
<resource>
|
|
|
|
<directory>${project.build.directory}</directory>
|
|
|
|
<includes>
|
|
|
|
<include>hbase-webapps/**</include>
|
|
|
|
</includes>
|
|
|
|
</resource>
|
|
|
|
</resources>
|
|
|
|
<testResources>
|
|
|
|
<testResource>
|
|
|
|
<directory>src/test/resources</directory>
|
|
|
|
<includes>
|
|
|
|
<include>**/**</include>
|
|
|
|
</includes>
|
|
|
|
</testResource>
|
|
|
|
</testResources>
|
|
|
|
<plugins>
|
|
|
|
<plugin>
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
<artifactId>maven-site-plugin</artifactId>
|
|
|
|
<configuration>
|
|
|
|
<skip>true</skip>
|
|
|
|
</configuration>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
|
|
|
<!--Make it so assembly:single does nothing in here-->
|
|
|
|
<artifactId>maven-assembly-plugin</artifactId>
|
|
|
|
<version>${maven.assembly.version}</version>
|
|
|
|
<configuration>
|
|
|
|
<skipAssembly>true</skipAssembly>
|
|
|
|
</configuration>
|
|
|
|
</plugin>
|
|
|
|
<!-- Make a jar and put the sources in the jar -->
|
|
|
|
<plugin>
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
<artifactId>maven-source-plugin</artifactId>
|
|
|
|
</plugin>
|
|
|
|
|
|
|
|
<!-- General ant tasks, bound to different build phases -->
|
|
|
|
<plugin>
|
|
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
|
|
|
<executions>
|
|
|
|
<!-- Generate web app sources -->
|
|
|
|
<execution>
|
|
|
|
<id>generate</id>
|
|
|
|
<phase>generate-sources</phase>
|
|
|
|
<configuration>
|
|
|
|
<target>
|
|
|
|
<property name="build.webapps" location="${project.build.directory}/hbase-webapps"/>
|
|
|
|
<property name="src.webapps"
|
|
|
|
location="${basedir}/src/main/resources/hbase-webapps"/>
|
|
|
|
<property name="generated.sources"
|
|
|
|
location="${project.build.directory}/generated-sources"/>
|
|
|
|
<mkdir dir="${build.webapps}"/>
|
|
|
|
<copy todir="${build.webapps}">
|
|
|
|
<fileset dir="${src.webapps}">
|
|
|
|
<exclude name="**/*.jsp"/>
|
|
|
|
<exclude name="**/.*"/>
|
|
|
|
<exclude name="**/*~"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
|
|
|
<!--The compile.classpath is passed in by maven -->
|
|
|
|
<taskdef classname="org.apache.jasper.JspC" name="jspcompiler"
|
|
|
|
classpathref="maven.compile.classpath"/>
|
|
|
|
<mkdir dir="${build.webapps}/rest/WEB-INF"/>
|
|
|
|
<jspcompiler uriroot="${src.webapps}/rest" outputdir="${generated.sources}/java"
|
|
|
|
package="org.apache.hadoop.hbase.generated.rest"
|
|
|
|
webxml="${build.webapps}/rest/WEB-INF/web.xml"/>
|
|
|
|
</target>
|
|
|
|
</configuration>
|
|
|
|
<goals>
|
|
|
|
<goal>run</goal>
|
|
|
|
</goals>
|
|
|
|
</execution>
|
|
|
|
</executions>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
|
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
|
|
<artifactId>build-helper-maven-plugin</artifactId>
|
|
|
|
<executions>
|
|
|
|
<!-- Add the generated sources -->
|
|
|
|
<execution>
|
|
|
|
<id>jspcSource-packageInfo-source</id>
|
|
|
|
<phase>generate-sources</phase>
|
|
|
|
<goals>
|
|
|
|
<goal>add-source</goal>
|
|
|
|
</goals>
|
|
|
|
<configuration>
|
|
|
|
<sources>
|
|
|
|
<source>${project.build.directory}/generated-sources/java</source>
|
|
|
|
</sources>
|
|
|
|
</configuration>
|
|
|
|
</execution>
|
|
|
|
</executions>
|
|
|
|
</plugin>
|
|
|
|
<!-- Testing plugins -->
|
|
|
|
<plugin>
|
|
|
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
|
|
<configuration>
|
|
|
|
<properties>
|
|
|
|
<property>
|
|
|
|
<name>listener</name>
|
|
|
|
<value>org.apache.hadoop.hbase.ServerResourceCheckerJUnitListener</value>
|
|
|
|
</property>
|
|
|
|
</properties>
|
|
|
|
<systemPropertyVariables>
|
|
|
|
<test.build.webapps>target/test-classes/webapps</test.build.webapps>
|
|
|
|
</systemPropertyVariables>
|
|
|
|
</configuration>
|
|
|
|
</plugin>
|
|
|
|
</plugins>
|
2015-03-13 17:27:54 -04:00
|
|
|
<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.maven.plugins</groupId>
|
|
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
|
|
|
<versionRange>[1.6,)</versionRange>
|
|
|
|
<goals>
|
|
|
|
<goal>run</goal>
|
|
|
|
</goals>
|
|
|
|
</pluginExecutionFilter>
|
|
|
|
<action>
|
|
|
|
<ignore></ignore>
|
|
|
|
</action>
|
|
|
|
</pluginExecution>
|
|
|
|
</pluginExecutions>
|
|
|
|
</lifecycleMappingMetadata>
|
|
|
|
</configuration>
|
|
|
|
</plugin>
|
|
|
|
</plugins>
|
|
|
|
</pluginManagement>
|
2014-10-07 18:08:54 -04:00
|
|
|
</build>
|
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
<!-- Intra-project dependencies -->
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hbase</groupId>
|
|
|
|
<artifactId>hbase-common</artifactId>
|
|
|
|
<type>jar</type>
|
|
|
|
</dependency>
|
2016-07-20 19:25:40 -04:00
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hbase</groupId>
|
|
|
|
<artifactId>hbase-protocol</artifactId>
|
|
|
|
<type>jar</type>
|
|
|
|
</dependency>
|
2014-10-07 18:08:54 -04:00
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hbase</groupId>
|
|
|
|
<artifactId>hbase-annotations</artifactId>
|
2015-06-24 22:10:13 -04:00
|
|
|
<exclusions>
|
|
|
|
<exclusion>
|
|
|
|
<groupId>jdk.tools</groupId>
|
|
|
|
<artifactId>jdk.tools</artifactId>
|
|
|
|
</exclusion>
|
|
|
|
</exclusions>
|
2014-10-07 18:08:54 -04:00
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hbase</groupId>
|
|
|
|
<artifactId>hbase-client</artifactId>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hbase</groupId>
|
|
|
|
<artifactId>hbase-server</artifactId>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hbase</groupId>
|
|
|
|
<artifactId>hbase-hadoop-compat</artifactId>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hbase</groupId>
|
|
|
|
<artifactId>${compat.module}</artifactId>
|
|
|
|
<version>${project.version}</version>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hbase</groupId>
|
|
|
|
<artifactId>hbase-server</artifactId>
|
|
|
|
<type>test-jar</type>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hbase</groupId>
|
|
|
|
<artifactId>hbase-testing-util</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hbase</groupId>
|
|
|
|
<artifactId>hbase-annotations</artifactId>
|
|
|
|
<type>test-jar</type>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
<!-- REST dependencies -->
|
2015-01-21 16:12:57 -05:00
|
|
|
<dependency>
|
|
|
|
<groupId>com.google.guava</groupId>
|
|
|
|
<artifactId>guava</artifactId>
|
|
|
|
</dependency>
|
2014-10-07 18:08:54 -04:00
|
|
|
<dependency>
|
|
|
|
<groupId>com.google.protobuf</groupId>
|
|
|
|
<artifactId>protobuf-java</artifactId>
|
|
|
|
</dependency>
|
2015-01-21 16:12:57 -05:00
|
|
|
<dependency>
|
|
|
|
<groupId>commons-cli</groupId>
|
|
|
|
<artifactId>commons-cli</artifactId>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
2016-05-05 16:41:26 -04:00
|
|
|
<groupId>org.apache.httpcomponents</groupId>
|
|
|
|
<artifactId>httpclient</artifactId>
|
2015-01-21 16:12:57 -05:00
|
|
|
</dependency>
|
2016-08-11 00:28:45 -04:00
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.httpcomponents</groupId>
|
|
|
|
<artifactId>httpcore</artifactId>
|
|
|
|
</dependency>
|
2015-01-21 16:12:57 -05:00
|
|
|
<dependency>
|
|
|
|
<groupId>commons-lang</groupId>
|
|
|
|
<artifactId>commons-lang</artifactId>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>commons-logging</groupId>
|
|
|
|
<artifactId>commons-logging</artifactId>
|
|
|
|
</dependency>
|
2014-10-07 18:08:54 -04:00
|
|
|
<dependency>
|
|
|
|
<groupId>javax.xml.bind</groupId>
|
|
|
|
<artifactId>jaxb-api</artifactId>
|
|
|
|
</dependency>
|
2015-01-21 16:12:57 -05:00
|
|
|
<dependency>
|
2017-01-30 14:54:54 -05:00
|
|
|
<groupId>javax.servlet</groupId>
|
|
|
|
<artifactId>javax.servlet-api</artifactId>
|
2015-01-21 16:12:57 -05:00
|
|
|
</dependency>
|
|
|
|
<dependency>
|
2017-01-30 14:54:54 -05:00
|
|
|
<groupId>org.eclipse.jetty</groupId>
|
|
|
|
<artifactId>jetty-server</artifactId>
|
2015-01-21 16:12:57 -05:00
|
|
|
</dependency>
|
|
|
|
<dependency>
|
2017-01-30 14:54:54 -05:00
|
|
|
<groupId>org.eclipse.jetty</groupId>
|
|
|
|
<artifactId>jetty-servlet</artifactId>
|
2015-01-21 16:12:57 -05:00
|
|
|
</dependency>
|
|
|
|
<dependency>
|
2017-01-30 14:54:54 -05:00
|
|
|
<groupId>org.eclipse.jetty</groupId>
|
|
|
|
<artifactId>jetty-util</artifactId>
|
2015-01-21 16:12:57 -05:00
|
|
|
</dependency>
|
|
|
|
<dependency>
|
2017-01-30 14:54:54 -05:00
|
|
|
<groupId>org.eclipse.jetty</groupId>
|
|
|
|
<artifactId>jetty-http</artifactId>
|
2015-01-21 16:12:57 -05:00
|
|
|
</dependency>
|
|
|
|
<dependency>
|
2017-01-30 14:54:54 -05:00
|
|
|
<groupId>org.eclipse.jetty</groupId>
|
|
|
|
<artifactId>jetty-io</artifactId>
|
2017-01-23 13:46:09 -05:00
|
|
|
</dependency>
|
|
|
|
<dependency>
|
2017-01-30 14:54:54 -05:00
|
|
|
<groupId>org.eclipse.jetty</groupId>
|
|
|
|
<artifactId>jetty-jmx</artifactId>
|
2017-01-23 13:46:09 -05:00
|
|
|
</dependency>
|
|
|
|
<dependency>
|
2017-01-30 14:54:54 -05:00
|
|
|
<groupId>org.eclipse.jetty</groupId>
|
|
|
|
<artifactId>jetty-jsp</artifactId>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.glassfish.jersey.containers</groupId>
|
|
|
|
<artifactId>jersey-container-servlet-core</artifactId>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.glassfish.jersey.media</groupId>
|
|
|
|
<artifactId>jersey-media-json-jackson1</artifactId>
|
2015-01-21 16:12:57 -05:00
|
|
|
</dependency>
|
2014-10-07 18:08:54 -04:00
|
|
|
</dependencies>
|
|
|
|
<profiles>
|
|
|
|
<!-- Skip the tests in this module -->
|
|
|
|
<profile>
|
2014-10-21 12:26:46 -04:00
|
|
|
<id>skipRestTests</id>
|
2014-10-07 18:08:54 -04:00
|
|
|
<activation>
|
|
|
|
<property>
|
|
|
|
<name>skipRestTests</name>
|
|
|
|
</property>
|
|
|
|
</activation>
|
|
|
|
<properties>
|
|
|
|
<surefire.skipFirstPart>true</surefire.skipFirstPart>
|
|
|
|
<surefire.skipSecondPart>true</surefire.skipSecondPart>
|
|
|
|
</properties>
|
|
|
|
</profile>
|
HBASE-15638 Shade protobuf
Which includes
HBASE-16742 Add chapter for devs on how we do protobufs going forward
HBASE-16741 Amend the generate protobufs out-of-band build step
to include shade, pulling in protobuf source and a hook for patching protobuf
Removed ByteStringer from hbase-protocol-shaded. Use the protobuf-3.1.0
trick directly instead. Makes stuff cleaner. All under 'shaded' dir is
now generated.
HBASE-16567 Upgrade to protobuf-3.1.x
Regenerate all protos in this module with protoc3.
Redo ByteStringer to use new pb3.1.0 unsafebytesutil
instead of HBaseZeroCopyByteString
HBASE-16264 Figure how to deal with endpoints and shaded pb Shade our protobufs.
Do it in a manner that makes it so we can still have in our API references to
com.google.protobuf (and in REST). The c.g.p in API is for Coprocessor Endpoints (CPEP)
This patch is Tactic #4 from Shading Doc attached to the referenced issue.
Figuring an appoach took a while because we have Coprocessor Endpoints
mixed in with the core of HBase that are tough to untangle (FIX).
Tactic #4 (the fourth attempt at addressing this issue) is COPY all but
the CPEP .proto files currently in hbase-protocol to a new module named
hbase-protocol-shaded. Generate .protos again in the new location and
then relocate/shade the generated files. Let CPEPs keep on with the
old references at com.google.protobuf.* and
org.apache.hadoop.hbase.protobuf.* but change the hbase core so all
instead refer to the relocated files in their new location at
org.apache.hadoop.hbase.shaded.com.google.protobuf.*.
Let the new module also shade protobufs themselves and change hbase
core to pick up this shaded protobuf rather than directly reference
com.google.protobuf.
This approach allows us to explicitly refer to either the shaded or
non-shaded version of a protobuf class in any particular context (though
usually context dictates one or the other). Core runs on shaded protobuf.
CPEPs continue to use whatever is on the classpath with
com.google.protobuf.* which is pb2.5.0 for the near future at least.
See above cited doc for follow-ons and downsides. In short, IDEs will complain
about not being able to find the shaded protobufs since shading happens at package
time; will fix by checking in all generated classes and relocated protobuf in
a follow-on. Also, CPEPs currently suffer an extra-copy as marshalled from
non-shaded to shaded. To fix. Finally, our .protos are duplicated; once
shaded, and once not. Pain, but how else to reveal our protos to CPEPs or
C++ client that wants to talk with HBase AND shade protobuf.
Details:
Add a new hbase-protocol-shaded module. It is a copy of hbase-protocol
i with all relocated offset from o.a.h.h. to o.a.h.h.shaded. The new module
also includes the relocated pb. It does not include CPEPs. They stay in
their old location.
Add another module hbase-endpoint which has in it all the endpoints
that ship as part of hbase -- at least the ones that are not
entangled with core such as AccessControl and Auth. Move all protos
for these CPEPs here as well as their unit tests (mostly moving a
bunch of stuff out of hbase-server module)
Much of the change looks like this:
-import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
-import org.apache.hadoop.hbase.protobuf.generated.ClusterIdProtos;
+import org.apache.hadoop.hbase.protobuf.shaded.ProtobufUtil;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterIdProtos;
In HTable and in HBaseAdmin, regularize the way Callables are used and also hide
protobuf usage as much as possible moving it up into Callable super classes or out
to utility classes. Still TODO is adding in of retries, etc., but can wait on
procedure which will redo all this.
Also in HTable and HBaseAdmin as well as in HRegionServer and Server, be explicit
when using non-shaded protobuf. Do the full-path so it is clear. This is around
endpoint coprocessors registration of services and execution of CPEP methods.
Shrunk ProtobufUtil by moving methods used by one CPEP only back to the CPEP either
into Client class or as new Util class; e.g. AccessControlUtil.
There are actually two versions of ProtobufUtil now; a shaded one and a subset
that is used by CPEPs doing non-shaded work.
Made it so hbase-common no longer depends on hbase-protocol (with Matteo's help)
R*Converter classes got moved down under shaded package -- they are for internal
use only. There are no non-shaded versions of these classes.
D hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractRegionServerCallable
D RetryingCallableBase
Not used anymore and we have too many tiers of Callables so removed/cleaned-up.
A ClientServicecallable
Had to add this one. RegionServerCallable was made generic so it could be used
for a few Interfaces (Client and Admin). Then added ClientServiceCallable to
implement RegionServerCallable with the Client Interface.
2016-10-04 00:37:32 -04:00
|
|
|
<profile>
|
|
|
|
<id>compile-protobuf</id>
|
|
|
|
<activation>
|
|
|
|
<property>
|
|
|
|
<name>compile-protobuf</name>
|
|
|
|
</property>
|
|
|
|
</activation>
|
|
|
|
<build>
|
|
|
|
<plugins>
|
|
|
|
<plugin>
|
2016-10-27 16:17:59 -04:00
|
|
|
<groupId>org.xolstice.maven.plugins</groupId>
|
|
|
|
<artifactId>protobuf-maven-plugin</artifactId>
|
HBASE-15638 Shade protobuf
Which includes
HBASE-16742 Add chapter for devs on how we do protobufs going forward
HBASE-16741 Amend the generate protobufs out-of-band build step
to include shade, pulling in protobuf source and a hook for patching protobuf
Removed ByteStringer from hbase-protocol-shaded. Use the protobuf-3.1.0
trick directly instead. Makes stuff cleaner. All under 'shaded' dir is
now generated.
HBASE-16567 Upgrade to protobuf-3.1.x
Regenerate all protos in this module with protoc3.
Redo ByteStringer to use new pb3.1.0 unsafebytesutil
instead of HBaseZeroCopyByteString
HBASE-16264 Figure how to deal with endpoints and shaded pb Shade our protobufs.
Do it in a manner that makes it so we can still have in our API references to
com.google.protobuf (and in REST). The c.g.p in API is for Coprocessor Endpoints (CPEP)
This patch is Tactic #4 from Shading Doc attached to the referenced issue.
Figuring an appoach took a while because we have Coprocessor Endpoints
mixed in with the core of HBase that are tough to untangle (FIX).
Tactic #4 (the fourth attempt at addressing this issue) is COPY all but
the CPEP .proto files currently in hbase-protocol to a new module named
hbase-protocol-shaded. Generate .protos again in the new location and
then relocate/shade the generated files. Let CPEPs keep on with the
old references at com.google.protobuf.* and
org.apache.hadoop.hbase.protobuf.* but change the hbase core so all
instead refer to the relocated files in their new location at
org.apache.hadoop.hbase.shaded.com.google.protobuf.*.
Let the new module also shade protobufs themselves and change hbase
core to pick up this shaded protobuf rather than directly reference
com.google.protobuf.
This approach allows us to explicitly refer to either the shaded or
non-shaded version of a protobuf class in any particular context (though
usually context dictates one or the other). Core runs on shaded protobuf.
CPEPs continue to use whatever is on the classpath with
com.google.protobuf.* which is pb2.5.0 for the near future at least.
See above cited doc for follow-ons and downsides. In short, IDEs will complain
about not being able to find the shaded protobufs since shading happens at package
time; will fix by checking in all generated classes and relocated protobuf in
a follow-on. Also, CPEPs currently suffer an extra-copy as marshalled from
non-shaded to shaded. To fix. Finally, our .protos are duplicated; once
shaded, and once not. Pain, but how else to reveal our protos to CPEPs or
C++ client that wants to talk with HBase AND shade protobuf.
Details:
Add a new hbase-protocol-shaded module. It is a copy of hbase-protocol
i with all relocated offset from o.a.h.h. to o.a.h.h.shaded. The new module
also includes the relocated pb. It does not include CPEPs. They stay in
their old location.
Add another module hbase-endpoint which has in it all the endpoints
that ship as part of hbase -- at least the ones that are not
entangled with core such as AccessControl and Auth. Move all protos
for these CPEPs here as well as their unit tests (mostly moving a
bunch of stuff out of hbase-server module)
Much of the change looks like this:
-import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
-import org.apache.hadoop.hbase.protobuf.generated.ClusterIdProtos;
+import org.apache.hadoop.hbase.protobuf.shaded.ProtobufUtil;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterIdProtos;
In HTable and in HBaseAdmin, regularize the way Callables are used and also hide
protobuf usage as much as possible moving it up into Callable super classes or out
to utility classes. Still TODO is adding in of retries, etc., but can wait on
procedure which will redo all this.
Also in HTable and HBaseAdmin as well as in HRegionServer and Server, be explicit
when using non-shaded protobuf. Do the full-path so it is clear. This is around
endpoint coprocessors registration of services and execution of CPEP methods.
Shrunk ProtobufUtil by moving methods used by one CPEP only back to the CPEP either
into Client class or as new Util class; e.g. AccessControlUtil.
There are actually two versions of ProtobufUtil now; a shaded one and a subset
that is used by CPEPs doing non-shaded work.
Made it so hbase-common no longer depends on hbase-protocol (with Matteo's help)
R*Converter classes got moved down under shaded package -- they are for internal
use only. There are no non-shaded versions of these classes.
D hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractRegionServerCallable
D RetryingCallableBase
Not used anymore and we have too many tiers of Callables so removed/cleaned-up.
A ClientServicecallable
Had to add this one. RegionServerCallable was made generic so it could be used
for a few Interfaces (Client and Admin). Then added ClientServiceCallable to
implement RegionServerCallable with the Client Interface.
2016-10-04 00:37:32 -04:00
|
|
|
<executions>
|
|
|
|
<execution>
|
|
|
|
<id>compile-protoc</id>
|
|
|
|
<phase>generate-sources</phase>
|
|
|
|
<goals>
|
2016-10-27 16:17:59 -04:00
|
|
|
<goal>compile</goal>
|
HBASE-15638 Shade protobuf
Which includes
HBASE-16742 Add chapter for devs on how we do protobufs going forward
HBASE-16741 Amend the generate protobufs out-of-band build step
to include shade, pulling in protobuf source and a hook for patching protobuf
Removed ByteStringer from hbase-protocol-shaded. Use the protobuf-3.1.0
trick directly instead. Makes stuff cleaner. All under 'shaded' dir is
now generated.
HBASE-16567 Upgrade to protobuf-3.1.x
Regenerate all protos in this module with protoc3.
Redo ByteStringer to use new pb3.1.0 unsafebytesutil
instead of HBaseZeroCopyByteString
HBASE-16264 Figure how to deal with endpoints and shaded pb Shade our protobufs.
Do it in a manner that makes it so we can still have in our API references to
com.google.protobuf (and in REST). The c.g.p in API is for Coprocessor Endpoints (CPEP)
This patch is Tactic #4 from Shading Doc attached to the referenced issue.
Figuring an appoach took a while because we have Coprocessor Endpoints
mixed in with the core of HBase that are tough to untangle (FIX).
Tactic #4 (the fourth attempt at addressing this issue) is COPY all but
the CPEP .proto files currently in hbase-protocol to a new module named
hbase-protocol-shaded. Generate .protos again in the new location and
then relocate/shade the generated files. Let CPEPs keep on with the
old references at com.google.protobuf.* and
org.apache.hadoop.hbase.protobuf.* but change the hbase core so all
instead refer to the relocated files in their new location at
org.apache.hadoop.hbase.shaded.com.google.protobuf.*.
Let the new module also shade protobufs themselves and change hbase
core to pick up this shaded protobuf rather than directly reference
com.google.protobuf.
This approach allows us to explicitly refer to either the shaded or
non-shaded version of a protobuf class in any particular context (though
usually context dictates one or the other). Core runs on shaded protobuf.
CPEPs continue to use whatever is on the classpath with
com.google.protobuf.* which is pb2.5.0 for the near future at least.
See above cited doc for follow-ons and downsides. In short, IDEs will complain
about not being able to find the shaded protobufs since shading happens at package
time; will fix by checking in all generated classes and relocated protobuf in
a follow-on. Also, CPEPs currently suffer an extra-copy as marshalled from
non-shaded to shaded. To fix. Finally, our .protos are duplicated; once
shaded, and once not. Pain, but how else to reveal our protos to CPEPs or
C++ client that wants to talk with HBase AND shade protobuf.
Details:
Add a new hbase-protocol-shaded module. It is a copy of hbase-protocol
i with all relocated offset from o.a.h.h. to o.a.h.h.shaded. The new module
also includes the relocated pb. It does not include CPEPs. They stay in
their old location.
Add another module hbase-endpoint which has in it all the endpoints
that ship as part of hbase -- at least the ones that are not
entangled with core such as AccessControl and Auth. Move all protos
for these CPEPs here as well as their unit tests (mostly moving a
bunch of stuff out of hbase-server module)
Much of the change looks like this:
-import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
-import org.apache.hadoop.hbase.protobuf.generated.ClusterIdProtos;
+import org.apache.hadoop.hbase.protobuf.shaded.ProtobufUtil;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterIdProtos;
In HTable and in HBaseAdmin, regularize the way Callables are used and also hide
protobuf usage as much as possible moving it up into Callable super classes or out
to utility classes. Still TODO is adding in of retries, etc., but can wait on
procedure which will redo all this.
Also in HTable and HBaseAdmin as well as in HRegionServer and Server, be explicit
when using non-shaded protobuf. Do the full-path so it is clear. This is around
endpoint coprocessors registration of services and execution of CPEP methods.
Shrunk ProtobufUtil by moving methods used by one CPEP only back to the CPEP either
into Client class or as new Util class; e.g. AccessControlUtil.
There are actually two versions of ProtobufUtil now; a shaded one and a subset
that is used by CPEPs doing non-shaded work.
Made it so hbase-common no longer depends on hbase-protocol (with Matteo's help)
R*Converter classes got moved down under shaded package -- they are for internal
use only. There are no non-shaded versions of these classes.
D hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractRegionServerCallable
D RetryingCallableBase
Not used anymore and we have too many tiers of Callables so removed/cleaned-up.
A ClientServicecallable
Had to add this one. RegionServerCallable was made generic so it could be used
for a few Interfaces (Client and Admin). Then added ClientServiceCallable to
implement RegionServerCallable with the Client Interface.
2016-10-04 00:37:32 -04:00
|
|
|
</goals>
|
|
|
|
</execution>
|
|
|
|
</executions>
|
|
|
|
</plugin>
|
|
|
|
</plugins>
|
|
|
|
</build>
|
|
|
|
</profile>
|
2015-01-21 16:12:57 -05:00
|
|
|
<!-- Hadoop-specific dependencies -->
|
|
|
|
<!-- profile for building against Hadoop 2.0.x
|
|
|
|
This is the default.
|
|
|
|
-->
|
|
|
|
<profile>
|
|
|
|
<id>hadoop-2.0</id>
|
|
|
|
<activation>
|
|
|
|
<property>
|
|
|
|
<!--Below formatting for dev-support/generate-hadoopX-poms.sh-->
|
|
|
|
<!--h2--><name>!hadoop.profile</name>
|
|
|
|
</property>
|
|
|
|
</activation>
|
|
|
|
<dependencies>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hadoop</groupId>
|
|
|
|
<artifactId>hadoop-mapreduce-client-core</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hadoop</groupId>
|
|
|
|
<artifactId>hadoop-common</artifactId>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hadoop</groupId>
|
|
|
|
<artifactId>hadoop-auth</artifactId>
|
|
|
|
</dependency>
|
|
|
|
</dependencies>
|
|
|
|
</profile>
|
|
|
|
<!--
|
|
|
|
profile for building against Hadoop 3.0.0. Activate using:
|
|
|
|
mvn -Dhadoop.profile=3.0
|
|
|
|
-->
|
|
|
|
<profile>
|
|
|
|
<id>hadoop-3.0</id>
|
|
|
|
<activation>
|
|
|
|
<property>
|
|
|
|
<name>hadoop.profile</name>
|
|
|
|
<value>3.0</value>
|
|
|
|
</property>
|
|
|
|
</activation>
|
|
|
|
<dependencies>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hadoop</groupId>
|
|
|
|
<artifactId>hadoop-mapreduce-client-core</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hadoop</groupId>
|
|
|
|
<artifactId>hadoop-common</artifactId>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.hadoop</groupId>
|
|
|
|
<artifactId>hadoop-auth</artifactId>
|
|
|
|
</dependency>
|
|
|
|
</dependencies>
|
|
|
|
</profile>
|
2014-10-07 18:08:54 -04:00
|
|
|
</profiles>
|
|
|
|
</project>
|