Skip to content

Commit

Permalink
chore: bumps to elasticsearch 8.15.2 (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdmbr authored Nov 4, 2024
1 parent 4e39eb8 commit 2808580
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 26 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions src/main/java/com/o19s/es/ltr/action/CachesStatsAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ protected CachesStatsAction() {
}

public static class CachesStatsNodesRequest extends BaseNodesRequest<CachesStatsNodesRequest> {
public CachesStatsNodesRequest(StreamInput in) throws IOException {
super(in);
}

public CachesStatsNodesRequest() {
super((String[]) null);
}
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/com/o19s/es/ltr/action/ClearCachesAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public static class ClearCachesNodesRequest extends BaseNodesRequest<ClearCaches


public ClearCachesNodesRequest(StreamInput in) throws IOException {
super(in);
store = in.readString();
operation = Operation.values()[in.readVInt()];
name = in.readOptionalString();
Expand Down Expand Up @@ -107,9 +106,7 @@ private void clearElement(String storeName, String name, ClearCachesNodesRequest
this.name = Objects.requireNonNull(name);
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
public void writeToStream(StreamOutput out) throws IOException {
out.writeString(store);
out.writeVInt(operation.ordinal());
out.writeOptionalString(name);
Expand Down
18 changes: 8 additions & 10 deletions src/main/java/com/o19s/es/ltr/action/LTRStatsAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public LTRStatsRequestBuilder(ElasticsearchClient client) {
public static class LTRStatsNodeRequest extends TransportRequest {
private final LTRStatsNodesRequest nodesRequest;

public LTRStatsNodeRequest(LTRStatsNodesRequest nodesRequest) {
this.nodesRequest = nodesRequest;
}

public LTRStatsNodeRequest(StreamInput in) throws IOException {
super(in);
nodesRequest = new LTRStatsNodesRequest(in);
this.nodesRequest = new LTRStatsNodesRequest(in);
}

public LTRStatsNodeRequest(LTRStatsNodesRequest nodesRequest) {
this.nodesRequest = nodesRequest;
}

public LTRStatsNodesRequest getLTRStatsNodesRequest() {
Expand All @@ -58,7 +58,7 @@ public LTRStatsNodesRequest getLTRStatsNodesRequest() {
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
nodesRequest.writeTo(out);
nodesRequest.writeToStream(out);
}
}

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

public LTRStatsNodesRequest(StreamInput in) throws IOException {
super(in);
super((String[])null);
statsToBeRetrieved = in.readCollectionAsSet(StreamInput::readString);
}

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

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
public void writeToStream(StreamOutput out) throws IOException {
out.writeStringCollection(statsToBeRetrieved);
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/o19s/es/ltr/action/ListStoresAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
8 changes: 7 additions & 1 deletion src/main/java/com/o19s/es/ltr/rest/RestLTRStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String> requestedStats =
splitCommaSeparatedParam(request, "stat")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 2808580

Please sign in to comment.