atlas git commit: Fix for generating correct REST API docs

2018-10-24 Thread apoorvnaik
Repository: atlas
Updated Branches:
  refs/heads/master 93bd535eb -> 756c272ef


Fix for generating correct REST API docs


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/756c272e
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/756c272e
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/756c272e

Branch: refs/heads/master
Commit: 756c272ef0db175b3b6aca09d86b8a4acafd27ca
Parents: 93bd535
Author: apoorvnaik 
Authored: Mon Oct 22 09:22:45 2018 -0700
Committer: apoorvnaik 
Committed: Wed Oct 24 21:49:59 2018 -0700

--
 build-tools/src/main/resources/enunciate.xml|  8 ++--
 pom.xml |  4 +-
 .../apache/atlas/web/rest/DiscoveryREST.java| 29 ++
 .../org/apache/atlas/web/rest/EntityREST.java   | 41 +---
 .../org/apache/atlas/web/rest/GlossaryREST.java |  7 ++--
 .../org/apache/atlas/web/rest/LineageREST.java  |  6 +--
 .../apache/atlas/web/rest/RelationshipREST.java | 22 ++-
 .../org/apache/atlas/web/rest/TypesREST.java| 35 ++---
 8 files changed, 32 insertions(+), 120 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/756c272e/build-tools/src/main/resources/enunciate.xml
--
diff --git a/build-tools/src/main/resources/enunciate.xml 
b/build-tools/src/main/resources/enunciate.xml
index dafd66f..e01d696 100755
--- a/build-tools/src/main/resources/enunciate.xml
+++ b/build-tools/src/main/resources/enunciate.xml
@@ -16,8 +16,7 @@
   ~ limitations under the License.
   -->
 
-http://www.w3.org/2001/XMLSchema-instance;
-   
xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.8.0.xsd;>
+http://www.w3.org/2001/XMLSchema-instance; 
xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.11.0.xsd;>
 Atlas REST API
  Atlas exposes a variety of REST endpoints to work with 
types, entities, lineage and data discovery.
 
@@ -26,8 +25,9 @@
 
 
 
-
-
+
+
+
 
 
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/756c272e/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 91ec2c8..887d3ba 100644
--- a/pom.xml
+++ b/pom.xml
@@ -693,7 +693,7 @@
 1.3.7
 2.7
 0.8
-2.10.1
+2.11.1
 4.5
 3.7
 1.8
@@ -716,7 +716,7 @@
 false
 true
 true
-true
+false
 ${project.basedir}
 10
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/756c272e/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java
--
diff --git a/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java 
b/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java
index 82d6f35..64da211 100644
--- a/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java
+++ b/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java
@@ -51,6 +51,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
 import java.io.IOException;
 import java.util.List;
 
@@ -60,6 +61,8 @@ import java.util.List;
 @Path("v2/search")
 @Singleton
 @Service
+@Consumes({Servlets.JSON_MEDIA_TYPE, MediaType.APPLICATION_JSON})
+@Produces({Servlets.JSON_MEDIA_TYPE, MediaType.APPLICATION_JSON})
 public class DiscoveryREST {
 private static final Logger PERF_LOG = 
AtlasPerfTracer.getPerfLogger("rest.DiscoveryREST");
 
@@ -95,8 +98,6 @@ public class DiscoveryREST {
  */
 @GET
 @Path("/dsl")
-@Consumes(Servlets.JSON_MEDIA_TYPE)
-@Produces(Servlets.JSON_MEDIA_TYPE)
 public AtlasSearchResult searchUsingDSL(@QueryParam("query")  
String query,
 @QueryParam("typeName")   
String typeName,
 @QueryParam("classification") 
String classification,
@@ -144,8 +145,6 @@ public class DiscoveryREST {
  */
 @GET
 @Path("/fulltext")
-@Consumes(Servlets.JSON_MEDIA_TYPE)
-@Produces(Servlets.JSON_MEDIA_TYPE)
 public AtlasSearchResult searchUsingFullText(@QueryParam("query")  
String  query,
  
@QueryParam("excludeDeletedEntities") boolean excludeDeletedEntities,
  @QueryParam("limit")  
int limit,
@@ -185,8 +184,6 @@ public class DiscoveryREST {
  */
 @GET
 @Path("/basic")
-

atlas git commit: ATLAS-2934: utility to detect and repair incorrect entity state

2018-10-24 Thread madhan
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 2a547434b -> 8f99ffedf


ATLAS-2934: utility to detect and repair incorrect entity state


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/8f99ffed
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/8f99ffed
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/8f99ffed

Branch: refs/heads/branch-0.8
Commit: 8f99ffedfb9f8b87b4142167cb9e26ebb13f232c
Parents: 2a54743
Author: Madhan Neethiraj 
Authored: Tue Oct 23 09:16:26 2018 -0700
Committer: Madhan Neethiraj 
Committed: Wed Oct 24 16:01:28 2018 -0700

--
 .../model/instance/AtlasCheckStateRequest.java  | 100 ++
 .../model/instance/AtlasCheckStateResult.java   | 257 +++
 .../store/graph/AtlasEntityStore.java   |  10 +
 .../store/graph/v1/AtlasEntityStoreV1.java  |  26 ++
 .../store/graph/v1/EntityGraphRetriever.java|  59 ++--
 .../store/graph/v1/EntityStateChecker.java  | 323 +++
 .../atlas/web/resources/AdminResource.java  |  62 ++--
 .../atlas/web/resources/AdminResourceTest.java  |   4 +-
 8 files changed, 802 insertions(+), 39 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/8f99ffed/intg/src/main/java/org/apache/atlas/model/instance/AtlasCheckStateRequest.java
--
diff --git 
a/intg/src/main/java/org/apache/atlas/model/instance/AtlasCheckStateRequest.java
 
b/intg/src/main/java/org/apache/atlas/model/instance/AtlasCheckStateRequest.java
new file mode 100644
index 000..3184746
--- /dev/null
+++ 
b/intg/src/main/java/org/apache/atlas/model/instance/AtlasCheckStateRequest.java
@@ -0,0 +1,100 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.atlas.model.instance;
+
+import org.apache.atlas.model.typedef.AtlasBaseTypeDef;
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+import java.util.Set;
+
+import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.NONE;
+import static 
org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONLY;
+
+
+/**
+ * Request to run state-check of entities
+ */
+@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, 
fieldVisibility=NONE)
+@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown=true)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.PROPERTY)
+public class AtlasCheckStateRequest implements Serializable {
+private static final long serialVersionUID = 1L;
+
+private Set entityGuids;
+private Set entityTypes;
+private boolean fixIssues;
+
+
+public AtlasCheckStateRequest() {
+}
+
+public Set getEntityGuids() {
+return entityGuids;
+}
+
+public void setEntityGuids(Set entityGuids) {
+this.entityGuids = entityGuids;
+}
+
+public Set getEntityTypes() {
+return entityTypes;
+}
+
+public void setEntityTypes(Set entityTypes) {
+this.entityTypes = entityTypes;
+}
+
+public boolean getFixIssues() {
+return fixIssues;
+}
+
+public void setFixIssues(boolean fixIssues) {
+this.fixIssues = fixIssues;
+}
+
+
+public StringBuilder toString(StringBuilder sb) {
+if (sb == null) {
+sb = new StringBuilder();
+}
+
+sb.append("AtlasCheckStateRequest{");
+sb.append("entityGuids=[");
+AtlasBaseTypeDef.dumpObjects(entityGuids, sb);
+sb.append("], entityTypes=[");
+AtlasBaseTypeDef.dumpObjects(entityTypes, sb);
+sb.append("]");
+sb.append(", fixIssues=").append(fixIssues);
+sb.append("}");
+
+return sb;
+}
+
+@Override
+public String 

atlas git commit: ATLAS-2927: Update lineage query for Process entities

2018-10-24 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 707bcb1cb -> 2a547434b


ATLAS-2927: Update lineage query for Process entities


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/2a547434
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/2a547434
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/2a547434

Branch: refs/heads/branch-0.8
Commit: 2a547434b5dd5a8a78ed915f17b05b674aa9df95
Parents: 707bcb1
Author: Sarath Subramanian 
Authored: Wed Oct 24 11:10:58 2018 -0700
Committer: Sarath Subramanian 
Committed: Wed Oct 24 11:10:58 2018 -0700

--
 .../atlas/discovery/EntityLineageService.java   | 124 +++
 .../atlas/util/AtlasGremlin2QueryProvider.java  |  10 +-
 2 files changed, 78 insertions(+), 56 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/2a547434/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
index c928d35..472d692 100644
--- 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
+++ 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
@@ -26,8 +26,10 @@ import org.apache.atlas.model.instance.AtlasEntityHeader;
 import org.apache.atlas.model.lineage.AtlasLineageInfo;
 import org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection;
 import org.apache.atlas.model.lineage.AtlasLineageInfo.LineageRelation;
+import org.apache.atlas.repository.graphdb.AtlasEdge;
 import org.apache.atlas.repository.graphdb.AtlasGraph;
 import org.apache.atlas.repository.graphdb.AtlasVertex;
+import org.apache.atlas.repository.store.graph.v1.AtlasGraphUtilsV1;
 import org.apache.atlas.repository.store.graph.v1.EntityGraphRetriever;
 import org.apache.atlas.type.AtlasEntityType;
 import org.apache.atlas.type.AtlasTypeRegistry;
@@ -36,6 +38,8 @@ import org.apache.commons.collections.CollectionUtils;
 import org.springframework.stereotype.Service;
 
 import javax.inject.Inject;
+import javax.script.ScriptEngine;
+import javax.script.ScriptException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -45,6 +49,7 @@ import java.util.Set;
 
 import static org.apache.atlas.AtlasClient.DATA_SET_SUPER_TYPE;
 import static org.apache.atlas.AtlasClient.PROCESS_SUPER_TYPE;
+import static org.apache.atlas.AtlasErrorCode.INSTANCE_LINEAGE_QUERY_FAILED;
 import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.BOTH;
 import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.INPUT;
 import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.OUTPUT;
@@ -114,39 +119,14 @@ public class EntityLineageService implements 
AtlasLineageService {
 private AtlasLineageInfo getLineageInfo(String guid, LineageDirection 
direction, int depth, boolean isDataSet) throws AtlasBaseException {
 Map entities = new HashMap<>();
 Set   relations= new HashSet<>();
-String lineageQuery = getLineageQuery(guid, 
direction, depth, isDataSet);
-
-List paths = (List) graph.executeGremlinScript(lineageQuery, true);
-
-if (CollectionUtils.isNotEmpty(paths)) {
-for (Object path : paths) {
-if (path instanceof List) {
-List vertices = (List) path;
-
-if (CollectionUtils.isNotEmpty(vertices)) {
-AtlasEntityHeader prev = null;
-
-for (Object vertex : vertices) {
-if (!(vertex instanceof AtlasVertex)) {
-continue;
-}
-
-AtlasEntityHeader entity = 
entityRetriever.toAtlasEntityHeader((AtlasVertex)vertex);
-
-if (!entities.containsKey(entity.getGuid())) {
-entities.put(entity.getGuid(), entity);
-}
-
-if (prev != null) {
-if (direction.equals(INPUT)) {
-relations.add(new 
LineageRelation(entity.getGuid(), prev.getGuid()));
-} else if (direction.equals(OUTPUT)) {
-relations.add(new 
LineageRelation(prev.getGuid(), entity.getGuid()));
-}
-}
-prev = entity;
-}
-}
+final Map  bindings = new 

atlas git commit: ATLAS-2930: UI changes to handle error message based on softReference attribute

2018-10-24 Thread kbhatt
Repository: atlas
Updated Branches:
  refs/heads/master 46b9b7c85 -> 93bd535eb


ATLAS-2930: UI changes to handle error message based on softReference attribute

Signed-off-by: kevalbhatt 


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/93bd535e
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/93bd535e
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/93bd535e

Branch: refs/heads/master
Commit: 93bd535eb66562ea8aadf5219d09a7893fff724e
Parents: 46b9b7c
Author: Abhishek Kadam 
Authored: Tue Oct 23 12:43:10 2018 +0530
Committer: kevalbhatt 
Committed: Wed Oct 24 18:48:15 2018 +0530

--
 dashboardv2/public/js/utils/CommonViewFunction.js | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/93bd535e/dashboardv2/public/js/utils/CommonViewFunction.js
--
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js 
b/dashboardv2/public/js/utils/CommonViewFunction.js
index 0439177..4af5270 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -79,7 +79,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 attributeDefs = options.attributeDefs;
 
 var table = "",
-fetchInputOutputValue = function(id) {
+fetchInputOutputValue = function(id, defEntity) {
 var that = this;
 scope.entityModel.getEntityHeader(id, {
 success: function(serverData) {
@@ -107,6 +107,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 cust_error: function(error, xhr) {
 if (xhr.status == 403) {
 scope.$('td div[data-id="' + id + 
'"]').html(' Not Authorized');
+} else if (defEntity && defEntity.options && 
defEntity.options.isSoftReference === "true") {
+scope.$('td div[data-id="' + id + 
'"]').html(' ' + id + '');
 } else {
 scope.$('td div[data-id="' + id + 
'"]').html(' ' + 
Messages.defaultErrorMessage + '');
 }
@@ -117,7 +119,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 extractObject = function(opt) {
 var valueOfArray = [],
 keyValue = opt.keyValue,
-key = opt.key;
+key = opt.key,
+defEntity = opt.defEntity;
 if (!_.isArray(keyValue) && _.isObject(keyValue)) {
 keyValue = [keyValue];
 }
@@ -172,7 +175,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 if ((name === "-" || name === id) && 
!inputOutputField.attributes) {
 var fetch = true;
 var fetchId = (_.isObject(id) ? id.id : id);
-fetchInputOutputValue(fetchId);
+fetchInputOutputValue(fetchId, defEntity);
 tempLink += '';
 } else {
 tempLink += '' 
+ name + ''
@@ -212,7 +215,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 if (defEntityType === 'date') {
 keyValue = new Date(keyValue);
 } else if (_.isObject(keyValue)) {
-keyValue = extractObject({ "keyValue": keyValue, "key": 
key });
+keyValue = extractObject({ "keyValue": keyValue, "key": 
key, 'defEntity': defEntity });
 }
 } else {
 if (_.isObject(keyValue)) {



atlas git commit: ATLAS-2930: UI changes to handle error message based on softReference attribute

2018-10-24 Thread kbhatt
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 95cc62be3 -> 707bcb1cb


ATLAS-2930: UI changes to handle error message based on softReference attribute

Signed-off-by: kevalbhatt 


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/707bcb1c
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/707bcb1c
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/707bcb1c

Branch: refs/heads/branch-0.8
Commit: 707bcb1cb9dc38b66a3718d13790e1e6beb9b972
Parents: 95cc62b
Author: Abhishek Kadam 
Authored: Tue Oct 23 12:24:43 2018 +0530
Committer: kevalbhatt 
Committed: Wed Oct 24 18:47:12 2018 +0530

--
 dashboardv2/public/js/utils/CommonViewFunction.js | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/707bcb1c/dashboardv2/public/js/utils/CommonViewFunction.js
--
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js 
b/dashboardv2/public/js/utils/CommonViewFunction.js
index 9863dca..4511e1a 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -83,7 +83,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 attributeDefs = options.attributeDefs;
 
 var table = "",
-fetchInputOutputValue = function(id) {
+fetchInputOutputValue = function(id, defEntity) {
 var that = this;
 scope.entityModel.getEntityHeader(id, {
 success: function(serverData) {
@@ -108,10 +108,19 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 scope.$('td div[data-id="' + id + 
'"]').append(deleteButton);
 }
 },
+cust_error: function(error, xhr) {
+if (xhr.status == 403) {
+scope.$('td div[data-id="' + id + 
'"]').html(' Not Authorized');
+} else if (defEntity && defEntity.options && 
defEntity.options.isSoftReference === "true") {
+scope.$('td div[data-id="' + id + 
'"]').html(' ' + id + '');
+} else {
+scope.$('td div[data-id="' + id + 
'"]').html(' ' + 
Messages.defaultErrorMessage + '');
+}
+},
 complete: function() {}
 });
 },
-extractObject = function(keyValue) {
+extractObject = function(keyValue, defEntity) {
 var valueOfArray = [];
 if (!_.isArray(keyValue) && _.isObject(keyValue)) {
 keyValue = [keyValue];
@@ -168,7 +177,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 if ((name === "-" || name === id) && 
!inputOutputField.attributes) {
 var fetch = true;
 var fetchId = (_.isObject(id) ? id.id : id);
-fetchInputOutputValue(fetchId);
+fetchInputOutputValue(fetchId, defEntity);
 tempLink += '';
 } else {
 tempLink += '' 
+ name + ''
@@ -208,7 +217,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 if (defEntityType === 'date' || defEntityType === 'time') {
 keyValue = new Date(keyValue);
 } else if (_.isObject(keyValue)) {
-keyValue = extractObject(keyValue);
+keyValue = extractObject(keyValue, defEntity);
 }
 } else {
 if (_.isObject(keyValue)) {