use of com.emc.vipr.model.sys.ClusterInfo.ClusterState in project coprhd-controller by CoprHD.
the class ClusterInfo method loadRenderArgs.
/**
* loads render args
*/
private static void loadRenderArgs() {
boolean reconfigSupported = true;
boolean unsupportedPlatform = BourneUtil.getViprClient().vdcs().isGeoSetup();
if (unsupportedPlatform) {
reconfigSupported = false;
Logger.info(UNSUPPORTED_KEY + " isGeo: " + unsupportedPlatform);
flash.put("warning", MessagesUtils.get(UNSUPPORTED_KEY));
}
ClusterState clusterState = getClusterStateFromCoordinator();
if (clusterState == null || !clusterState.equals(ClusterState.STABLE)) {
reconfigSupported = false;
flash.put("warning", MessagesUtils.get(UNSTABLE_KEY));
}
renderArgs.put("reconfigSupported", reconfigSupported);
renderArgs.put("vip", vip);
}
use of com.emc.vipr.model.sys.ClusterInfo.ClusterState in project coprhd-controller by CoprHD.
the class SchedulerConfig method isClusterUpgrading.
private boolean isClusterUpgrading() {
try {
RepositoryInfo target = coordinator.getTargetInfo(RepositoryInfo.class);
SoftwareVersion targetVersion = target.getCurrentVersion();
SoftwareVersion currentVersion = new LocalRepository().getRepositoryInfo().getCurrentVersion();
log.info("The current version={} target version={}", currentVersion, targetVersion);
if (!currentVersion.equals(targetVersion)) {
log.info("The current version is NOT equals to target version");
return true;
}
} catch (Exception e) {
log.error("Failed to get versions e=", e);
// failed to read data from zk, so no need to do backup at this time
return true;
}
CoordinatorClient coordinatorClient = coordinator.getCoordinatorClient();
String currentDbSchemaVersion = coordinatorClient.getCurrentDbSchemaVersion();
String targetDbSchemaVersion = coordinatorClient.getTargetDbSchemaVersion();
log.info("Current db schema version: {}, target db schema version: {}.", currentDbSchemaVersion, targetDbSchemaVersion);
if (currentDbSchemaVersion == null || !currentDbSchemaVersion.equalsIgnoreCase(targetDbSchemaVersion)) {
log.warn("Current version is not equal to the target version");
return true;
}
ClusterState state = coordinatorClient.getControlNodesState();
log.info("Current control nodes' state: {}", state);
if (state == ClusterState.STABLE || state == ClusterState.SYNCING || state == ClusterState.DEGRADED) {
return false;
}
return true;
}
use of com.emc.vipr.model.sys.ClusterInfo.ClusterState in project coprhd-controller by CoprHD.
the class ClusterInfo method getClusterStateFromCoordinator.
private static ClusterState getClusterStateFromCoordinator() {
if (StorageOsPlugin.isEnabled()) {
CoordinatorClient coordinatorClient = StorageOsPlugin.getInstance().getCoordinatorClient();
ClusterState clusterState = coordinatorClient.getControlNodesState();
return clusterState;
}
return null;
}
Aggregations