You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "haiyang1985 (GitHub)" <gi...@apache.org> on 2020/02/24 01:47:29 UTC

[GitHub] [dubbo] haiyang1985 opened pull request #5780: export hessian InputStream&OutputStream for pb stream

## What is the purpose of the change
Once we are going to extend the serialization, write direct to Hessian InputStream/OutputStream is high efficient on the memroy. 

## Brief changelog
Currently, the InputStream/OutputStream is not exported. The change is going to export the InputStream/OutputStream from Hessian2ObjectInput and Hessian2ObjectOutput.

```
private final Hessian2ObjectOutput delegate;

protected ProtobufObjectOutput(OutputStream os) {
  this.delegate = new Hessian2ObjectOutput(os);
}

void writeBytesForPBObject(Object obj, Class clazz) throws IOException {
  try (OutputStream os = delegate.getOutputStream()) {
    if (obj instanceof MessageLite) {
      try {
        ((MessageLite) obj).writeTo(os);
      } catch (IOException e) {
        throw new RuntimeException("Google PB序列化失败,序列化对象的类型为" + obj.getClass().getName(), e);
      }
    }
  }
}
```


Follow this checklist to help us incorporate your contribution quickly and easily:

- [x] Make sure there is a [GITHUB_issue](https://github.com/apache/dubbo/issues) field for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [ ] Format the pull request title like `[Dubbo-XXX] Fix UnknownException when host config not exist #XXX`. Each commit in the pull request should have a meaningful subject line and body.
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
- [ ] Run `mvn clean install -DskipTests=false` & `mvn clean test-compile failsafe:integration-test` to make sure unit-test and integration-test pass.
- [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/dubbo/wiki/Software-donation-guide).


[ Full content available at: https://github.com/apache/dubbo/pull/5780 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo] chickenlj closed pull request #5780: export hessian InputStream&OutputStream for pb stream

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
[ pull request closed by chickenlj ]

[ Full content available at: https://github.com/apache/dubbo/pull/5780 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo] codecov-io commented on issue #5780: export hessian InputStream&OutputStream for pb stream

Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/dubbo/pull/5780?src=pr&el=h1) Report
> Merging [#5780](https://codecov.io/gh/apache/dubbo/pull/5780?src=pr&el=desc) into [master](https://codecov.io/gh/apache/dubbo/commit/56f1c1861b146a37e3d49541781532fa2757f0e8?src=pr&el=desc) will **decrease** coverage by `0.17%`.
> The diff coverage is `0%`.

[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo/pull/5780/graphs/tree.svg?width=650&token=VnEIkiFQT0&height=150&src=pr)](https://codecov.io/gh/apache/dubbo/pull/5780?src=pr&el=tree)

```diff
@@             Coverage Diff              @@
##             master    #5780      +/-   ##
============================================
- Coverage     61.49%   61.32%   -0.18%     
+ Complexity      497      495       -2     
============================================
  Files           979      979              
  Lines         38871    38825      -46     
  Branches       5602     5569      -33     
============================================
- Hits          23905    23810      -95     
- Misses        12351    12393      +42     
- Partials       2615     2622       +7
```


| [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/5780?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...ommon/serialize/hessian2/Hessian2ObjectOutput.java](https://codecov.io/gh/apache/dubbo/pull/5780/diff?src=pr&el=tree#diff-ZHViYm8tc2VyaWFsaXphdGlvbi9kdWJiby1zZXJpYWxpemF0aW9uLWhlc3NpYW4yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vc2VyaWFsaXplL2hlc3NpYW4yL0hlc3NpYW4yT2JqZWN0T3V0cHV0LmphdmE=) | `96.55% <0%> (-3.45%)` | `0 <0> (ø)` | |
| [...common/serialize/hessian2/Hessian2ObjectInput.java](https://codecov.io/gh/apache/dubbo/pull/5780/diff?src=pr&el=tree#diff-ZHViYm8tc2VyaWFsaXphdGlvbi9kdWJiby1zZXJpYWxpemF0aW9uLWhlc3NpYW4yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vc2VyaWFsaXplL2hlc3NpYW4yL0hlc3NpYW4yT2JqZWN0SW5wdXQuamF2YQ==) | `94.11% <0%> (-5.89%)` | `0 <0> (ø)` | |
| [...ache/dubbo/remoting/transport/AbstractChannel.java](https://codecov.io/gh/apache/dubbo/pull/5780/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvQWJzdHJhY3RDaGFubmVsLmphdmE=) | `37.5% <0%> (-50%)` | `0% <0%> (ø)` | |
| [...rg/apache/dubbo/remoting/utils/PayloadDropper.java](https://codecov.io/gh/apache/dubbo/pull/5780/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy91dGlscy9QYXlsb2FkRHJvcHBlci5qYXZh) | `30.76% <0%> (-46.16%)` | `0% <0%> (ø)` | |
| [...va/org/apache/dubbo/remoting/TimeoutException.java](https://codecov.io/gh/apache/dubbo/pull/5780/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9UaW1lb3V0RXhjZXB0aW9uLmphdmE=) | `22.22% <0%> (-11.12%)` | `0% <0%> (ø)` | |
| [...che/dubbo/remoting/transport/mina/MinaChannel.java](https://codecov.io/gh/apache/dubbo/pull/5780/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbWluYS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcmVtb3RpbmcvdHJhbnNwb3J0L21pbmEvTWluYUNoYW5uZWwuamF2YQ==) | `39.47% <0%> (-10.53%)` | `15% <0%> (-1%)` | |
| [...dubbo/remoting/exchange/support/DefaultFuture.java](https://codecov.io/gh/apache/dubbo/pull/5780/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9leGNoYW5nZS9zdXBwb3J0L0RlZmF1bHRGdXR1cmUuamF2YQ==) | `80.37% <0%> (-8.82%)` | `0% <0%> (ø)` | |
| [...ubbo/rpc/protocol/dubbo/ChannelWrappedInvoker.java](https://codecov.io/gh/apache/dubbo/pull/5780/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1kdWJiby9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcnBjL3Byb3RvY29sL2R1YmJvL0NoYW5uZWxXcmFwcGVkSW52b2tlci5qYXZh) | `39.13% <0%> (-8.7%)` | `0% <0%> (ø)` | |
| [.../apache/dubbo/rpc/protocol/AsyncToSyncInvoker.java](https://codecov.io/gh/apache/dubbo/pull/5780/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC9Bc3luY1RvU3luY0ludm9rZXIuamF2YQ==) | `79.16% <0%> (-8.34%)` | `0% <0%> (ø)` | |
| [...mmon/threadpool/support/fixed/FixedThreadPool.java](https://codecov.io/gh/apache/dubbo/pull/5780/diff?src=pr&el=tree#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vdGhyZWFkcG9vbC9zdXBwb3J0L2ZpeGVkL0ZpeGVkVGhyZWFkUG9vbC5qYXZh) | `80% <0%> (-7.5%)` | `0% <0%> (ø)` | |
| ... and [38 more](https://codecov.io/gh/apache/dubbo/pull/5780/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo/pull/5780?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/dubbo/pull/5780?src=pr&el=footer). Last update [56f1c18...340fd4f](https://codecov.io/gh/apache/dubbo/pull/5780?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


[ Full content available at: https://github.com/apache/dubbo/pull/5780 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org