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

[#864] feat(server): Introduce Jersey to strengthen REST API #939

Merged
merged 40 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5a4e760
Support metric reporter and Support promethues push gateway
xianjingfeng Dec 13, 2022
b7828bf
Merge branch 'master' into issue_169
xianjingfeng Dec 13, 2022
4226a0e
Optimize
xianjingfeng Dec 14, 2022
02c5161
Remove useless modification
xianjingfeng Dec 14, 2022
583db4f
Miss files
xianjingfeng Dec 14, 2022
52eaab5
Fix code style
xianjingfeng Dec 14, 2022
480d4de
Optimize
xianjingfeng Dec 15, 2022
6f76966
Add instanceId
xianjingfeng Dec 15, 2022
c4293e0
合并metric接口
xianjingfeng Dec 19, 2022
dd0ee24
ISSUE-455
xianjingfeng Feb 1, 2023
39bc96c
ISSUE-456
xianjingfeng Feb 1, 2023
9e541e2
ISSUE-468
xianjingfeng Feb 1, 2023
e36e3a3
Revert "[#772] fix(kerberos): cache proxy user ugi to avoid memory le…
jerqi Apr 13, 2023
7330d44
[#772] fix(kerberos): cache proxy user ugi to avoid memory leak (#773)
zuston Mar 29, 2023
4cdfbec
Revert "[#772] fix(kerberos): cache proxy user ugi to avoid memory le…
jerqi Apr 17, 2023
926c314
[#772][0.7] fix(kerberos): cache proxy user ugi to avoid memory leak …
zuston Apr 17, 2023
4b82788
Revert "[#886] fix(mr): MR Client may lost data or throw exception wh…
jerqi May 19, 2023
a7fa07f
Merge branch 'master' of https://github.com/xianjingfeng/incubator-un…
xianjingfeng Jun 20, 2023
69518b5
Introduce Jersey to strengthen REST API
xianjingfeng Jun 7, 2023
c13825f
Introduce Jersey to to shuffle server
xianjingfeng Jun 7, 2023
61b4db7
fix ut
xianjingfeng Jun 8, 2023
e37c717
fix ut
xianjingfeng Jun 8, 2023
0784bf7
use jersey1
xianjingfeng Jun 8, 2023
921bba2
fix ut
xianjingfeng Jun 8, 2023
593ddf7
fix ut
xianjingfeng Jun 8, 2023
c31f067
fix ut
xianjingfeng Jun 8, 2023
57479a1
fix ut
xianjingfeng Jun 8, 2023
df7a321
nit
xianjingfeng Jun 8, 2023
eef176d
Adapt to other APIs of the master branch
xianjingfeng Jun 20, 2023
131c3d2
nit
xianjingfeng Jun 20, 2023
549f86f
nit
xianjingfeng Jun 20, 2023
f6e08af
use hbase thirdparty
xianjingfeng Jun 30, 2023
3c7a5bb
nit
xianjingfeng Jun 30, 2023
d62081e
fix spotbugs
xianjingfeng Jun 30, 2023
7c7f8a0
fix bug
xianjingfeng Jun 30, 2023
d650f00
fix codestyle
xianjingfeng Jun 30, 2023
621977f
introduce hbase-shaded-jackson-jaxrs-json-provider
xianjingfeng Jun 30, 2023
1bf8ec2
Revert "introduce hbase-shaded-jackson-jaxrs-json-provider"
xianjingfeng Jun 30, 2023
04c9d31
nit
xianjingfeng Jul 6, 2023
07f3daa
fix license
xianjingfeng Jul 6, 2023
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
Prev Previous commit
Next Next commit
Revert "introduce hbase-shaded-jackson-jaxrs-json-provider"
This reverts commit 621977f.
  • Loading branch information
xianjingfeng committed Jun 30, 2023
commit 1bf8ec220adfae554428c5b1ff65ac6246f601e5
4 changes: 0 additions & 4 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@
<groupId>org.apache.hbase.thirdparty</groupId>
<artifactId>hbase-shaded-jersey</artifactId>
</dependency>
<dependency>
<groupId>org.apache.hbase.thirdparty</groupId>
<artifactId>hbase-shaded-jackson-jaxrs-json-provider</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import javax.annotation.Priority;

import org.apache.hbase.thirdparty.com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
import org.apache.hbase.thirdparty.javax.ws.rs.core.Configuration;
import org.apache.hbase.thirdparty.javax.ws.rs.core.FeatureContext;
import org.apache.hbase.thirdparty.org.glassfish.jersey.internal.spi.AutoDiscoverable;
Expand All @@ -28,8 +27,8 @@
public class JerseyAutoDiscoverable implements AutoDiscoverable {
public void configure(FeatureContext context) {
Configuration config = context.getConfiguration();
if (!config.isRegistered(JacksonJsonProvider.class)) {
context.register(JacksonJsonProvider.class);
if (!config.isRegistered(JsonConverter.class)) {
context.register(JsonConverter.class);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* 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.
*/

package org.apache.uniffle.common.web;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.nio.charset.Charset;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.hbase.thirdparty.javax.ws.rs.Consumes;
import org.apache.hbase.thirdparty.javax.ws.rs.Produces;
import org.apache.hbase.thirdparty.javax.ws.rs.WebApplicationException;
import org.apache.hbase.thirdparty.javax.ws.rs.core.MediaType;
import org.apache.hbase.thirdparty.javax.ws.rs.core.MultivaluedMap;
import org.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyReader;
import org.apache.hbase.thirdparty.javax.ws.rs.ext.MessageBodyWriter;
import org.apache.hbase.thirdparty.javax.ws.rs.ext.Provider;

@Provider
@Consumes({MediaType.APPLICATION_JSON, "text/json", "application/*+json"})
@Produces({MediaType.APPLICATION_JSON, "text/json", "application/*+json"})
public class JsonConverter implements MessageBodyReader<Object>, MessageBodyWriter<Object> {
private final ObjectMapper objectMapper = new ObjectMapper();

public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations,
MediaType mediaType) {
return true;
}

public void writeTo(Object t, Class<?> type, Type genericType, Annotation[] annotations,
MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
OutputStream entityStream) throws IOException, WebApplicationException {
objectMapper.writeValue(new OutputStreamWriter(entityStream, Charset.defaultCharset()), t);
}

public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations,
MediaType mediaType) {
return true;
}

public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations,
MediaType mediaType, MultivaluedMap<String, String> httpHeaders,
InputStream entityStream) throws IOException, WebApplicationException {
return objectMapper.readValue(entityStream, type);
}

public long getSize(Object t, Class<?> type, Type genericType, Annotation[] annotations,
MediaType mediaType) {
return -1;
}
}
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,6 @@
<artifactId>hbase-shaded-jersey</artifactId>
<version>${hbase.thirdparty.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hbase.thirdparty</groupId>
<artifactId>hbase-shaded-jackson-jaxrs-json-provider</artifactId>
<version>${hbase.thirdparty.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down