|
33 | 33 | import org.elasticsearch.cluster.ClusterStateObserver; |
34 | 34 | import org.elasticsearch.cluster.action.index.MappingUpdatedAction; |
35 | 35 | import org.elasticsearch.cluster.action.shard.ShardStateAction; |
36 | | -import org.elasticsearch.cluster.metadata.ProjectMetadata; |
37 | 36 | import org.elasticsearch.cluster.project.ProjectResolver; |
38 | 37 | import org.elasticsearch.cluster.service.ClusterService; |
39 | 38 | import org.elasticsearch.common.bytes.BytesReference; |
|
74 | 73 | import java.io.IOException; |
75 | 74 | import java.util.Map; |
76 | 75 | import java.util.concurrent.Executor; |
77 | | -import java.util.concurrent.TimeUnit; |
78 | | -import java.util.concurrent.locks.LockSupport; |
79 | 76 | import java.util.function.Consumer; |
80 | 77 | import java.util.function.LongSupplier; |
81 | 78 | import java.util.function.ObjLongConsumer; |
@@ -169,12 +166,7 @@ protected void shardOperationOnPrimary( |
169 | 166 |
|
170 | 167 | @Override |
171 | 168 | protected Map<ShardId, BulkShardRequest> splitRequestOnPrimary(BulkShardRequest request) { |
172 | | - // TODO Needed right now for not in primary mode on the target. Need to make sure we handle that with retries. |
173 | | -// LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(100)); |
174 | | - ClusterState clusterState = clusterService.state(); |
175 | | - ProjectMetadata project = projectResolver.getProjectMetadata(clusterState); |
176 | | - |
177 | | - return ShardBulkSplitHelper.splitRequests(request, project); |
| 169 | + return ShardBulkSplitHelper.splitRequests(request, projectResolver.getProjectMetadata(clusterService.state())); |
178 | 170 | } |
179 | 171 |
|
180 | 172 | @Override |
|
0 commit comments