File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
server/src/main/java/org/elasticsearch/action/admin/indices/rollover Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 3434import org .elasticsearch .cluster .routing .allocation .AllocationService ;
3535import org .elasticsearch .cluster .service .ClusterService ;
3636import org .elasticsearch .common .Priority ;
37+ import org .elasticsearch .common .Strings ;
3738import org .elasticsearch .common .inject .Inject ;
3839import org .elasticsearch .common .unit .ByteSizeValue ;
3940import org .elasticsearch .core .Nullable ;
@@ -101,10 +102,17 @@ public TransportRolloverAction(
101102 builder .failure (task , e );
102103 }
103104 }
104- String reason = "bulk rollover ["
105- + tasks .stream ().map (t -> t .sourceIndex .get () + "->" + t .rolloverIndex .get ()).collect (Collectors .joining ())
106- + "]" ;
107- state = allocationService .reroute (state , reason );
105+
106+ var reason = new StringBuilder ();
107+ Strings .collectionToDelimitedStringWithLimit (
108+ (Iterable <String >) () -> tasks .stream ().map (t -> t .sourceIndex .get () + "->" + t .rolloverIndex .get ()).iterator (),
109+ "," ,
110+ "bulk rollover [" ,
111+ "]" ,
112+ 1024 ,
113+ reason
114+ );
115+ state = allocationService .reroute (state , reason .toString ());
108116 return builder .build (state );
109117 };
110118 }
You can’t perform that action at this time.
0 commit comments