-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
Mostly modification to satisfy more complexing support scenrio such as service Level model #3264
Conversation
Jeff-Lv
commented
Jan 17, 2019
- add a attributeMap to Invocation
- rename the varibale name NAME_ID_MAP
- add a method for class CodecSupport
- import servicemetada and associated it with models class
Codecov Report
@@ Coverage Diff @@
## 3.x-dev #3264 +/- ##
=============================================
- Coverage 63.81% 63.75% -0.06%
Complexity 75 75
=============================================
Files 654 655 +1
Lines 28377 28416 +39
Branches 4806 4808 +2
=============================================
+ Hits 18108 18116 +8
- Misses 7993 8022 +29
- Partials 2276 2278 +2
Continue to review full report at Codecov.
|
@@ -83,4 +83,9 @@ | |||
*/ | |||
Invoker<?> getInvoker(); | |||
|
|||
Object put(Object key, Object value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we these interface level method documentation? what do you say?
@@ -113,6 +115,14 @@ public void setInvoker(Invoker<?> invoker) { | |||
this.invoker = invoker; | |||
} | |||
|
|||
public Object put(Object key, Object value) { | |||
return attributes.put(key, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to consider any thread safety here?
should we not prevent addition of adding NULL as key?
@@ -53,6 +56,10 @@ public Method getMethod() { | |||
return method; | |||
} | |||
|
|||
public ConcurrentMap<String, Object> getAttributeMap() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning the same copy of attributeMap may lead to programatic mistake as many different java file may modify it, we may not have the track of who is modifying what what modifying.
Should we not have a put and get method of attribute map it self in this class. What do you say?
|
||
private final ConcurrentMap<String, Object> attributeMap = new ConcurrentHashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private final Map<String, Object> attributeMap = new ConcurrentHashMap<>();
would be better.
public String getServiceName() { | ||
return serviceName; | ||
public ConcurrentMap<String, Object> getAttributeMap() { | ||
return attributeMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return the mutable member variable ** attributeMap** may be harmful as any caller can have the reference and modify it. may be we can provide put and get method for attributeMap in this class it self.