21
21
22
22
import org .apache .logging .log4j .Logger ;
23
23
import org .apache .logging .log4j .message .ParameterizedMessage ;
24
- import org .apache .logging .log4j .util .Supplier ;
25
24
import org .elasticsearch .cluster .ClusterChangedEvent ;
26
25
import org .elasticsearch .cluster .ClusterState ;
27
26
import org .elasticsearch .cluster .ClusterStateApplier ;
61
60
import java .util .concurrent .atomic .AtomicReference ;
62
61
import java .util .function .Consumer ;
63
62
import java .util .function .Function ;
63
+ import java .util .function .Supplier ;
64
64
import java .util .stream .Stream ;
65
65
66
66
import static org .elasticsearch .cluster .service .ClusterService .CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING ;
@@ -401,8 +401,7 @@ protected void runTask(UpdateTask task) {
401
401
} catch (Exception e ) {
402
402
TimeValue executionTime = TimeValue .timeValueMillis (Math .max (0 , TimeValue .nsecToMSec (currentTimeInNanos () - startTimeNS )));
403
403
if (logger .isTraceEnabled ()) {
404
- logger .trace (
405
- (Supplier <?>) () -> new ParameterizedMessage (
404
+ logger .trace (new ParameterizedMessage (
406
405
"failed to execute cluster state applier in [{}], state:\n version [{}], source [{}]\n {}{}{}" ,
407
406
executionTime ,
408
407
previousClusterState .version (),
@@ -441,7 +440,7 @@ protected void runTask(UpdateTask task) {
441
440
final String stateUUID = newClusterState .stateUUID ();
442
441
final String fullState = newClusterState .toString ();
443
442
logger .warn (
444
- (Supplier <?>) () -> new ParameterizedMessage (
443
+ (org . apache . logging . log4j . util . Supplier <?>) () -> new ParameterizedMessage (
445
444
"failed to apply updated cluster state in [{}]:\n version [{}], uuid [{}], source [{}]\n {}" ,
446
445
executionTime ,
447
446
version ,
@@ -528,8 +527,7 @@ public void onFailure(String source, Exception e) {
528
527
listener .onFailure (source , e );
529
528
} catch (Exception inner ) {
530
529
inner .addSuppressed (e );
531
- logger .error (
532
- (Supplier <?>) () -> new ParameterizedMessage (
530
+ logger .error (new ParameterizedMessage (
533
531
"exception thrown by listener notifying of failure from [{}]" , source ), inner );
534
532
}
535
533
}
@@ -539,12 +537,10 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS
539
537
try {
540
538
listener .clusterStateProcessed (source , oldState , newState );
541
539
} catch (Exception e ) {
542
- logger .error (
543
- (Supplier <?>) () -> new ParameterizedMessage (
540
+ logger .error (new ParameterizedMessage (
544
541
"exception thrown by listener while notifying of cluster state processed from [{}], old cluster state:\n " +
545
542
"{}\n new cluster state:\n {}" ,
546
- source , oldState , newState ),
547
- e );
543
+ source , oldState , newState ), e );
548
544
}
549
545
}
550
546
}
0 commit comments