Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
magibney committed Oct 9, 2024
1 parent 68db4d8 commit 6c7be34
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6c7be34

Please sign in to comment.