Skip to content

Commit f9767f5

Browse files
committed
HBASE-25864 Use shaded javax.ws.rs package classes
Adapt to the changes provided by apache/hbase-thirdparty#51
1 parent 44d5624 commit f9767f5

37 files changed

+236
-338
lines changed

hbase-http/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@
179179
<groupId>javax.servlet</groupId>
180180
<artifactId>javax.servlet-api</artifactId>
181181
</dependency>
182-
<dependency>
183-
<groupId>javax.ws.rs</groupId>
184-
<artifactId>javax.ws.rs-api</artifactId>
185-
</dependency>
186182
<dependency>
187183
<groupId>com.github.stephenc.findbugs</groupId>
188184
<artifactId>findbugs-annotations</artifactId>

hbase-http/src/test/java/org/apache/hadoop/hbase/http/resource/JerseyResource.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*
22
* Licensed to the Apache Software Foundation (ASF) under one
33
* or more contributor license agreements. See the NOTICE file
44
* distributed with this work for additional information
@@ -20,17 +20,16 @@
2020
import java.io.IOException;
2121
import java.util.Map;
2222
import java.util.TreeMap;
23-
import javax.ws.rs.DefaultValue;
24-
import javax.ws.rs.GET;
25-
import javax.ws.rs.Path;
26-
import javax.ws.rs.PathParam;
27-
import javax.ws.rs.Produces;
28-
import javax.ws.rs.QueryParam;
29-
import javax.ws.rs.core.MediaType;
30-
import javax.ws.rs.core.Response;
3123
import org.slf4j.Logger;
3224
import org.slf4j.LoggerFactory;
33-
25+
import org.apache.hbase.thirdparty.javax.ws.rs.DefaultValue;
26+
import org.apache.hbase.thirdparty.javax.ws.rs.GET;
27+
import org.apache.hbase.thirdparty.javax.ws.rs.Path;
28+
import org.apache.hbase.thirdparty.javax.ws.rs.PathParam;
29+
import org.apache.hbase.thirdparty.javax.ws.rs.Produces;
30+
import org.apache.hbase.thirdparty.javax.ws.rs.QueryParam;
31+
import org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType;
32+
import org.apache.hbase.thirdparty.javax.ws.rs.core.Response;
3433
import org.apache.hbase.thirdparty.org.eclipse.jetty.util.ajax.JSON;
3534

3635
/**

hbase-it/pom.xml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,7 @@
140140
</build>
141141

142142
<dependencies>
143-
<!--This one is upfront to get in front of
144-
any dependency that pulls in jersey-core.
145-
Jersey-core has implemented version 1
146-
Interfaces of what is in this dependency
147-
which does version 2.-->
148-
<dependency>
149-
<groupId>javax.ws.rs</groupId>
150-
<artifactId>javax.ws.rs-api</artifactId>
151-
<scope>test</scope>
152-
</dependency>
153-
<!-- Intra-project dependencies -->
143+
<!-- Intra-project dependencies -->
154144
<dependency>
155145
<groupId>org.apache.hbase</groupId>
156146
<artifactId>hbase-annotations</artifactId>

hbase-it/src/test/java/org/apache/hadoop/hbase/MockHttpApiRule.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@
2828
import java.util.regex.Pattern;
2929
import javax.servlet.http.HttpServletRequest;
3030
import javax.servlet.http.HttpServletResponse;
31-
import javax.ws.rs.core.MediaType;
3231
import org.junit.rules.ExternalResource;
3332
import org.slf4j.Logger;
3433
import org.slf4j.LoggerFactory;
35-
34+
import org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType;
3635
import org.apache.hbase.thirdparty.org.eclipse.jetty.server.Request;
3736
import org.apache.hbase.thirdparty.org.eclipse.jetty.server.RequestLog;
3837
import org.apache.hbase.thirdparty.org.eclipse.jetty.server.Server;

hbase-it/src/test/java/org/apache/hadoop/hbase/RESTApiClusterManager.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import static org.apache.hadoop.hbase.HBaseClusterManager.DEFAULT_RETRY_SLEEP_INTERVAL;
2323
import static org.apache.hadoop.hbase.HBaseClusterManager.RETRY_ATTEMPTS_KEY;
2424
import static org.apache.hadoop.hbase.HBaseClusterManager.RETRY_SLEEP_INTERVAL_KEY;
25-
2625
import java.io.IOException;
2726
import java.net.URI;
2827
import java.util.Collections;
@@ -32,14 +31,6 @@
3231
import java.util.Objects;
3332
import java.util.Optional;
3433
import java.util.concurrent.Callable;
35-
import javax.ws.rs.client.Client;
36-
import javax.ws.rs.client.ClientBuilder;
37-
import javax.ws.rs.client.Entity;
38-
import javax.ws.rs.client.Invocation;
39-
import javax.ws.rs.client.WebTarget;
40-
import javax.ws.rs.core.MediaType;
41-
import javax.ws.rs.core.Response;
42-
import javax.ws.rs.core.UriBuilder;
4334
import javax.xml.ws.http.HTTPException;
4435
import org.apache.commons.lang3.StringUtils;
4536
import org.apache.hadoop.conf.Configuration;
@@ -50,10 +41,17 @@
5041
import org.apache.hadoop.util.ReflectionUtils;
5142
import org.slf4j.Logger;
5243
import org.slf4j.LoggerFactory;
53-
5444
import org.apache.hbase.thirdparty.com.google.gson.JsonElement;
5545
import org.apache.hbase.thirdparty.com.google.gson.JsonObject;
5646
import org.apache.hbase.thirdparty.com.google.gson.JsonParser;
47+
import org.apache.hbase.thirdparty.javax.ws.rs.client.Client;
48+
import org.apache.hbase.thirdparty.javax.ws.rs.client.ClientBuilder;
49+
import org.apache.hbase.thirdparty.javax.ws.rs.client.Entity;
50+
import org.apache.hbase.thirdparty.javax.ws.rs.client.Invocation;
51+
import org.apache.hbase.thirdparty.javax.ws.rs.client.WebTarget;
52+
import org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType;
53+
import org.apache.hbase.thirdparty.javax.ws.rs.core.Response;
54+
import org.apache.hbase.thirdparty.javax.ws.rs.core.UriBuilder;
5755
import org.apache.hbase.thirdparty.org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
5856

5957
/**

hbase-rest/pom.xml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,6 @@
130130
</plugins>
131131
</build>
132132
<dependencies>
133-
<!--This one is upfront to get in front of
134-
any dependency that pulls in jersey-core.
135-
Jersey-core has implemented version 1
136-
Interfaces of what is in this dependency
137-
which does version 2.-->
138-
<dependency>
139-
<groupId>javax.ws.rs</groupId>
140-
<artifactId>javax.ws.rs-api</artifactId>
141-
</dependency>
142133
<!-- Intra-project dependencies -->
143134
<dependency>
144135
<groupId>org.apache.hbase</groupId>
@@ -160,7 +151,6 @@
160151
<dependency>
161152
<groupId>org.apache.hbase</groupId>
162153
<artifactId>hbase-protocol-shaded</artifactId>
163-
<type>jar</type>
164154
</dependency>
165155
<dependency>
166156
<groupId>org.apache.hbase</groupId>
@@ -228,6 +218,10 @@
228218
<scope>test</scope>
229219
</dependency>
230220
<!-- REST dependencies -->
221+
<dependency>
222+
<groupId>org.apache.hbase.thirdparty</groupId>
223+
<artifactId>hbase-shaded-jackson-jaxrs-json-provider</artifactId>
224+
</dependency>
231225
<dependency>
232226
<groupId>org.apache.hbase.thirdparty</groupId>
233227
<artifactId>hbase-shaded-miscellaneous</artifactId>
@@ -264,10 +258,6 @@
264258
<groupId>com.sun.activation</groupId>
265259
<artifactId>javax.activation</artifactId>
266260
</dependency>
267-
<dependency>
268-
<groupId>com.fasterxml.jackson.jaxrs</groupId>
269-
<artifactId>jackson-jaxrs-json-provider</artifactId>
270-
</dependency>
271261
<dependency>
272262
<groupId>com.fasterxml.jackson.core</groupId>
273263
<artifactId>jackson-annotations</artifactId>

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/ExistsResource.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/*
2-
*
32
* Licensed to the Apache Software Foundation (ASF) under one
43
* or more contributor license agreements. See the NOTICE file
54
* distributed with this work for additional information
@@ -20,16 +19,14 @@
2019
package org.apache.hadoop.hbase.rest;
2120

2221
import java.io.IOException;
23-
24-
import javax.ws.rs.GET;
25-
import javax.ws.rs.Produces;
26-
import javax.ws.rs.core.CacheControl;
27-
import javax.ws.rs.core.Context;
28-
import javax.ws.rs.core.Response;
29-
import javax.ws.rs.core.UriInfo;
30-
import javax.ws.rs.core.Response.ResponseBuilder;
31-
3222
import org.apache.yetus.audience.InterfaceAudience;
23+
import org.apache.hbase.thirdparty.javax.ws.rs.GET;
24+
import org.apache.hbase.thirdparty.javax.ws.rs.Produces;
25+
import org.apache.hbase.thirdparty.javax.ws.rs.core.CacheControl;
26+
import org.apache.hbase.thirdparty.javax.ws.rs.core.Context;
27+
import org.apache.hbase.thirdparty.javax.ws.rs.core.Response;
28+
import org.apache.hbase.thirdparty.javax.ws.rs.core.Response.ResponseBuilder;
29+
import org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo;
3330

3431
@InterfaceAudience.Private
3532
public class ExistsResource extends ResourceBase {

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/MultiRowResource.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/**
2-
*
1+
/*
32
* Licensed to the Apache Software Foundation (ASF) under one
43
* or more contributor license agreements. See the NOTICE file
54
* distributed with this work for additional information
@@ -19,14 +18,6 @@
1918
package org.apache.hadoop.hbase.rest;
2019

2120
import java.io.IOException;
22-
23-
import javax.ws.rs.GET;
24-
import javax.ws.rs.Produces;
25-
import javax.ws.rs.core.Context;
26-
import javax.ws.rs.core.MultivaluedMap;
27-
import javax.ws.rs.core.Response;
28-
import javax.ws.rs.core.UriInfo;
29-
3021
import org.apache.hadoop.hbase.Cell;
3122
import org.apache.hadoop.hbase.CellUtil;
3223
import org.apache.hadoop.hbase.rest.model.CellModel;
@@ -36,6 +27,12 @@
3627
import org.apache.yetus.audience.InterfaceAudience;
3728
import org.slf4j.Logger;
3829
import org.slf4j.LoggerFactory;
30+
import org.apache.hbase.thirdparty.javax.ws.rs.GET;
31+
import org.apache.hbase.thirdparty.javax.ws.rs.Produces;
32+
import org.apache.hbase.thirdparty.javax.ws.rs.core.Context;
33+
import org.apache.hbase.thirdparty.javax.ws.rs.core.MultivaluedMap;
34+
import org.apache.hbase.thirdparty.javax.ws.rs.core.Response;
35+
import org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo;
3936

4037
@InterfaceAudience.Private
4138
public class MultiRowResource extends ResourceBase implements Constants {

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/NamespacesInstanceResource.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/*
2-
*
32
* Licensed to the Apache Software Foundation (ASF) under one
43
* or more contributor license agreements. See the NOTICE file
54
* distributed with this work for additional information
@@ -21,18 +20,6 @@
2120
import java.io.IOException;
2221
import java.util.List;
2322
import javax.servlet.ServletContext;
24-
import javax.ws.rs.Consumes;
25-
import javax.ws.rs.DELETE;
26-
import javax.ws.rs.GET;
27-
import javax.ws.rs.POST;
28-
import javax.ws.rs.PUT;
29-
import javax.ws.rs.Path;
30-
import javax.ws.rs.PathParam;
31-
import javax.ws.rs.Produces;
32-
import javax.ws.rs.core.Context;
33-
import javax.ws.rs.core.HttpHeaders;
34-
import javax.ws.rs.core.Response;
35-
import javax.ws.rs.core.UriInfo;
3623
import org.apache.hadoop.hbase.NamespaceDescriptor;
3724
import org.apache.hadoop.hbase.client.Admin;
3825
import org.apache.hadoop.hbase.client.TableDescriptor;
@@ -43,6 +30,18 @@
4330
import org.apache.yetus.audience.InterfaceAudience;
4431
import org.slf4j.Logger;
4532
import org.slf4j.LoggerFactory;
33+
import org.apache.hbase.thirdparty.javax.ws.rs.Consumes;
34+
import org.apache.hbase.thirdparty.javax.ws.rs.DELETE;
35+
import org.apache.hbase.thirdparty.javax.ws.rs.GET;
36+
import org.apache.hbase.thirdparty.javax.ws.rs.POST;
37+
import org.apache.hbase.thirdparty.javax.ws.rs.PUT;
38+
import org.apache.hbase.thirdparty.javax.ws.rs.Path;
39+
import org.apache.hbase.thirdparty.javax.ws.rs.PathParam;
40+
import org.apache.hbase.thirdparty.javax.ws.rs.Produces;
41+
import org.apache.hbase.thirdparty.javax.ws.rs.core.Context;
42+
import org.apache.hbase.thirdparty.javax.ws.rs.core.HttpHeaders;
43+
import org.apache.hbase.thirdparty.javax.ws.rs.core.Response;
44+
import org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo;
4645

4746
/**
4847
* Implements the following REST end points:

hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/NamespacesResource.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/*
2-
*
32
* Licensed to the Apache Software Foundation (ASF) under one
43
* or more contributor license agreements. See the NOTICE file
54
* distributed with this work for additional information
@@ -20,20 +19,18 @@
2019
package org.apache.hadoop.hbase.rest;
2120

2221
import java.io.IOException;
23-
2422
import javax.servlet.ServletContext;
25-
import javax.ws.rs.GET;
26-
import javax.ws.rs.Path;
27-
import javax.ws.rs.PathParam;
28-
import javax.ws.rs.Produces;
29-
import javax.ws.rs.core.Context;
30-
import javax.ws.rs.core.Response;
31-
import javax.ws.rs.core.UriInfo;
32-
23+
import org.apache.hadoop.hbase.rest.model.NamespacesModel;
3324
import org.apache.yetus.audience.InterfaceAudience;
3425
import org.slf4j.Logger;
3526
import org.slf4j.LoggerFactory;
36-
import org.apache.hadoop.hbase.rest.model.NamespacesModel;
27+
import org.apache.hbase.thirdparty.javax.ws.rs.GET;
28+
import org.apache.hbase.thirdparty.javax.ws.rs.Path;
29+
import org.apache.hbase.thirdparty.javax.ws.rs.PathParam;
30+
import org.apache.hbase.thirdparty.javax.ws.rs.Produces;
31+
import org.apache.hbase.thirdparty.javax.ws.rs.core.Context;
32+
import org.apache.hbase.thirdparty.javax.ws.rs.core.Response;
33+
import org.apache.hbase.thirdparty.javax.ws.rs.core.UriInfo;
3734

3835
/**
3936
* Implements REST GET list of all namespaces.

0 commit comments

Comments
 (0)