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
c95aba21
Commit
c95aba21
authored
Dec 04, 2019
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3545: NullPointerException while trying to delete classification
parent
8ca94c8d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
EntityGraphMapper.java
...he/atlas/repository/store/graph/v2/EntityGraphMapper.java
+8
-0
EntityGraphRetriever.java
...atlas/repository/store/graph/v2/EntityGraphRetriever.java
+22
-7
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
View file @
c95aba21
...
...
@@ -1862,6 +1862,10 @@ public class EntityGraphMapper {
AtlasVertex
classificationVertex
=
getClassificationVertex
(
entityVertex
,
classificationName
);
AtlasClassification
classification
=
entityRetriever
.
toAtlasClassification
(
classificationVertex
);
if
(
classification
==
null
)
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
CLASSIFICATION_NOT_FOUND
,
classificationName
);
}
// remove classification from propagated entities if propagation is turned on
if
(
isPropagationEnabled
(
classificationVertex
))
{
List
<
AtlasVertex
>
propagatedEntityVertices
=
deleteDelegate
.
getHandler
().
removeTagPropagation
(
classificationVertex
);
...
...
@@ -2028,6 +2032,10 @@ public class EntityGraphMapper {
AtlasClassification
currentClassification
=
entityRetriever
.
toAtlasClassification
(
classificationVertex
);
if
(
currentClassification
==
null
)
{
continue
;
}
validateAndNormalizeForUpdate
(
classification
);
boolean
isClassificationUpdated
=
false
;
...
...
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java
View file @
c95aba21
...
...
@@ -277,7 +277,13 @@ public class EntityGraphRetriever {
}
public
AtlasClassification
toAtlasClassification
(
AtlasVertex
classificationVertex
)
throws
AtlasBaseException
{
AtlasClassification
ret
=
new
AtlasClassification
(
getTypeName
(
classificationVertex
));
AtlasClassification
ret
=
null
;
String
classificationName
=
getTypeName
(
classificationVertex
);
if
(
StringUtils
.
isEmpty
(
classificationName
))
{
LOG
.
warn
(
"Ignoring invalid classification vertex: {}"
,
AtlasGraphUtilsV2
.
toString
(
classificationVertex
));
}
else
{
ret
=
new
AtlasClassification
(
classificationName
);
ret
.
setEntityGuid
(
AtlasGraphUtilsV2
.
getEncodedProperty
(
classificationVertex
,
CLASSIFICATION_ENTITY_GUID
,
String
.
class
));
ret
.
setEntityStatus
(
getClassificationEntityStatus
(
classificationVertex
));
...
...
@@ -291,6 +297,7 @@ public class EntityGraphRetriever {
}
mapAttributes
(
classificationVertex
,
ret
,
null
);
}
return
ret
;
}
...
...
@@ -621,10 +628,12 @@ public class EntityGraphRetriever {
Iterator
<
AtlasEdge
>
iterator
=
edges
.
iterator
();
while
(
iterator
.
hasNext
())
{
AtlasEdge
edge
=
iterator
.
next
();
AtlasEdge
classificationEdge
=
iterator
.
next
();
AtlasVertex
classificationVertex
=
classificationEdge
!=
null
?
classificationEdge
.
getInVertex
()
:
null
;
AtlasClassification
classification
=
toAtlasClassification
(
classificationVertex
);
if
(
edge
!=
null
)
{
ret
.
add
(
toAtlasClassification
(
edge
.
getInVertex
())
);
if
(
classification
!=
null
)
{
ret
.
add
(
classification
);
}
}
}
...
...
@@ -715,8 +724,11 @@ public class EntityGraphRetriever {
for
(
AtlasEdge
edge
:
edges
)
{
AtlasVertex
classificationVertex
=
edge
.
getInVertex
();
AtlasClassification
classification
=
toAtlasClassification
(
classificationVertex
);
allClassifications
.
add
(
toAtlasClassification
(
classificationVertex
));
if
(
classification
!=
null
)
{
allClassifications
.
add
(
classification
);
}
}
entity
.
setClassifications
(
allClassifications
);
...
...
@@ -1387,7 +1399,10 @@ public class EntityGraphRetriever {
for
(
AtlasVertex
classificationVertex
:
classificationVertices
)
{
String
classificationId
=
classificationVertex
.
getIdForDisplay
();
AtlasClassification
classification
=
toAtlasClassification
(
classificationVertex
);
String
entityGuid
=
classification
.
getEntityGuid
();
if
(
classification
==
null
)
{
continue
;
}
if
(
blockedClassificationIds
.
contains
(
classificationId
))
{
blockedClassifications
.
add
(
classification
);
...
...
@@ -1397,7 +1412,7 @@ public class EntityGraphRetriever {
// add entity headers to referred entities
if
(
extendedInfo
)
{
addToReferredEntities
(
relationshipWithExtInfo
,
entityGuid
);
addToReferredEntities
(
relationshipWithExtInfo
,
classification
.
getEntityGuid
()
);
}
}
...
...
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