Skip to content

Commit 2808580

Browse files
authored
chore: bumps to elasticsearch 8.15.2 (#501)
1 parent 4e39eb8 commit 2808580

8 files changed

+24
-26
lines changed

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ltrVersion = 1.5.9
2-
elasticsearchVersion = 8.14.3
3-
luceneVersion = 9.10.0
2+
elasticsearchVersion = 8.15.2
3+
luceneVersion = 9.11.1
44
ow2Version = 8.0.1
55
antlrVersion = 4.5.1-1

src/main/java/com/o19s/es/ltr/action/CachesStatsAction.java

-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ protected CachesStatsAction() {
4747
}
4848

4949
public static class CachesStatsNodesRequest extends BaseNodesRequest<CachesStatsNodesRequest> {
50-
public CachesStatsNodesRequest(StreamInput in) throws IOException {
51-
super(in);
52-
}
53-
5450
public CachesStatsNodesRequest() {
5551
super((String[]) null);
5652
}

src/main/java/com/o19s/es/ltr/action/ClearCachesAction.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public static class ClearCachesNodesRequest extends BaseNodesRequest<ClearCaches
5757

5858

5959
public ClearCachesNodesRequest(StreamInput in) throws IOException {
60-
super(in);
6160
store = in.readString();
6261
operation = Operation.values()[in.readVInt()];
6362
name = in.readOptionalString();
@@ -107,9 +106,7 @@ private void clearElement(String storeName, String name, ClearCachesNodesRequest
107106
this.name = Objects.requireNonNull(name);
108107
}
109108

110-
@Override
111-
public void writeTo(StreamOutput out) throws IOException {
112-
super.writeTo(out);
109+
public void writeToStream(StreamOutput out) throws IOException {
113110
out.writeString(store);
114111
out.writeVInt(operation.ordinal());
115112
out.writeOptionalString(name);

src/main/java/com/o19s/es/ltr/action/LTRStatsAction.java

+8-10
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ public LTRStatsRequestBuilder(ElasticsearchClient client) {
4242
public static class LTRStatsNodeRequest extends TransportRequest {
4343
private final LTRStatsNodesRequest nodesRequest;
4444

45-
public LTRStatsNodeRequest(LTRStatsNodesRequest nodesRequest) {
46-
this.nodesRequest = nodesRequest;
47-
}
48-
4945
public LTRStatsNodeRequest(StreamInput in) throws IOException {
5046
super(in);
51-
nodesRequest = new LTRStatsNodesRequest(in);
47+
this.nodesRequest = new LTRStatsNodesRequest(in);
48+
}
49+
50+
public LTRStatsNodeRequest(LTRStatsNodesRequest nodesRequest) {
51+
this.nodesRequest = nodesRequest;
5252
}
5353

5454
public LTRStatsNodesRequest getLTRStatsNodesRequest() {
@@ -58,7 +58,7 @@ public LTRStatsNodesRequest getLTRStatsNodesRequest() {
5858
@Override
5959
public void writeTo(StreamOutput out) throws IOException {
6060
super.writeTo(out);
61-
nodesRequest.writeTo(out);
61+
nodesRequest.writeToStream(out);
6262
}
6363
}
6464

@@ -102,7 +102,7 @@ public static class LTRStatsNodesRequest extends BaseNodesRequest<LTRStatsNodesR
102102
private Set<String> statsToBeRetrieved;
103103

104104
public LTRStatsNodesRequest(StreamInput in) throws IOException {
105-
super(in);
105+
super((String[])null);
106106
statsToBeRetrieved = in.readCollectionAsSet(StreamInput::readString);
107107
}
108108

@@ -119,9 +119,7 @@ public Set<String> getStatsToBeRetrieved() {
119119
return statsToBeRetrieved;
120120
}
121121

122-
@Override
123-
public void writeTo(StreamOutput out) throws IOException {
124-
super.writeTo(out);
122+
public void writeToStream(StreamOutput out) throws IOException {
125123
out.writeStringCollection(statsToBeRetrieved);
126124
}
127125
}

src/main/java/com/o19s/es/ltr/action/ListStoresAction.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.common.io.stream.StreamInput;
2828
import org.elasticsearch.common.io.stream.StreamOutput;
2929
import org.elasticsearch.common.io.stream.Writeable;
30+
import org.elasticsearch.core.TimeValue;
3031
import org.elasticsearch.xcontent.ToXContent;
3132
import org.elasticsearch.xcontent.ToXContentObject;
3233
import org.elasticsearch.xcontent.XContentBuilder;
@@ -51,7 +52,9 @@ public ActionRequestValidationException validate() {
5152
return null;
5253
}
5354

54-
public ListStoresActionRequest() {}
55+
public ListStoresActionRequest() {
56+
super(TimeValue.MAX_VALUE);
57+
}
5558

5659
public ListStoresActionRequest(StreamInput in) throws IOException {
5760
super(in);

src/main/java/com/o19s/es/ltr/action/TransportClearCachesAction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public ClearCachesNodeRequest(ClearCachesNodesRequest req) {
108108
@Override
109109
public void writeTo(StreamOutput out) throws IOException {
110110
super.writeTo(out);
111-
request.writeTo(out);
111+
request.writeToStream(out);
112112
}
113113
}
114114
}

src/main/java/com/o19s/es/ltr/rest/RestLTRStats.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.o19s.es.ltr.action.LTRStatsAction.LTRStatsNodesRequest;
55
import com.o19s.es.ltr.stats.StatName;
66
import org.elasticsearch.client.internal.node.NodeClient;
7+
import org.elasticsearch.core.TimeValue;
78
import org.elasticsearch.rest.BaseRestHandler;
89
import org.elasticsearch.rest.RestRequest;
910
import org.elasticsearch.rest.action.RestActions;
@@ -55,7 +56,12 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli
5556
private LTRStatsNodesRequest getRequest(RestRequest request) {
5657
LTRStatsNodesRequest ltrStatsRequest = new LTRStatsNodesRequest(
5758
splitCommaSeparatedParam(request, "nodeId").orElse(null));
58-
ltrStatsRequest.timeout(request.param("timeout"));
59+
60+
ltrStatsRequest.timeout(
61+
Optional.ofNullable(request.param("timeout"))
62+
.map(timeout -> TimeValue.parseTimeValue(timeout, "timeout"))
63+
.orElse(TimeValue.MAX_VALUE)
64+
);
5965

6066
List<String> requestedStats =
6167
splitCommaSeparatedParam(request, "stat")

src/test/java/com/o19s/es/ltr/logging/LoggingFetchSubPhaseTests.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
import org.elasticsearch.search.SearchHit;
5454
import org.elasticsearch.search.fetch.FetchSubPhase;
5555
import org.elasticsearch.search.fetch.FetchSubPhaseProcessor;
56-
import org.elasticsearch.search.lookup.Source;
5756
import org.junit.AfterClass;
5857
import org.junit.BeforeClass;
5958

@@ -185,8 +184,7 @@ public void collect(int doc) throws IOException {
185184
doc,
186185
id
187186
);
188-
Source source = null;
189-
processor.process(new FetchSubPhase.HitContext(hit, context, doc, Map.of(), source));
187+
processor.process(new FetchSubPhase.HitContext(hit, context, doc, Map.of(), null, null));
190188
hits.add(hit);
191189
}
192190
}

0 commit comments

Comments
 (0)