Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dubbo-#1293][Baiji-9]fix the issue #1293 #2357

Closed
wants to merge 1 commit into from

Conversation

shenlong123321
Copy link

What is the purpose of the change

fix the issue #1293

Brief changelog

add the method of getting whether the cache exists
add the method of putting key and ReferenceConfig
add a new method of getting ReferenceConfig through url,name,version

Verifying this change

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

  • Make sure there is a GITHUB_issue filed 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 integration-test in test module.
  • Run mvn clean install -DskipTests & 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.

@shenlong123321 shenlong123321 changed the title Dubbo-Baiji-274-team9-issue-#1293 [Dubbo-#1293]Baiji-274-team9 Aug 28, 2018
@shenlong123321 shenlong123321 changed the title [Dubbo-#1293]Baiji-274-team9 [Dubbo-#1293]Baiji-274 Aug 28, 2018
@shenlong123321 shenlong123321 changed the title [Dubbo-#1293]Baiji-274 [Dubbo-#1293]fix the issue #1293 Aug 28, 2018
@shenlong123321 shenlong123321 changed the title [Dubbo-#1293]fix the issue #1293 [Dubbo-#1293][Baiji-team9]fix the issue #1293 Aug 28, 2018
@shenlong123321 shenlong123321 changed the title [Dubbo-#1293][Baiji-team9]fix the issue #1293 [Dubbo-#1293][Baiji-9]fix the issue #1293 Aug 28, 2018
@@ -149,5 +202,6 @@ public String toString() {

public static interface KeyGenerator {
String generateKey(ReferenceConfig<?> referenceConfig);
String generateKey(String version,String url,String name);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the parameters are version, url and name? not interfaceName, group and version?

};
static final ConcurrentMap<String, ReferenceConfigCache> cacheHolder = new ConcurrentHashMap<String, ReferenceConfigCache>();
private final String name;
private final KeyGenerator generator;
ConcurrentMap<String, ReferenceConfig<?>> cache = new ConcurrentHashMap<String, ReferenceConfig<?>>();

//存储自定以字段到ReferenceConfig的映射

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use English comments.

@@ -115,12 +130,50 @@ public static ReferenceConfigCache getCache(String name, KeyGenerator keyGenerat
return (T) config.get();
}

public <T> void put(String version,String url,String name,ReferenceConfig<T> referenceConfig){
if(StringUtils.isBlank(version)){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diecui1202
Copy link

Since we have not found a reasonable, easy-to-use way for ReferenceConfigCache, we'll close this PR firstly.

@diecui1202 diecui1202 closed this Aug 30, 2018
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