diff --git a/gradle.properties b/gradle.properties index b523e913..0ea5b81c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ ltrVersion = 1.5.9 -elasticsearchVersion = 8.14.3 -luceneVersion = 9.10.0 +elasticsearchVersion = 8.15.2 +luceneVersion = 9.11.1 ow2Version = 8.0.1 antlrVersion = 4.5.1-1 diff --git a/src/main/java/com/o19s/es/ltr/action/CachesStatsAction.java b/src/main/java/com/o19s/es/ltr/action/CachesStatsAction.java index 30594d17..0fe1565d 100644 --- a/src/main/java/com/o19s/es/ltr/action/CachesStatsAction.java +++ b/src/main/java/com/o19s/es/ltr/action/CachesStatsAction.java @@ -47,10 +47,6 @@ protected CachesStatsAction() { } public static class CachesStatsNodesRequest extends BaseNodesRequest { - public CachesStatsNodesRequest(StreamInput in) throws IOException { - super(in); - } - public CachesStatsNodesRequest() { super((String[]) null); } diff --git a/src/main/java/com/o19s/es/ltr/action/ClearCachesAction.java b/src/main/java/com/o19s/es/ltr/action/ClearCachesAction.java index c9b38b06..347950cc 100644 --- a/src/main/java/com/o19s/es/ltr/action/ClearCachesAction.java +++ b/src/main/java/com/o19s/es/ltr/action/ClearCachesAction.java @@ -57,7 +57,6 @@ public static class ClearCachesNodesRequest extends BaseNodesRequest statsToBeRetrieved; public LTRStatsNodesRequest(StreamInput in) throws IOException { - super(in); + super((String[])null); statsToBeRetrieved = in.readCollectionAsSet(StreamInput::readString); } @@ -119,9 +119,7 @@ public Set getStatsToBeRetrieved() { return statsToBeRetrieved; } - @Override - public void writeTo(StreamOutput out) throws IOException { - super.writeTo(out); + public void writeToStream(StreamOutput out) throws IOException { out.writeStringCollection(statsToBeRetrieved); } } diff --git a/src/main/java/com/o19s/es/ltr/action/ListStoresAction.java b/src/main/java/com/o19s/es/ltr/action/ListStoresAction.java index afa61f7d..3b2822a3 100644 --- a/src/main/java/com/o19s/es/ltr/action/ListStoresAction.java +++ b/src/main/java/com/o19s/es/ltr/action/ListStoresAction.java @@ -27,6 +27,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xcontent.XContentBuilder; @@ -51,7 +52,9 @@ public ActionRequestValidationException validate() { return null; } - public ListStoresActionRequest() {} + public ListStoresActionRequest() { + super(TimeValue.MAX_VALUE); + } public ListStoresActionRequest(StreamInput in) throws IOException { super(in); diff --git a/src/main/java/com/o19s/es/ltr/action/TransportClearCachesAction.java b/src/main/java/com/o19s/es/ltr/action/TransportClearCachesAction.java index e8044671..7f3a94ee 100644 --- a/src/main/java/com/o19s/es/ltr/action/TransportClearCachesAction.java +++ b/src/main/java/com/o19s/es/ltr/action/TransportClearCachesAction.java @@ -108,7 +108,7 @@ public ClearCachesNodeRequest(ClearCachesNodesRequest req) { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - request.writeTo(out); + request.writeToStream(out); } } } diff --git a/src/main/java/com/o19s/es/ltr/rest/RestLTRStats.java b/src/main/java/com/o19s/es/ltr/rest/RestLTRStats.java index 63f59301..90aad495 100644 --- a/src/main/java/com/o19s/es/ltr/rest/RestLTRStats.java +++ b/src/main/java/com/o19s/es/ltr/rest/RestLTRStats.java @@ -4,6 +4,7 @@ import com.o19s.es.ltr.action.LTRStatsAction.LTRStatsNodesRequest; import com.o19s.es.ltr.stats.StatName; import org.elasticsearch.client.internal.node.NodeClient; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestActions; @@ -55,7 +56,12 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli private LTRStatsNodesRequest getRequest(RestRequest request) { LTRStatsNodesRequest ltrStatsRequest = new LTRStatsNodesRequest( splitCommaSeparatedParam(request, "nodeId").orElse(null)); - ltrStatsRequest.timeout(request.param("timeout")); + + ltrStatsRequest.timeout( + Optional.ofNullable(request.param("timeout")) + .map(timeout -> TimeValue.parseTimeValue(timeout, "timeout")) + .orElse(TimeValue.MAX_VALUE) + ); List requestedStats = splitCommaSeparatedParam(request, "stat") diff --git a/src/test/java/com/o19s/es/ltr/logging/LoggingFetchSubPhaseTests.java b/src/test/java/com/o19s/es/ltr/logging/LoggingFetchSubPhaseTests.java index ea1d9a40..539c2629 100644 --- a/src/test/java/com/o19s/es/ltr/logging/LoggingFetchSubPhaseTests.java +++ b/src/test/java/com/o19s/es/ltr/logging/LoggingFetchSubPhaseTests.java @@ -53,7 +53,6 @@ import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.fetch.FetchSubPhase; import org.elasticsearch.search.fetch.FetchSubPhaseProcessor; -import org.elasticsearch.search.lookup.Source; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -185,8 +184,7 @@ public void collect(int doc) throws IOException { doc, id ); - Source source = null; - processor.process(new FetchSubPhase.HitContext(hit, context, doc, Map.of(), source)); + processor.process(new FetchSubPhase.HitContext(hit, context, doc, Map.of(), null, null)); hits.add(hit); } }