Skip to content

Commit

Permalink
[SCB-1139] update vertx version from 3.5.3 to 3.6.2 (#1084)
Browse files Browse the repository at this point in the history
* [SCB-1139] update vertx version from 3.5.3 to 3.6.2
1、update netty to 4.1.28 ncnative to 2.0.14.Final jackson 2.9.8
2、vertximpl (just for test) does not have an public construtor, so add the VertxImpl to resolve first, later will be removed
3、DefaultVertxMetrics does not have the vertx parameter, so add an setter method
4、delete the #961, jackson has fixed the promblem by FasterXML/jackson-core@b6c54cf

* remove pseudo :status header of http2 response
* change the three file's license to vertx
  • Loading branch information
jeho0815 authored and wujimin committed Feb 18, 2019
1 parent 96f83e5 commit 8225fde
Show file tree
Hide file tree
Showing 41 changed files with 2,501 additions and 394 deletions.
4 changes: 3 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ This product bundles files from vertx which is licensed under the Apache License
For details, see https://github.com/vert-x3/vertx-web

================================================================
For foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpImplEx.java
For foundations/foundation-vertx/src/main/java/io/vertx/core/impl/VertxImpl.java
foundations/foundation-test-scaffolding/src/main/java/io/vertx/core/impl/VertxImpl.java
foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpImplEx.java
================================================================
This product bundles files from vertx which is licensed under the Apache License v2.
For details, see https://github.com/eclipse-vertx/vert.x
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@

package org.apache.servicecomb.common.rest.codec;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.databind.ObjectMapper;

public abstract class AbstractRestObjectMapper extends ObjectMapper {
private static final long serialVersionUID = 189026839992490564L;

public AbstractRestObjectMapper(JsonFactory jsonFactory) {
super(jsonFactory);
}

abstract public String convertToString(Object value) throws Exception;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser.Feature;
import com.fasterxml.jackson.core.base.DoSFix;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonSerializer;
Expand All @@ -35,9 +34,6 @@
import io.vertx.core.json.JsonObject;

public class RestObjectMapper extends AbstractRestObjectMapper {
static {
DoSFix.init();
}

private static class JsonObjectSerializer extends JsonSerializer<JsonObject> {
@Override
Expand All @@ -52,7 +48,6 @@ public void serialize(JsonObject value, JsonGenerator jgen, SerializerProvider p

@SuppressWarnings("deprecation")
public RestObjectMapper() {
super(DoSFix.createJsonFactory());

// swagger中要求date使用ISO8601格式传递,这里与之做了功能绑定,这在cse中是没有问题的
setDateFormat(new com.fasterxml.jackson.databind.util.ISO8601DateFormat() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.UUID;

import javax.servlet.http.Part;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;

import org.hamcrest.Matchers;
Expand All @@ -35,7 +36,6 @@
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.CaseInsensitiveHeaders;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpHeaders;
import mockit.Deencapsulation;
import mockit.Expectations;
import mockit.Mock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class TransportVertxFactory {
public TransportVertxFactory() {
vertxOptions.setMetricsOptions(metricsOptionsEx);
transportVertx = VertxUtils.getOrCreateVertxByName("transport", vertxOptions);
metricsFactory.setVertx(transportVertx, vertxOptions);
}

public DefaultVertxMetricsFactory getMetricsFactory() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public void getTransportVertx() {

Assert.assertNotNull(vertxFactory.getTransportVertx());
Assert.assertSame(vertxFactory.getTransportVertx(), vertxFactory.getTransportVertx());
Assert.assertSame(vertxFactory.getTransportVertx(), vertxFactory.getMetricsFactory().getVertxMetrics().getVertx());

vertxFactory.getTransportVertx().close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ private void refreshMembers(MemberDiscovery memberDiscovery) {
String configCenter = memberDiscovery.getConfigServer();
IpPort ipPort = NetUtils.parseIpPortFromURI(configCenter);
clientMgr.findThreadBindClientPool().runOnContext(client -> {
@SuppressWarnings("deprecation")
HttpClientRequest request =
client.get(ipPort.getPort(), ipPort.getHostOrIp(), uriConst.MEMBERS, rsp -> {
if (rsp.statusCode() == HttpResponseStatus.OK.code()) {
Expand Down Expand Up @@ -374,6 +375,7 @@ public void refreshConfig(String configcenter, boolean wait) {
+ ParseConfigUtils.getInstance().getCurrentVersionInfo();
clientMgr.findThreadBindClientPool().runOnContext(client -> {
IpPort ipPort = NetUtils.parseIpPortFromURI(configcenter);
@SuppressWarnings("deprecation")
HttpClientRequest request = client.get(ipPort.getPort(), ipPort.getHostOrIp(), path, rsp -> {
if (rsp.statusCode() == HttpResponseStatus.OK.code()) {
rsp.bodyHandler(buf -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import mockit.MockUp;
import mockit.Mocked;

@SuppressWarnings("deprecation")
public class TestConfigCenterClient {
@BeforeClass
public static void setUpClass() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ public static <T> void syncExecuteBlocking(Handler<Future<T>> blockingCodeHandle
}

@Override
public <T> void executeBlocking(Action<T> action, Handler<AsyncResult<T>> resultHandler) {
public <T> void executeBlockingInternal(Handler<Future<T>> action, Handler<AsyncResult<T>> resultHandler) {
syncExecuteBlocking((future) -> {
try {
future.complete(action.perform());
action.handle(future);
} catch (Throwable e) {
future.fail(e);
}
Expand All @@ -72,7 +72,7 @@ public <T> void executeBlocking(Handler<Future<T>> blockingCodeHandler, boolean
}

@Override
<T> void executeBlocking(Action<T> action, Handler<Future<T>> blockingCodeHandler,
<T> void executeBlocking(Handler<Future<T>> blockingCodeHandler,
Handler<AsyncResult<T>> resultHandler,
Executor exec, TaskQueue queue, @SuppressWarnings("rawtypes") PoolMetrics metrics) {
syncExecuteBlocking(blockingCodeHandler, resultHandler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.net.impl.transport.Transport;

/**
* after test finished, need to invoke vertx.close
Expand All @@ -28,10 +29,12 @@ public class SyncVertx extends VertxImpl {
private ContextImpl context = new SyncContext(this);

public SyncVertx() {
this(null, null);
this(new VertxOptions(), null);
}

protected SyncVertx(VertxOptions options, Handler<AsyncResult<Vertx>> resultHandler) {
super(options, Transport.transport(options.getPreferNativeTransport()));
init();
}

@Override
Expand Down
Loading

0 comments on commit 8225fde

Please sign in to comment.