[2/3] atlas git commit: ATLAS-2662: Remove complex array and map attribute's edge information from entity vertex
http://git-wip-us.apache.org/repos/asf/atlas/blob/6e7aa6ed/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java index f28d771..d285e69 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java @@ -51,6 +51,11 @@ import org.slf4j.LoggerFactory; import java.util.*; +import static org.apache.atlas.model.TypeCategory.ARRAY; +import static org.apache.atlas.model.TypeCategory.CLASSIFICATION; +import static org.apache.atlas.model.TypeCategory.MAP; +import static org.apache.atlas.model.TypeCategory.OBJECT_ID_TYPE; +import static org.apache.atlas.model.TypeCategory.STRUCT; import static org.apache.atlas.model.instance.AtlasEntity.Status.DELETED; import static org.apache.atlas.model.typedef.AtlasRelationshipDef.PropagateTags.ONE_TO_TWO; import static org.apache.atlas.repository.Constants.CLASSIFICATION_EDGE_NAME_PROPERTY_KEY; @@ -58,7 +63,6 @@ import static org.apache.atlas.repository.Constants.CLASSIFICATION_LABEL; import static org.apache.atlas.repository.Constants.PROPAGATED_TRAIT_NAMES_PROPERTY_KEY; import static org.apache.atlas.repository.Constants.RELATIONSHIP_GUID_PROPERTY_KEY; import static org.apache.atlas.repository.Constants.TRAIT_NAMES_PROPERTY_KEY; -import static org.apache.atlas.repository.graph.GraphHelper.EDGE_LABEL_PREFIX; import static org.apache.atlas.repository.graph.GraphHelper.addToPropagatedTraitNames; import static org.apache.atlas.repository.graph.GraphHelper.getAllClassificationEdges; import static org.apache.atlas.repository.graph.GraphHelper.getAssociatedEntityVertex; @@ -66,7 +70,9 @@ import static org.apache.atlas.repository.graph.GraphHelper.getClassificationEdg import static org.apache.atlas.repository.graph.GraphHelper.getClassificationEntityGuid; import static org.apache.atlas.repository.graph.GraphHelper.getClassificationName; import static org.apache.atlas.repository.graph.GraphHelper.getClassificationVertices; +import static org.apache.atlas.repository.graph.GraphHelper.getCollectionElementsUsingRelationship; import static org.apache.atlas.repository.graph.GraphHelper.getGuid; +import static org.apache.atlas.repository.graph.GraphHelper.getMapValuesUsingRelationship; import static org.apache.atlas.repository.graph.GraphHelper.getPropagatedClassificationEdge; import static org.apache.atlas.repository.graph.GraphHelper.getPropagatedEdges; import static org.apache.atlas.repository.graph.GraphHelper.getPropagationEnabledClassificationVertices; @@ -77,7 +83,9 @@ import static org.apache.atlas.repository.graph.GraphHelper.isPropagatedClassifi import static org.apache.atlas.repository.graph.GraphHelper.string; import static org.apache.atlas.repository.graph.GraphHelper.updateModificationMetadata; import static org.apache.atlas.repository.store.graph.v1.AtlasGraphUtilsV1.getIdFromEdge; +import static org.apache.atlas.repository.store.graph.v1.AtlasGraphUtilsV1.getQualifiedAttributePropertyKey; import static org.apache.atlas.repository.store.graph.v1.AtlasGraphUtilsV1.getState; +import static org.apache.atlas.repository.store.graph.v1.AtlasGraphUtilsV1.isReference; public abstract class DeleteHandlerV1 { public static final Logger LOG = LoggerFactory.getLogger(DeleteHandlerV1.class); @@ -198,63 +206,43 @@ public abstract class DeleteHandlerV1 { continue; } -StringedgeLabel = AtlasGraphUtilsV1.getAttributeEdgeLabel(entityType, attributeInfo.getName()); -AtlasType attrType = attributeInfo.getAttributeType(); +String edgeLabel= attributeInfo.getRelationshipEdgeLabel(); +AtlasTypeattrType = attributeInfo.getAttributeType(); +TypeCategory typeCategory = attrType.getTypeCategory(); -switch (attrType.getTypeCategory()) { -case OBJECT_ID_TYPE: { -AtlasEdge edge = graphHelper.getEdgeForLabel(vertex, edgeLabel); +if (typeCategory == OBJECT_ID_TYPE) { +AtlasEdge edge = graphHelper.getEdgeForLabel(vertex, edgeLabel); -if (edge != null && getState(edge) == AtlasEntity.Status.ACTIVE) { -vertices.push(edge.getInVertex()); -} +if (edge == null || getState(edge) == DELETED) { +continue; } -break; - -case ARRAY: { -AtlasArrayType arrType = (AtlasArrayType) attrType; - -
[1/3] atlas git commit: ATLAS-2662: Remove complex array and map attribute's edge information from entity vertex
Repository: atlas Updated Branches: refs/heads/master a8fab3e77 -> 6e7aa6ed3 http://git-wip-us.apache.org/repos/asf/atlas/blob/6e7aa6ed/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java -- diff --git a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java index 0913e6f..8e0b2ed 100644 --- a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java +++ b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java @@ -19,15 +19,12 @@ package org.apache.atlas.repository.store.graph.v1; import com.google.common.collect.ImmutableSet; import org.apache.atlas.AtlasErrorCode; -import org.apache.atlas.AtlasException; import org.apache.atlas.TestModules; -import org.apache.atlas.RequestContextV1; import org.apache.atlas.TestUtilsV2; import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.model.instance.AtlasClassification; import org.apache.atlas.model.instance.AtlasEntity; import org.apache.atlas.model.instance.AtlasEntity.AtlasEntitiesWithExtInfo; -import org.apache.atlas.model.instance.AtlasEntity.AtlasEntityExtInfo; import org.apache.atlas.model.instance.AtlasEntity.AtlasEntityWithExtInfo; import org.apache.atlas.model.instance.AtlasEntityHeader; import org.apache.atlas.model.instance.AtlasObjectId; @@ -37,63 +34,35 @@ import org.apache.atlas.model.instance.EntityMutations; import org.apache.atlas.model.instance.EntityMutations.EntityOperation; import org.apache.atlas.model.typedef.AtlasClassificationDef; import org.apache.atlas.model.typedef.AtlasEntityDef; -import org.apache.atlas.model.typedef.AtlasStructDef; -import org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef; import org.apache.atlas.model.typedef.AtlasTypesDef; -import org.apache.atlas.repository.graph.AtlasGraphProvider; -import org.apache.atlas.repository.graph.GraphBackedSearchIndexer; -import org.apache.atlas.repository.store.bootstrap.AtlasTypeDefStoreInitializer; -import org.apache.atlas.repository.store.graph.AtlasEntityStore; -import org.apache.atlas.runner.LocalSolrRunner; -import org.apache.atlas.store.AtlasTypeDefStore; -import org.apache.atlas.type.AtlasArrayType; -import org.apache.atlas.type.AtlasMapType; -import org.apache.atlas.type.AtlasStructType; -import org.apache.atlas.type.AtlasType; -import org.apache.atlas.type.AtlasTypeRegistry; import org.apache.atlas.type.AtlasTypeUtil; import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; -import org.apache.commons.collections.Transformer; -import org.apache.commons.configuration.Configuration; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.testng.Assert; -import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; -import org.testng.annotations.BeforeTest; import org.testng.annotations.Guice; import org.testng.annotations.Test; import javax.inject.Inject; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import static org.apache.atlas.TestUtilsV2.COLUMNS_ATTR_NAME; import static org.apache.atlas.TestUtilsV2.COLUMN_TYPE; import static org.apache.atlas.TestUtilsV2.NAME; -import static org.apache.atlas.TestUtilsV2.randomString; import static org.apache.atlas.TestUtilsV2.TABLE_TYPE; -import static org.apache.atlas.graph.GraphSandboxUtil.useLocalSolr; import static org.mockito.Mockito.mock; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; @Guice(modules = TestModules.TestOnlyModule.class) -public class AtlasEntityStoreV1Test { -private static final Logger LOG = LoggerFactory.getLogger(AtlasEntityStoreV1Test.class); - -@Inject -AtlasTypeRegistry typeRegistry; - -@Inject -AtlasTypeDefStore typeDefStore; - -AtlasEntityStore entityStore; - -@Inject -DeleteHandlerV1 deleteHandler; - +public class AtlasEntityStoreV1Test extends AtlasEntityTestBase { private AtlasEntitiesWithExtInfo deptEntity; private AtlasEntityWithExtInfo dbEntity; private AtlasEntityWithExtInfo tblEntity; @@ -101,86 +70,55 @@ public class AtlasEntityStoreV1Test { private AtlasEntityWithExtInfo primitiveEntity; AtlasEntityChangeNotifier mockChangeNotifier = mock(AtlasEntityChangeNotifier.class); + @Inject private EntityGraphMapper graphMapper; @Inject -private Configuration configuration; private String dbEntityGuid; private String tblEntityGuid; @BeforeClass public
[3/3] atlas git commit: ATLAS-2662: Remove complex array and map attribute's edge information from entity vertex
ATLAS-2662: Remove complex array and map attribute's edge information from entity vertex Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/6e7aa6ed Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/6e7aa6ed Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/6e7aa6ed Branch: refs/heads/master Commit: 6e7aa6ed312f381c478c9f5e535a7c86ae80d51e Parents: a8fab3e Author: Sarath SubramanianAuthored: Wed May 9 16:13:05 2018 -0700 Committer: Sarath Subramanian Committed: Wed May 9 17:44:47 2018 -0700 -- .../org/apache/atlas/repository/Constants.java | 2 + .../java/org/apache/atlas/AtlasErrorCode.java | 1 + .../atlas/model/instance/AtlasObjectId.java | 13 +- .../org/apache/atlas/type/AtlasStructType.java | 11 + .../test/java/org/apache/atlas/TestUtilsV2.java | 519 +++ .../atlas/repository/graph/GraphHelper.java | 122 - .../store/graph/v1/AtlasGraphUtilsV1.java | 5 +- .../store/graph/v1/DeleteHandlerV1.java | 169 +++--- .../store/graph/v1/EntityGraphMapper.java | 176 +++ .../store/graph/v1/EntityGraphRetriever.java| 69 +-- .../graph/v1/AtlasComplexAttributesTest.java| 396 ++ .../store/graph/v1/AtlasEntityStoreV1Test.java | 275 ++ .../store/graph/v1/AtlasEntityTestBase.java | 243 + 13 files changed, 1281 insertions(+), 720 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/6e7aa6ed/common/src/main/java/org/apache/atlas/repository/Constants.java -- diff --git a/common/src/main/java/org/apache/atlas/repository/Constants.java b/common/src/main/java/org/apache/atlas/repository/Constants.java index 16a3aaa..3732556 100644 --- a/common/src/main/java/org/apache/atlas/repository/Constants.java +++ b/common/src/main/java/org/apache/atlas/repository/Constants.java @@ -126,6 +126,8 @@ public final class Constants { public static final String CLASSIFICATION_EDGE_STATE_PROPERTY_KEY = STATE_PROPERTY_KEY; public static final String CLASSIFICATION_LABEL = "classifiedAs"; public static final String TERM_ASSIGNMENT_LABEL = "r:AtlasGlossarySemanticAssignment"; +public static final String ATTRIBUTE_INDEX_PROPERTY_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "index"; +public static final String ATTRIBUTE_KEY_PROPERTY_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "key"; public static final String VERTEX_ID_IN_IMPORT_KEY = "__vIdInImport"; public static final String EDGE_ID_IN_IMPORT_KEY = "__eIdInImport"; http://git-wip-us.apache.org/repos/asf/atlas/blob/6e7aa6ed/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java -- diff --git a/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java index 5f89ffb..5e3d818 100644 --- a/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java +++ b/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java @@ -142,6 +142,7 @@ public enum AtlasErrorCode { RELATIONSHIP_END_IS_NULL(400, "ATLAS-400-00-07D", "Relationship end is invalid. Expected {0} but is NULL"), INVALID_TERM_RELATION_TO_SELF(400, "ATLAS-400-00-07E", "Invalid Term relationship: Term can't have a relationship with self"), INVALID_CHILD_CATEGORY_DIFFERENT_GLOSSARY(400, "ATLAS-400-00-07F", "Invalid child category relationship: Child category (guid = {0}) belongs to different glossary"), +ATTRIBUTE_TYPE_INVALID(400, "ATLAS-400-00-080", "{0}.{1}: invalid attribute type. Attribute cannot be of type classification"), UNAUTHORIZED_ACCESS(403, "ATLAS-403-00-001", "{0} is not authorized to perform {1}"), http://git-wip-us.apache.org/repos/asf/atlas/blob/6e7aa6ed/intg/src/main/java/org/apache/atlas/model/instance/AtlasObjectId.java -- diff --git a/intg/src/main/java/org/apache/atlas/model/instance/AtlasObjectId.java b/intg/src/main/java/org/apache/atlas/model/instance/AtlasObjectId.java index ab5f145..a8958a8 100644 --- a/intg/src/main/java/org/apache/atlas/model/instance/AtlasObjectId.java +++ b/intg/src/main/java/org/apache/atlas/model/instance/AtlasObjectId.java @@ -34,6 +34,8 @@ import javax.xml.bind.annotation.XmlSeeAlso; import org.apache.atlas.model.PList; import org.apache.atlas.model.SearchFilter.SortType; import org.apache.atlas.model.typedef.AtlasBaseTypeDef; +import org.apache.commons.lang.StringUtils; + import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static
atlas git commit: ATLAS-2663: Glossary UI updates for related term association
Repository: atlas Updated Branches: refs/heads/master 570f24231 -> a8fab3e77 ATLAS-2663: Glossary UI updates for related term association Signed-off-by: Madhan NeethirajProject: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/a8fab3e7 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/a8fab3e7 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/a8fab3e7 Branch: refs/heads/master Commit: a8fab3e77fd9374595b08f72d21a06b6543ba28d Parents: 570f242 Author: kevalbhatt Authored: Wed May 9 18:05:28 2018 +0530 Committer: Madhan Neethiraj Committed: Wed May 9 07:29:00 2018 -0700 -- dashboardv2/public/js/collection/VSearchList.js | 2 +- dashboardv2/public/js/modules/Helpers.js| 10 ++ dashboardv2/public/js/router/Router.js | 2 +- .../public/js/templates/common/Modal.html | 3 +- .../glossary/GlossaryDetailLayoutView_tmpl.html | 6 +- .../TermRelationAttributeLayoutView_tmpl.html | 8 +- .../TermRelationAttributeTable_tmpl.html| 32 ++-- .../public/js/utils/CommonViewFunction.js | 4 +- dashboardv2/public/js/utils/Overrides.js| 26 ++- dashboardv2/public/js/utils/Utils.js| 28 ++- .../views/detail_page/DetailPageLayoutView.js | 2 +- .../views/glossary/GlossaryDetailLayoutView.js | 3 + .../js/views/glossary/GlossaryLayoutView.js | 21 ++- .../glossary/TermRelationAttributeLayoutView.js | 172 +++ .../public/js/views/search/SearchLayoutView.js | 2 +- .../js/views/search/SearchResultLayoutView.js | 6 +- 16 files changed, 254 insertions(+), 73 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/a8fab3e7/dashboardv2/public/js/collection/VSearchList.js -- diff --git a/dashboardv2/public/js/collection/VSearchList.js b/dashboardv2/public/js/collection/VSearchList.js index db380f6..7417efc 100644 --- a/dashboardv2/public/js/collection/VSearchList.js +++ b/dashboardv2/public/js/collection/VSearchList.js @@ -57,7 +57,7 @@ define(['require', this.dynamicTable = false; return resp.entities ? resp.entities : []; } else { -return resp ? resp : []; +return []; } }, getBasicRearchResult: function(options) { http://git-wip-us.apache.org/repos/asf/atlas/blob/a8fab3e7/dashboardv2/public/js/modules/Helpers.js -- diff --git a/dashboardv2/public/js/modules/Helpers.js b/dashboardv2/public/js/modules/Helpers.js index 4a92932..258a40e 100644 --- a/dashboardv2/public/js/modules/Helpers.js +++ b/dashboardv2/public/js/modules/Helpers.js @@ -100,5 +100,15 @@ define(['require', return (obj[field] ? obj[field] : (defaulValue ? defaulValue : "")); }); +Handlebars.registerHelper('eachlookup', function(obj, field, options) { +return Handlebars.helpers.each((obj[field] ? obj[field] : null), options); +}); + +Handlebars.registerHelper('callmyfunction', function(functionObj, param, options) { +var argumentObj = _.extend([], arguments); +argumentObj.shift(); +return functionObj.apply(this, argumentObj); +}); + return HHelpers; }); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/atlas/blob/a8fab3e7/dashboardv2/public/js/router/Router.js -- diff --git a/dashboardv2/public/js/router/Router.js b/dashboardv2/public/js/router/Router.js index 9899a96..1f1bd40 100644 --- a/dashboardv2/public/js/router/Router.js +++ b/dashboardv2/public/js/router/Router.js @@ -225,7 +225,7 @@ define([ if (Utils.getUrlState.isTagTab()) { App.rSideNav.currentView.RTagLayoutView.currentView.manualRender(); } else if (Utils.getUrlState.isGlossaryTab()) { - App.rSideNav.currentView.RGlossaryLayoutView.currentView.manualRender(_.extend({ isTrigger: true }, paramObj)); + App.rSideNav.currentView.RGlossaryLayoutView.currentView.manualRender(_.extend({ "isTrigger": true }, { "value": paramObj })); } } http://git-wip-us.apache.org/repos/asf/atlas/blob/a8fab3e7/dashboardv2/public/js/templates/common/Modal.html -- diff --git a/dashboardv2/public/js/templates/common/Modal.html b/dashboardv2/public/js/templates/common/Modal.html index e000fa8..2179a7d 100644 --- a/dashboardv2/public/js/templates/common/Modal.html +++