diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java index 9f86edf44ab..ac941e4edd4 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java @@ -21,11 +21,11 @@ import static org.apache.solr.security.PermissionNameProvider.Name.CORE_EDIT_PERM; import static org.apache.solr.security.PermissionNameProvider.Name.CORE_READ_PERM; -import java.io.Closeable; import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; import com.github.benmanes.caffeine.cache.Expiry; import com.github.benmanes.caffeine.cache.Ticker; +import java.io.Closeable; import java.io.File; import java.lang.invoke.MethodHandles; import java.util.ArrayList; diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java index 56e4a13bece..d698457ec8d 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java +++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java @@ -29,7 +29,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.TimeUnit; - import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.impl.Http2SolrClient; import org.apache.solr.client.solrj.impl.HttpClientUtil; @@ -203,31 +202,31 @@ private void initReplicaListTransformers(NamedList routingConfig) { private static final long DELAY_WARN_THRESHOLD = TimeUnit.NANOSECONDS.convert(200, TimeUnit.MILLISECONDS); - private final HttpListenerFactory delayedReqLogger = new HttpListenerFactory() { - @Override - public RequestResponseListener get() { - long start = System.nanoTime(); - return new RequestResponseListener() { + private final HttpListenerFactory delayedReqLogger = + new HttpListenerFactory() { @Override - public void onBegin(Request request) { - // There should be negligible delay between request submission and actually sending - // the request. Here we add extra logging to notify us if this assumption is - // violated. See: SOLR-16099, SOLR-16129, - // https://github.com/fullstorydev/lucene-solr/commit/445508adb4a - long delayNanos = System.nanoTime() - start; - if (delayNanos > DELAY_WARN_THRESHOLD) { - long millis = TimeUnit.MILLISECONDS.convert(delayNanos, TimeUnit.NANOSECONDS); - log.info("Remote shard request delayed by {} milliseconds", millis); - if (delayedRequests != null) { - delayedRequests.update(millis); + public RequestResponseListener get() { + long start = System.nanoTime(); + return new RequestResponseListener() { + @Override + public void onBegin(Request request) { + // There should be negligible delay between request submission and actually sending + // the request. Here we add extra logging to notify us if this assumption is + // violated. See: SOLR-16099, SOLR-16129, + // https://github.com/fullstorydev/lucene-solr/commit/445508adb4a + long delayNanos = System.nanoTime() - start; + if (delayNanos > DELAY_WARN_THRESHOLD) { + long millis = TimeUnit.MILLISECONDS.convert(delayNanos, TimeUnit.NANOSECONDS); + log.info("Remote shard request delayed by {} milliseconds", millis); + if (delayedRequests != null) { + delayedRequests.update(millis); + } + } + super.onBegin(request); // no-op } - } - super.onBegin(request); // no-op + }; } }; - } - }; - @Override public void init(PluginInfo info) { diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetBucket.java b/solr/core/src/java/org/apache/solr/search/facet/FacetBucket.java index 4a1117b53ab..45bf38f2870 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetBucket.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetBucket.java @@ -29,6 +29,7 @@ public class FacetBucket { @SuppressWarnings({"rawtypes"}) final Comparable bucketValue; + // this is just for internal correlation (the first bucket created is bucket 0, the next bucket 1, // across all field buckets) // bucketNumber is only supplied for buckets that could be part of a refinement chain, otherwise diff --git a/solr/solrj/src/test/org/apache/solr/common/cloud/DocCollectionTest.java b/solr/solrj/src/test/org/apache/solr/common/cloud/DocCollectionTest.java index 96eb8594157..4772521cb7a 100644 --- a/solr/solrj/src/test/org/apache/solr/common/cloud/DocCollectionTest.java +++ b/solr/solrj/src/test/org/apache/solr/common/cloud/DocCollectionTest.java @@ -57,8 +57,10 @@ public void testDocCollectionEqualsAndHashcode() throws Exception { prsStates.add(prsState); final PerReplicaStates prs = new PerReplicaStates(collName, 1, prsStates); propMap.put(DocCollection.CollectionStateProps.PER_REPLICA_STATE, Boolean.TRUE); - docCollection = DocCollection.create(collName, sliceMap, propMap, docRouter, 1, Instant.now(), () -> prs); - docCollection2 = DocCollection.create(collName, sliceMap, propMap, docRouter, 1, Instant.now(), () -> prs); + docCollection = + DocCollection.create(collName, sliceMap, propMap, docRouter, 1, Instant.now(), () -> prs); + docCollection2 = + DocCollection.create(collName, sliceMap, propMap, docRouter, 1, Instant.now(), () -> prs); prsState = "replicacore:1:D:L"; prsStates = new ArrayList<>(); prsStates.add(prsState);