-
Notifications
You must be signed in to change notification settings - Fork 9
MLH-1226 track denorm attributes and add to kafka #5392
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
base: staging
Are you sure you want to change the base?
Conversation
|
||
public Map<String, Map<String, Object>> getAllInternalAttributesMap() { |
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.
Move the getter later after all intializations
|
||
public Map<String, Map<String, Object>> getAllInternalAttributesMap() { | ||
return allInternalAttributesMap; | ||
} |
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.
This class has a method clearCache()
, please clear the allInternalAttributesMap
in this method
if (MapUtils.isNotEmpty(allInternalAttributesMap)) { | ||
for (String key : allInternalAttributesMap.keySet()) { | ||
Object value = allInternalAttributesMap.get(key); | ||
ret.setAttribute(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.
this will put internal attributes in attributes like attributes.__meanings
. Nothing wrong in this just wanted to highlight
Iterator<? extends Property<String>> it = getWrappedElement().properties(propertyName); | ||
while(it.hasNext()) { | ||
Property<String> property = it.next(); | ||
property.remove(); | ||
//fill the map for the entityGuid and remove value | ||
if (propertyName.startsWith(INTERNAL_PROPERTY_KEY_PREFIX)) { |
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.
This will collect attrs like __createdBy, __createdAt & other attributes which not denorm attrs. shall we exclude them as well?
or we can even have inclusion list but we will loose future readyness & have to update the inclusion list everytime we introduce new denorm attribute
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.
will do this change after i test this in an environment
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.
ACK
graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusElement.java
Outdated
Show resolved
Hide resolved
graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusElement.java
Outdated
Show resolved
Hide resolved
if (propertyName.startsWith(INTERNAL_PROPERTY_KEY_PREFIX)) { | ||
String entityGuid = this.getProperty(GUID_PROPERTY_KEY, String.class); | ||
if (StringUtils.isNotEmpty(entityGuid)) { | ||
if (context.getAllInternalAttributesMap().get(entityGuid) != null) { | ||
context.getAllInternalAttributesMap().get(entityGuid).put(propertyName, null); | ||
} else { | ||
Map<String, Object> map = new HashMap<>(); | ||
map.put(propertyName, null); | ||
context.getAllInternalAttributesMap().put(entityGuid, map); | ||
} | ||
} | ||
} |
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.
From method name I think intention is to remove all items from value list
E.g
Imagine __meaningNames current has values ["term_0", "term_1"],
Someone updates asset to remove both term_0, term_1
I will check more on this method & get back
@@ -130,25 +130,14 @@ public void removePropertyValue(String propertyName, Object propertyValue) { | |||
RequestContext context = RequestContext.get(); | |||
Iterator<? extends Property<Object>> it = getWrappedElement().properties(propertyName); | |||
// we create a map of properties that are only internal | |||
fillInternalPropertiesIfApplicable(propertyName, propertyValue, it, context); | |||
it = getWrappedElement().properties(propertyName); |
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 have an idea to avoid iterating twice
@@ -109,36 +114,49 @@ public void removeProperty(String propertyName) { | |||
while(it.hasNext()) { | |||
Property<String> property = it.next(); | |||
property.remove(); | |||
recordInternalAttribute(propertyName, null); |
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.
Change description
Type of change
Related issues
https://atlanhq.atlassian.net/browse/MLH-1226
Helm Config Changes for Running Tests (Staging PR)
Does this PR require Helm config changes for testing?
enpla9up36
. (You can proceed with the PR.) ✅Checklists
Development
Security
Code review