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

oleewere pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new b2f99fb  AMBARI-22959. Upgrade Log Search Solr client version to 7.2.1
b2f99fb is described below

commit b2f99fb6f8baee3725218d7b243d98419a86161e
Author: Oliver Szabo <oleew...@gmail.com>
AuthorDate: Sun Feb 11 22:31:32 2018 +0100

    AMBARI-22959. Upgrade Log Search Solr client version to 7.2.1
---
 .../apache/ambari/logsearch/steps/AbstractLogSearchSteps.java  | 10 ++++++----
 .../java/org/apache/ambari/logfeeder/output/OutputSolr.java    | 10 ++++++----
 .../ambari/logsearch/configurer/SolrCollectionConfigurer.java  |  9 +++++----
 ambari-logsearch/pom.xml                                       |  2 +-
 4 files changed, 18 insertions(+), 13 deletions(-)

diff --git 
a/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/AbstractLogSearchSteps.java
 
b/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/AbstractLogSearchSteps.java
index a0027ae..a778284 100644
--- 
a/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/AbstractLogSearchSteps.java
+++ 
b/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/AbstractLogSearchSteps.java
@@ -73,10 +73,12 @@ public class AbstractLogSearchSteps {
     String lastExceptionMessage = null;
     for (int tries = 1; tries < maxTries; tries++) {
       try {
-        SolrClient solrClient = new 
LBHttpSolrClient(String.format("http://%s:%d/solr/%s_shard0_replica1";,
-          StoryDataRegistry.INSTANCE.getDockerHost(),
-          StoryDataRegistry.INSTANCE.getSolrPort(),
-          StoryDataRegistry.INSTANCE.getServiceLogsCollection()));
+        SolrClient solrClient = new LBHttpSolrClient.Builder()
+          
.withBaseSolrUrl(String.format("http://%s:%d/solr/%s_shard0_replica1";,
+            StoryDataRegistry.INSTANCE.getDockerHost(),
+            StoryDataRegistry.INSTANCE.getSolrPort(),
+            StoryDataRegistry.INSTANCE.getServiceLogsCollection()))
+          .build();
         StoryDataRegistry.INSTANCE.setSolrClient(solrClient);
         SolrPingResponse pingResponse = solrClient.ping();
         if (pingResponse.getStatus() != 0) {
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputSolr.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputSolr.java
index 9816c15..65e653d 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputSolr.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputSolr.java
@@ -32,8 +32,7 @@ import org.apache.log4j.Logger;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
+import org.apache.solr.client.solrj.impl.Krb5HttpClientBuilder;
 import org.apache.solr.client.solrj.response.SolrPingResponse;
 import org.apache.solr.client.solrj.response.UpdateResponse;
 import org.apache.solr.common.SolrException;
@@ -71,6 +70,9 @@ public class OutputSolr extends Output<LogFeederProps, 
InputMarker> implements C
 
   private static final int RETRY_INTERVAL = 30;
 
+  private static final String JAVA_SECURITY_AUTH_LOGIN_CONFIG = 
"java.security.auth.login.config";
+  private static final String SOLR_HTTPCLIENT_BUILDER_FACTORY = 
"solr.httpclient.builder.factory";
+
   private String type;
   private String collection;
   private String splitMode;
@@ -181,8 +183,8 @@ public class OutputSolr extends Output<LogFeederProps, 
InputMarker> implements C
     String jaasFile = 
logFeederProps.getLogFeederSecurityConfig().getSolrJaasFile();
     boolean securityEnabled = 
logFeederProps.getLogFeederSecurityConfig().isSolrKerberosEnabled();
     if (securityEnabled) {
-      System.setProperty("java.security.auth.login.config", jaasFile);
-      HttpClientUtil.addConfigurer(new Krb5HttpClientConfigurer());
+      System.setProperty(JAVA_SECURITY_AUTH_LOGIN_CONFIG, jaasFile);
+      System.setProperty(SOLR_HTTPCLIENT_BUILDER_FACTORY, 
Krb5HttpClientBuilder.class.getCanonicalName());
       LOG.info("setupSecurity() called for kerberos configuration, jaas file: 
" + jaasFile);
     }
   }
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 7b67482..4dc3dc5 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
@@ -29,8 +29,7 @@ import 
org.apache.ambari.logsearch.handler.UpgradeSchemaHandler;
 import org.apache.ambari.logsearch.handler.UploadConfigurationHandler;
 import org.apache.commons.lang.StringUtils;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer;
+import org.apache.solr.client.solrj.impl.Krb5HttpClientBuilder;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.ZooKeeper;
@@ -52,6 +51,8 @@ public class SolrCollectionConfigurer implements Configurer {
   private static final int SETUP_RETRY_SECOND = 10;
   private static final int SESSION_TIMEOUT = 15000;
   private static final int CONNECTION_TIMEOUT = 30000;
+  private static final String JAVA_SECURITY_AUTH_LOGIN_CONFIG = 
"java.security.auth.login.config";
+  private static final String SOLR_HTTPCLIENT_BUILDER_FACTORY = 
"solr.httpclient.builder.factory";
 
   private final SolrDaoBase solrDaoBase;
   private final boolean hasEnumConfig; // enumConfig.xml for solr collection
@@ -137,8 +138,8 @@ public class SolrCollectionConfigurer implements Configurer 
{
     String jaasFile = solrDaoBase.getSolrKerberosConfig().getJaasFile();
     boolean securityEnabled = solrDaoBase.getSolrKerberosConfig().isEnabled();
     if (securityEnabled) {
-      System.setProperty("java.security.auth.login.config", jaasFile);
-      HttpClientUtil.addConfigurer(new Krb5HttpClientConfigurer());
+      System.setProperty(JAVA_SECURITY_AUTH_LOGIN_CONFIG, jaasFile);
+      System.setProperty(SOLR_HTTPCLIENT_BUILDER_FACTORY, 
Krb5HttpClientBuilder.class.getCanonicalName());
       LOG.info("setupSecurity() called for kerberos configuration, jaas file: 
" + jaasFile);
     }
   }
diff --git a/ambari-logsearch/pom.xml b/ambari-logsearch/pom.xml
index 868f94d..5b19a11 100644
--- a/ambari-logsearch/pom.xml
+++ b/ambari-logsearch/pom.xml
@@ -41,7 +41,7 @@
     <deb.python.ver>python (&gt;= 2.6)</deb.python.ver>
     <deb.architecture>amd64</deb.architecture>
     <deb.dependency.list>${deb.python.ver}</deb.dependency.list>
-    <solr.version>6.6.2</solr.version>
+    <solr.version>7.2.1</solr.version>
     <hadoop.version>2.7.2</hadoop.version>
     <common.io.version>2.5</common.io.version>
     <forkCount>4</forkCount>

-- 
To stop receiving notification emails like this one, please contact
oleew...@apache.org.

Reply via email to