Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phoenix 7164 HBase 3 support WIP #1815

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions dev/replace_sources_with_relocated.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

# This script replaces the normal sources with the ones where the packages are replaced for HBase 3.0
# The purpose is to enable debugging from an IDE without having to change the source directory settings
# Make sure to never commit the changes this script makes.

# Usage:
# 1. Activate the Hadoop3 maven profile in your ide (and deactive the default)
# 2. Make sure that you have no uncommitted changes
# 3. Run "mvn clean package -am -pl phoenix-core -Dhbase.profile=3.0 -DskipTests"
# 4. Run this script
# 5. Work with the source in the IDE
# 6. get a diff of your fixes
# 7. Run "git reset --hard"
# 8. Re-apply your changes.

orig_dir=$(pwd)
cd "$(dirname "$0")"/..
cp -r phoenix-core/target/generated-sources/replaced/* phoenix-core/src
cp -r phoenix-core-client/target/generated-sources/replaced/* phoenix-core-client/src
cp -r phoenix-core-server/target/generated-sources/replaced/* phoenix-core-server/src

cd $orig_dir
5 changes: 5 additions & 0 deletions phoenix-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@
<artifactId>phoenix-hbase-compat-2.5.4</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.phoenix</groupId>
<artifactId>phoenix-hbase-compat-2.6.0</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>
Expand Down
187 changes: 178 additions & 9 deletions phoenix-core-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<description>Core Phoenix Client codebase</description>

<build>
<sourceDirectory>does/not/exist</sourceDirectory>

<plugins>
<!-- Add the ant-generated sources to the source path -->
<plugin>
Expand Down Expand Up @@ -66,6 +68,13 @@
|| ("${hbase.compat.version}".equals("2.5.4")
&amp;&amp; hbaseMinor == 5
&amp;&amp; hbasePatch &gt;=4)
|| ("${hbase.compat.version}".equals("2.6.0")
&amp;&amp; hbaseMinor == 6
&amp;&amp; hbasePatch &gt;=0)
) || hbaseMajor == 3 &amp;&amp; (
("${hbase.compat.version}".equals("3.0.0")
&amp;&amp; hbaseMinor == 0
&amp;&amp; hbasePatch &gt;=0)
)
</condition>
</evaluateBeanshell>
Expand All @@ -86,7 +95,7 @@
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<id>add-antlr-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
Expand All @@ -98,6 +107,18 @@
</sources>
</configuration>
</execution>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/src/main/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Compile the antlr sources -->
Expand Down Expand Up @@ -248,18 +269,10 @@
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-hadoop-compat</artifactId>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-hadoop2-compat</artifactId>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-zookeeper</artifactId>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-protocol</artifactId>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-protocol-shaded</artifactId>
Expand Down Expand Up @@ -424,4 +437,160 @@
<artifactId>HdrHistogram</artifactId>
</dependency>
</dependencies>
<profiles>
<profile>
<id>phoenix-hbase-compat-3.0.0</id>
<activation>
<property>
<name>hbase.profile</name>
<value>3.0</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<executions>
<execution>
<id>replace-generated-sources</id>

<phase>process-sources</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<basedir>${basedir}/target/generated-sources/protobuf</basedir>
<includes>
<include>**/*.java</include>
</includes>
<ignoreErrors>true</ignoreErrors>
<replacements>
<replacement>
<token>([^\.])com.google.protobuf</token>
<value>$1org.apache.hbase.thirdparty.com.google.protobuf</value>
</replacement>
<replacement>
<token>([^\.])org.apache.hadoop.hbase.protobuf.generated</token>
<value>$1org.apache.hadoop.hbase.shaded.protobuf.generated</value>
</replacement>
</replacements>
</configuration>
</execution>
<execution>
<id>replace-sources</id>
<phase>process-sources</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<basedir>${basedir}/src</basedir>
<outputDir>../target/generated-sources/replaced</outputDir>
<includes>
<include>**/*.java</include>
</includes>
<!-- Omid uses unshaded protobuf 3 -->
<excludes>
<exclude>**/OmidTransactionContext*.java</exclude>
</excludes>
<!-- Ignore errors when missing files, because it means this build
was run with -Dprotoc.skip and there is no -Dreplacer.skip -->
<!-- <ignoreErrors>true</ignoreErrors>-->
<replacements>
<replacement>
<token>([^\.])com.google.protobuf</token>
<value>$1org.apache.hbase.thirdparty.com.google.protobuf</value>
</replacement>
<replacement>
<token>([^\.])org.apache.hadoop.hbase.protobuf.generated</token>
<value>$1org.apache.hadoop.hbase.shaded.protobuf.generated</value>
</replacement>
</replacements>
</configuration>
</execution>
<execution>
<id>copy-sources</id>
<phase>process-sources</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<basedir>${basedir}/src</basedir>
<outputDir>../target/generated-sources/replaced</outputDir>
<!-- Copy Omid files without change -->
<includes>
<include>**/OmidTransactionContext*.java</include>
</includes>
<!-- Ignore errors when missing files, because it means this build
was run with -Dprotoc.skip and there is no -Dreplacer.skip -->
<!-- <ignoreErrors>true</ignoreErrors>-->
<replacements>
<!-- Just copy -->
</replacements>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>

<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/target/generated-sources/replaced/main/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-antlr-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${antlr-output.dir}</source>
<source>${antlr-input.dir}</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-it-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/target/generated-sources/replaced/it/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-it-resource</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${basedir}/target/generated-sources/replaced/it/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.phoenix.query.QueryServices;
import org.apache.phoenix.query.QueryServicesOptions;

import com.google.protobuf.RpcController;
import org.apache.phoenix.util.IndexUtil;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.apache.phoenix.util.SchemaUtil;

import org.apache.phoenix.thirdparty.com.google.common.collect.ImmutableList;
import com.google.protobuf.RpcController;

/**
* {@link RpcController} that sets the appropriate priority of RPC calls destined for Phoenix SYSTEM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.ipc.CoprocessorRpcUtils.BlockingRpcCallback;
import org.apache.hadoop.hbase.ipc.ServerRpcController;
import org.apache.hadoop.hbase.util.ByteStringer;
import org.apache.phoenix.compat.hbase.ByteStringer;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.phoenix.compile.QueryPlan;
import org.apache.phoenix.compile.ScanRanges;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.NavigableMap;
import java.util.TreeMap;

import org.apache.hadoop.hbase.util.ByteStringer;
import org.apache.phoenix.compat.hbase.ByteStringer;
import org.apache.phoenix.coprocessor.generated.MetaDataProtos;
import org.apache.phoenix.coprocessor.generated.MetaDataProtos.MetaDataResponse;
import org.apache.phoenix.coprocessor.generated.MetaDataProtos.MetaDataService;
Expand Down
Loading