-
Notifications
You must be signed in to change notification settings - Fork 34
[Network Config Mgr] Add cache basic entities #584
Conversation
// Private IP => List<ResourceMetadata> | ||
private HashMap<String, List<ResourceMeta>> resourceMetas; |
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.
@xieus What's the IP here?
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.
Here is the private ip within the VPC ip space.
private String ownerId; | ||
private List<Goalstate.ResourceIdType> resources; | ||
|
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.
@xieus What's the ownerId here? projectID?
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.
It depends. It can be private ip or host id, depending on the scenario.
// Map <VNI, Map<PIP, List<ResoruceIDType>> | ||
private ICache<String, VpcResourceMeta> vpcResourceMetas; |
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.
@xieus Is the PIP equals to Host IP?
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.
PIP == Private IP.
public class HostResourceStateCache { | ||
// Map <ResourceId, ResourceState> | ||
private ICache<String, Object> hostResourceStates; |
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.
@xieus Is HostResourceStatesCache better?
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.
Is it correct to state that HostResourceStateCache entires are connected to HostResourceIdCache through the key (ResourceId) of HostResourceStateCache? Without this clarification, it is possible to assume that since HostResourceIdCache has hostid as the key, HostResourceStateCache may also have the same key.
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.
@xieus Is HostResourceStatesCache better?
Hmm, we can justify either of them :-) For class name, I prefer singular. What do you think of?
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.
I prefer singular in most cases and this is one of them.
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.
Is it correct to state that HostResourceStateCache entires are connected to HostResourceIdCache through the key (ResourceId) of HostResourceStateCache?
You are right.
Without this clarification, it is possible to assume that since HostResourceIdCache has hostid as the key, HostResourceStateCache may also have the same key.
Hmm, good point. I think we should rename HostResourceStateCache to ResourceStateCache to avoid confusion.
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.
ResourceStateCache fits better.
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.
Changed.
public class HostResourceIdCache { | ||
// Map <HostId, List<ResoruceIDType>> | ||
private ICache<String, ResourceMeta> hostResourceMetas; |
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.
@xieus Is HostResourceIdsCache better?
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.
I think HostResourceIdCache is fine becuase cache of something is more common than cahce of somethings.
...nfig_manager/src/main/java/com/futurewei/alcor/netwconfigmanager/entity/VpcResourceMeta.java
Show resolved
Hide resolved
API to Register, Unregister, Query NCM partitions. This API is subject to change depending on PR futurewei-cloud#584. The API itself will be in the next PR but this one adds the necessary infrastrure.
This PR adds the basic cache/db entity classes.
Two internal classes