mneethiraj commented on a change in pull request #28: ATLAS-3069: Avoid
repeated printing of missing relationship def warning messages
URL: https://github.com/apache/atlas/pull/28#discussion_r264529368
##########
File path: intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java
##########
@@ -54,18 +55,22 @@
private static final Logger LOG =
LoggerFactory.getLogger(AtlasTypeRegistry.class);
private static final int DEFAULT_LOCK_MAX_WAIT_TIME_IN_SECONDS = 15;
- protected RegistryData registryData;
- private final TypeRegistryUpdateSynchronizer updateSynchronizer;
+ protected RegistryData registryData;
+ private final TypeRegistryUpdateSynchronizer updateSynchronizer;
+ private final Map<String, Map<String, Set<String>>>
missingRelationshipDefs;
Review comment:
Consider the following alternate approach, which might be a bit simpler:
```
private final Set<String> missingRelationships = new HashSet();
void reportMissingRelationshipDef(String type1Name, String type2Name, String
attrName) {
String key = type1Name + "->" + type2Name + ":" + attrName;
if (!missingRelationships.contains(key)) {
LOG.warn("No RelationshipDef defined between {} and {} on attribute:
{}.{}", type1Name, type2Name, attrName);
missingRelationships.add(key);
}
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services