Skip to content

Commit bf4c364

Browse files
authored
remove _primary and _replica shard preferences (#26791)
The shard preference _primary, _replica and its variants were useful for the asynchronous replication. However, with the current impl, they are no longer useful and should be removed. Closes #26335
1 parent 9db21cd commit bf4c364

File tree

33 files changed

+112
-303
lines changed

33 files changed

+112
-303
lines changed

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchRequestBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ public NoopSearchRequestBuilder setRouting(String... routing) {
142142

143143
/**
144144
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
145-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
146-
* a custom value, which guarantees that the same order will be used across different requests.
145+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
146+
* will be used across different requests.
147147
*/
148148
public NoopSearchRequestBuilder setPreference(String preference) {
149149
request.preference(preference);

core/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ public ClusterSearchShardsRequest routing(String... routings) {
146146

147147
/**
148148
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
149-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
150-
* a custom value, which guarantees that the same order will be used across different requests.
149+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
150+
* will be used across different requests.
151151
*/
152152
public ClusterSearchShardsRequest preference(String preference) {
153153
this.preference = preference;

core/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequestBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public ClusterSearchShardsRequestBuilder setRouting(String... routing) {
5555

5656
/**
5757
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
58-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
59-
* a custom value, which guarantees that the same order will be used across different requests.
58+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
59+
* will be used across different requests.
6060
*/
6161
public ClusterSearchShardsRequestBuilder setPreference(String preference) {
6262
request.preference(preference);

core/src/main/java/org/elasticsearch/action/get/GetRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ public GetRequest routing(String routing) {
152152

153153
/**
154154
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
155-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
156-
* a custom value, which guarantees that the same order will be used across different requests.
155+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
156+
* will be used across different requests.
157157
*/
158158
public GetRequest preference(String preference) {
159159
this.preference = preference;

core/src/main/java/org/elasticsearch/action/get/GetRequestBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public GetRequestBuilder setRouting(String routing) {
7676

7777
/**
7878
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
79-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
80-
* a custom value, which guarantees that the same order will be used across different requests.
79+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
80+
* will be used across different requests.
8181
*/
8282
public GetRequestBuilder setPreference(String preference) {
8383
request.preference(preference);

core/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ public ActionRequestValidationException validate() {
284284

285285
/**
286286
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
287-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
288-
* a custom value, which guarantees that the same order will be used across different requests.
287+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
288+
* will be used across different requests.
289289
*/
290290
public MultiGetRequest preference(String preference) {
291291
this.preference = preference;

core/src/main/java/org/elasticsearch/action/get/MultiGetRequestBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public MultiGetRequestBuilder add(MultiGetRequest.Item item) {
5858

5959
/**
6060
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
61-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
62-
* a custom value, which guarantees that the same order will be used across different requests.
61+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
62+
* will be used across different requests.
6363
*/
6464
public MultiGetRequestBuilder setPreference(String preference) {
6565
request.preference(preference);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public int shardId() {
6464

6565
/**
6666
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
67-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
68-
* a custom value, which guarantees that the same order will be used across different requests.
67+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
68+
* will be used across different requests.
6969
*/
7070
public MultiGetShardRequest preference(String preference) {
7171
this.preference = preference;

core/src/main/java/org/elasticsearch/action/search/SearchRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ public SearchRequest routing(String... routings) {
241241

242242
/**
243243
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
244-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
245-
* a custom value, which guarantees that the same order will be used across different requests.
244+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
245+
* will be used across different requests.
246246
*/
247247
public SearchRequest preference(String preference) {
248248
this.preference = preference;

core/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ public SearchRequestBuilder setRouting(String... routing) {
144144

145145
/**
146146
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
147-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
148-
* a custom value, which guarantees that the same order will be used across different requests.
147+
* <tt>_local</tt> to prefer local shards or a custom value, which guarantees that the same order
148+
* will be used across different requests.
149149
*/
150150
public SearchRequestBuilder setPreference(String preference) {
151151
request.preference(preference);

0 commit comments

Comments
 (0)