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
fa2c3e2c
Commit
fa2c3e2c
authored
Mar 20, 2019
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3070: Create patch framework to persist typedef patches applied to atlas…
ATLAS-3070: Create patch framework to persist typedef patches applied to atlas #2 fix getPatches() method
parent
3addc237
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
AtlasGraphUtilsV2.java
...he/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
+15
-7
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
View file @
fa2c3e2c
...
...
@@ -484,23 +484,31 @@ public class AtlasGraphUtilsV2 {
}
public
static
AtlasPatches
getPatches
()
{
List
<
AtlasPatch
>
patches
=
new
ArrayList
<>();
String
indexQuery
=
getIndexSearchPrefix
()
+
"\""
+
PATCH_ID_PROPERTY_KEY
+
"\" : (*)"
;
Iterator
<
Result
<
Object
,
Object
>>
results
=
AtlasGraphProvider
.
getGraphInstance
().
indexQuery
(
VERTEX_INDEX
,
indexQuery
).
vertices
();
List
<
AtlasPatch
>
ret
=
new
ArrayList
<>();
String
idxQueryString
=
getIndexSearchPrefix
()
+
"\""
+
PATCH_ID_PROPERTY_KEY
+
"\" : (*)"
;
AtlasIndexQuery
idxQuery
=
AtlasGraphProvider
.
getGraphInstance
().
indexQuery
(
VERTEX_INDEX
,
idxQueryString
);
Iterator
<
Result
<
Object
,
Object
>>
results
;
try
{
results
=
idxQuery
.
vertices
();
while
(
results
!=
null
&&
results
.
hasNext
())
{
AtlasVertex
patchVertex
=
results
.
next
().
getVertex
();
AtlasPatch
patch
=
toAtlasPatch
(
patchVertex
);
patches
.
add
(
patch
);
ret
.
add
(
patch
);
}
// Sort the patches based on patch id
if
(
CollectionUtils
.
isNotEmpty
(
patches
))
{
Collections
.
sort
(
patches
,
(
p1
,
p2
)
->
p1
.
getId
().
compareTo
(
p2
.
getId
()));
if
(
CollectionUtils
.
isNotEmpty
(
ret
))
{
Collections
.
sort
(
ret
,
(
p1
,
p2
)
->
p1
.
getId
().
compareTo
(
p2
.
getId
()));
}
}
catch
(
Throwable
t
)
{
// first time idx query is fired, returns no field exists in solr exception
LOG
.
warn
(
"getPatches() returned empty result!"
);
}
return
new
AtlasPatches
(
patches
);
return
new
AtlasPatches
(
ret
);
}
private
static
AtlasPatch
toAtlasPatch
(
AtlasVertex
vertex
)
{
...
...
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