You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2017/09/17 18:42:09 UTC
atlas git commit: ATLAS-2141: edit/disassociate tag results in NPE
Repository: atlas
Updated Branches:
refs/heads/branch-0.8 fd144e018 -> 4b9d26707
ATLAS-2141: edit/disassociate tag results in NPE
Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/4b9d2670
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/4b9d2670
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/4b9d2670
Branch: refs/heads/branch-0.8
Commit: 4b9d2670709df52e0d983587832fe6256220691b
Parents: fd144e0
Author: Madhan Neethiraj <ma...@apache.org>
Authored: Sun Sep 17 10:37:26 2017 -0700
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Sun Sep 17 10:37:26 2017 -0700
----------------------------------------------------------------------
.../java/org/apache/atlas/repository/graph/GraphHelper.java | 6 +++++-
.../repository/store/graph/v1/AtlasEntityChangeNotifier.java | 6 +-----
.../atlas/notification/NotificationEntityChangeListener.java | 4 +++-
3 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/atlas/blob/4b9d2670/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
index 9dec281..0a13efb 100755
--- a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
+++ b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
@@ -994,8 +994,12 @@ public final class GraphHelper {
}
+ public static boolean isInternalType(AtlasVertex vertex) {
+ return vertex != null && isInternalType(getTypeName(vertex));
+ }
+
public static boolean isInternalType(String typeName) {
- return typeName.startsWith(Constants.INTERNAL_PROPERTY_KEY_PREFIX);
+ return typeName != null && typeName.startsWith(Constants.INTERNAL_PROPERTY_KEY_PREFIX);
}
public static void setArrayElementsProperty(IDataType elementType, AtlasVertex instanceVertex, String propertyName, List<Object> values) {
http://git-wip-us.apache.org/repos/asf/atlas/blob/4b9d2670/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java
index db47627..f04f9d0 100644
--- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java
+++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityChangeNotifier.java
@@ -227,14 +227,10 @@ public class AtlasEntityChangeNotifier {
}
for (AtlasEntityHeader atlasEntityHeader : atlasEntityHeaders) {
- if(GraphHelper.isInternalType(atlasEntityHeader.getTypeName())) {
- continue;
- }
-
String guid = atlasEntityHeader.getGuid();
AtlasVertex atlasVertex = AtlasGraphUtilsV1.findByGuid(guid);
- if(atlasVertex == null) {
+ if(atlasVertex == null || GraphHelper.isInternalType(atlasVertex)) {
continue;
}
http://git-wip-us.apache.org/repos/asf/atlas/blob/4b9d2670/webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java b/webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java
index 604a19e..53acf56 100644
--- a/webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java
+++ b/webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java
@@ -187,7 +187,9 @@ public class NotificationEntityChangeListener implements EntityChangeListener {
messages.add(notification);
}
- notificationInterface.send(NotificationInterface.NotificationType.ENTITIES, messages);
+ if (!messages.isEmpty()) {
+ notificationInterface.send(NotificationInterface.NotificationType.ENTITIES, messages);
+ }
}
private List<String> getNotificationAttributes(String entityType) {