3232import org .elasticsearch .cluster .service .MasterServiceTaskQueue ;
3333import org .elasticsearch .common .Priority ;
3434import org .elasticsearch .common .Strings ;
35- import org .elasticsearch .common .collect .Iterators ;
3635import org .elasticsearch .features .NodeFeature ;
3736import org .elasticsearch .injection .guice .Inject ;
3837import org .elasticsearch .tasks .CancellableTask ;
@@ -186,7 +185,7 @@ record LazyRolloverExecutor(
186185 @ Override
187186 public ClusterState execute (BatchExecutionContext <LazyRolloverTask > batchExecutionContext ) {
188187 final var listener = new AllocationActionMultiListener <RolloverResponse >(threadPool .getThreadContext ());
189- final var results = new ArrayList <MetadataRolloverService . RolloverResult >(batchExecutionContext .taskContexts ().size ());
188+ final var results = new ArrayList <String >(batchExecutionContext .taskContexts ().size ());
190189 var state = batchExecutionContext .initialState ();
191190 Map <RolloverRequest , List <TaskContext <LazyRolloverTask >>> groupedRequests = new HashMap <>();
192191 for (final var taskContext : batchExecutionContext .taskContexts ()) {
@@ -206,14 +205,7 @@ public ClusterState execute(BatchExecutionContext<LazyRolloverTask> batchExecuti
206205
207206 if (state != batchExecutionContext .initialState ()) {
208207 var reason = new StringBuilder ();
209- Strings .collectionToDelimitedStringWithLimit (
210- (Iterable <String >) () -> Iterators .map (results .iterator (), t -> t .sourceIndexName () + "->" + t .rolloverIndexName ()),
211- "," ,
212- "lazy bulk rollover [" ,
213- "]" ,
214- 1024 ,
215- reason
216- );
208+ Strings .collectionToDelimitedStringWithLimit (results , "," , "lazy bulk rollover [" , "]" , 1024 , reason );
217209 try (var ignored = batchExecutionContext .dropHeadersContext ()) {
218210 state = allocationService .reroute (state , reason .toString (), listener .reroute ());
219211 }
@@ -226,7 +218,7 @@ public ClusterState execute(BatchExecutionContext<LazyRolloverTask> batchExecuti
226218 public ClusterState executeTask (
227219 ClusterState currentState ,
228220 RolloverRequest rolloverRequest ,
229- List < MetadataRolloverService . RolloverResult > results ,
221+ ArrayList < String > results ,
230222 List <TaskContext <LazyRolloverTask >> rolloverTaskContexts ,
231223 AllocationActionMultiListener <RolloverResponse > allocationActionMultiListener
232224 ) throws Exception {
@@ -263,7 +255,7 @@ public ClusterState executeTask(
263255 null ,
264256 isFailureStoreRollover
265257 );
266- results .add (rolloverResult );
258+ results .add (rolloverResult . sourceIndexName () + "->" + rolloverResult . rolloverIndexName () );
267259 logger .trace ("lazy rollover result [{}]" , rolloverResult );
268260
269261 final var rolloverIndexName = rolloverResult .rolloverIndexName ();
0 commit comments