Skip to content

Commit 5015cc7

Browse files
authored
Remove hppc from multi*shard request and responses (#85888)
The Multi API requests and responses use an hppc int array for term location data. The use of hppc here dates back to the beginning of the multi apis, yet all the other members have been converted to Java collections. This commit converts these uses to ArrayLists. relates #84735
1 parent 9f46aae commit 5015cc7

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

server/src/main/java/org/elasticsearch/action/get/MultiGetShardRequest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
package org.elasticsearch.action.get;
1010

11-
import com.carrotsearch.hppc.IntArrayList;
12-
1311
import org.elasticsearch.action.ActionRequestValidationException;
1412
import org.elasticsearch.action.support.single.shard.SingleShardRequest;
1513
import org.elasticsearch.common.io.stream.StreamInput;
@@ -26,13 +24,13 @@ public class MultiGetShardRequest extends SingleShardRequest<MultiGetShardReques
2624
private boolean realtime;
2725
private boolean refresh;
2826

29-
IntArrayList locations;
27+
List<Integer> locations;
3028
List<MultiGetRequest.Item> items;
3129

3230
MultiGetShardRequest(StreamInput in) throws IOException {
3331
super(in);
3432
int size = in.readVInt();
35-
locations = new IntArrayList(size);
33+
locations = new ArrayList<>(size);
3634
items = new ArrayList<>(size);
3735

3836
for (int i = 0; i < size; i++) {
@@ -48,7 +46,7 @@ public class MultiGetShardRequest extends SingleShardRequest<MultiGetShardReques
4846
MultiGetShardRequest(MultiGetRequest multiGetRequest, String index, int shardId) {
4947
super(index);
5048
this.shardId = shardId;
51-
locations = new IntArrayList();
49+
locations = new ArrayList<>();
5250
items = new ArrayList<>();
5351
preference = multiGetRequest.preference;
5452
realtime = multiGetRequest.realtime;

server/src/main/java/org/elasticsearch/action/get/MultiGetShardResponse.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
package org.elasticsearch.action.get;
1010

11-
import com.carrotsearch.hppc.IntArrayList;
12-
1311
import org.elasticsearch.action.ActionResponse;
1412
import org.elasticsearch.common.io.stream.StreamInput;
1513
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -20,20 +18,20 @@
2018

2119
public class MultiGetShardResponse extends ActionResponse {
2220

23-
final IntArrayList locations;
21+
final List<Integer> locations;
2422
final List<GetResponse> responses;
2523
final List<MultiGetResponse.Failure> failures;
2624

2725
MultiGetShardResponse() {
28-
locations = new IntArrayList();
26+
locations = new ArrayList<>();
2927
responses = new ArrayList<>();
3028
failures = new ArrayList<>();
3129
}
3230

3331
MultiGetShardResponse(StreamInput in) throws IOException {
3432
super(in);
3533
int size = in.readVInt();
36-
locations = new IntArrayList(size);
34+
locations = new ArrayList<>(size);
3735
responses = new ArrayList<>(size);
3836
failures = new ArrayList<>(size);
3937
for (int i = 0; i < size; i++) {

server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsShardRequest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
package org.elasticsearch.action.termvectors;
1010

11-
import com.carrotsearch.hppc.IntArrayList;
12-
1311
import org.elasticsearch.action.ActionRequestValidationException;
1412
import org.elasticsearch.action.support.single.shard.SingleShardRequest;
1513
import org.elasticsearch.common.io.stream.StreamInput;
@@ -24,13 +22,13 @@ public class MultiTermVectorsShardRequest extends SingleShardRequest<MultiTermVe
2422
private int shardId;
2523
private String preference;
2624

27-
IntArrayList locations;
25+
List<Integer> locations;
2826
List<TermVectorsRequest> requests;
2927

3028
MultiTermVectorsShardRequest(StreamInput in) throws IOException {
3129
super(in);
3230
int size = in.readVInt();
33-
locations = new IntArrayList(size);
31+
locations = new ArrayList<>(size);
3432
requests = new ArrayList<>(size);
3533
for (int i = 0; i < size; i++) {
3634
locations.add(in.readVInt());
@@ -43,7 +41,7 @@ public class MultiTermVectorsShardRequest extends SingleShardRequest<MultiTermVe
4341
MultiTermVectorsShardRequest(String index, int shardId) {
4442
super(index);
4543
this.shardId = shardId;
46-
locations = new IntArrayList();
44+
locations = new ArrayList<>();
4745
requests = new ArrayList<>();
4846
}
4947

server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsShardResponse.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
package org.elasticsearch.action.termvectors;
1010

11-
import com.carrotsearch.hppc.IntArrayList;
12-
1311
import org.elasticsearch.action.ActionResponse;
1412
import org.elasticsearch.common.io.stream.StreamInput;
1513
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -20,20 +18,20 @@
2018

2119
public class MultiTermVectorsShardResponse extends ActionResponse {
2220

23-
final IntArrayList locations;
21+
final List<Integer> locations;
2422
final List<TermVectorsResponse> responses;
2523
final List<MultiTermVectorsResponse.Failure> failures;
2624

2725
MultiTermVectorsShardResponse() {
28-
locations = new IntArrayList();
26+
locations = new ArrayList<>();
2927
responses = new ArrayList<>();
3028
failures = new ArrayList<>();
3129
}
3230

3331
MultiTermVectorsShardResponse(StreamInput in) throws IOException {
3432
super(in);
3533
int size = in.readVInt();
36-
locations = new IntArrayList(size);
34+
locations = new ArrayList<>(size);
3735
responses = new ArrayList<>(size);
3836
failures = new ArrayList<>(size);
3937
for (int i = 0; i < size; i++) {

0 commit comments

Comments
 (0)