@aloxc
2017-12-05T06:35:46.000000Z
字数 1285
阅读 585
ignite
如题,今天测试ignite的时候,看到一行日志,[16:25:12] New version is available at ignite.apache.org: 1.8.0
意思就是ignite已经发布新版本了,提醒我们升级,
为什么会有这个提示,经过查找代码发现提示是出自
org.apache.ignite.internal.processors.cluster.GridUpdateNotifier类,
里面有相关代码在方法
void reportStatus(IgniteLogger log) {assert log != null;log = log.getLogger(getClass());String latestVer = this.latestVer;String downloadUrl = this.downloadUrl;downloadUrl = downloadUrl != null ? downloadUrl : IgniteKernal.SITE;if (latestVer != null)if (latestVer.equals(ver)) {if (!reportOnlyNew)throttle(log, false, "Your version is up to date.");}elsethrottle(log, true, "New version is available at " + downloadUrl + ": " + latestVer);elseif (!reportOnlyNew)throttle(log, false, "Update status is not available.");}
经过分析代码,ignite通过org.apache.ignite.internal.processors.cluster.ClusterProcessor类来判断是否读取在线版本文件,
public ClusterProcessor(GridKernalContext ctx) {super(ctx);notifyEnabled.set(IgniteSystemProperties.getBoolean(IGNITE_UPDATE_NOTIFIER,Boolean.parseBoolean(IgniteProperties.get("ignite.update.notifier.enabled.by.default"))));cluster = new IgniteClusterImpl(ctx);}
读取ignite.properties文件的ignite.update.notifier.enabled.by.default属性配置,ignite.properties文件在ignite-core.xxx.jar中,xxx是版本号,
为了不让ignite启动的时候做版本检查,我们可以修改该资源文件中ignite.update.notifier.enabled.by.default的值为false,也可以在ignite启动脚本上启动参数-DIGNITE_UPDATE_NOTIFIER=false.

