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
64c9bde6
Commit
64c9bde6
authored
7 years ago
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2082: basic-search fails when in-memory filters all results from index-query
parent
bb189766
master
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
ClassificationSearchProcessor.java
...apache/atlas/discovery/ClassificationSearchProcessor.java
+5
-4
EntitySearchProcessor.java
...ava/org/apache/atlas/discovery/EntitySearchProcessor.java
+14
-4
No files found.
repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java
View file @
64c9bde6
...
@@ -236,6 +236,10 @@ public class ClassificationSearchProcessor extends SearchProcessor {
...
@@ -236,6 +236,10 @@ public class ClassificationSearchProcessor extends SearchProcessor {
// Now filter on the tag attributes
// Now filter on the tag attributes
Set
<
String
>
guids
=
getGuids
(
entityVertices
);
Set
<
String
>
guids
=
getGuids
(
entityVertices
);
// Clear prior results
entityVertices
.
clear
();
if
(
CollectionUtils
.
isNotEmpty
(
guids
))
{
gremlinQueryBindings
.
put
(
"guids"
,
guids
);
gremlinQueryBindings
.
put
(
"guids"
,
guids
);
try
{
try
{
...
@@ -243,17 +247,14 @@ public class ClassificationSearchProcessor extends SearchProcessor {
...
@@ -243,17 +247,14 @@ public class ClassificationSearchProcessor extends SearchProcessor {
ScriptEngine
gremlinScriptEngine
=
graph
.
getGremlinScriptEngine
();
ScriptEngine
gremlinScriptEngine
=
graph
.
getGremlinScriptEngine
();
List
<
AtlasVertex
>
atlasVertices
=
(
List
<
AtlasVertex
>)
graph
.
executeGremlinScript
(
gremlinScriptEngine
,
gremlinQueryBindings
,
gremlinTagFilterQuery
,
false
);
List
<
AtlasVertex
>
atlasVertices
=
(
List
<
AtlasVertex
>)
graph
.
executeGremlinScript
(
gremlinScriptEngine
,
gremlinQueryBindings
,
gremlinTagFilterQuery
,
false
);
// Clear prior results
entityVertices
.
clear
();
if
(
CollectionUtils
.
isNotEmpty
(
atlasVertices
))
{
if
(
CollectionUtils
.
isNotEmpty
(
atlasVertices
))
{
entityVertices
.
addAll
(
atlasVertices
);
entityVertices
.
addAll
(
atlasVertices
);
}
}
}
catch
(
AtlasBaseException
|
ScriptException
e
)
{
}
catch
(
AtlasBaseException
|
ScriptException
e
)
{
LOG
.
warn
(
e
.
getMessage
(),
e
);
LOG
.
warn
(
e
.
getMessage
(),
e
);
}
}
}
}
}
super
.
filter
(
entityVertices
);
super
.
filter
(
entityVertices
);
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java
View file @
64c9bde6
...
@@ -173,13 +173,18 @@ public class EntitySearchProcessor extends SearchProcessor {
...
@@ -173,13 +173,18 @@ public class EntitySearchProcessor extends SearchProcessor {
CollectionUtils
.
filter
(
entityVertices
,
inMemoryPredicate
);
CollectionUtils
.
filter
(
entityVertices
,
inMemoryPredicate
);
if
(
graphQuery
!=
null
)
{
if
(
graphQuery
!=
null
)
{
AtlasGraphQuery
guidQuery
=
context
.
getGraph
().
query
().
in
(
Constants
.
GUID_PROPERTY_KEY
,
getGuids
(
entityVertices
));
Set
<
String
>
guids
=
getGuids
(
entityVertices
);
entityVertices
.
clear
();
if
(
CollectionUtils
.
isNotEmpty
(
guids
))
{
AtlasGraphQuery
guidQuery
=
context
.
getGraph
().
query
().
in
(
Constants
.
GUID_PROPERTY_KEY
,
guids
);
guidQuery
.
addConditionsFrom
(
graphQuery
);
guidQuery
.
addConditionsFrom
(
graphQuery
);
entityVertices
.
clear
();
getVertices
(
guidQuery
.
vertices
().
iterator
(),
entityVertices
);
getVertices
(
guidQuery
.
vertices
().
iterator
(),
entityVertices
);
}
}
}
}
else
{
}
else
{
Iterator
<
AtlasVertex
>
queryResult
=
graphQuery
.
vertices
(
qryOffset
,
limit
).
iterator
();
Iterator
<
AtlasVertex
>
queryResult
=
graphQuery
.
vertices
(
qryOffset
,
limit
).
iterator
();
...
@@ -211,12 +216,17 @@ public class EntitySearchProcessor extends SearchProcessor {
...
@@ -211,12 +216,17 @@ public class EntitySearchProcessor extends SearchProcessor {
LOG
.
debug
(
"==> EntitySearchProcessor.filter({})"
,
entityVertices
.
size
());
LOG
.
debug
(
"==> EntitySearchProcessor.filter({})"
,
entityVertices
.
size
());
}
}
AtlasGraphQuery
query
=
context
.
getGraph
().
query
().
in
(
Constants
.
GUID_PROPERTY_KEY
,
getGuids
(
entityVertices
));
Set
<
String
>
guids
=
getGuids
(
entityVertices
);
entityVertices
.
clear
();
if
(
CollectionUtils
.
isNotEmpty
(
guids
))
{
AtlasGraphQuery
query
=
context
.
getGraph
().
query
().
in
(
Constants
.
GUID_PROPERTY_KEY
,
guids
);
query
.
addConditionsFrom
(
filterGraphQuery
);
query
.
addConditionsFrom
(
filterGraphQuery
);
entityVertices
.
clear
();
getVertices
(
query
.
vertices
().
iterator
(),
entityVertices
);
getVertices
(
query
.
vertices
().
iterator
(),
entityVertices
);
}
super
.
filter
(
entityVertices
);
super
.
filter
(
entityVertices
);
...
...
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