-
Notifications
You must be signed in to change notification settings - Fork 4
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
give out-of-package access to location fileds. this is needed for REST calls as part of the CRV #39
Conversation
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.
If Ying and Sonya have no response by this Friday afternoon, we can consider to approve this PR and merge into main branch first. If there are incoming issues, we can make further changes.
@@ -8,14 +8,14 @@ import ( | |||
const RingRange = float64(360) | |||
|
|||
type Location struct { | |||
region Region | |||
partition ResourcePartition | |||
Region Region |
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.
As I mentioned before, Location is a critical data structure that is used as the base of hash ring. It is absolutely not allowed to change its value. Therefore, it should not use uppercase field names. If you need to use it, please make your own data structure.
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.
we will create a new structure for transit and copy over the CRV info in this case.
@@ -247,11 +247,11 @@ func GetRPsForRegion(region Region) []ResourcePartition { | |||
} | |||
|
|||
func (loc *Location) GetRegion() Region { | |||
return loc.region | |||
return loc.Region |
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.
With getter, you don't need to make field name uppercase.
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.
we will create a new structure for CRV in transit for now.
close this PR and we will get new data struct for CRV in transit. |
close this PR and to preserve the commit for wordaround of the serialization issue in test. new PR #67 was created with the fix as proposed. |
the region and partition of the Location type is needed to be in REST req and resp for the CRVs. the fileds is currently accessible only for in-package functions, which causes the CRV is not transmitted in REST calls. below is an example with the region service simulator and aggregators in the POSTCRV calls.
the sim.log is from the simulator where the CRVs are posted and the t.log is the aggregrator which pushes the CRVs. you can see 10 in the map with the values and only one shows in the simulator with fake values.
with this PR, all 10 shows in both sides.