use of com.sequenceiq.cloudbreak.cloud.scheduler.PollGroup in project cloudbreak by hortonworks.
the class ClusterDeletionBasedExitCriteria method isExitNeeded.
@Override
public boolean isExitNeeded(ExitCriteriaModel exitCriteriaModel) {
ClusterDeletionBasedExitCriteriaModel model = (ClusterDeletionBasedExitCriteriaModel) exitCriteriaModel;
LOGGER.debug("Check isExitNeeded for model: {}", model);
PollGroup stackPollGroup = InMemoryStateStore.getStack(model.getStackId());
if (stackPollGroup != null && CANCELLED.equals(stackPollGroup)) {
LOGGER.warn("Stack is getting terminated, polling is cancelled.");
return true;
}
if (model.getClusterId() != null) {
PollGroup clusterPollGroup = InMemoryStateStore.getCluster(model.getClusterId());
if (clusterPollGroup != null && CANCELLED.equals(clusterPollGroup)) {
LOGGER.warn("Cluster is getting terminated, polling is cancelled.");
return true;
}
}
return false;
}
use of com.sequenceiq.cloudbreak.cloud.scheduler.PollGroup in project cloudbreak by hortonworks.
the class StackDeletionBasedExitCriteria method isExitNeeded.
@Override
public boolean isExitNeeded(ExitCriteriaModel exitCriteriaModel) {
StackDeletionBasedExitCriteriaModel model = (StackDeletionBasedExitCriteriaModel) exitCriteriaModel;
LOGGER.debug("Check isExitNeeded for model: {}", model);
PollGroup pollGroup = InMemoryStateStore.getStack(model.getStackId());
if (pollGroup != null && CANCELLED.equals(pollGroup)) {
LOGGER.warn("Stack is getting terminated, polling is cancelled.");
return true;
}
return false;
}
Aggregations