atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject atlas git commit: ATLAS-1997: fix to avoid NPE while getting vertex_indices
Date Thu, 03 Aug 2017 01:20:20 GMT
Repository: atlas
Updated Branches:
  refs/heads/0.8-incubating dd8544b51 -> 096917e94


ATLAS-1997: fix to avoid NPE while getting vertex_indices

Signed-off-by: Madhan Neethiraj <madhan@apache.org>
(cherry picked from commit 38297a8441e7d32d41e717fd6efc415804e640af)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/096917e9
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/096917e9
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/096917e9

Branch: refs/heads/0.8-incubating
Commit: 096917e946ee43be250ad12ca079daef2facb672
Parents: dd8544b
Author: apoorvnaik <apoorvnaik@apache.org>
Authored: Thu Jul 27 09:51:23 2017 -0700
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Wed Aug 2 18:20:17 2017 -0700

----------------------------------------------------------------------
 .../repository/graph/GraphBackedSearchIndexer.java  | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/096917e9/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
index 94b6092..632b479 100755
--- a/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
+++ b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
@@ -263,17 +263,19 @@ public class GraphBackedSearchIndexer implements SearchIndexer, ActiveStateChang
             }
 
             if (management != null) {
-                recomputeIndexedKeys = false;
-
                 AtlasGraphIndex vertexIndex = management.getGraphIndex(Constants.VERTEX_INDEX);
 
-                Set<String> indexKeys = new HashSet<>();
+                if (vertexIndex != null) {
+                    recomputeIndexedKeys = false;
 
-                for (AtlasPropertyKey fieldKey : vertexIndex.getFieldKeys()) {
-                    indexKeys.add(fieldKey.getName());
-                }
+                    Set<String> indexKeys = new HashSet<>();
 
-                vertexIndexKeys = indexKeys;
+                    for (AtlasPropertyKey fieldKey : vertexIndex.getFieldKeys()) {
+                        indexKeys.add(fieldKey.getName());
+                    }
+
+                    vertexIndexKeys = indexKeys;
+                }
             }
         }
 


Mime
View raw message