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
Aug 23, 2017
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
20 deletions
+31
-20
ClassificationSearchProcessor.java
...apache/atlas/discovery/ClassificationSearchProcessor.java
+13
-12
EntitySearchProcessor.java
...ava/org/apache/atlas/discovery/EntitySearchProcessor.java
+18
-8
No files found.
repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java
View file @
64c9bde6
...
...
@@ -236,22 +236,23 @@ public class ClassificationSearchProcessor extends SearchProcessor {
// Now filter on the tag attributes
Set
<
String
>
guids
=
getGuids
(
entityVertices
);
gremlinQueryBindings
.
put
(
"guids"
,
guids
);
// Clear prior results
entityVertices
.
clear
();
try
{
AtlasGraph
graph
=
context
.
getGraph
();
ScriptEngine
gremlinScriptEngine
=
graph
.
getGremlinScriptEngine
();
List
<
AtlasVertex
>
atlasVertices
=
(
List
<
AtlasVertex
>)
graph
.
executeGremlinScript
(
gremlinScriptEngine
,
gremlinQueryBindings
,
gremlinTagFilterQuery
,
false
);
if
(
CollectionUtils
.
isNotEmpty
(
guids
))
{
gremlinQueryBindings
.
put
(
"guids"
,
guids
);
// Clear prior results
entityVertices
.
clear
();
try
{
AtlasGraph
graph
=
context
.
getGraph
();
ScriptEngine
gremlinScriptEngine
=
graph
.
getGremlinScriptEngine
();
List
<
AtlasVertex
>
atlasVertices
=
(
List
<
AtlasVertex
>)
graph
.
executeGremlinScript
(
gremlinScriptEngine
,
gremlinQueryBindings
,
gremlinTagFilterQuery
,
false
);
if
(
CollectionUtils
.
isNotEmpty
(
atlasVertices
))
{
entityVertices
.
addAll
(
atlasVertices
);
if
(
CollectionUtils
.
isNotEmpty
(
atlasVertices
))
{
entityVertices
.
addAll
(
atlasVertices
);
}
}
catch
(
AtlasBaseException
|
ScriptException
e
)
{
LOG
.
warn
(
e
.
getMessage
(),
e
);
}
}
catch
(
AtlasBaseException
|
ScriptException
e
)
{
LOG
.
warn
(
e
.
getMessage
(),
e
);
}
}
...
...
repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java
View file @
64c9bde6
...
...
@@ -173,12 +173,17 @@ public class EntitySearchProcessor extends SearchProcessor {
CollectionUtils
.
filter
(
entityVertices
,
inMemoryPredicate
);
if
(
graphQuery
!=
null
)
{
AtlasGraphQuery
guidQuery
=
context
.
getGraph
().
query
().
in
(
Constants
.
GUID_PROPERTY_KEY
,
getGuids
(
entityVertices
));
guidQuery
.
addConditionsFrom
(
graphQuery
);
Set
<
String
>
guids
=
getGuids
(
entityVertices
);
entityVertices
.
clear
();
getVertices
(
guidQuery
.
vertices
().
iterator
(),
entityVertices
);
if
(
CollectionUtils
.
isNotEmpty
(
guids
))
{
AtlasGraphQuery
guidQuery
=
context
.
getGraph
().
query
().
in
(
Constants
.
GUID_PROPERTY_KEY
,
guids
);
guidQuery
.
addConditionsFrom
(
graphQuery
);
getVertices
(
guidQuery
.
vertices
().
iterator
(),
entityVertices
);
}
}
}
else
{
Iterator
<
AtlasVertex
>
queryResult
=
graphQuery
.
vertices
(
qryOffset
,
limit
).
iterator
();
...
...
@@ -211,12 +216,17 @@ public class EntitySearchProcessor extends SearchProcessor {
LOG
.
debug
(
"==> EntitySearchProcessor.filter({})"
,
entityVertices
.
size
());
}
AtlasGraphQuery
query
=
context
.
getGraph
().
query
().
in
(
Constants
.
GUID_PROPERTY_KEY
,
getGuids
(
entityVertices
));
query
.
addConditionsFrom
(
filterGraphQuery
);
Set
<
String
>
guids
=
getGuids
(
entityVertices
);
entityVertices
.
clear
();
getVertices
(
query
.
vertices
().
iterator
(),
entityVertices
);
if
(
CollectionUtils
.
isNotEmpty
(
guids
))
{
AtlasGraphQuery
query
=
context
.
getGraph
().
query
().
in
(
Constants
.
GUID_PROPERTY_KEY
,
guids
);
query
.
addConditionsFrom
(
filterGraphQuery
);
getVertices
(
query
.
vertices
().
iterator
(),
entityVertices
);
}
super
.
filter
(
entityVertices
);
...
...
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