mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Compilation fixes for 7.x
This commit is contained in:
parent
d8f1735e39
commit
eb1ed2a35f
@ -50,9 +50,9 @@ public class EqlPlugin extends Plugin implements ActionPlugin {
|
||||
@Override
|
||||
public List<Setting<?>> getSettings() {
|
||||
if (isSnapshot()) {
|
||||
return List.of(EQL_ENABLED_SETTING);
|
||||
return Collections.singletonList(EQL_ENABLED_SETTING);
|
||||
} else {
|
||||
return List.of();
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class RestEqlSearchAction extends BaseRestHandler {
|
||||
eqlRequest.indices(Strings.splitStringByCommaToArray(request.param("index")));
|
||||
}
|
||||
|
||||
return channel -> client.execute(EqlSearchAction.INSTANCE, eqlRequest, new RestResponseListener<>(channel) {
|
||||
return channel -> client.execute(EqlSearchAction.INSTANCE, eqlRequest, new RestResponseListener<EqlSearchResponse>(channel) {
|
||||
@Override
|
||||
public RestResponse buildResponse(EqlSearchResponse response) throws Exception {
|
||||
XContentBuilder builder = channel.newBuilder(request.getXContentType(), XContentType.JSON, true);
|
||||
|
@ -54,8 +54,8 @@ public class TransportEqlSearchAction extends HandledTransportAction<EqlSearchRe
|
||||
// Stubbed search response
|
||||
// TODO: implement actual search response processing once the parser/executor is in place
|
||||
List<SearchHit> events = Arrays.asList(
|
||||
new SearchHit(1, "111", null),
|
||||
new SearchHit(2, "222", null)
|
||||
new SearchHit(1, "111", null, null),
|
||||
new SearchHit(2, "222", null, null)
|
||||
);
|
||||
EqlSearchResponse.Hits hits = new EqlSearchResponse.Hits(null, Arrays.asList(
|
||||
new EqlSearchResponse.Sequence(Collections.singletonList("4021"), events),
|
||||
|
@ -16,7 +16,7 @@ import org.elasticsearch.search.SearchModule;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
@ -25,7 +25,7 @@ import static org.hamcrest.Matchers.containsString;
|
||||
public class EqlRequestParserTests extends ESTestCase {
|
||||
|
||||
private static NamedXContentRegistry registry =
|
||||
new NamedXContentRegistry(new SearchModule(Settings.EMPTY, List.of()).getNamedXContents());
|
||||
new NamedXContentRegistry(new SearchModule(Settings.EMPTY, false, Collections.emptyList()).getNamedXContents());
|
||||
public void testUnknownFieldParsingErrors() throws IOException {
|
||||
assertParsingErrorMessage("{\"key\" : \"value\"}", "unknown field [key]", EqlSearchRequest::fromXContent);
|
||||
}
|
||||
|
@ -46,13 +46,13 @@ public class EqlSearchRequestTests extends AbstractSerializingTestCase<EqlSearch
|
||||
|
||||
@Override
|
||||
protected NamedWriteableRegistry getNamedWriteableRegistry() {
|
||||
SearchModule searchModule = new SearchModule(Settings.EMPTY, Collections.emptyList());
|
||||
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
|
||||
return new NamedWriteableRegistry(searchModule.getNamedWriteables());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected NamedXContentRegistry xContentRegistry() {
|
||||
SearchModule searchModule = new SearchModule(Settings.EMPTY, Collections.emptyList());
|
||||
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
|
||||
return new NamedXContentRegistry(searchModule.getNamedXContents());
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ public class EqlSearchResponseTests extends AbstractSerializingTestCase<EqlSearc
|
||||
if (randomBoolean()) {
|
||||
hits = new ArrayList<>();
|
||||
for (int i = 0; i < size; i++) {
|
||||
hits.add(new SearchHit(i, randomAlphaOfLength(10), new HashMap<>()));
|
||||
hits.add(new SearchHit(i, randomAlphaOfLength(10), null, new HashMap<>()));
|
||||
}
|
||||
}
|
||||
if (randomBoolean()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user