use of com.alibaba.nacos.naming.core.v2.upgrade.doublewrite.execute.AsyncServicesCheckTask in project nacos by alibaba.
the class UpgradeJudgement method checkForUpgrade.
private boolean checkForUpgrade() {
if (!useGrpcFeatures.get()) {
boolean selfCheckResult = selfUpgradeChecker.isReadyToUpgrade(serviceManager, doubleWriteDelayTaskEngine);
Member self = memberManager.getSelf();
self.setExtendVal(MemberMetaDataConstants.READY_TO_UPGRADE, selfCheckResult);
memberManager.updateMember(self);
if (!selfCheckResult) {
NamingExecuteTaskDispatcher.getInstance().dispatchAndExecuteTask(AsyncServicesCheckTask.class, new AsyncServicesCheckTask(doubleWriteDelayTaskEngine, this));
}
}
boolean result = true;
for (Member each : memberManager.allMembers()) {
Object isReadyToUpgrade = each.getExtendVal(MemberMetaDataConstants.READY_TO_UPGRADE);
result &= null != isReadyToUpgrade && (boolean) isReadyToUpgrade;
}
return result;
}
Aggregations