incubator-atlas git commit: ATLAS-1952: UI optimization to use searchResult.referredEntity to render object type attributes

2017-07-14 Thread madhan
Repository: incubator-atlas
Updated Branches:
  refs/heads/0.8-incubating c1f0f4964 -> da9a0e2e7


ATLAS-1952: UI optimization to use searchResult.referredEntity to render object 
type attributes

Signed-off-by: Madhan Neethiraj 
(cherry picked from commit 84c6d52d266c6aa2039e7e8cb9a7edb8f4bb8a93)


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

Branch: refs/heads/0.8-incubating
Commit: da9a0e2e796e985744bae84bc50387fc3b432816
Parents: c1f0f49
Author: kevalbhatt 
Authored: Fri Jul 14 17:47:03 2017 +0530
Committer: Madhan Neethiraj 
Committed: Fri Jul 14 16:26:10 2017 -0700

--
 dashboardv2/public/js/collection/VSearchList.js|  3 ++-
 dashboardv2/public/js/utils/CommonViewFunction.js  | 17 ++---
 dashboardv2/public/js/utils/Utils.js   | 17 -
 .../js/views/entity/EntityDetailTableLayoutView.js |  7 ---
 .../js/views/search/SearchResultLayoutView.js  |  5 -
 5 files changed, 28 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/da9a0e2e/dashboardv2/public/js/collection/VSearchList.js
--
diff --git a/dashboardv2/public/js/collection/VSearchList.js 
b/dashboardv2/public/js/collection/VSearchList.js
index 6291838..0a7b713 100644
--- a/dashboardv2/public/js/collection/VSearchList.js
+++ b/dashboardv2/public/js/collection/VSearchList.js
@@ -37,6 +37,7 @@ define(['require',
 parseRecords: function(resp, options) {
 this.queryType = resp.queryType;
 this.queryText = resp.queryText;
+this.referredEntities = resp.referredEntities;
 return resp.entities ? resp.entities : [];
 },
 getBasicRearchResult: function(options) {
@@ -62,4 +63,4 @@ define(['require',
 }
 );
 return VSearchList;
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/da9a0e2e/dashboardv2/public/js/utils/CommonViewFunction.js
--
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js 
b/dashboardv2/public/js/utils/CommonViewFunction.js
index a04fb3f..6b8f50d 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -75,19 +75,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 }
 });
 };
-CommonViewFunction.findAndmergeRefEntity = function(attributeObject, 
referredEntities) {
-_.each(attributeObject, function(obj, key) {
-if (_.isObject(obj)) {
-if (_.isArray(obj)) {
-_.each(obj, function(value) {
-_.extend(value, referredEntities[value.guid]);
-});
-} else {
-_.extend(obj, referredEntities[obj.guid]);
-}
-}
-});
-}
 CommonViewFunction.propertyTable = function(options) {
 var scope = options.scope,
 valueObject = options.valueObject,
@@ -179,7 +166,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 }
 if (id && inputOutputField) {
 var name = Utils.getName(inputOutputField);
-if (name === "-" || name === id) {
+if ((name === "-" || name === id) && 
!inputOutputField.attributes) {
 var fetch = true;
 var fetchId = (_.isObject(id) ? id.id : id);
 fetchInputOutputValue(fetchId);
@@ -474,4 +461,4 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 }
 }
 return CommonViewFunction;
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/da9a0e2e/dashboardv2/public/js/utils/Utils.js
--
diff --git a/dashboardv2/public/js/utils/Utils.js 
b/dashboardv2/public/js/utils/Utils.js
index 9071df3..6e0453b 100644
--- a/dashboardv2/public/js/utils/Utils.js
+++ b/dashboardv2/public/js/utils/Utils.js
@@ -454,6 +454,21 @@ define(['require', 'utils/Globals', 'pnotify', 
'utils/Messages', 'pnotify.button
 loaderEl.hide();
 titleBoxEl.fadeIn();
 }
+Utils.findAndMergeRefEntity = function(attributeObject, referredEntities) {
+if (attributeObject && referred

incubator-atlas git commit: ATLAS-1952: UI optimization to use searchResult.referredEntity to render object type attributes

2017-07-14 Thread madhan
Repository: incubator-atlas
Updated Branches:
  refs/heads/master bcec42e33 -> 84c6d52d2


ATLAS-1952: UI optimization to use searchResult.referredEntity to render object 
type attributes

Signed-off-by: Madhan Neethiraj 


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

Branch: refs/heads/master
Commit: 84c6d52d266c6aa2039e7e8cb9a7edb8f4bb8a93
Parents: bcec42e
Author: kevalbhatt 
Authored: Fri Jul 14 17:47:03 2017 +0530
Committer: Madhan Neethiraj 
Committed: Fri Jul 14 16:08:31 2017 -0700

--
 dashboardv2/public/js/collection/VSearchList.js|  3 ++-
 dashboardv2/public/js/utils/CommonViewFunction.js  | 17 ++---
 dashboardv2/public/js/utils/Utils.js   | 17 -
 .../js/views/entity/EntityDetailTableLayoutView.js |  7 ---
 .../js/views/search/SearchResultLayoutView.js  |  5 -
 5 files changed, 28 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/84c6d52d/dashboardv2/public/js/collection/VSearchList.js
--
diff --git a/dashboardv2/public/js/collection/VSearchList.js 
b/dashboardv2/public/js/collection/VSearchList.js
index 6291838..0a7b713 100644
--- a/dashboardv2/public/js/collection/VSearchList.js
+++ b/dashboardv2/public/js/collection/VSearchList.js
@@ -37,6 +37,7 @@ define(['require',
 parseRecords: function(resp, options) {
 this.queryType = resp.queryType;
 this.queryText = resp.queryText;
+this.referredEntities = resp.referredEntities;
 return resp.entities ? resp.entities : [];
 },
 getBasicRearchResult: function(options) {
@@ -62,4 +63,4 @@ define(['require',
 }
 );
 return VSearchList;
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/84c6d52d/dashboardv2/public/js/utils/CommonViewFunction.js
--
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js 
b/dashboardv2/public/js/utils/CommonViewFunction.js
index a04fb3f..6b8f50d 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -75,19 +75,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 }
 });
 };
-CommonViewFunction.findAndmergeRefEntity = function(attributeObject, 
referredEntities) {
-_.each(attributeObject, function(obj, key) {
-if (_.isObject(obj)) {
-if (_.isArray(obj)) {
-_.each(obj, function(value) {
-_.extend(value, referredEntities[value.guid]);
-});
-} else {
-_.extend(obj, referredEntities[obj.guid]);
-}
-}
-});
-}
 CommonViewFunction.propertyTable = function(options) {
 var scope = options.scope,
 valueObject = options.valueObject,
@@ -179,7 +166,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 }
 if (id && inputOutputField) {
 var name = Utils.getName(inputOutputField);
-if (name === "-" || name === id) {
+if ((name === "-" || name === id) && 
!inputOutputField.attributes) {
 var fetch = true;
 var fetchId = (_.isObject(id) ? id.id : id);
 fetchInputOutputValue(fetchId);
@@ -474,4 +461,4 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 }
 }
 return CommonViewFunction;
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/84c6d52d/dashboardv2/public/js/utils/Utils.js
--
diff --git a/dashboardv2/public/js/utils/Utils.js 
b/dashboardv2/public/js/utils/Utils.js
index 9071df3..6e0453b 100644
--- a/dashboardv2/public/js/utils/Utils.js
+++ b/dashboardv2/public/js/utils/Utils.js
@@ -454,6 +454,21 @@ define(['require', 'utils/Globals', 'pnotify', 
'utils/Messages', 'pnotify.button
 loaderEl.hide();
 titleBoxEl.fadeIn();
 }
+Utils.findAndMergeRefEntity = function(attributeObject, referredEntities) {
+if (attributeObject && referredEntities) {
+_.each(attributeObject, function(obj, key) {
+  

[2/2] incubator-atlas git commit: ATLAS-1947: AtlasSearchResult to include referredEntity headers

2017-07-14 Thread madhan
ATLAS-1947: AtlasSearchResult to include referredEntity headers

(cherry picked from commit bcec42e3306c9517c1ded5e7ed538c76cfd29c33)


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

Branch: refs/heads/0.8-incubating
Commit: c1f0f4964a786d572a10866692fb790d6ca4d45d
Parents: c5f10a9
Author: apoorvnaik 
Authored: Thu Jul 13 09:03:06 2017 -0700
Committer: Madhan Neethiraj 
Committed: Fri Jul 14 16:03:08 2017 -0700

--
 .../model/discovery/AtlasSearchResult.java  |  78 ++-
 .../atlas/model/discovery/SearchParameters.java |  34 +-
 .../atlas/discovery/AtlasDiscoveryService.java  |   2 +-
 .../ClassificationSearchProcessor.java  | 198 ++
 .../atlas/discovery/EntityDiscoveryService.java | 138 +++--
 .../atlas/discovery/EntitySearchProcessor.java  | 203 ++
 .../discovery/FullTextSearchProcessor.java  | 110 
 .../org/apache/atlas/discovery/GremlinStep.java | 389 
 .../apache/atlas/discovery/SearchContext.java   | 126 
 .../apache/atlas/discovery/SearchPipeline.java  | 611 ---
 .../apache/atlas/discovery/SearchProcessor.java | 381 
 .../org/apache/atlas/discovery/SolrStep.java| 288 -
 .../store/graph/v1/EntityGraphRetriever.java|  20 +-
 .../org/apache/atlas/util/SearchTracker.java|  16 +-
 .../test/java/org/apache/atlas/TestModules.java |   3 -
 .../atlas/web/resources/AdminResource.java  |   4 +-
 .../apache/atlas/web/rest/DiscoveryREST.java|   2 +-
 17 files changed, 1216 insertions(+), 1387 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c1f0f496/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java
--
diff --git 
a/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java 
b/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java
index 9513dcb..5827440 100644
--- a/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java
+++ b/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java
@@ -31,6 +31,7 @@ import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
 
 import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.NONE;
@@ -40,14 +41,15 @@ import static 
org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONL
 @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class AtlasSearchResult implements Serializable {
-private AtlasQueryTypequeryType;
-private SearchParameters  searchParameters;
-private StringqueryText;
-private Stringtype;
-private Stringclassification;
-private List   entities;
-private AttributeSearchResult attributes;
-private List fullTextResult;
+private AtlasQueryType queryType;
+private SearchParameters   searchParameters;
+private String queryText;
+private String type;
+private String classification;
+private Listentities;
+private AttributeSearchResult  attributes;
+private List  fullTextResult;
+private Map referredEntities;
 
 public AtlasSearchResult() {}
 
@@ -62,6 +64,7 @@ public class AtlasSearchResult implements Serializable {
 setEntities(null);
 setAttributes(null);
 setFullTextResult(null);
+setReferredEntities(null);
 }
 
 public AtlasSearchResult(SearchParameters searchParameters) {
@@ -73,6 +76,7 @@ public class AtlasSearchResult implements Serializable {
 setEntities(null);
 setAttributes(null);
 setFullTextResult(null);
+setReferredEntities(null);
 }
 }
 
@@ -80,6 +84,14 @@ public class AtlasSearchResult implements Serializable {
 
 public void setQueryType(AtlasQueryType queryType) { this.queryType = 
queryType; }
 
+public SearchParameters getSearchParameters() {
+return searchParameters;
+}
+
+public void setSearchParameters(SearchParameters searchParameters) {
+this.searchParameters = searchParameters;
+}
+
 public String getQueryText() { return queryText; }
 
 public void setQueryText(String queryText) { this.queryText = queryText; }
@@ -104,6 +116,17 @@ public class AtlasSearchResult implements Serializable 

[1/2] incubator-atlas git commit: ATLAS-1947: AtlasSearchResult to include referredEntity headers

2017-07-14 Thread madhan
Repository: incubator-atlas
Updated Branches:
  refs/heads/0.8-incubating c5f10a9af -> c1f0f4964


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c1f0f496/repository/src/main/java/org/apache/atlas/discovery/SearchPipeline.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/SearchPipeline.java 
b/repository/src/main/java/org/apache/atlas/discovery/SearchPipeline.java
deleted file mode 100644
index 0f91b2d..000
--- a/repository/src/main/java/org/apache/atlas/discovery/SearchPipeline.java
+++ /dev/null
@@ -1,611 +0,0 @@
-/**
- * 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.discovery;
-
-import org.apache.atlas.exception.AtlasBaseException;
-import org.apache.atlas.model.discovery.SearchParameters;
-import org.apache.atlas.model.discovery.SearchParameters.FilterCriteria;
-import 
org.apache.atlas.model.discovery.SearchParameters.FilterCriteria.Condition;
-import org.apache.atlas.repository.Constants;
-import org.apache.atlas.repository.graph.GraphBackedSearchIndexer;
-import org.apache.atlas.repository.graphdb.*;
-import org.apache.atlas.type.AtlasClassificationType;
-import org.apache.atlas.type.AtlasEntityType;
-import org.apache.atlas.type.AtlasStructType;
-import org.apache.atlas.type.AtlasTypeRegistry;
-import org.apache.atlas.util.SearchTracker;
-import org.apache.atlas.utils.AtlasPerfTracer;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import javax.inject.Inject;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-@Component
-public class SearchPipeline {
-private static final Logger LOG  = 
LoggerFactory.getLogger(SearchPipeline.class);
-private static final Logger PERF_LOG = 
AtlasPerfTracer.getPerfLogger("SearchPipeline");
-
-enum ExecutionMode { SOLR, GREMLIN, MIXED }
-
-enum IndexResultType { TAG, ENTITY, TEXT }
-
-private final SolrStep solrStep;
-private final GremlinStep  gremlinStep;
-private final SearchTrackersearchTracker;
-private final AtlasTypeRegistrytypeRegistry;
-private final ConfigurationatlasConfiguration;
-private final GraphBackedSearchIndexer indexer;
-
-@Inject
-public SearchPipeline(SolrStep solrStep, GremlinStep gremlinStep, 
SearchTracker searchTracker, AtlasTypeRegistry typeRegistry, Configuration 
atlasConfiguration, GraphBackedSearchIndexer indexer) {
-this.solrStep   = solrStep;
-this.gremlinStep= gremlinStep;
-this.searchTracker  = searchTracker;
-this.typeRegistry   = typeRegistry;
-this.atlasConfiguration = atlasConfiguration;
-this.indexer= indexer;
-}
-
-public List run(SearchParameters searchParameters) throws 
AtlasBaseException {
-final List ret;
-
-AtlasPerfTracer perf = null;
-
-if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, 
"SearchPipeline.run("+ searchParameters +")");
-}
-
-AtlasEntityType entityType = 
typeRegistry.getEntityTypeByName(searchParameters.getTypeName());
-AtlasClassificationType classiType = 
typeRegistry.getClassificationTypeByName(searchParameters.getClassification());
-PipelineContext context= new 
PipelineContext(searchParameters, entityType, classiType, 
indexer.getVertexIndexKeys());
-String  searchId   = searchTracker.add(context); // 
For future cancellation
-
-try {
-ExecutionMode mode = determineExecutionMode(context);
-
-if (LOG.isDebugEnabled()) {
-LOG.debug("Execution mode {}", mode);
-}
-
- 

[1/2] incubator-atlas git commit: ATLAS-1947: AtlasSearchResult to include referredEntity headers

2017-07-14 Thread madhan
Repository: incubator-atlas
Updated Branches:
  refs/heads/master 0d8f9f8d2 -> bcec42e33


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/bcec42e3/repository/src/main/java/org/apache/atlas/discovery/SearchPipeline.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/SearchPipeline.java 
b/repository/src/main/java/org/apache/atlas/discovery/SearchPipeline.java
deleted file mode 100644
index 0f91b2d..000
--- a/repository/src/main/java/org/apache/atlas/discovery/SearchPipeline.java
+++ /dev/null
@@ -1,611 +0,0 @@
-/**
- * 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.discovery;
-
-import org.apache.atlas.exception.AtlasBaseException;
-import org.apache.atlas.model.discovery.SearchParameters;
-import org.apache.atlas.model.discovery.SearchParameters.FilterCriteria;
-import 
org.apache.atlas.model.discovery.SearchParameters.FilterCriteria.Condition;
-import org.apache.atlas.repository.Constants;
-import org.apache.atlas.repository.graph.GraphBackedSearchIndexer;
-import org.apache.atlas.repository.graphdb.*;
-import org.apache.atlas.type.AtlasClassificationType;
-import org.apache.atlas.type.AtlasEntityType;
-import org.apache.atlas.type.AtlasStructType;
-import org.apache.atlas.type.AtlasTypeRegistry;
-import org.apache.atlas.util.SearchTracker;
-import org.apache.atlas.utils.AtlasPerfTracer;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import javax.inject.Inject;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-@Component
-public class SearchPipeline {
-private static final Logger LOG  = 
LoggerFactory.getLogger(SearchPipeline.class);
-private static final Logger PERF_LOG = 
AtlasPerfTracer.getPerfLogger("SearchPipeline");
-
-enum ExecutionMode { SOLR, GREMLIN, MIXED }
-
-enum IndexResultType { TAG, ENTITY, TEXT }
-
-private final SolrStep solrStep;
-private final GremlinStep  gremlinStep;
-private final SearchTrackersearchTracker;
-private final AtlasTypeRegistrytypeRegistry;
-private final ConfigurationatlasConfiguration;
-private final GraphBackedSearchIndexer indexer;
-
-@Inject
-public SearchPipeline(SolrStep solrStep, GremlinStep gremlinStep, 
SearchTracker searchTracker, AtlasTypeRegistry typeRegistry, Configuration 
atlasConfiguration, GraphBackedSearchIndexer indexer) {
-this.solrStep   = solrStep;
-this.gremlinStep= gremlinStep;
-this.searchTracker  = searchTracker;
-this.typeRegistry   = typeRegistry;
-this.atlasConfiguration = atlasConfiguration;
-this.indexer= indexer;
-}
-
-public List run(SearchParameters searchParameters) throws 
AtlasBaseException {
-final List ret;
-
-AtlasPerfTracer perf = null;
-
-if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, 
"SearchPipeline.run("+ searchParameters +")");
-}
-
-AtlasEntityType entityType = 
typeRegistry.getEntityTypeByName(searchParameters.getTypeName());
-AtlasClassificationType classiType = 
typeRegistry.getClassificationTypeByName(searchParameters.getClassification());
-PipelineContext context= new 
PipelineContext(searchParameters, entityType, classiType, 
indexer.getVertexIndexKeys());
-String  searchId   = searchTracker.add(context); // 
For future cancellation
-
-try {
-ExecutionMode mode = determineExecutionMode(context);
-
-if (LOG.isDebugEnabled()) {
-LOG.debug("Execution mode {}", mode);
-}
-
- 

[2/2] incubator-atlas git commit: ATLAS-1947: AtlasSearchResult to include referredEntity headers

2017-07-14 Thread madhan
ATLAS-1947: AtlasSearchResult to include referredEntity headers


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

Branch: refs/heads/master
Commit: bcec42e3306c9517c1ded5e7ed538c76cfd29c33
Parents: 0d8f9f8
Author: apoorvnaik 
Authored: Thu Jul 13 09:03:06 2017 -0700
Committer: Madhan Neethiraj 
Committed: Fri Jul 14 16:02:38 2017 -0700

--
 .../model/discovery/AtlasSearchResult.java  |  78 ++-
 .../atlas/model/discovery/SearchParameters.java |  34 +-
 .../atlas/discovery/AtlasDiscoveryService.java  |   2 +-
 .../ClassificationSearchProcessor.java  | 198 ++
 .../atlas/discovery/EntityDiscoveryService.java | 138 +++--
 .../atlas/discovery/EntitySearchProcessor.java  | 203 ++
 .../discovery/FullTextSearchProcessor.java  | 110 
 .../org/apache/atlas/discovery/GremlinStep.java | 389 
 .../apache/atlas/discovery/SearchContext.java   | 126 
 .../apache/atlas/discovery/SearchPipeline.java  | 611 ---
 .../apache/atlas/discovery/SearchProcessor.java | 381 
 .../org/apache/atlas/discovery/SolrStep.java| 288 -
 .../store/graph/v1/EntityGraphRetriever.java|  20 +-
 .../org/apache/atlas/util/SearchTracker.java|  16 +-
 .../test/java/org/apache/atlas/TestModules.java |   3 -
 .../atlas/web/resources/AdminResource.java  |   4 +-
 .../apache/atlas/web/rest/DiscoveryREST.java|   2 +-
 17 files changed, 1216 insertions(+), 1387 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/bcec42e3/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java
--
diff --git 
a/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java 
b/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java
index 9513dcb..5827440 100644
--- a/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java
+++ b/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java
@@ -31,6 +31,7 @@ import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
 
 import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.NONE;
@@ -40,14 +41,15 @@ import static 
org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONL
 @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class AtlasSearchResult implements Serializable {
-private AtlasQueryTypequeryType;
-private SearchParameters  searchParameters;
-private StringqueryText;
-private Stringtype;
-private Stringclassification;
-private List   entities;
-private AttributeSearchResult attributes;
-private List fullTextResult;
+private AtlasQueryType queryType;
+private SearchParameters   searchParameters;
+private String queryText;
+private String type;
+private String classification;
+private Listentities;
+private AttributeSearchResult  attributes;
+private List  fullTextResult;
+private Map referredEntities;
 
 public AtlasSearchResult() {}
 
@@ -62,6 +64,7 @@ public class AtlasSearchResult implements Serializable {
 setEntities(null);
 setAttributes(null);
 setFullTextResult(null);
+setReferredEntities(null);
 }
 
 public AtlasSearchResult(SearchParameters searchParameters) {
@@ -73,6 +76,7 @@ public class AtlasSearchResult implements Serializable {
 setEntities(null);
 setAttributes(null);
 setFullTextResult(null);
+setReferredEntities(null);
 }
 }
 
@@ -80,6 +84,14 @@ public class AtlasSearchResult implements Serializable {
 
 public void setQueryType(AtlasQueryType queryType) { this.queryType = 
queryType; }
 
+public SearchParameters getSearchParameters() {
+return searchParameters;
+}
+
+public void setSearchParameters(SearchParameters searchParameters) {
+this.searchParameters = searchParameters;
+}
+
 public String getQueryText() { return queryText; }
 
 public void setQueryText(String queryText) { this.queryText = queryText; }
@@ -104,6 +116,17 @@ public class AtlasSearchResult implements Serializable {
 
 public void setFullTextResult(List fullTextResult) { 
this.fullTextRe

incubator-atlas git commit: ATLAS-1908: updated to use existing Kafka consumer properties when equivalent new Kafka consumer properties are not present

2017-07-14 Thread madhan
Repository: incubator-atlas
Updated Branches:
  refs/heads/0.8-incubating 63e339a9b -> c5f10a9af


ATLAS-1908: updated to use existing Kafka consumer properties when equivalent 
new Kafka consumer properties are not present

Signed-off-by: Madhan Neethiraj 
(cherry picked from commit 0d8f9f8d2d3902471dc246bd51d3eb7512021f74)


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

Branch: refs/heads/0.8-incubating
Commit: c5f10a9afae9d2fd63792ab18adb26f18e4121a1
Parents: 63e339a
Author: nixonrodrigues 
Authored: Mon Jul 3 18:18:47 2017 +0530
Committer: Madhan Neethiraj 
Committed: Fri Jul 14 15:45:06 2017 -0700

--
 distro/src/conf/atlas-application.properties|  2 +-
 .../org/apache/atlas/kafka/AtlasKafkaConsumer.java  | 13 +++--
 .../org/apache/atlas/kafka/KafkaNotification.java   | 12 ++--
 .../atlas/notification/NotificationConsumer.java|  3 +--
 .../org/apache/atlas/kafka/KafkaConsumerTest.java   | 16 
 .../apache/atlas/kafka/KafkaNotificationTest.java   |  2 +-
 .../AbstractNotificationConsumerTest.java   |  8 
 .../notification/NotificationHookConsumer.java  |  2 +-
 .../NotificationHookConsumerKafkaTest.java  |  2 +-
 .../atlas/web/integration/BaseResourceIT.java   |  2 +-
 10 files changed, 35 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c5f10a9a/distro/src/conf/atlas-application.properties
--
diff --git a/distro/src/conf/atlas-application.properties 
b/distro/src/conf/atlas-application.properties
index c3213df..29a4cc1 100755
--- a/distro/src/conf/atlas-application.properties
+++ b/distro/src/conf/atlas-application.properties
@@ -79,7 +79,7 @@ atlas.kafka.hook.group.id=atlas
 atlas.kafka.enable.auto.commit=false
 atlas.kafka.auto.offset.reset=earliest
 atlas.kafka.session.timeout.ms=3
-
+atlas.kafka.poll.timeout.ms=1000
 
 atlas.notification.create.topics=true
 atlas.notification.replicas=1

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c5f10a9a/notification/src/main/java/org/apache/atlas/kafka/AtlasKafkaConsumer.java
--
diff --git 
a/notification/src/main/java/org/apache/atlas/kafka/AtlasKafkaConsumer.java 
b/notification/src/main/java/org/apache/atlas/kafka/AtlasKafkaConsumer.java
index 9c15243..52d0916 100644
--- a/notification/src/main/java/org/apache/atlas/kafka/AtlasKafkaConsumer.java
+++ b/notification/src/main/java/org/apache/atlas/kafka/AtlasKafkaConsumer.java
@@ -41,19 +41,20 @@ public class AtlasKafkaConsumer extends 
AbstractNotificationConsumer {
 private static final Logger LOG = 
LoggerFactory.getLogger(AtlasKafkaConsumer.class);
 
 private final KafkaConsumer kafkaConsumer;
-private final boolean   autoCommitEnabled;
+private final boolean autoCommitEnabled;
+private long pollTimeoutMilliSeconds = 1000L;
 
-public AtlasKafkaConsumer(MessageDeserializer deserializer, 
KafkaConsumer kafkaConsumer, boolean autoCommitEnabled) {
+public AtlasKafkaConsumer(MessageDeserializer deserializer, 
KafkaConsumer kafkaConsumer, boolean autoCommitEnabled, long 
pollTimeoutMilliSeconds) {
 super(deserializer);
-
-this.kafkaConsumer = kafkaConsumer;
+this.kafkaConsumer = kafkaConsumer;
 this.autoCommitEnabled = autoCommitEnabled;
+this.pollTimeoutMilliSeconds = pollTimeoutMilliSeconds;
 }
 
-public List> receive(long timeoutMilliSeconds) {
+public List> receive() {
 List> messages = new ArrayList();
 
-ConsumerRecords records = 
kafkaConsumer.poll(timeoutMilliSeconds);
+ConsumerRecords records = 
kafkaConsumer.poll(pollTimeoutMilliSeconds);
 
 if (records != null) {
 for (ConsumerRecord record : records) {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/c5f10a9a/notification/src/main/java/org/apache/atlas/kafka/KafkaNotification.java
--
diff --git 
a/notification/src/main/java/org/apache/atlas/kafka/KafkaNotification.java 
b/notification/src/main/java/org/apache/atlas/kafka/KafkaNotification.java
index 366c8a7..38889ef 100644
--- a/notification/src/main/java/org/apache/atlas/kafka/KafkaNotification.java
+++ b/notification/src/main/java/org/apache/atlas/kafka/KafkaNotification.java
@@ -83,6 +83,7 @@ public class KafkaNotification extends AbstractNotification 
implements Service {
 private Properties properties;
 private KafkaConsumer c

incubator-atlas git commit: ATLAS-1908: updated to use existing Kafka consumer properties when equivalent new Kafka consumer properties are not present

2017-07-14 Thread madhan
Repository: incubator-atlas
Updated Branches:
  refs/heads/master de9160844 -> 0d8f9f8d2


ATLAS-1908: updated to use existing Kafka consumer properties when equivalent 
new Kafka consumer properties are not present

Signed-off-by: Madhan Neethiraj 


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

Branch: refs/heads/master
Commit: 0d8f9f8d2d3902471dc246bd51d3eb7512021f74
Parents: de91608
Author: nixonrodrigues 
Authored: Mon Jul 3 18:18:47 2017 +0530
Committer: Madhan Neethiraj 
Committed: Fri Jul 14 15:28:58 2017 -0700

--
 distro/src/conf/atlas-application.properties|  2 +-
 .../org/apache/atlas/kafka/AtlasKafkaConsumer.java  | 13 +++--
 .../org/apache/atlas/kafka/KafkaNotification.java   | 12 ++--
 .../atlas/notification/NotificationConsumer.java|  3 +--
 .../org/apache/atlas/kafka/KafkaConsumerTest.java   | 16 
 .../apache/atlas/kafka/KafkaNotificationTest.java   |  2 +-
 .../AbstractNotificationConsumerTest.java   |  8 
 .../notification/NotificationHookConsumer.java  |  2 +-
 .../NotificationHookConsumerKafkaTest.java  |  2 +-
 .../atlas/web/integration/BaseResourceIT.java   |  2 +-
 10 files changed, 35 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/0d8f9f8d/distro/src/conf/atlas-application.properties
--
diff --git a/distro/src/conf/atlas-application.properties 
b/distro/src/conf/atlas-application.properties
index c3213df..29a4cc1 100755
--- a/distro/src/conf/atlas-application.properties
+++ b/distro/src/conf/atlas-application.properties
@@ -79,7 +79,7 @@ atlas.kafka.hook.group.id=atlas
 atlas.kafka.enable.auto.commit=false
 atlas.kafka.auto.offset.reset=earliest
 atlas.kafka.session.timeout.ms=3
-
+atlas.kafka.poll.timeout.ms=1000
 
 atlas.notification.create.topics=true
 atlas.notification.replicas=1

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/0d8f9f8d/notification/src/main/java/org/apache/atlas/kafka/AtlasKafkaConsumer.java
--
diff --git 
a/notification/src/main/java/org/apache/atlas/kafka/AtlasKafkaConsumer.java 
b/notification/src/main/java/org/apache/atlas/kafka/AtlasKafkaConsumer.java
index 9c15243..52d0916 100644
--- a/notification/src/main/java/org/apache/atlas/kafka/AtlasKafkaConsumer.java
+++ b/notification/src/main/java/org/apache/atlas/kafka/AtlasKafkaConsumer.java
@@ -41,19 +41,20 @@ public class AtlasKafkaConsumer extends 
AbstractNotificationConsumer {
 private static final Logger LOG = 
LoggerFactory.getLogger(AtlasKafkaConsumer.class);
 
 private final KafkaConsumer kafkaConsumer;
-private final boolean   autoCommitEnabled;
+private final boolean autoCommitEnabled;
+private long pollTimeoutMilliSeconds = 1000L;
 
-public AtlasKafkaConsumer(MessageDeserializer deserializer, 
KafkaConsumer kafkaConsumer, boolean autoCommitEnabled) {
+public AtlasKafkaConsumer(MessageDeserializer deserializer, 
KafkaConsumer kafkaConsumer, boolean autoCommitEnabled, long 
pollTimeoutMilliSeconds) {
 super(deserializer);
-
-this.kafkaConsumer = kafkaConsumer;
+this.kafkaConsumer = kafkaConsumer;
 this.autoCommitEnabled = autoCommitEnabled;
+this.pollTimeoutMilliSeconds = pollTimeoutMilliSeconds;
 }
 
-public List> receive(long timeoutMilliSeconds) {
+public List> receive() {
 List> messages = new ArrayList();
 
-ConsumerRecords records = 
kafkaConsumer.poll(timeoutMilliSeconds);
+ConsumerRecords records = 
kafkaConsumer.poll(pollTimeoutMilliSeconds);
 
 if (records != null) {
 for (ConsumerRecord record : records) {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/0d8f9f8d/notification/src/main/java/org/apache/atlas/kafka/KafkaNotification.java
--
diff --git 
a/notification/src/main/java/org/apache/atlas/kafka/KafkaNotification.java 
b/notification/src/main/java/org/apache/atlas/kafka/KafkaNotification.java
index 366c8a7..38889ef 100644
--- a/notification/src/main/java/org/apache/atlas/kafka/KafkaNotification.java
+++ b/notification/src/main/java/org/apache/atlas/kafka/KafkaNotification.java
@@ -83,6 +83,7 @@ public class KafkaNotification extends AbstractNotification 
implements Service {
 private Properties properties;
 private KafkaConsumer consumer = null;
 private KafkaProducer producer = null;
+private Long pollTim

incubator-atlas git commit: ATLAS-1940: fix to remove duplicate type which causes Atlas server to fail during startup

2017-07-14 Thread madhan
Repository: incubator-atlas
Updated Branches:
  refs/heads/0.8-incubating 9b63509dc -> 63e339a9b


ATLAS-1940: fix to remove duplicate type which causes Atlas server to fail 
during startup

Signed-off-by: Madhan Neethiraj 
(cherry picked from commit de91608446514df864995d1e50a8db4276b08ad8)


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

Branch: refs/heads/0.8-incubating
Commit: 63e339a9bf563dee65c3fe07afbf200c224fca4f
Parents: 9b63509
Author: nixonrodrigues 
Authored: Fri Jul 14 19:16:23 2017 +0530
Committer: Madhan Neethiraj 
Committed: Fri Jul 14 15:12:45 2017 -0700

--
 .../store/graph/AtlasTypeDefGraphStore.java | 16 
 1 file changed, 16 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/63e339a9/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
index 17b7e17..97a578e 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
@@ -613,21 +613,37 @@ public abstract class AtlasTypeDefGraphStore implements 
AtlasTypeDefStore, Activ
 for (AtlasStructDef structDef : typesDef.getStructDefs()) {
 rectifyAttributesIfNeeded(entityNames, structDef);
 }
+removeDuplicateTypeIfAny(typesDef.getStructDefs());
 }
 
 if (CollectionUtils.isNotEmpty(typesDef.getClassificationDefs())) {
 for (AtlasClassificationDef classificationDef : 
typesDef.getClassificationDefs()) {
 rectifyAttributesIfNeeded(entityNames, classificationDef);
 }
+removeDuplicateTypeIfAny(typesDef.getClassificationDefs());
 }
 
 if (CollectionUtils.isNotEmpty(typesDef.getEntityDefs())) {
 for (AtlasEntityDef entityDef : typesDef.getEntityDefs()) {
 rectifyAttributesIfNeeded(entityNames, entityDef);
 }
+removeDuplicateTypeIfAny(typesDef.getEntityDefs());
 }
 }
 
+private  void removeDuplicateTypeIfAny(List 
defList) {
+final Set entityDefNames = new HashSet<>();
+
+for (int i = 0; i < defList.size(); i++) {
+if (!entityDefNames.add((defList.get(i)).getName())) {
+LOG.warn(" Found Duplicate Type => " + 
defList.get(i).getName());
+defList.remove(i);
+i--;
+}
+}
+}
+
+
 private void rectifyAttributesIfNeeded(final Set entityNames, 
AtlasStructDef structDef) {
 List attributeDefs = structDef.getAttributeDefs();
 



incubator-atlas git commit: ATLAS-1940: fix to remove duplicate type which causes Atlas server to fail during startup

2017-07-14 Thread madhan
Repository: incubator-atlas
Updated Branches:
  refs/heads/master c3808cf1f -> de9160844


ATLAS-1940: fix to remove duplicate type which causes Atlas server to fail 
during startup

Signed-off-by: Madhan Neethiraj 


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

Branch: refs/heads/master
Commit: de91608446514df864995d1e50a8db4276b08ad8
Parents: c3808cf
Author: nixonrodrigues 
Authored: Fri Jul 14 19:16:23 2017 +0530
Committer: Madhan Neethiraj 
Committed: Fri Jul 14 14:53:37 2017 -0700

--
 .../store/graph/AtlasTypeDefGraphStore.java| 17 +
 1 file changed, 17 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/de916084/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
index 9d9c59d..eedcd10 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
@@ -159,6 +159,7 @@ public abstract class AtlasTypeDefGraphStore implements 
AtlasTypeDefStore, Activ
 
 return ret;
 }
+
 @Override
 public AtlasRelationshipDef getRelationshipDefByName(String name) throws 
AtlasBaseException {
 AtlasRelationshipDef ret = typeRegistry.getRelationshipDefByName(name);
@@ -680,21 +681,37 @@ public abstract class AtlasTypeDefGraphStore implements 
AtlasTypeDefStore, Activ
 for (AtlasStructDef structDef : typesDef.getStructDefs()) {
 rectifyAttributesIfNeeded(entityNames, structDef);
 }
+removeDuplicateTypeIfAny(typesDef.getStructDefs());
 }
 
 if (CollectionUtils.isNotEmpty(typesDef.getClassificationDefs())) {
 for (AtlasClassificationDef classificationDef : 
typesDef.getClassificationDefs()) {
 rectifyAttributesIfNeeded(entityNames, classificationDef);
 }
+removeDuplicateTypeIfAny(typesDef.getClassificationDefs());
 }
 
 if (CollectionUtils.isNotEmpty(typesDef.getEntityDefs())) {
 for (AtlasEntityDef entityDef : typesDef.getEntityDefs()) {
 rectifyAttributesIfNeeded(entityNames, entityDef);
 }
+removeDuplicateTypeIfAny(typesDef.getEntityDefs());
 }
 }
 
+private  void removeDuplicateTypeIfAny(List 
defList) {
+final Set entityDefNames = new HashSet<>();
+
+for (int i = 0; i < defList.size(); i++) {
+if (!entityDefNames.add((defList.get(i)).getName())) {
+LOG.warn(" Found Duplicate Type => " + 
defList.get(i).getName());
+defList.remove(i);
+i--;
+}
+}
+}
+
+
 private void rectifyAttributesIfNeeded(final Set entityNames, 
AtlasStructDef structDef) {
 List attributeDefs = structDef.getAttributeDefs();