This is an automated email from the ASF dual-hosted git repository.

wujimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
     new b56b0f5  [SCB-1202]pump down with vertx3.6.3 no need to check buff 
length in AsynFileImpl#doWrite
b56b0f5 is described below

commit b56b0f583d9c6be2d80e0ba114a50f20611e6511
Author: heyile <2513931...@qq.com>
AuthorDate: Sat Mar 16 19:07:47 2019 +0800

    [SCB-1202]pump down with vertx3.6.3 no need to check buff length in 
AsynFileImpl#doWrite
---
 LICENSE                                            |   1 -
 .../foundation/vertx/stream/PumpCommon.java        |   3 +-
 .../foundation/vertx/stream/PumpImplEx.java        | 104 ---------------------
 .../foundation/vertx/stream/TestPumpImpl.java      |  50 ----------
 .../it-producer-deploy-springboot2-servlet/pom.xml |   1 -
 .../pom.xml                                        |   1 -
 java-chassis-distribution/src/release/LICENSE      |   6 --
 pom.xml                                            |   1 -
 8 files changed, 2 insertions(+), 165 deletions(-)

diff --git a/LICENSE b/LICENSE
index 916a104..6eab432 100644
--- a/LICENSE
+++ b/LICENSE
@@ -219,7 +219,6 @@ For details, see https://github.com/vert-x3/vertx-web
 ================================================================
 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
diff --git 
a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpCommon.java
 
b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpCommon.java
index 090882a..77334b9 100644
--- 
a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpCommon.java
+++ 
b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpCommon.java
@@ -23,6 +23,7 @@ import 
org.apache.servicecomb.foundation.common.io.AsyncCloseable;
 import io.vertx.core.Context;
 import io.vertx.core.buffer.Buffer;
 import io.vertx.core.http.HttpClientResponse;
+import io.vertx.core.streams.Pump;
 import io.vertx.core.streams.ReadStream;
 import io.vertx.core.streams.WriteStream;
 
@@ -63,7 +64,7 @@ public class PumpCommon {
     // belongs to difference eventloop
     // maybe will cause deadlock
     // if happened, vertx will print deadlock stacks
-    PumpImplEx.getPumpImplEx(readStream, writeStream).start();
+    Pump.pump(readStream, writeStream).start();
     try {
       context.runOnContext(v -> readStream.resume());
     } catch (Throwable e) {
diff --git 
a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpImplEx.java
 
b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpImplEx.java
deleted file mode 100644
index e835629..0000000
--- 
a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/stream/PumpImplEx.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2014 Red Hat, Inc. and others
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
- * which is available at https://www.apache.org/licenses/LICENSE-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
- */
-
-/*
- *  Froked from 
https://github.com/eclipse-vertx/vert.x/blob/master/src/main/java/io/vertx/core/streams/impl/PumpImpl.java
- *
- */
-package org.apache.servicecomb.foundation.vertx.stream;
-
-import io.vertx.core.Handler;
-import io.vertx.core.buffer.Buffer;
-import io.vertx.core.streams.Pump;
-import io.vertx.core.streams.ReadStream;
-import io.vertx.core.streams.WriteStream;
-
-public class PumpImplEx<T> implements Pump {
-
-  private final ReadStream<T> readStream;
-
-  private final WriteStream<T> writeStream;
-
-  private final Handler<T> dataHandler;
-
-  private final Handler<Void> drainHandler;
-
-  private int pumped;
-
-  public PumpImplEx(ReadStream<T> readStream, WriteStream<T> writeStream, int 
maxWriteQueueSize) {
-    this(readStream, writeStream);
-    this.writeStream.setWriteQueueMaxSize(maxWriteQueueSize);
-  }
-
-  public PumpImplEx(ReadStream<T> readStream, WriteStream<T> writeStream) {
-    this.readStream = readStream;
-    this.writeStream = writeStream;
-    drainHandler = v -> readStream.resume();
-    dataHandler = data -> {
-      if (data instanceof Buffer) {
-        if (((Buffer) data).length() == 0) {
-          return;
-        }
-      }
-      writeStream.write(data);
-      incPumped();
-      if (writeStream.writeQueueFull()) {
-        readStream.pause();
-        writeStream.drainHandler(drainHandler);
-      }
-    };
-  }
-
-
-  @Override
-  public PumpImplEx<T> setWriteQueueMaxSize(int maxSize) {
-    writeStream.setWriteQueueMaxSize(maxSize);
-    return this;
-  }
-
-  @Override
-  public PumpImplEx<T> start() {
-    readStream.handler(dataHandler);
-    return this;
-  }
-
-  @Override
-  public PumpImplEx<T> stop() {
-    writeStream.drainHandler(null);
-    readStream.handler(null);
-    return this;
-  }
-
-
-  @Override
-  public synchronized int numberPumped() {
-    return pumped;
-  }
-
-
-  private synchronized void incPumped() {
-    pumped++;
-  }
-
-  public Handler<T> getDataHandler() {
-    return dataHandler;
-  }
-
-  @SuppressWarnings({"rawtypes", "unchecked"})
-  public static PumpImplEx getPumpImplEx(ReadStream rs, WriteStream ws) {
-    return new PumpImplEx(rs, ws);
-  }
-
-  @SuppressWarnings({"rawtypes", "unchecked"})
-  public static PumpImplEx getPumpImplEx(ReadStream rs, WriteStream ws, int 
writeQueueMaxSize) {
-    return new PumpImplEx(rs, ws, writeQueueMaxSize);
-  }
-}
diff --git 
a/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/stream/TestPumpImpl.java
 
b/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/stream/TestPumpImpl.java
deleted file mode 100644
index 3380550..0000000
--- 
a/foundations/foundation-vertx/src/test/java/org/apache/servicecomb/foundation/vertx/stream/TestPumpImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.servicecomb.foundation.vertx.stream;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import io.vertx.core.Handler;
-import io.vertx.core.buffer.Buffer;
-import io.vertx.core.streams.ReadStream;
-import io.vertx.core.streams.WriteStream;
-import mockit.Expectations;
-import mockit.Mocked;
-
-public class TestPumpImpl {
-
-  @Test
-  public void testPumpWithPending(@Mocked ReadStream<Object> rs, @Mocked 
WriteStream<Object> ws, @Mocked Buffer zeroBuf,
-      @Mocked Buffer contentBuf) {
-    PumpImplEx<Object> pump = new PumpImplEx<>(rs, ws);
-    Handler<Object> handler = pump.getDataHandler();
-    new Expectations() {
-      {
-        zeroBuf.length();
-        result = 0;
-        contentBuf.length();
-        result = 1;
-      }
-    };
-    handler.handle(zeroBuf);
-    handler.handle(contentBuf);
-    Assert.assertEquals(1, pump.numberPumped());
-    handler.handle(contentBuf);
-    Assert.assertEquals(2, pump.numberPumped());
-  }
-}
diff --git a/integration-tests/it-producer-deploy-springboot2-servlet/pom.xml 
b/integration-tests/it-producer-deploy-springboot2-servlet/pom.xml
index d1b810b..b2bd5be 100644
--- a/integration-tests/it-producer-deploy-springboot2-servlet/pom.xml
+++ b/integration-tests/it-producer-deploy-springboot2-servlet/pom.xml
@@ -93,7 +93,6 @@
               <!-- Skip the source files which are forked from vertx -->
               <exclude>**/io/vertx/ext/web/impl/MimeTypesUtils.java</exclude>
               
<exclude>**/java/org/apache/servicecomb/transport/rest/vertx/RestBodyHandler.java</exclude>
-              
<exclude>**/java/org/apache/servicecomb/foundation/vertx/stream/PumpImplEx.java</exclude>
               <!--Skip protobuf generated file-->
               
<exclude>**/java/org/apache/servicecomb/foundation/protobuf/internal/model/ProtobufRoot.java</exclude>
             </excludes>
diff --git 
a/integration-tests/it-producer-deploy-springboot2-standalone/pom.xml 
b/integration-tests/it-producer-deploy-springboot2-standalone/pom.xml
index 41a3126..14b37af 100644
--- a/integration-tests/it-producer-deploy-springboot2-standalone/pom.xml
+++ b/integration-tests/it-producer-deploy-springboot2-standalone/pom.xml
@@ -93,7 +93,6 @@
               <!-- Skip the source files which are forked from vertx -->
               <exclude>**/io/vertx/ext/web/impl/MimeTypesUtils.java</exclude>
               
<exclude>**/java/org/apache/servicecomb/transport/rest/vertx/RestBodyHandler.java</exclude>
-              
<exclude>**/java/org/apache/servicecomb/foundation/vertx/stream/PumpImplEx.java</exclude>
               <!--Skip protobuf generated file-->
               
<exclude>**/java/org/apache/servicecomb/foundation/protobuf/internal/model/ProtobufRoot.java</exclude>
             </excludes>
diff --git a/java-chassis-distribution/src/release/LICENSE 
b/java-chassis-distribution/src/release/LICENSE
index 812d6d9..584a255 100644
--- a/java-chassis-distribution/src/release/LICENSE
+++ b/java-chassis-distribution/src/release/LICENSE
@@ -369,12 +369,6 @@ 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
-================================================================
-This product bundles files from vertx which is licensed under the Apache 
License v2.
-For details, see https://github.com/eclipse-vertx/vert.x
-
-================================================================
 For 
swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/extend/property/AbstractBaseIntegerProperty.java
 ================================================================
 This product bundles files from swagger which is licensed under the Apache 
License v2.
diff --git a/pom.xml b/pom.xml
index 1ee8b52..e632223 100644
--- a/pom.xml
+++ b/pom.xml
@@ -201,7 +201,6 @@
             <exclude>**/io/vertx/ext/web/impl/MimeTypesUtils.java</exclude>
             <exclude>**/io/vertx/core/impl/VertxImpl.java</exclude>
             
<exclude>**/java/org/apache/servicecomb/transport/rest/vertx/RestBodyHandler.java</exclude>
-            
<exclude>**/java/org/apache/servicecomb/foundation/vertx/stream/PumpImplEx.java</exclude>
             <!--Skip protobuf generated file-->
             
<exclude>**/java/org/apache/servicecomb/foundation/protobuf/internal/model/ProtobufRoot.java</exclude>
           </excludes>

Reply via email to