incubator-atlas git commit: ATLAS-1925: basic search fixes for ATLAS-1917, ATLAS-1922, ATLAS-1926
Repository: incubator-atlas Updated Branches: refs/heads/0.8-incubating cbf6038c2 -> 35fbd58e4 ATLAS-1925: basic search fixes for ATLAS-1917, ATLAS-1922, ATLAS-1926 Signed-off-by: Madhan Neethiraj (cherry picked from commit abc4856e94e24837eee0dc5efc1763a5ceba6fc9) Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/35fbd58e Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/35fbd58e Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/35fbd58e Branch: refs/heads/0.8-incubating Commit: 35fbd58e40baed438d6e4d7ade77b27511b0ca86 Parents: cbf6038 Author: apoorvnaik Authored: Mon Jul 17 14:09:22 2017 -0700 Committer: Madhan Neethiraj Committed: Mon Jul 17 17:08:24 2017 -0700 -- .../atlas/discovery/EntityDiscoveryService.java | 106 ++- .../apache/atlas/discovery/SearchProcessor.java | 36 +-- 2 files changed, 82 insertions(+), 60 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/35fbd58e/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java -- diff --git a/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java b/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java index a4538bd..c7a624f 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java +++ b/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java @@ -55,6 +55,7 @@ import org.apache.atlas.type.AtlasBuiltInTypes.AtlasObjectIdType; import org.apache.atlas.type.AtlasStructType.AtlasAttribute; import org.apache.atlas.util.AtlasGremlinQueryProvider; import org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery; +import org.apache.atlas.util.SearchTracker; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.StringUtils; @@ -84,17 +85,19 @@ public class EntityDiscoveryService implements AtlasDiscoveryService { private final AtlasGremlinQueryProvider gremlinQueryProvider; private final AtlasTypeRegistry typeRegistry; private final GraphBackedSearchIndexerindexer; +private final SearchTracker searchTracker; private final int maxResultSetSize; private final int maxTypesCountInIdxQuery; private final int maxTagsCountInIdxQuery; @Inject EntityDiscoveryService(MetadataRepository metadataRepository, AtlasTypeRegistry typeRegistry, - AtlasGraph graph, GraphBackedSearchIndexer indexer) throws AtlasException { + AtlasGraph graph, GraphBackedSearchIndexer indexer, SearchTracker searchTracker) throws AtlasException { this.graph= graph; this.graphPersistenceStrategy = new DefaultGraphPersistenceStrategy(metadataRepository); this.entityRetriever = new EntityGraphRetriever(typeRegistry); this.indexer = indexer; +this.searchTracker= searchTracker; this.gremlinQueryProvider = AtlasGremlinQueryProvider.INSTANCE; this.typeRegistry = typeRegistry; this.maxResultSetSize = ApplicationProperties.get().getInt(Constants.INDEX_SEARCH_MAX_RESULT_SET_SIZE, 150); @@ -401,73 +404,78 @@ public class EntityDiscoveryService implements AtlasDiscoveryService { public AtlasSearchResult searchWithParameters(SearchParameters searchParameters) throws AtlasBaseException { AtlasSearchResult ret = new AtlasSearchResult(searchParameters); -SearchContext context = new SearchContext(searchParameters, typeRegistry, graph, indexer.getVertexIndexKeys()); +SearchContext context = new SearchContext(searchParameters, typeRegistry, graph, indexer.getVertexIndexKeys()); +StringsearchID = searchTracker.add(context); // For future cancellations -List resultList = context.getSearchProcessor().execute(); +try { +List resultList = context.getSearchProcessor().execute(); -// By default any attribute that shows up in the search parameter should be sent back in the response -// If additional values are requested then the entityAttributes will be a superset of the all search attributes -// and the explicitly requested attribute(s) -Set resultAttributes = new HashSet<>(); -Set entityAttributes = new HashSet<>(); +// By default any attribute that shows up in the search parameter should be sent
incubator-atlas git commit: ATLAS-1925: basic search fixes for ATLAS-1917, ATLAS-1922, ATLAS-1926
Repository: incubator-atlas Updated Branches: refs/heads/master 3962057c6 -> abc4856e9 ATLAS-1925: basic search fixes for ATLAS-1917, ATLAS-1922, ATLAS-1926 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/abc4856e Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/abc4856e Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/abc4856e Branch: refs/heads/master Commit: abc4856e94e24837eee0dc5efc1763a5ceba6fc9 Parents: 3962057 Author: apoorvnaik Authored: Mon Jul 17 14:09:22 2017 -0700 Committer: Madhan Neethiraj Committed: Mon Jul 17 17:07:53 2017 -0700 -- .../atlas/discovery/EntityDiscoveryService.java | 106 ++- .../apache/atlas/discovery/SearchProcessor.java | 36 +-- 2 files changed, 82 insertions(+), 60 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/abc4856e/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java -- diff --git a/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java b/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java index a4538bd..c7a624f 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java +++ b/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java @@ -55,6 +55,7 @@ import org.apache.atlas.type.AtlasBuiltInTypes.AtlasObjectIdType; import org.apache.atlas.type.AtlasStructType.AtlasAttribute; import org.apache.atlas.util.AtlasGremlinQueryProvider; import org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery; +import org.apache.atlas.util.SearchTracker; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.StringUtils; @@ -84,17 +85,19 @@ public class EntityDiscoveryService implements AtlasDiscoveryService { private final AtlasGremlinQueryProvider gremlinQueryProvider; private final AtlasTypeRegistry typeRegistry; private final GraphBackedSearchIndexerindexer; +private final SearchTracker searchTracker; private final int maxResultSetSize; private final int maxTypesCountInIdxQuery; private final int maxTagsCountInIdxQuery; @Inject EntityDiscoveryService(MetadataRepository metadataRepository, AtlasTypeRegistry typeRegistry, - AtlasGraph graph, GraphBackedSearchIndexer indexer) throws AtlasException { + AtlasGraph graph, GraphBackedSearchIndexer indexer, SearchTracker searchTracker) throws AtlasException { this.graph= graph; this.graphPersistenceStrategy = new DefaultGraphPersistenceStrategy(metadataRepository); this.entityRetriever = new EntityGraphRetriever(typeRegistry); this.indexer = indexer; +this.searchTracker= searchTracker; this.gremlinQueryProvider = AtlasGremlinQueryProvider.INSTANCE; this.typeRegistry = typeRegistry; this.maxResultSetSize = ApplicationProperties.get().getInt(Constants.INDEX_SEARCH_MAX_RESULT_SET_SIZE, 150); @@ -401,73 +404,78 @@ public class EntityDiscoveryService implements AtlasDiscoveryService { public AtlasSearchResult searchWithParameters(SearchParameters searchParameters) throws AtlasBaseException { AtlasSearchResult ret = new AtlasSearchResult(searchParameters); -SearchContext context = new SearchContext(searchParameters, typeRegistry, graph, indexer.getVertexIndexKeys()); +SearchContext context = new SearchContext(searchParameters, typeRegistry, graph, indexer.getVertexIndexKeys()); +StringsearchID = searchTracker.add(context); // For future cancellations -List resultList = context.getSearchProcessor().execute(); +try { +List resultList = context.getSearchProcessor().execute(); -// By default any attribute that shows up in the search parameter should be sent back in the response -// If additional values are requested then the entityAttributes will be a superset of the all search attributes -// and the explicitly requested attribute(s) -Set resultAttributes = new HashSet<>(); -Set entityAttributes = new HashSet<>(); +// By default any attribute that shows up in the search parameter should be sent back in the response +// If additional values are requested then the ent