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 ...@@ -186,6 +186,10 @@ atlas.webserver.keepalivetimesecs=60
# Queue size for the requests(when max threads are busy) for the atlas web server # Queue size for the requests(when max threads are busy) for the atlas web server
atlas.webserver.queuesize=100 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> </verbatim>
---+++ Recording performance metrics ---+++ Recording performance metrics
......
...@@ -53,6 +53,8 @@ public enum AtlasConfiguration { ...@@ -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() 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 configuration
SEARCH_MAX_LIMIT("atlas.search.maxlimit", 10000), SEARCH_MAX_LIMIT("atlas.search.maxlimit", 10000),
SEARCH_DEFAULT_LIMIT("atlas.search.defaultlimit", 100), SEARCH_DEFAULT_LIMIT("atlas.search.defaultlimit", 100),
......
...@@ -110,6 +110,7 @@ public class EntityGraphMapper { ...@@ -110,6 +110,7 @@ public class EntityGraphMapper {
private static final String SOFT_REF_FORMAT = "%s:%s"; 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 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 static final String CLASSIFICATION_NAME_DELIMITER = "|";
private final GraphHelper graphHelper = GraphHelper.getInstance(); private final GraphHelper graphHelper = GraphHelper.getInstance();
...@@ -948,9 +949,9 @@ public class EntityGraphMapper { ...@@ -948,9 +949,9 @@ public class EntityGraphMapper {
} }
} else { } else {
// use legacy way to create/update edges // use legacy way to create/update edges
if (LOG.isDebugEnabled()) { if (WARN_ON_NO_RELATIONSHIP || LOG.isDebugEnabled()) {
LOG.debug("No RelationshipDef defined between {} and {} on attribute: {}", getTypeName(entityVertex), LOG.warn("No RelationshipDef defined between {} and {} on attribute: {}. This can lead to severe performance degradation.",
getTypeName(attributeVertex), attributeName); getTypeName(entityVertex), getTypeName(attributeVertex), attributeName);
} }
ret = mapObjectIdValue(ctx, context); 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