Skip to content

Add 'exclude' filtering policy for instance-level params#10002

Closed
chickenlj wants to merge 5 commits intoapache:3.0from
chickenlj:3.0-metadata-params
Closed

Add 'exclude' filtering policy for instance-level params#10002
chickenlj wants to merge 5 commits intoapache:3.0from
chickenlj:3.0-metadata-params

Conversation

@chickenlj
Copy link
Contributor

@chickenlj chickenlj commented May 6, 2022

related issue #9990

New definition of ParamsFilter is as below

/**
 * This filter applies an either 'include' or 'exclude' policy with 'include' having higher priority.
 * That means if 'include' is specified then params specified in 'exclude' will be ignored
 *
 * If multiple Filter extensions are provided, then,
 * 1. All params specified as should be included within different Filter extension instances will determine the params that will finally be used.
 * 2. If none of the Filter extensions specified any params as should be included, then the final effective params would be those left after removed all the params specified as should be excluded.
 *
 * It is recommended for most users to use 'exclude' policy for service params and 'include' policy for instance params.
 * Please use 'params-filter=-default, -filterName1, filterName2' to activate or deactivate filter extensions.
 */
@SPI
public interface MetadataParamsFilter {

    */
   String[] serviceParamsIncluded();

    /**
     * params that need to be excluded before sending to metadata center
     *
     * @return arrays of keys
     */
    String[] serviceParamsExcluded();

   /**
    * params that need to be sent to registry center
    *
    * @return arrays of keys
    */
   String[] instanceParamsIncluded();

    /**
     * params that need to be excluded before sending to registry center
     *
     * @return arrays of keys
     */
    String[] instanceParamsExcluded();
}

@chickenlj chickenlj added this to the 3.0.8 milestone May 6, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 6, 2022

Codecov Report

Merging #10002 (64fa3ed) into 3.0 (bce439e) will increase coverage by 0.06%.
The diff coverage is 85.33%.

@@             Coverage Diff              @@
##                3.0   #10002      +/-   ##
============================================
+ Coverage     65.69%   65.75%   +0.06%     
- Complexity      294      319      +25     
============================================
  Files          1215     1215              
  Lines         53040    53086      +46     
  Branches       8034     8046      +12     
============================================
+ Hits          34842    34905      +63     
+ Misses        14386    14374      -12     
+ Partials       3812     3807       -5     
Impacted Files Coverage Δ
...n/java/org/apache/dubbo/metadata/MetadataInfo.java 69.00% <85.33%> (+2.45%) ⬆️
.../remoting/transport/netty4/NettyServerHandler.java 62.79% <0.00%> (-9.31%) ⬇️
...ng/zookeeper/curator5/Curator5ZookeeperClient.java 69.56% <0.00%> (-1.94%) ⬇️
...exchange/support/header/HeaderExchangeHandler.java 61.06% <0.00%> (-1.77%) ⬇️
...dubbo/remoting/exchange/support/DefaultFuture.java 87.17% <0.00%> (-0.86%) ⬇️
...ubbo/registry/client/ServiceDiscoveryRegistry.java 76.24% <0.00%> (-0.56%) ⬇️
...pache/dubbo/registry/support/AbstractRegistry.java 75.25% <0.00%> (-0.34%) ⬇️
...ting/zookeeper/curator/CuratorZookeeperClient.java 69.23% <0.00%> (+0.96%) ⬆️
...stry/client/ServiceDiscoveryRegistryDirectory.java 45.54% <0.00%> (+0.99%) ⬆️
...ubbo/registry/client/AbstractServiceDiscovery.java 85.24% <0.00%> (+1.63%) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bce439e...64fa3ed. Read the comment docs.

@AlbumenJ AlbumenJ self-requested a review May 8, 2022 06:53
@chickenlj chickenlj closed this May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants