Skip to content

Commit a27ca11

Browse files
deps: clean up deps in replication client (#4235)
* deps: clean up deps in replication client Change-Id: Iffdb1e6e12712b3e6305a3fbbddadbce3ccca546 * oops Change-Id: If9e7f58c37a5439a4dfac91084642461daf651c9 * drop explicit deps on bigtable Change-Id: I68ba8c38c99ca3b6891f54dc7dab34eb0d88fdbb * make bigtable-hbase bridge a runtime dep Change-Id: I6f241142a2b5f572c546845d39cb1d3b83461239 * undo runtime config Change-Id: Id37e323322f76a0df9086a031b373555c2fd8078
1 parent 5f98419 commit a27ca11

File tree

15 files changed

+226
-265
lines changed

15 files changed

+226
-265
lines changed

hbase-migration-tools/bigtable-hbase-replication/bigtable-hbase-1.x-replication/pom.xml

Lines changed: 86 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -34,53 +34,68 @@ limitations under the License.
3434
Bigtable.
3535
</description>
3636

37-
<properties>
38-
<!-- define a property that can be ignored by renovate -->
39-
<hbase1-hadoop-slf4j.version>1.6.1</hbase1-hadoop-slf4j.version>
40-
</properties>
41-
4237
<build>
38+
<pluginManagement>
39+
<plugins>
40+
<!-- disable google-cloud-shared-config enforcement checks because
41+
hbase-client's dependency subtree doesn't follow the same rules and is
42+
unable to be fixed here -->
43+
<plugin>
44+
<groupId>org.apache.maven.plugins</groupId>
45+
<artifactId>maven-enforcer-plugin</artifactId>
46+
<executions>
47+
<execution>
48+
<id>enforce</id>
49+
<!-- requireUpperBoundDeps, banDuplicateClasses -->
50+
<configuration>
51+
<skip>true</skip>
52+
</configuration>
53+
</execution>
54+
55+
<!-- This must be a drop in replacement for hbase-client, so can't
56+
manage hbase's deps -->
57+
<execution>
58+
<id>enforce-banned-deps</id>
59+
<goals>
60+
<goal>enforce</goal>
61+
</goals>
62+
<configuration>
63+
<skip>true</skip>
64+
</configuration>
65+
</execution>
66+
<execution>
67+
<id>enforce-version-consistency-slf4j</id>
68+
<configuration>
69+
<skip>true</skip>
70+
</configuration>
71+
</execution>
72+
</executions>
73+
</plugin>
74+
</plugins>
75+
</pluginManagement>
76+
4377
<plugins>
4478
<plugin>
45-
<groupId>org.apache.maven.plugins</groupId>
46-
<artifactId>maven-enforcer-plugin</artifactId>
79+
<groupId>com.google.cloud.bigtable.test</groupId>
80+
<artifactId>bigtable-build-helper</artifactId>
81+
<version>2.12.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-client-parent:current} -->
4782
<executions>
48-
<!-- disable google-cloud-shared-config enforcement checks because
49-
hbase-client's dependency subtree doesn't follow the same rules and is
50-
unable to be fixed here -->
51-
<execution>
52-
<id>enforce</id>
53-
<configuration>
54-
<skip>true</skip>
55-
</configuration>
56-
</execution>
57-
<!-- This must be a drop in replacement for hbase-client, so can't
58-
manage hbase's deps -->
59-
<execution>
60-
<id>enforce-banned-deps</id>
61-
<goals>
62-
<goal>enforce</goal>
63-
</goals>
64-
<configuration>
65-
<skip>true</skip>
66-
</configuration>
67-
</execution>
6883
<execution>
69-
<id>enforce-java</id>
84+
<id>verify-mirror-deps-hbase</id>
85+
<phase>verify</phase>
7086
<goals>
71-
<goal>enforce</goal>
87+
<goal>verify-mirror-deps</goal>
7288
</goals>
7389
<configuration>
74-
<rules>
75-
<requireJavaVersion>
76-
<version>[1.8,)</version>
77-
</requireJavaVersion>
78-
</rules>
90+
<targetDependencies>
91+
<targetDependency>org.apache.hbase:hbase-server</targetDependency>
92+
</targetDependencies>
7993
</configuration>
8094
</execution>
8195
</executions>
8296
</plugin>
8397
<plugin>
98+
<groupId>org.apache.maven.plugins</groupId>
8499
<artifactId>maven-assembly-plugin</artifactId>
85100
<version>3.3.0</version>
86101
<executions>
@@ -109,55 +124,69 @@ limitations under the License.
109124
</goals>
110125
<configuration>
111126
<shadedArtifactAttached>false</shadedArtifactAttached>
127+
<transformers>
128+
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
129+
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"/>
130+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
131+
</transformers>
112132
</configuration>
113133
</execution>
114134
</executions>
115135
</plugin>
116136
</plugins>
117137
</build>
138+
118139
<dependencies>
119-
<!-- bigtable libs for org.apache.hadoop.hbase -->
140+
<dependency>
141+
<groupId>org.apache.hbase</groupId>
142+
<artifactId>hbase-server</artifactId>
143+
<version>${hbase1.version}</version>
144+
<!-- The library is running on the HBase region server,-->
145+
<!-- use the HBase server from the HBase environment-->
146+
<scope>provided</scope>
147+
</dependency>
148+
120149
<dependency>
121150
<groupId>com.google.cloud.bigtable</groupId>
122151
<artifactId>bigtable-hbase-replication-core</artifactId>
123152
<version>1.11.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-hbase-replication:current} -->
124153
<exclusions>
125-
<!-- HBase dependencies come from hbase-server below. Skip them here.-->
126154
<exclusion>
127155
<groupId>org.apache.hbase</groupId>
128156
<artifactId>hbase-client</artifactId>
129157
</exclusion>
158+
<exclusion>
159+
<groupId>com.google.cloud.bigtable</groupId>
160+
<artifactId>bigtable-hbase-1.x-hadoop</artifactId>
161+
</exclusion>
130162
</exclusions>
131163
</dependency>
132164
<dependency>
133-
<groupId>org.apache.hbase</groupId>
134-
<artifactId>hbase-server</artifactId>
135-
<version>${hbase1.version}</version>
136-
<!-- The library is running on the HBase region server,-->
137-
<!-- use the HBase server from the HBase environment-->
138-
<scope>provided</scope>
139-
</dependency>
140-
<!-- Versions conflict within HBase, enforce same versions but let
141-
them come from hbase-server to avoid version conflicts-->
142-
<dependency>
143-
<groupId>org.slf4j</groupId>
144-
<artifactId>slf4j-api</artifactId>
145-
<version>${hbase1-hadoop-slf4j.version}</version>
146-
<scope>provided</scope>
147-
</dependency>
148-
<dependency>
149-
<groupId>org.slf4j</groupId>
150-
<artifactId>slf4j-log4j12</artifactId>
151-
<version>${hbase1-hadoop-slf4j.version}</version>
152-
<scope>provided</scope>
165+
<groupId>com.google.cloud.bigtable</groupId>
166+
<artifactId>bigtable-hbase-1.x-hadoop</artifactId>
167+
<version>2.12.1-SNAPSHOT</version> <!-- {x-version-update:bigtable-client-parent:current} -->
168+
<exclusions>
169+
<!-- HBase dependencies come from hbase-server below. Skip them here.-->
170+
<exclusion>
171+
<groupId>org.apache.hbase</groupId>
172+
<artifactId>hbase-client</artifactId>
173+
</exclusion>
174+
</exclusions>
153175
</dependency>
154176

155-
<!-- test dependencies -->
177+
<!--Test dependencies-->
156178
<dependency>
157179
<groupId>org.apache.hbase</groupId>
158180
<artifactId>hbase-testing-util</artifactId>
159181
<version>${hbase1.version}</version>
160182
<scope>test</scope>
183+
<exclusions>
184+
<exclusion>
185+
<!-- Prevent test util from overriding the version from hbase-server -->
186+
<groupId>org.slf4j</groupId>
187+
<artifactId>slf4j-log4j12</artifactId>
188+
</exclusion>
189+
</exclusions>
161190
</dependency>
162191
<dependency>
163192
<groupId>com.google.cloud</groupId>

hbase-migration-tools/bigtable-hbase-replication/bigtable-hbase-1.x-replication/src/main/java/com/google/cloud/bigtable/hbase1_x/replication/HbaseToCloudBigtableReplicationEndpoint.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// TODO reverse the package names for 1.x and 2.x to com.google.cloud.bigtable.replication.hbase1_x
1717
package com.google.cloud.bigtable.hbase1_x.replication;
1818

19-
import com.google.bigtable.repackaged.com.google.api.core.InternalExtensionOnly;
2019
import com.google.cloud.bigtable.hbase.replication.CloudBigtableReplicator;
2120
import com.google.cloud.bigtable.hbase.replication.adapters.BigtableWALEntry;
2221
import com.google.cloud.bigtable.hbase1_x.replication.metrics.HBaseMetricsExporter;
@@ -28,8 +27,11 @@
2827
import org.apache.hadoop.hbase.replication.BaseReplicationEndpoint;
2928
import org.apache.hadoop.hbase.wal.WAL;
3029

31-
/** Basic endpoint that listens to CDC from HBase 1.x and replicates to Cloud Bigtable. */
32-
@InternalExtensionOnly
30+
/**
31+
* Basic endpoint that listens to CDC from HBase 1.x and replicates to Cloud Bigtable.
32+
*
33+
* <p>This class is only public for instantiation, and should not be subclassed.
34+
*/
3335
public class HbaseToCloudBigtableReplicationEndpoint extends BaseReplicationEndpoint {
3436

3537
private final CloudBigtableReplicator cloudBigtableReplicator;

hbase-migration-tools/bigtable-hbase-replication/bigtable-hbase-1.x-replication/src/main/java/com/google/cloud/bigtable/hbase1_x/replication/metrics/HBaseMetricsExporter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,21 @@
1616

1717
package com.google.cloud.bigtable.hbase1_x.replication.metrics;
1818

19-
import com.google.bigtable.repackaged.com.google.api.core.InternalApi;
20-
import com.google.bigtable.repackaged.com.google.api.core.InternalExtensionOnly;
2119
import com.google.cloud.bigtable.hbase.replication.metrics.MetricsExporter;
2220
import java.lang.reflect.Method;
21+
import org.apache.hadoop.hbase.classification.InterfaceAudience;
2322
import org.apache.hadoop.hbase.replication.ReplicationEndpoint.Context;
2423
import org.apache.hadoop.hbase.replication.regionserver.MetricsSource;
2524
import org.slf4j.Logger;
2625
import org.slf4j.LoggerFactory;
2726

2827
/** HBaseMetricsExporter implements MetricExporter which bridges with MetricsSource. */
29-
@InternalApi
28+
@InterfaceAudience.Private
3029
public class HBaseMetricsExporter implements MetricsExporter {
3130

3231
private static final Logger LOG = LoggerFactory.getLogger(HBaseMetricsExporter.class);
3332

3433
// Force the use of static factory method to create instances.
35-
@InternalExtensionOnly
3634
protected HBaseMetricsExporter() {}
3735

3836
// same pattern as used by HbaseInterClusterRepl

hbase-migration-tools/bigtable-hbase-replication/bigtable-hbase-1.x-replication/src/main/java/com/google/cloud/bigtable/hbase1_x/replication/metrics/NoOpHBaseMetricsExporter.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,13 @@
1616

1717
package com.google.cloud.bigtable.hbase1_x.replication.metrics;
1818

19-
import com.google.bigtable.repackaged.com.google.api.core.InternalApi;
20-
2119
/**
2220
* No-op implemnentation of MetricsExporter interface. To be used where incCounters method from
2321
* HBase MetricsSource is not available.
2422
*/
25-
@InternalApi
26-
public class NoOpHBaseMetricsExporter extends HBaseMetricsExporter {
23+
class NoOpHBaseMetricsExporter extends HBaseMetricsExporter {
2724

2825
// Use the HBaseMetricsExporter.create method to create instances of this class.
29-
@InternalApi
3026
NoOpHBaseMetricsExporter() {}
3127

3228
@Override

0 commit comments

Comments
 (0)