Skip to content

Commit 17a1647

Browse files
committed
[Test] Remove duplicate method in TestShardRouting (#32815)
1 parent 32eaaa2 commit 17a1647

File tree

11 files changed

+18
-21
lines changed

11 files changed

+18
-21
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class BuildPlugin implements Plugin<Project> {
6666
void apply(Project project) {
6767
if (project.pluginManager.hasPlugin('elasticsearch.standalone-rest-test')) {
6868
throw new InvalidUserDataException('elasticsearch.standalone-test, '
69-
+ 'elasticsearch.standalone-rest-test, and elasticsearch.build '
69+
+ 'elasticearch.standalone-rest-test, and elasticsearch.build '
7070
+ 'are mutually exclusive')
7171
}
7272
final String minimumGradleVersion

buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class PrecommitTasks {
6363
* (which provides NamingConventionsCheck) and :test:logger-usage
6464
* which provides the logger usage check. Since the build tools
6565
* don't use the logger usage check because they don't have any
66-
* of Elasticsearch's loggers and :test:logger-usage actually does
66+
* of Elaticsearch's loggers and :test:logger-usage actually does
6767
* use the NamingConventionsCheck we break the circular dependency
6868
* here.
6969
*/

docs/reference/setup/setup-xclient.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ level Java REST Client] with JSON request and response bodies.
3232

3333
. Add the {xpack} transport JAR file to your *CLASSPATH*. You can download the {xpack}
3434
distribution and extract the JAR file manually or you can get it from the
35-
https://artifacts.elastic.co/maven/org/elasticsearch/client/x-pack-transport/{version}/x-pack-transport-{version}.jar[Elasticsearch Maven repository].
35+
https://artifacts.elastic.co/maven/org/elasticsearch/client/x-pack-transport/{version}/x-pack-transport-{version}.jar[Elasticsearc Maven repository].
3636
As with any dependency, you will also need its transitive dependencies. Refer to the
3737
https://artifacts.elastic.co/maven/org/elasticsearch/client/x-pack-transport/{version}/x-pack-transport-{version}.pom[X-Pack POM file
3838
for your version] when downloading for offline usage.

docs/reference/upgrade/set-paths-tip.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
================================================
33
44
When you extract the zip or tarball packages, the `elasticsearch-n.n.n`
5-
directory contains the Elasticsearch `config`, `data`, `logs` and
5+
directory contains the Elasticsearh `config`, `data`, `logs` and
66
`plugins` directories.
77
88
We recommend moving these directories out of the Elasticsearch directory

modules/reindex/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ thirdPartyAudit.excludes = [
7171
'org.apache.log.Logger',
7272
]
7373

74-
// Support for testing reindex-from-remote against old Elasticsearch versions
74+
// Support for testing reindex-from-remote against old Elaticsearch versions
7575
configurations {
7676
oldesFixture
7777
es2

server/src/test/java/org/elasticsearch/cluster/routing/allocation/ResizeAllocationDeciderTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ public void testShrink() { // we don't handle shrink yet
136136

137137
ResizeAllocationDecider resizeAllocationDecider = new ResizeAllocationDecider(Settings.EMPTY);
138138
RoutingAllocation routingAllocation = new RoutingAllocation(null, null, clusterState, null, 0);
139-
ShardRouting shardRouting = TestShardRouting.newShardRouting(new ShardId(idx, 0), null, true, RecoverySource
140-
.LocalShardsRecoverySource.INSTANCE, ShardRoutingState.UNASSIGNED);
139+
ShardRouting shardRouting = TestShardRouting.newShardRouting(new ShardId(idx, 0), null, true, ShardRoutingState.UNASSIGNED,
140+
RecoverySource.LocalShardsRecoverySource.INSTANCE);
141141
assertEquals(Decision.ALWAYS, resizeAllocationDecider.canAllocate(shardRouting, routingAllocation));
142142
assertEquals(Decision.ALWAYS, resizeAllocationDecider.canAllocate(shardRouting, clusterState.getRoutingNodes().node("node1"),
143143
routingAllocation));
@@ -166,8 +166,8 @@ public void testSourceNotActive() {
166166
RoutingAllocation routingAllocation = new RoutingAllocation(null, clusterState.getRoutingNodes(), clusterState, null, 0);
167167
int shardId = randomIntBetween(0, 3);
168168
int sourceShardId = IndexMetaData.selectSplitShard(shardId, clusterState.metaData().index("source"), 4).id();
169-
ShardRouting shardRouting = TestShardRouting.newShardRouting(new ShardId(idx, shardId), null, true, RecoverySource
170-
.LocalShardsRecoverySource.INSTANCE, ShardRoutingState.UNASSIGNED);
169+
ShardRouting shardRouting = TestShardRouting.newShardRouting(new ShardId(idx, shardId), null, true, ShardRoutingState.UNASSIGNED,
170+
RecoverySource.LocalShardsRecoverySource.INSTANCE);
171171
assertEquals(Decision.NO, resizeAllocationDecider.canAllocate(shardRouting, routingAllocation));
172172
assertEquals(Decision.NO, resizeAllocationDecider.canAllocate(shardRouting, clusterState.getRoutingNodes().node("node1"),
173173
routingAllocation));
@@ -206,8 +206,8 @@ public void testSourcePrimaryActive() {
206206
RoutingAllocation routingAllocation = new RoutingAllocation(null, clusterState.getRoutingNodes(), clusterState, null, 0);
207207
int shardId = randomIntBetween(0, 3);
208208
int sourceShardId = IndexMetaData.selectSplitShard(shardId, clusterState.metaData().index("source"), 4).id();
209-
ShardRouting shardRouting = TestShardRouting.newShardRouting(new ShardId(idx, shardId), null, true, RecoverySource
210-
.LocalShardsRecoverySource.INSTANCE, ShardRoutingState.UNASSIGNED);
209+
ShardRouting shardRouting = TestShardRouting.newShardRouting(new ShardId(idx, shardId), null, true, ShardRoutingState.UNASSIGNED,
210+
RecoverySource.LocalShardsRecoverySource.INSTANCE);
211211
assertEquals(Decision.YES, resizeAllocationDecider.canAllocate(shardRouting, routingAllocation));
212212

213213
String allowedNode = clusterState.getRoutingTable().index("source").shard(sourceShardId).primaryShard().currentNodeId();
@@ -267,8 +267,8 @@ public void testAllocateOnOldNode() {
267267
RoutingAllocation routingAllocation = new RoutingAllocation(null, clusterState.getRoutingNodes(), clusterState, null, 0);
268268
int shardId = randomIntBetween(0, 3);
269269
int sourceShardId = IndexMetaData.selectSplitShard(shardId, clusterState.metaData().index("source"), 4).id();
270-
ShardRouting shardRouting = TestShardRouting.newShardRouting(new ShardId(idx, shardId), null, true, RecoverySource
271-
.LocalShardsRecoverySource.INSTANCE, ShardRoutingState.UNASSIGNED);
270+
ShardRouting shardRouting = TestShardRouting.newShardRouting(new ShardId(idx, shardId), null, true, ShardRoutingState.UNASSIGNED,
271+
RecoverySource.LocalShardsRecoverySource.INSTANCE);
272272
assertEquals(Decision.YES, resizeAllocationDecider.canAllocate(shardRouting, routingAllocation));
273273

274274
assertEquals(Decision.NO, resizeAllocationDecider.canAllocate(shardRouting, clusterState.getRoutingNodes().node("node1"),

server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,8 @@ public void testShardStats() throws IOException {
11991199
public void testShardStatsWithFailures() throws IOException {
12001200
allowShardFailures();
12011201
final ShardId shardId = new ShardId("index", "_na_", 0);
1202-
final ShardRouting shardRouting = newShardRouting(shardId, "node", true, RecoverySource.EmptyStoreRecoverySource.INSTANCE, ShardRoutingState.INITIALIZING);
1202+
final ShardRouting shardRouting =
1203+
newShardRouting(shardId, "node", true, ShardRoutingState.INITIALIZING, RecoverySource.EmptyStoreRecoverySource.INSTANCE);
12031204
final NodeEnvironment.NodePath nodePath = new NodeEnvironment.NodePath(createTempDir());
12041205

12051206

test/framework/src/main/java/org/elasticsearch/cluster/routing/TestShardRouting.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ public static ShardRouting newShardRouting(String index, int shardId, String cur
3939
return newShardRouting(new ShardId(index, IndexMetaData.INDEX_UUID_NA_VALUE, shardId), currentNodeId, primary, state);
4040
}
4141

42-
public static ShardRouting newShardRouting(ShardId shardId, String currentNodeId, boolean primary, RecoverySource recoverySource, ShardRoutingState state) {
43-
return new ShardRouting(shardId, currentNodeId, null, primary, state, recoverySource, buildUnassignedInfo(state), buildAllocationId(state), -1);
44-
}
45-
4642
public static ShardRouting newShardRouting(ShardId shardId, String currentNodeId, boolean primary, ShardRoutingState state) {
4743
return new ShardRouting(shardId, currentNodeId, null, primary, state, buildRecoveryTarget(primary, state), buildUnassignedInfo(state), buildAllocationId(state), -1);
4844
}

test/framework/src/main/java/org/elasticsearch/index/shard/IndexShardTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ protected void recoverShardFromSnapshot(final IndexShard shard,
723723
final IndexId indexId = new IndexId(shardId.getIndex().getName(), shardId.getIndex().getUUID());
724724
final DiscoveryNode node = getFakeDiscoNode(shard.routingEntry().currentNodeId());
725725
final RecoverySource.SnapshotRecoverySource recoverySource = new RecoverySource.SnapshotRecoverySource(snapshot, version, index);
726-
final ShardRouting shardRouting = newShardRouting(shardId, node.getId(), true, recoverySource, ShardRoutingState.INITIALIZING);
726+
final ShardRouting shardRouting = newShardRouting(shardId, node.getId(), true, ShardRoutingState.INITIALIZING, recoverySource);
727727

728728
shard.markAsRecovering("from snapshot", new RecoveryState(shardRouting, node, null));
729729
repository.restoreShard(shard, snapshot.getSnapshotId(), version, indexId, shard.shardId(), shard.recoveryState());

x-pack/docs/en/watcher/customizing-watches.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ initial payload.
4949
A <<input-search, search>> input contains a `request` object that specifies the
5050
indices you want to search, the {ref}/search-request-search-type.html[search type],
5151
and the search request body. The `body` field of a search input is the same as
52-
the body of an Elasticsearch `_search` request, making the full Elasticsearch
52+
the body of an Elasticsearch `_search` request, making the full Elaticsearch
5353
Query DSL available for you to use.
5454

5555
For example, the following `search` input loads the latest VIX quote:

0 commit comments

Comments
 (0)