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
eaf067bc
Commit
eaf067bc
authored
6 years ago
by
apoorvnaik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2705: Search using term shouldn't show deleted entities by default
Change-Id: I23b53086b2bb2380f451e7d85b59096edc610181
parent
0b9d7113
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
SearchContext.java
...c/main/java/org/apache/atlas/discovery/SearchContext.java
+7
-3
TermSearchProcessor.java
.../java/org/apache/atlas/discovery/TermSearchProcessor.java
+1
-5
No files found.
repository/src/main/java/org/apache/atlas/discovery/SearchContext.java
View file @
eaf067bc
...
...
@@ -27,16 +27,15 @@ import org.apache.atlas.model.typedef.AtlasClassificationDef;
import
org.apache.atlas.repository.Constants
;
import
org.apache.atlas.repository.graph.GraphHelper
;
import
org.apache.atlas.repository.graphdb.AtlasEdge
;
import
org.apache.atlas.repository.graphdb.AtlasEdgeDirection
;
import
org.apache.atlas.repository.graphdb.AtlasGraph
;
import
org.apache.atlas.repository.graphdb.AtlasGraphQuery
;
import
org.apache.atlas.repository.graphdb.AtlasVertex
;
import
org.apache.atlas.repository.store.graph.v1.AtlasGraphUtilsV1
;
import
org.apache.atlas.type.AtlasClassificationType
;
import
org.apache.atlas.type.AtlasEntityType
;
import
org.apache.atlas.type.AtlasStructType
;
import
org.apache.atlas.type.AtlasStructType.AtlasAttribute
;
import
org.apache.atlas.type.AtlasTypeRegistry
;
import
org.apache.atlas.v1.model.instance.Id
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -233,11 +232,16 @@ public class SearchContext {
AtlasAttribute
attr
=
termType
.
getRelationshipAttribute
(
TermSearchProcessor
.
ATLAS_GLOSSARY_TERM_ATTR_ASSIGNED_ENTITIES
);
Iterator
<
AtlasEdge
>
edges
=
GraphHelper
.
getEdgesForLabel
(
glossaryTerm
,
attr
.
getRelationshipEdgeLabel
(),
attr
.
getRelationshipEdgeDirection
());
boolean
excludeDeletedEntities
=
searchParameters
.
getExcludeDeletedEntities
();
if
(
edges
!=
null
)
{
while
(
edges
.
hasNext
())
{
AtlasEdge
edge
=
edges
.
next
();
ret
.
add
(
edge
.
getInVertex
());
AtlasVertex
inVertex
=
edge
.
getInVertex
();
if
(
excludeDeletedEntities
&&
AtlasGraphUtilsV1
.
getState
(
inVertex
)
==
AtlasEntity
.
Status
.
DELETED
)
{
continue
;
}
ret
.
add
(
inVertex
);
}
}
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/discovery/TermSearchProcessor.java
View file @
eaf067bc
...
...
@@ -20,7 +20,6 @@ package org.apache.atlas.discovery;
import
org.apache.atlas.repository.graphdb.AtlasVertex
;
import
org.apache.atlas.utils.AtlasPerfTracer
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.Predicate
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -89,9 +88,7 @@ public class TermSearchProcessor extends SearchProcessor {
if
(
CollectionUtils
.
isEmpty
(
assignedEntities
))
{
entityVertices
.
clear
();
}
else
{
CollectionUtils
.
filter
(
entityVertices
,
new
Predicate
()
{
@Override
public
boolean
evaluate
(
Object
o
)
{
CollectionUtils
.
filter
(
entityVertices
,
o
->
{
if
(
o
instanceof
AtlasVertex
)
{
AtlasVertex
entityVertex
=
(
AtlasVertex
)
o
;
...
...
@@ -103,7 +100,6 @@ public class TermSearchProcessor extends SearchProcessor {
}
return
false
;
}
});
}
}
...
...
This diff is collapsed.
Click to expand it.
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