1919
2020import java .io .Serializable ;
2121import java .util .Collection ;
22- import java .util .HashMap ;
2322import java .util .Map ;
2423import java .util .Set ;
2524import java .util .Timer ;
7675import org .apache .ignite .lang .IgniteUuid ;
7776import org .apache .ignite .metric .MetricRegistry ;
7877import org .apache .ignite .mxbean .IgniteClusterMXBean ;
78+ import org .apache .ignite .plugin .extensions .communication .Message ;
7979import org .apache .ignite .spi .discovery .DiscoveryDataBag ;
8080import org .apache .ignite .spi .discovery .DiscoveryDataBag .GridDiscoveryData ;
8181import org .apache .ignite .spi .discovery .DiscoveryMetricsProvider ;
@@ -465,33 +465,22 @@ public IgniteFuture<?> clientReconnectFuture() {
465465
466466 /** {@inheritDoc} */
467467 @ Override public void collectJoiningNodeData (DiscoveryDataBag dataBag ) {
468- dataBag .addJoiningNodeData (CLUSTER_PROC .ordinal (), getDiscoveryData ( ));
468+ dataBag .addJoiningNodeData (CLUSTER_PROC .ordinal (), new ClusterFlags ( notifyEnabled . get () ));
469469 }
470470
471471 /** {@inheritDoc} */
472472 @ Override public void collectGridNodeData (DiscoveryDataBag dataBag ) {
473- dataBag .addNodeSpecificData (CLUSTER_PROC .ordinal (), getDiscoveryData ( ));
473+ dataBag .addNodeSpecificData (CLUSTER_PROC .ordinal (), new ClusterFlags ( notifyEnabled . get () ));
474474
475- dataBag .addGridCommonData (CLUSTER_PROC .ordinal (), new ClusterIdAndTag (cluster .id (), cluster .tag ()));
476- }
477-
478- /**
479- * @return Discovery data.
480- */
481- private Serializable getDiscoveryData () {
482- HashMap <String , Object > map = new HashMap <>(2 );
483-
484- map .put (ATTR_UPDATE_NOTIFIER_STATUS , notifyEnabled .get ());
485-
486- return map ;
475+ dataBag .addGridCommonData (CLUSTER_PROC .ordinal (), (Message )new ClusterIdAndTag (cluster .id (), cluster .tag ()));
487476 }
488477
489478 /** {@inheritDoc} */
490479 @ Override public void onGridDataReceived (GridDiscoveryData data ) {
491- Map <UUID , Map < String , Boolean > > nodeSpecData = data .nodeSpecificData ();
480+ Map <UUID , ClusterFlags > nodeSpecData = data .nodeSpecificData ();
492481
493482 if (nodeSpecData != null ) {
494- Boolean lstFlag = findLastFlag (nodeSpecData .values ());
483+ Boolean lstFlag = findLastUpdateNotifierFlag (nodeSpecData .values ());
495484
496485 if (lstFlag != null )
497486 notifyEnabled .set (lstFlag );
@@ -500,7 +489,7 @@ private Serializable getDiscoveryData() {
500489 ClusterIdAndTag commonData = data .commonData ();
501490
502491 if (commonData != null ) {
503- Serializable remoteClusterId = commonData .id ();
492+ UUID remoteClusterId = commonData .id ();
504493
505494 if (remoteClusterId != null ) {
506495 if (locClusterId != null && !locClusterId .equals (remoteClusterId )) {
@@ -510,7 +499,7 @@ private Serializable getDiscoveryData() {
510499 ", local cluster ID: " + locClusterId );
511500 }
512501
513- locClusterId = ( UUID ) remoteClusterId ;
502+ locClusterId = remoteClusterId ;
514503 }
515504
516505 String remoteClusterTag = commonData .tag ();
@@ -521,15 +510,15 @@ private Serializable getDiscoveryData() {
521510 }
522511
523512 /**
524- * @param vals collection to seek through.
513+ * @param flags Flags collection to seek through.
525514 */
526- private Boolean findLastFlag (Collection <Map <String , Boolean >> vals ) {
527- for (Map <String , Boolean > map : vals ) {
528- if (map != null && map .containsKey (ATTR_UPDATE_NOTIFIER_STATUS ))
529- return map .get (ATTR_UPDATE_NOTIFIER_STATUS );
530- }
515+ private Boolean findLastUpdateNotifierFlag (Collection <ClusterFlags > flags ) {
516+ Boolean notifierFlag = null ;
531517
532- return null ;
518+ for (ClusterFlags flag : flags )
519+ notifierFlag = flag .updateNotifierEnabled ;
520+
521+ return notifierFlag ;
533522 }
534523
535524 /** {@inheritDoc} */
0 commit comments