You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/org/elasticsearch/cluster/routing/RoutingNode.java
+2-15Lines changed: 2 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -84,27 +84,14 @@ public List<MutableShardRouting> shards() {
84
84
* Add a new shard to this node
85
85
* @param shard Shard to crate on this Node
86
86
*/
87
-
publicvoidadd(MutableShardRoutingshard) {
87
+
voidadd(MutableShardRoutingshard) {
88
+
// TODO use Set with ShardIds for faster lookup.
88
89
for (MutableShardRoutingshardRouting : shards) {
89
90
if (shardRouting.shardId().equals(shard.shardId())) {
90
91
thrownewElasticSearchIllegalStateException("Trying to add a shard [" + shard.shardId().index().name() + "][" + shard.shardId().id() + "] to a node [" + nodeId + "] where it already exists");
91
92
}
92
93
}
93
94
shards.add(shard);
94
-
shard.assignToNode(node.id());
95
-
}
96
-
97
-
/**
98
-
* Remove a shard from this node
99
-
* @param shardId id of the shard to remove
100
-
*/
101
-
publicvoidremoveByShardId(intshardId) {
102
-
for (Iterator<MutableShardRouting> it = shards.iterator(); it.hasNext(); ) {
0 commit comments