Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
d7ce0a53
Commit
d7ce0a53
authored
Jul 17, 2017
by
apoorvnaik
Committed by
Madhan Neethiraj
Jul 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1956: AtlasSearchResult should include attributes present in filter criteria
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
abc4856e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
EntityDiscoveryService.java
...va/org/apache/atlas/discovery/EntityDiscoveryService.java
+4
-0
SearchContext.java
...c/main/java/org/apache/atlas/discovery/SearchContext.java
+5
-0
SearchProcessor.java
...main/java/org/apache/atlas/discovery/SearchProcessor.java
+5
-0
No files found.
repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java
View file @
d7ce0a53
...
...
@@ -420,6 +420,10 @@ public class EntityDiscoveryService implements AtlasDiscoveryService {
resultAttributes
.
addAll
(
searchParameters
.
getAttributes
());
}
if
(
CollectionUtils
.
isNotEmpty
(
context
.
getEntityAttributes
()))
{
resultAttributes
.
addAll
(
context
.
getEntityAttributes
());
}
for
(
String
resultAttribute
:
resultAttributes
)
{
AtlasAttribute
attribute
=
context
.
getEntityType
().
getAttribute
(
resultAttribute
);
...
...
repository/src/main/java/org/apache/atlas/discovery/SearchContext.java
View file @
d7ce0a53
...
...
@@ -27,6 +27,7 @@ import org.apache.atlas.type.AtlasTypeRegistry;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.HashSet
;
import
java.util.Set
;
...
...
@@ -35,6 +36,7 @@ public class SearchContext {
private
final
AtlasTypeRegistry
typeRegistry
;
private
final
AtlasGraph
graph
;
private
final
Set
<
String
>
indexedKeys
;
private
final
Set
<
String
>
entityAttributes
;
private
final
AtlasEntityType
entityType
;
private
final
AtlasClassificationType
classificationType
;
private
SearchProcessor
searchProcessor
;
...
...
@@ -45,6 +47,7 @@ public class SearchContext {
this
.
typeRegistry
=
typeRegistry
;
this
.
graph
=
graph
;
this
.
indexedKeys
=
indexedKeys
;
this
.
entityAttributes
=
new
HashSet
<>();
this
.
entityType
=
typeRegistry
.
getEntityTypeByName
(
searchParameters
.
getTypeName
());
this
.
classificationType
=
typeRegistry
.
getClassificationTypeByName
(
searchParameters
.
getClassification
());
...
...
@@ -70,6 +73,8 @@ public class SearchContext {
public
Set
<
String
>
getIndexedKeys
()
{
return
indexedKeys
;
}
public
Set
<
String
>
getEntityAttributes
()
{
return
entityAttributes
;
}
public
AtlasEntityType
getEntityType
()
{
return
entityType
;
}
public
AtlasClassificationType
getClassificationType
()
{
return
classificationType
;
}
...
...
repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
View file @
d7ce0a53
...
...
@@ -118,6 +118,11 @@ public abstract class SearchProcessor {
gremlinFiltered
.
add
(
attributeName
);
}
if
(
structType
instanceof
AtlasEntityType
)
{
// Capture the entity attributes
context
.
getEntityAttributes
().
add
(
attributeName
);
}
allAttributes
.
add
(
attributeName
);
}
catch
(
AtlasBaseException
e
)
{
LOG
.
warn
(
e
.
getMessage
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment