Skip to content

Commit 7e36520

Browse files
authored
HBASE-28726 Revert REST protobuf package to org.apache.hadoop.hbase.rest (#6408)
also move REST protobuf definition files a generated classes back to hbase-rest Signed-off-by: Duo Zhang <[email protected]>
1 parent 1662ad8 commit 7e36520

24 files changed

+98
-73
lines changed

hbase-protocol-shaded/pom.xml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
<description>Shaded protobuf protocol classes used by HBase internally.</description>
3232
<properties>
3333
<maven.javadoc.skip>true</maven.javadoc.skip>
34-
<!--
35-
Version of protobuf that hbase uses internally (we shade our pb) Must match what is out
36-
in hbase-thirdparty include.
37-
-->
38-
<internal.protobuf.version>4.28.2</internal.protobuf.version>
3934
</properties>
4035
<dependencies>
4136
<!--BE CAREFUL! Any dependency added here needs to be
@@ -110,39 +105,6 @@
110105
<plugin>
111106
<groupId>com.google.code.maven-replacer-plugin</groupId>
112107
<artifactId>replacer</artifactId>
113-
<version>1.5.3</version>
114-
<configuration>
115-
<basedir>${basedir}/target/generated-sources/</basedir>
116-
<includes>
117-
<include>**/*.java</include>
118-
</includes>
119-
<!-- Ignore errors when missing files, because it means this build
120-
was run with -Dprotoc.skip and there is no -Dreplacer.skip -->
121-
<ignoreErrors>true</ignoreErrors>
122-
<replacements>
123-
<replacement>
124-
<token>([^\.])com.google.protobuf</token>
125-
<value>$1org.apache.hbase.thirdparty.com.google.protobuf</value>
126-
</replacement>
127-
<replacement>
128-
<token>(public)(\W+static)?(\W+final)?(\W+class)</token>
129-
<value>@javax.annotation.Generated("proto") $1$2$3$4</value>
130-
</replacement>
131-
<!-- replacer doesn't support anchoring or negative lookbehind -->
132-
<replacement>
133-
<token>(@javax.annotation.Generated\("proto"\) ){2}</token>
134-
<value>$1</value>
135-
</replacement>
136-
</replacements>
137-
</configuration>
138-
<executions>
139-
<execution>
140-
<goals>
141-
<goal>replace</goal>
142-
</goals>
143-
<phase>process-sources</phase>
144-
</execution>
145-
</executions>
146108
</plugin>
147109
<plugin>
148110
<groupId>org.apache.maven.plugins</groupId>

hbase-rest/pom.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,29 @@
355355
</systemPropertyVariables>
356356
</configuration>
357357
</plugin>
358+
<!-- The protobuf-maven-plugin and com.google.code.maven-replacer-plugin config
359+
is copied directly from hbase-shaded-protocol, and should be kept in sync. -->
360+
<plugin>
361+
<groupId>org.xolstice.maven.plugins</groupId>
362+
<artifactId>protobuf-maven-plugin</artifactId>
363+
<executions>
364+
<execution>
365+
<id>compile-protoc</id>
366+
<goals>
367+
<goal>compile</goal>
368+
</goals>
369+
<phase>generate-sources</phase>
370+
<configuration>
371+
<protocArtifact>com.google.protobuf:protoc:${internal.protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
372+
<checkStaleness>true</checkStaleness>
373+
</configuration>
374+
</execution>
375+
</executions>
376+
</plugin>
377+
<plugin>
378+
<groupId>com.google.code.maven-replacer-plugin</groupId>
379+
<artifactId>replacer</artifactId>
380+
</plugin>
358381
<plugin>
359382
<groupId>net.revelc.code</groupId>
360383
<artifactId>warbucks-maven-plugin</artifactId>

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/CellModel.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@
3535
import org.apache.hadoop.hbase.HConstants;
3636
import org.apache.hadoop.hbase.rest.ProtobufMessageHandler;
3737
import org.apache.hadoop.hbase.rest.RestUtil;
38+
import org.apache.hadoop.hbase.rest.protobuf.generated.CellMessage.Cell;
3839
import org.apache.yetus.audience.InterfaceAudience;
3940

4041
import org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream;
4142
import org.apache.hbase.thirdparty.com.google.protobuf.Message;
4243
import org.apache.hbase.thirdparty.com.google.protobuf.UnsafeByteOperations;
4344

44-
import org.apache.hadoop.hbase.shaded.rest.protobuf.generated.CellMessage.Cell;
45-
4645
/**
4746
* Representation of a cell. A cell is a single value associated a column and optional qualifier,
4847
* and either the timestamp when it was stored or the user- provided timestamp if one was explicitly

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/CellSetModel.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,14 @@
3030
import org.apache.hadoop.hbase.HConstants;
3131
import org.apache.hadoop.hbase.rest.ProtobufMessageHandler;
3232
import org.apache.hadoop.hbase.rest.RestUtil;
33+
import org.apache.hadoop.hbase.rest.protobuf.generated.CellMessage.Cell;
34+
import org.apache.hadoop.hbase.rest.protobuf.generated.CellSetMessage.CellSet;
3335
import org.apache.yetus.audience.InterfaceAudience;
3436

3537
import org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream;
3638
import org.apache.hbase.thirdparty.com.google.protobuf.Message;
3739
import org.apache.hbase.thirdparty.com.google.protobuf.UnsafeByteOperations;
3840

39-
import org.apache.hadoop.hbase.shaded.rest.protobuf.generated.CellMessage.Cell;
40-
import org.apache.hadoop.hbase.shaded.rest.protobuf.generated.CellSetMessage.CellSet;
41-
4241
/**
4342
* Representation of a grouping of cells. May contain cells from more than one row. Encapsulates
4443
* RowModel and CellModel models.

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/NamespacesInstanceModel.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@
3030
import org.apache.hadoop.hbase.client.Admin;
3131
import org.apache.hadoop.hbase.rest.ProtobufMessageHandler;
3232
import org.apache.hadoop.hbase.rest.RestUtil;
33+
import org.apache.hadoop.hbase.rest.protobuf.generated.NamespacePropertiesMessage.NamespaceProperties;
3334
import org.apache.yetus.audience.InterfaceAudience;
3435

3536
import org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream;
3637
import org.apache.hbase.thirdparty.com.google.protobuf.Message;
3738

38-
import org.apache.hadoop.hbase.shaded.rest.protobuf.generated.NamespacePropertiesMessage.NamespaceProperties;
39-
4039
/**
4140
* List a HBase namespace's key/value properties.
4241
* <ul>

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/NamespacesModel.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@
3030
import org.apache.hadoop.hbase.client.Admin;
3131
import org.apache.hadoop.hbase.rest.ProtobufMessageHandler;
3232
import org.apache.hadoop.hbase.rest.RestUtil;
33+
import org.apache.hadoop.hbase.rest.protobuf.generated.NamespacesMessage.Namespaces;
3334
import org.apache.yetus.audience.InterfaceAudience;
3435

3536
import org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream;
3637
import org.apache.hbase.thirdparty.com.google.protobuf.Message;
3738

38-
import org.apache.hadoop.hbase.shaded.rest.protobuf.generated.NamespacesMessage.Namespaces;
39-
4039
/**
4140
* A list of HBase namespaces.
4241
* <ul>

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
import org.apache.hadoop.hbase.filter.WhileMatchFilter;
7070
import org.apache.hadoop.hbase.rest.ProtobufMessageHandler;
7171
import org.apache.hadoop.hbase.rest.RestUtil;
72+
import org.apache.hadoop.hbase.rest.protobuf.generated.ScannerMessage.Scanner;
7273
import org.apache.hadoop.hbase.security.visibility.Authorizations;
7374
import org.apache.hadoop.hbase.util.Bytes;
7475
import org.apache.hadoop.hbase.util.Pair;
@@ -81,8 +82,6 @@
8182
import org.apache.hbase.thirdparty.com.google.protobuf.UnsafeByteOperations;
8283
import org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType;
8384

84-
import org.apache.hadoop.hbase.shaded.rest.protobuf.generated.ScannerMessage.Scanner;
85-
8685
/**
8786
* A representation of Scanner parameters.
8887
*

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/StorageClusterStatusModel.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@
2828
import javax.xml.bind.annotation.XmlRootElement;
2929
import org.apache.hadoop.hbase.rest.ProtobufMessageHandler;
3030
import org.apache.hadoop.hbase.rest.RestUtil;
31+
import org.apache.hadoop.hbase.rest.protobuf.generated.StorageClusterStatusMessage.StorageClusterStatus;
3132
import org.apache.hadoop.hbase.util.Bytes;
3233
import org.apache.yetus.audience.InterfaceAudience;
3334

3435
import org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream;
3536
import org.apache.hbase.thirdparty.com.google.protobuf.Message;
3637
import org.apache.hbase.thirdparty.com.google.protobuf.UnsafeByteOperations;
3738

38-
import org.apache.hadoop.hbase.shaded.rest.protobuf.generated.StorageClusterStatusMessage.StorageClusterStatus;
39-
4039
/**
4140
* Representation of the status of a storage cluster:
4241
* <p>

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/TableInfoModel.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@
2626
import javax.xml.bind.annotation.XmlRootElement;
2727
import org.apache.hadoop.hbase.rest.ProtobufMessageHandler;
2828
import org.apache.hadoop.hbase.rest.RestUtil;
29+
import org.apache.hadoop.hbase.rest.protobuf.generated.TableInfoMessage.TableInfo;
2930
import org.apache.yetus.audience.InterfaceAudience;
3031

3132
import org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream;
3233
import org.apache.hbase.thirdparty.com.google.protobuf.Message;
3334
import org.apache.hbase.thirdparty.com.google.protobuf.UnsafeByteOperations;
3435

35-
import org.apache.hadoop.hbase.shaded.rest.protobuf.generated.TableInfoMessage.TableInfo;
36-
3736
/**
3837
* Representation of a list of table regions.
3938
*

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/TableListModel.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
import javax.xml.bind.annotation.XmlRootElement;
2626
import org.apache.hadoop.hbase.rest.ProtobufMessageHandler;
2727
import org.apache.hadoop.hbase.rest.RestUtil;
28+
import org.apache.hadoop.hbase.rest.protobuf.generated.TableListMessage.TableList;
2829
import org.apache.yetus.audience.InterfaceAudience;
2930

3031
import org.apache.hbase.thirdparty.com.google.protobuf.CodedInputStream;
3132
import org.apache.hbase.thirdparty.com.google.protobuf.Message;
3233

33-
import org.apache.hadoop.hbase.shaded.rest.protobuf.generated.TableListMessage.TableList;
34-
3534
/**
3635
* Simple representation of a list of table names.
3736
*/

0 commit comments

Comments
 (0)