You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ep...@apache.org on 2023/05/02 20:21:52 UTC

[solr] branch branch_9x updated: SOLR-13605: Fix backport issues (#1619)

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

epugh pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new fab9720b684 SOLR-13605: Fix backport issues (#1619)
fab9720b684 is described below

commit fab9720b684f6de6e95c44e6b13a699ea23ae86c
Author: Eric Pugh <ep...@opensourceconnections.com>
AuthorDate: Tue May 2 16:21:47 2023 -0400

    SOLR-13605: Fix backport issues (#1619)
---
 .../solrj/impl/ConcurrentUpdateSolrClient.java     | 33 ++++++++--------------
 .../solrj/impl/DelegationTokenHttpSolrClient.java  | 15 ----------
 2 files changed, 11 insertions(+), 37 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
index 212153467f1..822048d83ae 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
@@ -83,8 +83,8 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
   volatile CountDownLatch lock = null; // used to block everything
   final int threadCount;
   boolean shutdownExecutor = false;
-  int pollQueueTime = 250;
-  int stallTime;
+  int pollQueueTimeMillis = 250;
+  int stallTimeMillis;
   private final boolean streamDeletes;
   private boolean internalHttpClient;
   private final int connectionTimeout;
@@ -116,6 +116,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
     this.streamDeletes = builder.streamDeletes;
     this.connectionTimeout = builder.connectionTimeoutMillis;
     this.soTimeout = builder.socketTimeoutMillis;
+
     this.pollQueueTimeMillis = builder.pollQueueTime;
     this.stallTimeMillis = Integer.getInteger("solr.cloud.client.stallTime", 15000);
 
@@ -157,18 +158,6 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
     return this.client.getUrlParamNames();
   }
 
-  /**
-   * Expert Method.
-   *
-   * @param queryParams set of param keys to only send via the query string
-   * @deprecated use {@link ConcurrentUpdateSolrClient.Builder#withTheseParamNamesInTheUrl(Set)}
-   *     instead
-   */
-  @Deprecated
-  public void setQueryParams(Set<String> queryParams) {
-    this.client.setQueryParams(queryParams);
-  }
-
   /** Opens a connection and sends everything... */
   @SuppressWarnings({"unchecked"})
   class Runner implements Runnable {
@@ -240,7 +229,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
           notifyQueueAndRunnersIfEmptyQueue();
           try {
             inPoll = true;
-            update = queue.poll(pollQueueTime, TimeUnit.MILLISECONDS);
+            update = queue.poll(pollQueueTimeMillis, TimeUnit.MILLISECONDS);
           } catch (InterruptedException e) {
             if (log.isDebugEnabled()) pollInterrupts.incrementAndGet();
             continue;
@@ -307,7 +296,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
                         try {
                           while (true) {
                             try {
-                              upd = queue.poll(pollQueueTime, TimeUnit.MILLISECONDS);
+                              upd = queue.poll(pollQueueTimeMillis, TimeUnit.MILLISECONDS);
                               break;
                             } catch (InterruptedException e) {
                               if (log.isDebugEnabled()) pollInterrupts.incrementAndGet();
@@ -584,7 +573,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
             } else {
               long currentStallTime =
                   TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - lastStallTime);
-              if (currentStallTime > stallTime) {
+              if (currentStallTime > stallTimeMillis) {
                 throw new IOException(
                     "Request processing has stalled for "
                         + currentStallTime
@@ -645,7 +634,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
             } else {
               long currentStallTime =
                   TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - lastStallTime);
-              if (currentStallTime > stallTime) {
+              if (currentStallTime > stallTimeMillis) {
                 throw new IOException(
                     "Task queue processing has stalled for "
                         + currentStallTime
@@ -740,7 +729,7 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
           lastStallTime = System.nanoTime();
         } else {
           long currentStallTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - lastStallTime);
-          if (currentStallTime > stallTime) {
+          if (currentStallTime > stallTimeMillis) {
             throw new IOException(
                 "Task queue processing has stalled for "
                     + currentStallTime
@@ -851,12 +840,12 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
    */
   @Deprecated
   public void setPollQueueTime(int pollQueueTime) {
-    this.pollQueueTime = pollQueueTime;
+    this.pollQueueTimeMillis = pollQueueTime;
     // make sure the stall time is larger than the polling time
     // to give a chance for the queue to change
     int minimalStallTime = pollQueueTime * 2;
-    if (minimalStallTime > this.stallTime) {
-      this.stallTime = minimalStallTime;
+    if (minimalStallTime > this.stallTimeMillis) {
+      this.stallTimeMillis = minimalStallTime;
     }
   }
 
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/DelegationTokenHttpSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/DelegationTokenHttpSolrClient.java
index 02f5ba2ece8..8aad9ee6ef8 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/DelegationTokenHttpSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/DelegationTokenHttpSolrClient.java
@@ -17,9 +17,6 @@
 package org.apache.solr.client.solrj.impl;
 
 import java.io.IOException;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
 import org.apache.http.client.methods.HttpRequestBase;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -46,16 +43,4 @@ public class DelegationTokenHttpSolrClient extends HttpSolrClient {
     }
     return super.createMethod(request, collection);
   }
-
-  @Deprecated
-  @Override
-  public void setQueryParams(Set<String> urlParamNames) {
-    urlParamNames = urlParamNames == null ? Set.of(DELEGATION_TOKEN_PARAM) : urlParamNames;
-    if (!urlParamNames.contains(DELEGATION_TOKEN_PARAM)) {
-      urlParamNames = new HashSet<>(urlParamNames);
-      urlParamNames.add(DELEGATION_TOKEN_PARAM);
-      urlParamNames = Collections.unmodifiableSet(urlParamNames);
-    }
-    super.setQueryParams(urlParamNames);
-  }
 }