瀏覽代碼

Remove LegacyCTRAListener from open-indices batching (#83807)

Joe Gallo 3 年之前
父節點
當前提交
104e3540d1

+ 1 - 1
docs/changelog/83760.yaml

@@ -1,5 +1,5 @@
 pr: 83760
-summary: Batch open-indices
+summary: Batch open-indices cluster state updates
 area: Indices APIs
 type: enhancement
 issues: []

+ 16 - 1
server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexStateService.java

@@ -1078,7 +1078,17 @@ public class MetadataIndexStateService {
                 state = allocationService.reroute(state, "indices opened");
 
                 for (OpenIndicesTask task : tasks) {
-                    builder.success(task, new LegacyClusterTaskResultActionListener(task, currentState));
+                    builder.success(task, new ActionListener<>() {
+                        @Override
+                        public void onResponse(ClusterState clusterState) {
+                            // listener is notified at the end of acking
+                        }
+
+                        @Override
+                        public void onFailure(Exception e) {
+                            task.onFailure(e);
+                        }
+                    });
                 }
             } catch (Exception e) {
                 for (OpenIndicesTask task : tasks) {
@@ -1191,5 +1201,10 @@ public class MetadataIndexStateService {
         public TimeValue ackTimeout() {
             return request.ackTimeout();
         }
+
+        @Override
+        public void clusterStateProcessed(ClusterState oldState, ClusterState newState) {
+            assert false : "not called";
+        }
     }
 }