2121
2222import org .apache .logging .log4j .Logger ;
2323import org .apache .logging .log4j .message .ParameterizedMessage ;
24- import org .apache .logging .log4j .util .Supplier ;
2524import org .elasticsearch .cluster .ClusterChangedEvent ;
2625import org .elasticsearch .cluster .ClusterState ;
2726import org .elasticsearch .cluster .ClusterStateApplier ;
6160import java .util .concurrent .atomic .AtomicReference ;
6261import java .util .function .Consumer ;
6362import java .util .function .Function ;
63+ import java .util .function .Supplier ;
6464import java .util .stream .Stream ;
6565
6666import static org .elasticsearch .cluster .service .ClusterService .CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING ;
@@ -401,8 +401,7 @@ protected void runTask(UpdateTask task) {
401401 } catch (Exception e ) {
402402 TimeValue executionTime = TimeValue .timeValueMillis (Math .max (0 , TimeValue .nsecToMSec (currentTimeInNanos () - startTimeNS )));
403403 if (logger .isTraceEnabled ()) {
404- logger .trace (
405- (Supplier <?>) () -> new ParameterizedMessage (
404+ logger .trace (new ParameterizedMessage (
406405 "failed to execute cluster state applier in [{}], state:\n version [{}], source [{}]\n {}{}{}" ,
407406 executionTime ,
408407 previousClusterState .version (),
@@ -441,7 +440,7 @@ protected void runTask(UpdateTask task) {
441440 final String stateUUID = newClusterState .stateUUID ();
442441 final String fullState = newClusterState .toString ();
443442 logger .warn (
444- (Supplier <?>) () -> new ParameterizedMessage (
443+ (org . apache . logging . log4j . util . Supplier <?>) () -> new ParameterizedMessage (
445444 "failed to apply updated cluster state in [{}]:\n version [{}], uuid [{}], source [{}]\n {}" ,
446445 executionTime ,
447446 version ,
@@ -528,8 +527,7 @@ public void onFailure(String source, Exception e) {
528527 listener .onFailure (source , e );
529528 } catch (Exception inner ) {
530529 inner .addSuppressed (e );
531- logger .error (
532- (Supplier <?>) () -> new ParameterizedMessage (
530+ logger .error (new ParameterizedMessage (
533531 "exception thrown by listener notifying of failure from [{}]" , source ), inner );
534532 }
535533 }
@@ -539,12 +537,10 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS
539537 try {
540538 listener .clusterStateProcessed (source , oldState , newState );
541539 } catch (Exception e ) {
542- logger .error (
543- (Supplier <?>) () -> new ParameterizedMessage (
540+ logger .error (new ParameterizedMessage (
544541 "exception thrown by listener while notifying of cluster state processed from [{}], old cluster state:\n " +
545542 "{}\n new cluster state:\n {}" ,
546- source , oldState , newState ),
547- e );
543+ source , oldState , newState ), e );
548544 }
549545 }
550546 }
0 commit comments