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
a7e89196
Commit
a7e89196
authored
Nov 25, 2017
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2274: search for classification '*' with a typeName filter results in error
ATLAS-2277: search for classification '*' doesn't honor excludeDeletedEntities=true
parent
f5c59710
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
ClassificationSearchProcessor.java
...apache/atlas/discovery/ClassificationSearchProcessor.java
+10
-3
EntitySearchProcessor.java
...ava/org/apache/atlas/discovery/EntitySearchProcessor.java
+14
-3
No files found.
repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java
View file @
a7e89196
...
...
@@ -58,7 +58,7 @@ public class ClassificationSearchProcessor extends SearchProcessor {
private
final
AtlasIndexQuery
indexQuery
;
private
final
AtlasGraphQuery
tagGraphQueryWithAttributes
;
private
final
AtlasGraphQuery
entityGraphQueryTraitNames
;
private
final
Predicate
entityPredicateTraitNames
;
private
Predicate
entityPredicateTraitNames
;
private
final
String
gremlinTagFilterQuery
;
private
final
Map
<
String
,
Object
>
gremlinQueryBindings
;
...
...
@@ -144,12 +144,19 @@ public class ClassificationSearchProcessor extends SearchProcessor {
if
(
classificationType
!=
SearchContext
.
MATCH_ALL_CLASSIFICATION
)
{
entityGraphQueryTraitNames
=
graph
.
query
().
in
(
Constants
.
TRAIT_NAMES_PROPERTY_KEY
,
typeAndSubTypes
);
entityPredicateTraitNames
=
SearchPredicateUtil
.
getContainsAnyPredicateGenerator
().
generatePredicate
(
Constants
.
TRAIT_NAMES_PROPERTY_KEY
,
classificationType
.
getTypeAndAllSubTypes
(),
List
.
class
);
}
else
{
entityGraphQueryTraitNames
=
graph
.
query
().
has
(
Constants
.
TRAIT_NAMES_PROPERTY_KEY
,
NOT_EQUAL
,
null
);
entityPredicateTraitNames
=
SearchPredicateUtil
.
getNotNullPredicateGenerator
().
generatePredicate
(
Constants
.
TRAIT_NAMES_PROPERTY_KEY
,
null
,
List
.
class
);
}
entityPredicateTraitNames
=
SearchPredicateUtil
.
getContainsAnyPredicateGenerator
()
.
generatePredicate
(
Constants
.
TRAIT_NAMES_PROPERTY_KEY
,
classificationType
.
getTypeAndAllSubTypes
(),
List
.
class
);
if
(
context
.
getSearchParameters
().
getExcludeDeletedEntities
())
{
entityGraphQueryTraitNames
.
has
(
Constants
.
STATE_PROPERTY_KEY
,
"ACTIVE"
);
final
Predicate
activePredicate
=
SearchPredicateUtil
.
getEQPredicateGenerator
().
generatePredicate
(
Constants
.
STATE_PROPERTY_KEY
,
"ACTIVE"
,
String
.
class
);
entityPredicateTraitNames
=
PredicateUtils
.
andPredicate
(
entityPredicateTraitNames
,
activePredicate
);
}
gremlinTagFilterQuery
=
null
;
gremlinQueryBindings
=
null
;
...
...
repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java
View file @
a7e89196
...
...
@@ -39,6 +39,8 @@ import java.util.Iterator;
import
java.util.List
;
import
java.util.Set
;
import
static
org
.
apache
.
atlas
.
repository
.
graphdb
.
AtlasGraphQuery
.
ComparisionOperator
.
NOT_EQUAL
;
public
class
EntitySearchProcessor
extends
SearchProcessor
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
EntitySearchProcessor
.
class
);
private
static
final
Logger
PERF_LOG
=
AtlasPerfTracer
.
getPerfLogger
(
"EntitySearchProcessor"
);
...
...
@@ -66,10 +68,15 @@ public class EntitySearchProcessor extends SearchProcessor {
final
Predicate
typeNamePredicate
=
SearchPredicateUtil
.
getINPredicateGenerator
()
.
generatePredicate
(
Constants
.
TYPE_NAME_PROPERTY_KEY
,
typeAndSubTypes
,
String
.
class
);
final
Predicate
traitPredicate
=
SearchPredicateUtil
.
getContainsAnyPredicateGenerator
()
.
generatePredicate
(
Constants
.
TRAIT_NAMES_PROPERTY_KEY
,
classificationTypeAndSubTypes
,
List
.
class
);
final
Predicate
activePredicate
=
SearchPredicateUtil
.
getEQPredicateGenerator
()
.
generatePredicate
(
Constants
.
STATE_PROPERTY_KEY
,
"ACTIVE"
,
String
.
class
);
final
Predicate
traitPredicate
;
if
(
classificationType
==
SearchContext
.
MATCH_ALL_CLASSIFICATION
)
{
traitPredicate
=
SearchPredicateUtil
.
getNotNullPredicateGenerator
().
generatePredicate
(
Constants
.
TRAIT_NAMES_PROPERTY_KEY
,
null
,
List
.
class
);
}
else
{
traitPredicate
=
SearchPredicateUtil
.
getContainsAnyPredicateGenerator
().
generatePredicate
(
Constants
.
TRAIT_NAMES_PROPERTY_KEY
,
classificationTypeAndSubTypes
,
List
.
class
);
}
processSearchAttributes
(
entityType
,
filterCriteria
,
indexAttributes
,
graphAttributes
,
allAttributes
);
...
...
@@ -122,7 +129,11 @@ public class EntitySearchProcessor extends SearchProcessor {
// If we need to filter on the trait names then we need to build the query and equivalent in-memory predicate
if
(
filterClassification
)
{
query
.
in
(
Constants
.
TRAIT_NAMES_PROPERTY_KEY
,
classificationTypeAndSubTypes
);
if
(
classificationType
==
SearchContext
.
MATCH_ALL_CLASSIFICATION
)
{
query
.
has
(
Constants
.
TRAIT_NAMES_PROPERTY_KEY
,
NOT_EQUAL
,
null
);
}
else
{
query
.
in
(
Constants
.
TRAIT_NAMES_PROPERTY_KEY
,
classificationTypeAndSubTypes
);
}
// Construct a parallel in-memory predicate
if
(
graphQueryPredicate
!=
null
)
{
...
...
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