Commit 3eadf7e8 by Bolke de Bruin Committed by Madhan Neethiraj

ATLAS-3368: log warning for references without relationship-def

parent 314f4937
......@@ -186,6 +186,10 @@ atlas.webserver.keepalivetimesecs=60
# Queue size for the requests(when max threads are busy) for the atlas web server
atlas.webserver.queuesize=100
# Set to the property to true to enable warn on no relationships defined between entities on a particular attribute
# Not having relationships defined can lead to performance loss while adding new entities
atlas.relationships.warnOnNoRelationships=false
</verbatim>
---+++ Recording performance metrics
......
......@@ -53,6 +53,8 @@ public enum AtlasConfiguration {
GRAPHSTORE_INDEXED_STRING_SAFE_LENGTH("atlas.graphstore.indexed.string.safe.length", Short.MAX_VALUE), // based on org.apache.hadoop.hbase.client.Mutation.checkRow()
RELATIONSHIP_WARN_NO_RELATIONSHIPS("atlas.relationships.warnOnNoRelationships", false),
//search configuration
SEARCH_MAX_LIMIT("atlas.search.maxlimit", 10000),
SEARCH_DEFAULT_LIMIT("atlas.search.defaultlimit", 100),
......
......@@ -110,6 +110,7 @@ public class EntityGraphMapper {
private static final String SOFT_REF_FORMAT = "%s:%s";
private static final int INDEXED_STR_SAFE_LEN = AtlasConfiguration.GRAPHSTORE_INDEXED_STRING_SAFE_LENGTH.getInt();
private static final boolean WARN_ON_NO_RELATIONSHIP = AtlasConfiguration.RELATIONSHIP_WARN_NO_RELATIONSHIPS.getBoolean();
private static final String CLASSIFICATION_NAME_DELIMITER = "|";
private final GraphHelper graphHelper = GraphHelper.getInstance();
......@@ -948,9 +949,9 @@ public class EntityGraphMapper {
}
} else {
// use legacy way to create/update edges
if (LOG.isDebugEnabled()) {
LOG.debug("No RelationshipDef defined between {} and {} on attribute: {}", getTypeName(entityVertex),
getTypeName(attributeVertex), attributeName);
if (WARN_ON_NO_RELATIONSHIP || LOG.isDebugEnabled()) {
LOG.warn("No RelationshipDef defined between {} and {} on attribute: {}. This can lead to severe performance degradation.",
getTypeName(entityVertex), getTypeName(attributeVertex), attributeName);
}
ret = mapObjectIdValue(ctx, context);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment