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
6 years ago
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
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
AtlasGraphUtilsV2.java
...he/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
+20
-12
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 {
...
@@ -484,23 +484,31 @@ public class AtlasGraphUtilsV2 {
}
}
public
static
AtlasPatches
getPatches
()
{
public
static
AtlasPatches
getPatches
()
{
List
<
AtlasPatch
>
patches
=
new
ArrayList
<>();
List
<
AtlasPatch
>
ret
=
new
ArrayList
<>();
String
indexQuery
=
getIndexSearchPrefix
()
+
"\""
+
PATCH_ID_PROPERTY_KEY
+
"\" : (*)"
;
String
idxQueryString
=
getIndexSearchPrefix
()
+
"\""
+
PATCH_ID_PROPERTY_KEY
+
"\" : (*)"
;
Iterator
<
Result
<
Object
,
Object
>>
results
=
AtlasGraphProvider
.
getGraphInstance
().
indexQuery
(
VERTEX_INDEX
,
indexQuery
).
vertices
();
AtlasIndexQuery
idxQuery
=
AtlasGraphProvider
.
getGraphInstance
().
indexQuery
(
VERTEX_INDEX
,
idxQueryString
);
Iterator
<
Result
<
Object
,
Object
>>
results
;
while
(
results
!=
null
&&
results
.
hasNext
())
{
try
{
AtlasVertex
patchVertex
=
results
.
next
().
getVertex
();
results
=
idxQuery
.
vertices
();
AtlasPatch
patch
=
toAtlasPatch
(
patchVertex
);
patches
.
add
(
patch
);
while
(
results
!=
null
&&
results
.
hasNext
())
{
}
AtlasVertex
patchVertex
=
results
.
next
().
getVertex
();
AtlasPatch
patch
=
toAtlasPatch
(
patchVertex
);
// Sort the patches based on patch id
ret
.
add
(
patch
);
if
(
CollectionUtils
.
isNotEmpty
(
patches
))
{
}
Collections
.
sort
(
patches
,
(
p1
,
p2
)
->
p1
.
getId
().
compareTo
(
p2
.
getId
()));
// Sort the patches based on patch id
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
)
{
private
static
AtlasPatch
toAtlasPatch
(
AtlasVertex
vertex
)
{
...
...
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