AMBARI-21623 ADDENDUM Log Search Config should be separated into a Server and 
Log Feeder interface (mgergely)

Change-Id: I9e4c00c38ff3fc17852e589e88067fae911e1a53


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

Branch: refs/heads/feature-branch-AMBARI-21307
Commit: afa1b488c1118b7f54da97cd611a317c3d385a3a
Parents: aa9e16d
Author: Miklos Gergely <mgerg...@hortonworks.com>
Authored: Sun Aug 6 14:23:22 2017 +0200
Committer: Miklos Gergely <mgerg...@hortonworks.com>
Committed: Sun Aug 6 14:23:46 2017 +0200

----------------------------------------------------------------------
 .../ambari/logsearch/configurer/SolrCollectionConfigurer.java      | 1 +
 .../main/java/org/apache/ambari/logsearch/dao/AuditSolrDao.java    | 1 -
 .../java/org/apache/ambari/logsearch/dao/ServiceLogsSolrDao.java   | 1 -
 .../src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java | 2 +-
 .../apache/ambari/logsearch/handler/CreateCollectionHandler.java   | 1 -
 5 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/afa1b488/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/configurer/SolrCollectionConfigurer.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/configurer/SolrCollectionConfigurer.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/configurer/SolrCollectionConfigurer.java
index ff828a3..7b67482 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/configurer/SolrCollectionConfigurer.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/configurer/SolrCollectionConfigurer.java
@@ -219,6 +219,7 @@ public class SolrCollectionConfigurer implements Configurer 
{
       boolean reloadCollectionNeeded) {
     try {
       List<String> allCollectionList = new 
ListCollectionHandler().handle(solrClient, null);
+      solrDaoBase.waitForLogSearchConfig();
       CreateCollectionHandler handler = new 
CreateCollectionHandler(solrDaoBase.getLogSearchConfig(), allCollectionList);
       boolean collectionCreated = handler.handle(solrClient, solrPropsConfig);
       boolean collectionReloaded = true;

http://git-wip-us.apache.org/repos/asf/ambari/blob/afa1b488/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/AuditSolrDao.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/AuditSolrDao.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/AuditSolrDao.java
index 4142176..3eea08f 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/AuditSolrDao.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/AuditSolrDao.java
@@ -69,7 +69,6 @@ public class AuditSolrDao extends SolrDaoBase {
     String rangerAuditCollection = 
solrAuditLogPropsConfig.getRangerCollection();
 
     try {
-      waitForLogSearchConfig();
       new SolrCollectionConfigurer(this, true).start();
       boolean createAlias = (aliasNameIn != null && 
StringUtils.isNotBlank(rangerAuditCollection));
       if (createAlias) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/afa1b488/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/ServiceLogsSolrDao.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/ServiceLogsSolrDao.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/ServiceLogsSolrDao.java
index 0752ac0..308ef1f 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/ServiceLogsSolrDao.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/ServiceLogsSolrDao.java
@@ -65,7 +65,6 @@ public class ServiceLogsSolrDao extends SolrDaoBase {
   public void postConstructor() {
     LOG.info("postConstructor() called.");
     try {
-      waitForLogSearchConfig();
       new SolrCollectionConfigurer(this, true).start();
     } catch (Exception e) {
       LOG.error("error while connecting to Solr for service logs : solrUrl=" + 
solrServiceLogPropsConfig.getSolrUrl()

http://git-wip-us.apache.org/repos/asf/ambari/blob/afa1b488/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java
index ef5e697..05217d9 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java
@@ -67,7 +67,7 @@ public abstract class SolrDaoBase {
     this.logType = logType;
   }
 
-  protected void waitForLogSearchConfig() {
+  public void waitForLogSearchConfig() {
     while (!logSearchConfigState.isLogSearchConfigAvailable()) {
       LOG.info("Log Search config not available yet, waiting...");
       try { Thread.sleep(1000); } catch (Exception e) { LOG.warn("Exception 
during waiting for Log Search Config", e); }

http://git-wip-us.apache.org/repos/asf/ambari/blob/afa1b488/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/handler/CreateCollectionHandler.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/handler/CreateCollectionHandler.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/handler/CreateCollectionHandler.java
index a988856..6c259cd 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/handler/CreateCollectionHandler.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/handler/CreateCollectionHandler.java
@@ -22,7 +22,6 @@ import org.apache.ambari.logsearch.conf.SolrPropsConfig;
 import org.apache.ambari.logsearch.config.api.LogSearchConfigServer;
 import 
org.apache.ambari.logsearch.config.api.model.outputconfig.OutputSolrProperties;
 import 
org.apache.ambari.logsearch.config.zookeeper.model.outputconfig.impl.OutputSolrPropertiesImpl;
-import org.apache.ambari.logsearch.configurer.LogSearchConfigConfigurer;
 import org.apache.commons.lang.StringUtils;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.methods.HttpGet;

Reply via email to