use of org.apache.ignite.internal.processors.cluster.baseline.autoadjust.BaselineTopologyUpdater in project ignite by apache.
the class GridClusterStateProcessor method onKernalStart.
/**
* {@inheritDoc}
*/
@Override
public void onKernalStart(boolean active) throws IgniteCheckedException {
baselineTopologyUpdater = new BaselineTopologyUpdater(ctx);
ctx.event().addLocalEventListener(event -> {
DiscoveryEvent discoEvt = (DiscoveryEvent) event;
if (discoEvt.eventNode().isClient() || discoEvt.eventNode().isDaemon())
return;
baselineTopologyUpdater.triggerBaselineUpdate(discoEvt.topologyVersion());
}, EVT_NODE_FAILED, EVT_NODE_LEFT, EVT_NODE_JOINED);
distributedBaselineConfiguration.listenAutoAdjustEnabled((name, oldVal, newVal) -> {
if (newVal != null && newVal) {
long topVer = ctx.discovery().topologyVersion();
baselineTopologyUpdater.triggerBaselineUpdate(topVer);
}
});
}
Aggregations