use of com.emc.storageos.coordinator.client.service.CoordinatorClient in project coprhd-controller by CoprHD.
the class VdcConfigUtilTest method setup.
@BeforeClass
public static void setup() {
CoordinatorClient coordinatorClient = new VdcCoordinatorClient();
vdcConfigUtil = new VdcConfigUtil(coordinatorClient);
}
use of com.emc.storageos.coordinator.client.service.CoordinatorClient in project coprhd-controller by CoprHD.
the class DrInternodeAuthenticator method validateConfiguration.
/**
* Called by Cassandra startup routine to initialize this instance
*/
@Override
public void validateConfiguration() throws ConfigurationException {
log.info("Initializing DrInternodeAuthenticator");
CoordinatorClient coordinatorClient = DbServiceImpl.instance.getCoordinator();
DrUtil drUtil = new DrUtil(coordinatorClient);
Site localSite = drUtil.getLocalSite();
isStandbyDegraded = localSite.getState().equals(SiteState.STANDBY_DEGRADED) || localSite.getState().equals(SiteState.STANDBY_DEGRADING);
isStandbyPaused = localSite.getState().equals(SiteState.STANDBY_PAUSING) || localSite.getState().equals(SiteState.STANDBY_PAUSED);
isActiveDegraded = localSite.getState().equals(SiteState.ACTIVE_DEGRADED);
Collection<String> nodeAddrList = localSite.getHostIPv4AddressMap().values();
if (!localSite.isUsingIpv4()) {
nodeAddrList = localSite.getHostIPv6AddressMap().values();
}
for (String nodeAddr : nodeAddrList) {
try {
localAddresses.add(InetAddress.getByName(nodeAddr));
} catch (UnknownHostException e) {
log.error("Invalid IP address {}", nodeAddr);
}
}
}
use of com.emc.storageos.coordinator.client.service.CoordinatorClient in project coprhd-controller by CoprHD.
the class DbMigrationCheckpointTest method resetMigrationStatus.
/**
* reset migration status
*
* @param version
*/
private void resetMigrationStatus(String version) {
CoordinatorClient coordinator = getCoordinator();
Configuration config = coordinator.queryConfiguration(coordinator.getSiteId(), coordinator.getVersionedDbConfigPath(Constants.DBSVC_NAME, version), Constants.GLOBAL_ID);
Assert.assertNotNull(config);
log.info("setMigrationStatus: target version \"{}\" status {}", version, MigrationStatus.RUNNING);
config.setConfig(Constants.MIGRATION_STATUS, MigrationStatus.RUNNING.name());
coordinator.persistServiceConfiguration(coordinator.getSiteId(), config);
}
use of com.emc.storageos.coordinator.client.service.CoordinatorClient in project coprhd-controller by CoprHD.
the class DbMigrationCheckpointTest method getCheckpoint.
private String getCheckpoint(String version) {
CoordinatorClient coordinator = getCoordinator();
Configuration config = coordinator.queryConfiguration(coordinator.getSiteId(), coordinator.getVersionedDbConfigPath(Constants.DBSVC_NAME, version), Constants.GLOBAL_ID);
Assert.assertNotNull(config);
return config.getConfig(DbConfigConstants.MIGRATION_CHECKPOINT);
}
use of com.emc.storageos.coordinator.client.service.CoordinatorClient in project coprhd-controller by CoprHD.
the class SetupUtils method isSetupComplete.
public static boolean isSetupComplete() {
if (StorageOsPlugin.isEnabled()) {
CoordinatorClient coordinatorClient = StorageOsPlugin.getInstance().getCoordinatorClient();
Configuration setupConfig = coordinatorClient.queryConfiguration(CONFIG_KIND, CONFIG_ID);
complete = (setupConfig != null) && StringUtils.equals(setupConfig.getConfig(COMPLETE), Boolean.TRUE.toString());
} else // In Dev mode we don't have coordinator so assume always setup
if (Play.mode.isDev()) {
complete = true;
} else {
complete = false;
}
return complete;
}
Aggregations