mirror of https://github.com/apache/lucene.git
SOLR-8995: Replace anonymous implementations of SAM interfaces with Lambdas
This commit is contained in:
parent
6c74669375
commit
f82a27aa5c
|
@ -19,5 +19,5 @@ package org.apache.solr.cloud.rule;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public interface RemoteCallback {
|
public interface RemoteCallback {
|
||||||
public void remoteCallback(SnitchContext ctx, Map<String, Object> returnedVal) ;
|
void remoteCallback(SnitchContext ctx, Map<String, Object> returnedVal);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,5 +24,5 @@ import org.apache.solr.request.SolrRequestHandler;
|
||||||
public interface NestedRequestHandler {
|
public interface NestedRequestHandler {
|
||||||
/** Return a Requestandler to handle a subpath from the path this handler is registered.
|
/** Return a Requestandler to handle a subpath from the path this handler is registered.
|
||||||
*/
|
*/
|
||||||
public SolrRequestHandler getSubHandler(String subPath);
|
SolrRequestHandler getSubHandler(String subPath);
|
||||||
}
|
}
|
||||||
|
|
|
@ -794,14 +794,9 @@ public class QueryComponent extends SearchComponent
|
||||||
rb.resultIds = new HashMap<>();
|
rb.resultIds = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
EndResultTransformer.SolrDocumentSource solrDocumentSource = new EndResultTransformer.SolrDocumentSource() {
|
EndResultTransformer.SolrDocumentSource solrDocumentSource = doc -> {
|
||||||
|
ShardDoc solrDoc = (ShardDoc) doc;
|
||||||
@Override
|
return rb.retrievedDocuments.get(solrDoc.id);
|
||||||
public SolrDocument retrieve(ScoreDoc doc) {
|
|
||||||
ShardDoc solrDoc = (ShardDoc) doc;
|
|
||||||
return rb.retrievedDocuments.get(solrDoc.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
EndResultTransformer endResultTransformer;
|
EndResultTransformer endResultTransformer;
|
||||||
if (groupSpec.isMain()) {
|
if (groupSpec.isMain()) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ public interface EndResultTransformer {
|
||||||
* Abstracts the source for {@link SolrDocument} instances.
|
* Abstracts the source for {@link SolrDocument} instances.
|
||||||
* The source of documents is different for a distributed search than local search
|
* The source of documents is different for a distributed search than local search
|
||||||
*/
|
*/
|
||||||
public interface SolrDocumentSource {
|
interface SolrDocumentSource {
|
||||||
|
|
||||||
SolrDocument retrieve(ScoreDoc doc);
|
SolrDocument retrieve(ScoreDoc doc);
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ public abstract class SolrCoreState {
|
||||||
|
|
||||||
|
|
||||||
public interface IndexWriterCloser {
|
public interface IndexWriterCloser {
|
||||||
public void closeWriter(IndexWriter writer) throws IOException;
|
void closeWriter(IndexWriter writer) throws IOException;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void doRecovery(CoreContainer cc, CoreDescriptor cd);
|
public abstract void doRecovery(CoreContainer cc, CoreDescriptor cd);
|
||||||
|
|
|
@ -46,12 +46,7 @@ public class TestCryptoKeys extends AbstractFullDistribZkTestBase {
|
||||||
|
|
||||||
private void setupHarnesses() {
|
private void setupHarnesses() {
|
||||||
for (final SolrClient client : clients) {
|
for (final SolrClient client : clients) {
|
||||||
RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() {
|
RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient) client).getBaseURL());
|
||||||
@Override
|
|
||||||
public String getBaseURL() {
|
|
||||||
return ((HttpSolrClient) client).getBaseURL();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
restTestHarnesses.add(harness);
|
restTestHarnesses.add(harness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,12 +45,7 @@ public class TestDynamicLoading extends AbstractFullDistribZkTestBase {
|
||||||
|
|
||||||
private void setupHarnesses() {
|
private void setupHarnesses() {
|
||||||
for (final SolrClient client : clients) {
|
for (final SolrClient client : clients) {
|
||||||
RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() {
|
RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL());
|
||||||
@Override
|
|
||||||
public String getBaseURL() {
|
|
||||||
return ((HttpSolrClient)client).getBaseURL();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
restTestHarnesses.add(harness);
|
restTestHarnesses.add(harness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,12 +60,7 @@ public class TestConfigReload extends AbstractFullDistribZkTestBase {
|
||||||
|
|
||||||
private void setupHarnesses() {
|
private void setupHarnesses() {
|
||||||
for (final SolrClient client : clients) {
|
for (final SolrClient client : clients) {
|
||||||
RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() {
|
RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL());
|
||||||
@Override
|
|
||||||
public String getBaseURL() {
|
|
||||||
return ((HttpSolrClient)client).getBaseURL();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
restTestHarnesses.add(harness);
|
restTestHarnesses.add(harness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,12 +43,7 @@ public class TestReqParamsAPI extends AbstractFullDistribZkTestBase {
|
||||||
|
|
||||||
private void setupHarnesses() {
|
private void setupHarnesses() {
|
||||||
for (final SolrClient client : clients) {
|
for (final SolrClient client : clients) {
|
||||||
RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() {
|
RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient) client).getBaseURL());
|
||||||
@Override
|
|
||||||
public String getBaseURL() {
|
|
||||||
return ((HttpSolrClient) client).getBaseURL();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
restTestHarnesses.add(harness);
|
restTestHarnesses.add(harness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,12 +49,7 @@ public class TestSolrConfigHandlerCloud extends AbstractFullDistribZkTestBase {
|
||||||
|
|
||||||
private void setupHarnesses() {
|
private void setupHarnesses() {
|
||||||
for (final SolrClient client : clients) {
|
for (final SolrClient client : clients) {
|
||||||
RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() {
|
RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL());
|
||||||
@Override
|
|
||||||
public String getBaseURL() {
|
|
||||||
return ((HttpSolrClient)client).getBaseURL();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
restTestHarnesses.add(harness);
|
restTestHarnesses.add(harness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,12 +61,7 @@ public class TestSolrConfigHandlerConcurrent extends AbstractFullDistribZkTestBa
|
||||||
|
|
||||||
private void setupHarnesses() {
|
private void setupHarnesses() {
|
||||||
for (final SolrClient client : clients) {
|
for (final SolrClient client : clients) {
|
||||||
RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() {
|
RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL());
|
||||||
@Override
|
|
||||||
public String getBaseURL() {
|
|
||||||
return ((HttpSolrClient)client).getBaseURL();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
restTestHarnesses.add(harness);
|
restTestHarnesses.add(harness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,12 +60,7 @@ public class TestBulkSchemaConcurrent extends AbstractFullDistribZkTestBase {
|
||||||
|
|
||||||
private void setupHarnesses() {
|
private void setupHarnesses() {
|
||||||
for (final SolrClient client : clients) {
|
for (final SolrClient client : clients) {
|
||||||
RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() {
|
RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL());
|
||||||
@Override
|
|
||||||
public String getBaseURL() {
|
|
||||||
return ((HttpSolrClient)client).getBaseURL();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
restTestHarnesses.add(harness);
|
restTestHarnesses.add(harness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,12 +90,7 @@ public class TestCloudManagedSchemaConcurrent extends AbstractFullDistribZkTestB
|
||||||
|
|
||||||
private void setupHarnesses() {
|
private void setupHarnesses() {
|
||||||
for (final SolrClient client : clients) {
|
for (final SolrClient client : clients) {
|
||||||
RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() {
|
RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL());
|
||||||
@Override
|
|
||||||
public String getBaseURL() {
|
|
||||||
return ((HttpSolrClient)client).getBaseURL();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
restTestHarnesses.add(harness);
|
restTestHarnesses.add(harness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -352,11 +347,7 @@ public class TestCloudManagedSchemaConcurrent extends AbstractFullDistribZkTestB
|
||||||
final String coreUrl = (new ZkCoreNodeProps(shard1Leader)).getCoreUrl();
|
final String coreUrl = (new ZkCoreNodeProps(shard1Leader)).getCoreUrl();
|
||||||
assertNotNull(coreUrl);
|
assertNotNull(coreUrl);
|
||||||
|
|
||||||
RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() {
|
RestTestHarness harness = new RestTestHarness(() -> coreUrl.endsWith("/") ? coreUrl.substring(0, coreUrl.length()-1) : coreUrl);
|
||||||
public String getBaseURL() {
|
|
||||||
return coreUrl.endsWith("/") ? coreUrl.substring(0, coreUrl.length()-1) : coreUrl;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
try {
|
try {
|
||||||
addFieldTypePut(harness, "fooInt", 15);
|
addFieldTypePut(harness, "fooInt", 15);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -413,11 +404,7 @@ public class TestCloudManagedSchemaConcurrent extends AbstractFullDistribZkTestB
|
||||||
*/
|
*/
|
||||||
protected void validateZkVersion(Replica replica, int schemaZkVersion, int waitSecs, boolean retry) throws Exception {
|
protected void validateZkVersion(Replica replica, int schemaZkVersion, int waitSecs, boolean retry) throws Exception {
|
||||||
final String replicaUrl = (new ZkCoreNodeProps(replica)).getCoreUrl();
|
final String replicaUrl = (new ZkCoreNodeProps(replica)).getCoreUrl();
|
||||||
RestTestHarness testHarness = new RestTestHarness(new RESTfulServerProvider() {
|
RestTestHarness testHarness = new RestTestHarness(() -> replicaUrl.endsWith("/") ? replicaUrl.substring(0, replicaUrl.length()-1) : replicaUrl);
|
||||||
public String getBaseURL() {
|
|
||||||
return replicaUrl.endsWith("/") ? replicaUrl.substring(0, replicaUrl.length()-1) : replicaUrl;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
try {
|
try {
|
||||||
long waitMs = waitSecs * 1000L;
|
long waitMs = waitSecs * 1000L;
|
||||||
if (waitMs > 0) Thread.sleep(waitMs); // wait a moment for the zk watcher to fire
|
if (waitMs > 0) Thread.sleep(waitMs); // wait a moment for the zk watcher to fire
|
||||||
|
|
|
@ -81,12 +81,7 @@ public class TestCloudSchemaless extends AbstractFullDistribZkTestBase {
|
||||||
|
|
||||||
private void setupHarnesses() {
|
private void setupHarnesses() {
|
||||||
for (final SolrClient client : clients) {
|
for (final SolrClient client : clients) {
|
||||||
RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() {
|
RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL());
|
||||||
@Override
|
|
||||||
public String getBaseURL() {
|
|
||||||
return ((HttpSolrClient)client).getBaseURL();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
restTestHarnesses.add(harness);
|
restTestHarnesses.add(harness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,12 +49,7 @@ public class TestNamedUpdateProcessors extends AbstractFullDistribZkTestBase {
|
||||||
|
|
||||||
private void setupHarnesses() {
|
private void setupHarnesses() {
|
||||||
for (final SolrClient client : clients) {
|
for (final SolrClient client : clients) {
|
||||||
RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() {
|
RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient) client).getBaseURL());
|
||||||
@Override
|
|
||||||
public String getBaseURL() {
|
|
||||||
return ((HttpSolrClient) client).getBaseURL();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
restTestHarnesses.add(harness);
|
restTestHarnesses.add(harness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -898,7 +898,7 @@ public class JavaBinCodec {
|
||||||
* <p>
|
* <p>
|
||||||
* Implementors of this interface write a method to serialize a given object using an existing {@link JavaBinCodec}
|
* Implementors of this interface write a method to serialize a given object using an existing {@link JavaBinCodec}
|
||||||
*/
|
*/
|
||||||
public static interface ObjectResolver {
|
public interface ObjectResolver {
|
||||||
/**
|
/**
|
||||||
* Examine and attempt to serialize the given object, using a {@link JavaBinCodec} to write it to a stream.
|
* Examine and attempt to serialize the given object, using a {@link JavaBinCodec} to write it to a stream.
|
||||||
*
|
*
|
||||||
|
@ -907,12 +907,12 @@ public class JavaBinCodec {
|
||||||
* @return the object {@code o} itself if it could not be serialized, or {@code null} if the whole object was successfully serialized.
|
* @return the object {@code o} itself if it could not be serialized, or {@code null} if the whole object was successfully serialized.
|
||||||
* @see JavaBinCodec
|
* @see JavaBinCodec
|
||||||
*/
|
*/
|
||||||
public Object resolve(Object o, JavaBinCodec codec) throws IOException;
|
Object resolve(Object o, JavaBinCodec codec) throws IOException;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface WritableDocFields {
|
public interface WritableDocFields {
|
||||||
public boolean isWritable(String name);
|
boolean isWritable(String name);
|
||||||
public boolean wantsAllFields();
|
boolean wantsAllFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,5 +16,5 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.solr.util;
|
package org.apache.solr.util;
|
||||||
public interface RESTfulServerProvider {
|
public interface RESTfulServerProvider {
|
||||||
public String getBaseURL();
|
String getBaseURL();
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,12 +51,7 @@ abstract public class RestTestBase extends SolrJettyTestBase {
|
||||||
|
|
||||||
createJetty(solrHome, configFile, schemaFile, context, stopAtShutdown, extraServlets);
|
createJetty(solrHome, configFile, schemaFile, context, stopAtShutdown, extraServlets);
|
||||||
|
|
||||||
restTestHarness = new RestTestHarness(new RESTfulServerProvider() {
|
restTestHarness = new RestTestHarness(() -> jetty.getBaseUrl().toString() + "/" + DEFAULT_TEST_CORENAME);
|
||||||
@Override
|
|
||||||
public String getBaseURL() {
|
|
||||||
return jetty.getBaseUrl().toString() + "/" + DEFAULT_TEST_CORENAME;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Validates an update XML String is successful
|
/** Validates an update XML String is successful
|
||||||
|
|
Loading…
Reference in New Issue