mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
Merge main into multi-project
This commit is contained in:
commit
38d74f7408
352 changed files with 4243 additions and 2565 deletions
|
@ -19,7 +19,6 @@ import org.elasticsearch.cluster.block.ClusterBlockException;
|
|||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||
import org.elasticsearch.cluster.routing.GroupShardsIterator;
|
||||
import org.elasticsearch.cluster.routing.ShardIterator;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
|
@ -37,6 +36,7 @@ import org.elasticsearch.xpack.core.downsample.DownsampleShardTask;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
|
||||
/**
|
||||
|
@ -83,18 +83,13 @@ public class TransportDownsampleIndexerAction extends TransportBroadcastAction<
|
|||
}
|
||||
|
||||
@Override
|
||||
protected GroupShardsIterator<ShardIterator> shards(
|
||||
ClusterState clusterState,
|
||||
DownsampleIndexerAction.Request request,
|
||||
String[] concreteIndices
|
||||
) {
|
||||
protected List<ShardIterator> shards(ClusterState clusterState, DownsampleIndexerAction.Request request, String[] concreteIndices) {
|
||||
if (concreteIndices.length > 1) {
|
||||
throw new IllegalArgumentException("multiple indices: " + Arrays.toString(concreteIndices));
|
||||
}
|
||||
|
||||
ProjectState project = projectResolver.getProjectState(clusterState);
|
||||
final GroupShardsIterator<ShardIterator> groups = clusterService.operationRouting()
|
||||
.searchShards(project, concreteIndices, null, null);
|
||||
final List<ShardIterator> groups = clusterService.operationRouting().searchShards(project, concreteIndices, null, null);
|
||||
for (ShardIterator group : groups) {
|
||||
// fails fast if any non-active groups
|
||||
if (group.size() == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue