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/03/20 16:58:13 UTC
incubator-atlas git commit: ATLAS-1672: fix for issues flagged by
Coverity scan
Repository: incubator-atlas
Updated Branches:
refs/heads/master 94158e16e -> b86e8591a
ATLAS-1672: fix for issues flagged by Coverity scan
Signed-off-by: Madhan Neethiraj <ma...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/b86e8591
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/b86e8591
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/b86e8591
Branch: refs/heads/master
Commit: b86e8591a96740d638f548e52fd18fdad34da781
Parents: 94158e1
Author: ashutoshm <am...@hortonworks.com>
Authored: Sun Mar 19 10:52:58 2017 -0700
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Mon Mar 20 09:39:38 2017 -0700
----------------------------------------------------------------------
.../repository/store/graph/v1/AtlasEntityChangeNotifier.java | 8 +++++++-
.../main/java/org/apache/atlas/web/resources/ZipSource.java | 3 ++-
2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/b86e8591/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 8719cd4..8dd3556 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
@@ -231,8 +231,14 @@ public class AtlasEntityChangeNotifier {
if (StringUtils.isEmpty(entityId) || CollectionUtils.isEmpty(classifications)) {
return;
}
+
AtlasVertex atlasVertex = AtlasGraphUtilsV1.findByGuid(entityId);
+ if (atlasVertex == null) {
+ LOG.warn("updateFullTextMapping(): no entity exists with guid {}", entityId);
+ return;
+ }
+
try {
String classificationFullText = fullTextMapperV2.getIndexTextForClassifications(entityId, classifications);
String existingFullText = (String) GraphHelper.getProperty(atlasVertex, Constants.ENTITY_TEXT_PROPERTY_KEY);
@@ -250,4 +256,4 @@ public class AtlasEntityChangeNotifier {
doFullTextMapping(Collections.singletonList(entityHeader));
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/b86e8591/webapp/src/main/java/org/apache/atlas/web/resources/ZipSource.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/atlas/web/resources/ZipSource.java b/webapp/src/main/java/org/apache/atlas/web/resources/ZipSource.java
index 661542f..8b2b9df 100644
--- a/webapp/src/main/java/org/apache/atlas/web/resources/ZipSource.java
+++ b/webapp/src/main/java/org/apache/atlas/web/resources/ZipSource.java
@@ -196,7 +196,8 @@ public class ZipSource implements EntityImportStream {
private AtlasEntity getEntity(String guid) throws AtlasBaseException {
if(guidEntityJsonMap.containsKey(guid)) {
- return getEntityWithExtInfo(guid).getEntity();
+ AtlasEntityWithExtInfo extInfo = getEntityWithExtInfo(guid);
+ return (extInfo != null) ? extInfo.getEntity() : null;
}
return null;