ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mradhakrish...@apache.org
Subject [39/56] [abbrv] ambari git commit: AMBARI-22310. Get rid of deprecated Solr usages (infra + logsearch) (oleewere)
Date Mon, 30 Oct 2017 22:36:05 GMT
AMBARI-22310. Get rid of deprecated Solr usages (infra + logsearch) (oleewere)


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

Branch: refs/heads/branch-feature-AMBARI-14714
Commit: 7e6036c3ee7e16384df8ca372e1fa56f1d5e9e46
Parents: 4d3abaf
Author: Oliver Szabo <oleewere@gmail.com>
Authored: Thu Oct 26 11:20:14 2017 +0200
Committer: Oliver Szabo <oleewere@gmail.com>
Committed: Thu Oct 26 11:20:14 2017 +0200

----------------------------------------------------------------------
 .../ambari/infra/solr/AmbariSolrCloudClientBuilder.java |  4 ++--
 .../infra/solr/commands/CreateCollectionCommand.java    | 12 +++---------
 .../ambari/infra/solr/commands/CreateShardCommand.java  |  5 +----
 .../ambari/infra/solr/commands/GetShardsCommand.java    |  2 +-
 4 files changed, 7 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7e6036c3/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudClientBuilder.java
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudClientBuilder.java
b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudClientBuilder.java
index 54c4ae3..a187cdb 100644
--- a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudClientBuilder.java
+++ b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/AmbariSolrCloudClientBuilder.java
@@ -125,7 +125,7 @@ public class AmbariSolrCloudClientBuilder {
   }
 
   public AmbariSolrCloudClientBuilder withSolrCloudClient() {
-    this.solrCloudClient = new CloudSolrClient(this.zkConnectString);
+    this.solrCloudClient = new CloudSolrClient.Builder().withZkHost(this.zkConnectString).build();
     return this;
   }
 
@@ -209,7 +209,7 @@ public class AmbariSolrCloudClientBuilder {
   private void setupSecurity(String jaasFile) {
     if (jaasFile != null) {
       System.setProperty("java.security.auth.login.config", jaasFile);
-      HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());
+      HttpClientUtil.addConfigurer(new Krb5HttpClientConfigurer());
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e6036c3/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateCollectionCommand.java
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateCollectionCommand.java
b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateCollectionCommand.java
index 53e96fd..317d0b6 100644
--- a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateCollectionCommand.java
+++ b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateCollectionCommand.java
@@ -23,9 +23,6 @@ import org.apache.ambari.infra.solr.util.ShardUtils;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.response.CollectionAdminResponse;
 
-import java.util.ArrayList;
-import java.util.List;
-
 public class CreateCollectionCommand extends AbstractSolrRetryCommand<CollectionAdminRequest.Create
,String> {
 
   public CreateCollectionCommand(int maxRetries, int interval) {
@@ -39,12 +36,9 @@ public class CreateCollectionCommand extends AbstractSolrRetryCommand<Collection
 
   @Override
   public CollectionAdminRequest.Create createRequest(AmbariSolrCloudClient client) {
-    CollectionAdminRequest.Create request = new CollectionAdminRequest.Create();
-    request.setConfigName(client.getConfigSet());
-    request.setCollectionName(client.getCollection());
-    request.setNumShards(client.getShards());
-    request.setReplicationFactor(client.getReplication());
-    request.setMaxShardsPerNode(client.getMaxShardsPerNode());
+    CollectionAdminRequest.Create request =
+      CollectionAdminRequest.createCollection(client.getCollection(), client.getConfigSet(),
client.getShards(), client.getReplication());
+    request.setMaxShardsPerNode(client.getMaxShardsPerNode());;
     if (client.getRouterField() != null && client.getRouterName()!= null) {
       request.setRouterName(client.getRouterName());
       request.setRouterField(client.getRouterField());

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e6036c3/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateShardCommand.java
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateShardCommand.java
b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateShardCommand.java
index 9b57827..5492966 100644
--- a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateShardCommand.java
+++ b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/CreateShardCommand.java
@@ -38,10 +38,7 @@ public class CreateShardCommand extends AbstractSolrRetryCommand<CollectionAdmin
 
   @Override
   public CollectionAdminRequest.CreateShard createRequest(AmbariSolrCloudClient client) {
-    CollectionAdminRequest.CreateShard createShardRequest = new CollectionAdminRequest.CreateShard();
-    createShardRequest.setCollectionName(client.getCollection());
-    createShardRequest.setShardName(shardName);
-    return createShardRequest;
+    return CollectionAdminRequest.createShard(client.getCollection(), shardName);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e6036c3/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/GetShardsCommand.java
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/GetShardsCommand.java
b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/GetShardsCommand.java
index e49bfec..3683a1b 100644
--- a/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/GetShardsCommand.java
+++ b/ambari-infra/ambari-infra-solr-client/src/main/java/org/apache/ambari/infra/solr/commands/GetShardsCommand.java
@@ -34,6 +34,6 @@ public class GetShardsCommand extends AbstractRetryCommand<Collection<Slice>>
{
   public Collection<Slice> createAndProcessRequest(AmbariSolrCloudClient solrCloudClient)
throws Exception {
     ZkStateReader zkReader = new ZkStateReader(solrCloudClient.getSolrZkClient());
     zkReader.createClusterStateWatchersAndUpdate();
-    return zkReader.getClusterState().getSlices(solrCloudClient.getCollection());
+    return zkReader.getClusterState().getCollection(solrCloudClient.getCollection()).getSlices();
   }
 }


Mime
View raw message