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
c0f0abc1
Commit
c0f0abc1
authored
Sep 19, 2017
by
apoorvnaik
Committed by
Madhan Neethiraj
Sep 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2121: basic-search update to use case-sensitive filter for type-name / tag-name
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
400477c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
ClassificationSearchProcessor.java
...apache/atlas/discovery/ClassificationSearchProcessor.java
+9
-1
EntitySearchProcessor.java
...ava/org/apache/atlas/discovery/EntitySearchProcessor.java
+9
-8
No files found.
repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java
View file @
c0f0abc1
...
@@ -34,6 +34,7 @@ import org.apache.atlas.util.SearchPredicateUtil;
...
@@ -34,6 +34,7 @@ import org.apache.atlas.util.SearchPredicateUtil;
import
org.apache.atlas.utils.AtlasPerfTracer
;
import
org.apache.atlas.utils.AtlasPerfTracer
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.Predicate
;
import
org.apache.commons.collections.Predicate
;
import
org.apache.commons.collections.PredicateUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -93,7 +94,14 @@ public class ClassificationSearchProcessor extends SearchProcessor {
...
@@ -93,7 +94,14 @@ public class ClassificationSearchProcessor extends SearchProcessor {
this
.
indexQuery
=
graph
.
indexQuery
(
Constants
.
VERTEX_INDEX
,
indexQueryString
);
this
.
indexQuery
=
graph
.
indexQuery
(
Constants
.
VERTEX_INDEX
,
indexQueryString
);
inMemoryPredicate
=
constructInMemoryPredicate
(
classificationType
,
filterCriteria
,
indexAttributes
);
Predicate
typeNamePredicate
=
SearchPredicateUtil
.
getINPredicateGenerator
()
.
generatePredicate
(
Constants
.
TYPE_NAME_PROPERTY_KEY
,
typeAndSubTypes
,
String
.
class
);
Predicate
attributePredicate
=
constructInMemoryPredicate
(
classificationType
,
filterCriteria
,
indexAttributes
);
if
(
attributePredicate
!=
null
)
{
inMemoryPredicate
=
PredicateUtils
.
andPredicate
(
typeNamePredicate
,
attributePredicate
);
}
else
{
inMemoryPredicate
=
typeNamePredicate
;
}
}
else
{
}
else
{
indexQuery
=
null
;
indexQuery
=
null
;
}
}
...
...
repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java
View file @
c0f0abc1
...
@@ -80,12 +80,20 @@ public class EntitySearchProcessor extends SearchProcessor {
...
@@ -80,12 +80,20 @@ public class EntitySearchProcessor extends SearchProcessor {
if
(
typeSearchByIndex
)
{
if
(
typeSearchByIndex
)
{
constructTypeTestQuery
(
indexQuery
,
typeAndSubTypesQryStr
);
constructTypeTestQuery
(
indexQuery
,
typeAndSubTypesQryStr
);
// TypeName check to be done in-memory as well to address ATLAS-2121 (case sensitivity)
inMemoryPredicate
=
typeNamePredicate
;
}
}
if
(
attrSearchByIndex
)
{
if
(
attrSearchByIndex
)
{
constructFilterQuery
(
indexQuery
,
entityType
,
filterCriteria
,
indexAttributes
);
constructFilterQuery
(
indexQuery
,
entityType
,
filterCriteria
,
indexAttributes
);
inMemoryPredicate
=
constructInMemoryPredicate
(
entityType
,
filterCriteria
,
indexAttributes
);
Predicate
attributePredicate
=
constructInMemoryPredicate
(
entityType
,
filterCriteria
,
indexAttributes
);
if
(
inMemoryPredicate
!=
null
)
{
inMemoryPredicate
=
PredicateUtils
.
andPredicate
(
inMemoryPredicate
,
attributePredicate
);
}
else
{
inMemoryPredicate
=
attributePredicate
;
}
}
else
{
}
else
{
graphAttributes
.
addAll
(
indexAttributes
);
graphAttributes
.
addAll
(
indexAttributes
);
}
}
...
@@ -110,13 +118,6 @@ public class EntitySearchProcessor extends SearchProcessor {
...
@@ -110,13 +118,6 @@ public class EntitySearchProcessor extends SearchProcessor {
if
(!
typeSearchByIndex
)
{
if
(!
typeSearchByIndex
)
{
query
.
in
(
Constants
.
TYPE_NAME_PROPERTY_KEY
,
typeAndSubTypes
);
query
.
in
(
Constants
.
TYPE_NAME_PROPERTY_KEY
,
typeAndSubTypes
);
// Construct a parallel in-memory predicate
if
(
graphQueryPredicate
!=
null
)
{
graphQueryPredicate
=
PredicateUtils
.
andPredicate
(
graphQueryPredicate
,
typeNamePredicate
);
}
else
{
graphQueryPredicate
=
typeNamePredicate
;
}
}
}
// If we need to filter on the trait names then we need to build the query and equivalent in-memory predicate
// If we need to filter on the trait names then we need to build the query and equivalent in-memory predicate
...
...
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