You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "vkeeper (GitHub)" <gi...@apache.org> on 2018/11/01 10:10:21 UTC

[GitHub] [incubator-dubbo] vkeeper opened issue #2726: refactor ProtocolFilterWrapper buildInvokerChain method

- [ ] I have searched the [issues](https://github.com/apache/incubator-dubbo/issues) of this repository and believe that this is not a duplicate.
- [ ] I have checked the [FAQ](https://github.com/apache/incubator-dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: Latest
* Operating System version: win10
* Java version: 1.8

### Steps to reproduce this issue

```java
private static <T> Invoker<T> buildInvokerChain(final Invoker<T> invoker, String key, String group) {
        Invoker<T> last = invoker;
        List<Filter> filters = ExtensionLoader.getExtensionLoader(Filter.class).getActivateExtension(invoker.getUrl(), key, group);
        if (!filters.isEmpty()) {
            for (int i = filters.size() - 1; i >= 0; i--) {
                final Filter filter = filters.get(i);
                final Invoker<T> next = last;
                last = new Invoker<T>() {

                   ...........
                    @Override
                    public Result invoke(Invocation invocation) throws RpcException {
                        return filter.invoke(next, invocation);
                    }
                   ...........
                };
            }
        }
        return last;
    }
```
it will creates the same number of the **anonymous Invoker class** as **filters size** when refer() or export(...) every time, it's a linked structure

Pls. provide [GitHub address] to reproduce this issue.

### Expected Result

use one **anonymous Invoker class** to instead of it 

use one **for** call to instead of **linked** call

### Actual Result

NONE


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


[GitHub] [incubator-dubbo] vkeeper closed issue #2726: refactor ProtocolFilterWrapper buildInvokerChain method

Posted by "vkeeper (GitHub)" <gi...@apache.org>.
[ issue closed by vkeeper ]

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