SLA scheduler should not run during upgrade
@@ -27,6 +27,7 @@ import com.thinkbiganalytics.cluster.ClusterService;
import com.thinkbiganalytics.cluster.ClusterServiceMessageReceiver;
import com.thinkbiganalytics.metadata.api.MetadataAccess;
import com.thinkbiganalytics.metadata.api.PostMetadataConfigAction;
+import com.thinkbiganalytics.metadata.api.app.KyloVersionProvider;
import com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement;
import com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreement;
import com.thinkbiganalytics.metadata.sla.spi.ServiceLevelAgreementChecker;
@@ -79,6 +80,9 @@ public class DefaultServiceLevelAgreementScheduler implements ServiceLevelAgreem
@Inject
private MetadataAccess metadataAccess;
+ @Inject
+ private KyloVersionProvider kyloVersionProvider;
+
@Inject
private ClusterService clusterService;
@@ -95,6 +99,7 @@ public class DefaultServiceLevelAgreementScheduler implements ServiceLevelAgreem
*/
@Override
public void run() {
+ if(kyloVersionProvider.isUpToDate()) {
log.info("PostMetadataConfigAction called for DefaultServiceLevelAgreementScheduler. About to schedule the SLA's ");
metadataAccess.read(() -> {
List<? extends ServiceLevelAgreement> agreements = slaProvider.getAgreements();
@@ -116,6 +121,7 @@ public class DefaultServiceLevelAgreementScheduler implements ServiceLevelAgreem
return null;
}, MetadataAccess.SERVICE);
+ }
}
