3030import org .elasticsearch .cluster .service .MasterServiceTaskQueue ;
3131import org .elasticsearch .common .Priority ;
3232import org .elasticsearch .common .Strings ;
33- import org .elasticsearch .common .collect .Iterators ;
3433import org .elasticsearch .features .NodeFeature ;
3534import org .elasticsearch .injection .guice .Inject ;
3635import org .elasticsearch .tasks .CancellableTask ;
@@ -178,7 +177,7 @@ record LazyRolloverExecutor(
178177 @ Override
179178 public ClusterState execute (BatchExecutionContext <LazyRolloverTask > batchExecutionContext ) {
180179 final var listener = new AllocationActionMultiListener <RolloverResponse >(threadPool .getThreadContext ());
181- final var results = new ArrayList <MetadataRolloverService . RolloverResult >(batchExecutionContext .taskContexts ().size ());
180+ final var results = new ArrayList <String >(batchExecutionContext .taskContexts ().size ());
182181 var state = batchExecutionContext .initialState ();
183182 Map <RolloverRequest , List <TaskContext <LazyRolloverTask >>> groupedRequests = new HashMap <>();
184183 for (final var taskContext : batchExecutionContext .taskContexts ()) {
@@ -198,14 +197,7 @@ public ClusterState execute(BatchExecutionContext<LazyRolloverTask> batchExecuti
198197
199198 if (state != batchExecutionContext .initialState ()) {
200199 var reason = new StringBuilder ();
201- Strings .collectionToDelimitedStringWithLimit (
202- (Iterable <String >) () -> Iterators .map (results .iterator (), t -> t .sourceIndexName () + "->" + t .rolloverIndexName ()),
203- "," ,
204- "lazy bulk rollover [" ,
205- "]" ,
206- 1024 ,
207- reason
208- );
200+ Strings .collectionToDelimitedStringWithLimit (results , "," , "lazy bulk rollover [" , "]" , 1024 , reason );
209201 try (var ignored = batchExecutionContext .dropHeadersContext ()) {
210202 state = allocationService .reroute (state , reason .toString (), listener .reroute ());
211203 }
@@ -218,7 +210,7 @@ public ClusterState execute(BatchExecutionContext<LazyRolloverTask> batchExecuti
218210 public ClusterState executeTask (
219211 ClusterState currentState ,
220212 RolloverRequest rolloverRequest ,
221- List < MetadataRolloverService . RolloverResult > results ,
213+ ArrayList < String > results ,
222214 List <TaskContext <LazyRolloverTask >> rolloverTaskContexts ,
223215 AllocationActionMultiListener <RolloverResponse > allocationActionMultiListener
224216 ) throws Exception {
@@ -248,7 +240,7 @@ public ClusterState executeTask(
248240 null ,
249241 rolloverRequest .targetsFailureStore ()
250242 );
251- results .add (rolloverResult );
243+ results .add (rolloverResult . sourceIndexName () + "->" + rolloverResult . rolloverIndexName () );
252244 logger .trace ("lazy rollover result [{}]" , rolloverResult );
253245
254246 final var rolloverIndexName = rolloverResult .rolloverIndexName ();
0 commit comments