You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sa...@apache.org on 2019/03/26 07:08:14 UTC

[atlas] branch master updated: ATLAS-3099: Update graph storage and index backend property to be configurable

This is an automated email from the ASF dual-hosted git repository.

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
     new ee41891  ATLAS-3099: Update graph storage and index backend property to be configurable
ee41891 is described below

commit ee4189124cb647dce8afadb3e3ec1a7c959f5554
Author: Sarath Subramanian <ss...@hortonworks.com>
AuthorDate: Tue Mar 26 00:08:02 2019 -0700

    ATLAS-3099: Update graph storage and index backend property to be configurable
---
 .../org/apache/atlas/ApplicationProperties.java    | 68 +++++++++-------------
 1 file changed, 27 insertions(+), 41 deletions(-)

diff --git a/intg/src/main/java/org/apache/atlas/ApplicationProperties.java b/intg/src/main/java/org/apache/atlas/ApplicationProperties.java
index 01af49c..3f43496 100644
--- a/intg/src/main/java/org/apache/atlas/ApplicationProperties.java
+++ b/intg/src/main/java/org/apache/atlas/ApplicationProperties.java
@@ -261,62 +261,48 @@ public final class ApplicationProperties extends PropertiesConfiguration {
     }
 
     private void setDefaults() {
+        // setting value for 'atlas.graphdb.backend' (default = 'janus')
         String graphDbBackend = getString(GRAPHDB_BACKEND_CONF);
 
         if (StringUtils.isEmpty(graphDbBackend)) {
             graphDbBackend = DEFAULT_GRAPHDB_BACKEND;
-
-            clearPropertyDirect(GRAPHDB_BACKEND_CONF);
-            addPropertyDirect(GRAPHDB_BACKEND_CONF, graphDbBackend);
-            LOG.info("No graphdb backend specified. Will use '" + graphDbBackend + "'");
-
-            // The below default values for storage backend, index backend and solr-wait-searcher
-            // should be removed once ambari change to handle them is committed.
-            clearPropertyDirect(STORAGE_BACKEND_CONF);
-            addPropertyDirect(STORAGE_BACKEND_CONF, STORAGE_BACKEND_HBASE2);
-            LOG.info("Using storage backend '" + STORAGE_BACKEND_HBASE2 + "'");
-
-            clearPropertyDirect(INDEX_BACKEND_CONF);
-            addPropertyDirect(INDEX_BACKEND_CONF, INDEX_BACKEND_SOLR);
-            LOG.info("Using index backend '" + INDEX_BACKEND_SOLR + "'");
-
-            clearPropertyDirect(SOLR_WAIT_SEARCHER_CONF);
-            addPropertyDirect(SOLR_WAIT_SEARCHER_CONF, DEFAULT_SOLR_WAIT_SEARCHER);
-            LOG.info("Setting solr-wait-searcher property '" + DEFAULT_SOLR_WAIT_SEARCHER + "'");
-
-            clearPropertyDirect(INDEX_MAP_NAME_CONF);
-            addPropertyDirect(INDEX_MAP_NAME_CONF, DEFAULT_INDEX_MAP_NAME);
-            LOG.info("Setting index.search.map-name property '" + DEFAULT_INDEX_MAP_NAME + "'");
         }
 
-        String storageBackend = getString(STORAGE_BACKEND_CONF);
-
-        if (StringUtils.isEmpty(storageBackend)) {
-            if (graphDbBackend.contains(GRAPHBD_BACKEND_JANUS)) {
-                storageBackend = STORAGE_BACKEND_HBASE2;
-            }
+        clearPropertyDirect(GRAPHDB_BACKEND_CONF);
+        addPropertyDirect(GRAPHDB_BACKEND_CONF, graphDbBackend);
+        LOG.info("Using graphdb backend '" + graphDbBackend + "'");
 
-            if (StringUtils.isNotEmpty(storageBackend)) {
-                clearPropertyDirect(STORAGE_BACKEND_CONF);
-                addPropertyDirect(STORAGE_BACKEND_CONF, storageBackend);
+        // setting value for 'atlas.graph.storage.backend' (default = 'hbase2')
+        String storageBackend = getString(STORAGE_BACKEND_CONF);
 
-                LOG.info("No storage backend specified. Will use '" + storageBackend + "'");
-            }
+        if (StringUtils.isEmpty(storageBackend) || storageBackend.equalsIgnoreCase(STORAGE_BACKEND_HBASE)) {
+            storageBackend = STORAGE_BACKEND_HBASE2;
         }
 
+        clearPropertyDirect(STORAGE_BACKEND_CONF);
+        addPropertyDirect(STORAGE_BACKEND_CONF, storageBackend);
+        LOG.info("Using storage backend '" + storageBackend + "'");
+
+        // setting value for 'atlas.graph.index.search.backend' (default = 'solr')
         String indexBackend = getString(INDEX_BACKEND_CONF);
 
         if (StringUtils.isEmpty(indexBackend)) {
-            if (graphDbBackend.contains(GRAPHBD_BACKEND_JANUS)) {
-                indexBackend = INDEX_BACKEND_SOLR;
-            }
+            indexBackend = INDEX_BACKEND_SOLR;
+        }
 
-            if (StringUtils.isNotEmpty(indexBackend)) {
-                clearPropertyDirect(INDEX_BACKEND_CONF);
-                addPropertyDirect(INDEX_BACKEND_CONF, indexBackend);
+        clearPropertyDirect(INDEX_BACKEND_CONF);
+        addPropertyDirect(INDEX_BACKEND_CONF, indexBackend);
+        LOG.info("Using index backend '" + indexBackend + "'");
 
-                LOG.info("No index backend specified. Will use '" + indexBackend + "'");
-            }
+        // set the following if indexing backend is 'solr'
+        if (indexBackend.equalsIgnoreCase(INDEX_BACKEND_SOLR)) {
+            clearPropertyDirect(SOLR_WAIT_SEARCHER_CONF);
+            addPropertyDirect(SOLR_WAIT_SEARCHER_CONF, DEFAULT_SOLR_WAIT_SEARCHER);
+            LOG.info("Setting solr-wait-searcher property '" + DEFAULT_SOLR_WAIT_SEARCHER + "'");
+
+            clearPropertyDirect(INDEX_MAP_NAME_CONF);
+            addPropertyDirect(INDEX_MAP_NAME_CONF, DEFAULT_INDEX_MAP_NAME);
+            LOG.info("Setting index.search.map-name property '" + DEFAULT_INDEX_MAP_NAME + "'");
         }
 
         setDbCacheConfDefaults();