use of com.emc.storageos.coordinator.common.Configuration in project coprhd-controller by CoprHD.
the class MigrationHandlerImpl method setDbConfig.
/**
* Checks and registers db configuration information
*/
private void setDbConfig(String name) {
Configuration config = coordinator.queryConfiguration(coordinator.getSiteId(), coordinator.getVersionedDbConfigPath(service.getName(), service.getVersion()), service.getId());
if (config != null) {
if (config.getConfig(name) == null) {
config.setConfig(name, Boolean.TRUE.toString());
coordinator.persistServiceConfiguration(coordinator.getSiteId(), config);
}
} else {
throw new IllegalStateException("unexpected error, configuration is null");
}
}
use of com.emc.storageos.coordinator.common.Configuration in project coprhd-controller by CoprHD.
the class SchemaUtil method setMigrationStatus.
void setMigrationStatus(MigrationStatus status) {
Configuration config = _coordinator.queryConfiguration(_coordinator.getSiteId(), getDbConfigPath(), Constants.GLOBAL_ID);
_log.debug("setMigrationStatus: target version \"{}\" status {}", _coordinator.getTargetDbSchemaVersion(), status.name());
if (config == null) {
ConfigurationImpl cfg = new ConfigurationImpl();
cfg.setKind(getDbConfigPath());
cfg.setId(Constants.GLOBAL_ID);
config = cfg;
}
config.setConfig(Constants.MIGRATION_STATUS, status.name());
_coordinator.persistServiceConfiguration(_coordinator.getSiteId(), config);
}
use of com.emc.storageos.coordinator.common.Configuration in project coprhd-controller by CoprHD.
the class LocalToGeoMigrationDoneCleanup method processZKFlagCleanup.
private void processZKFlagCleanup() {
Configuration config = coordinatorClient.queryConfiguration(coordinatorClient.getSiteId(), DB_CONFIG, GLOBAL_ID);
if (config.getConfig(LOCAL_TO_GEO_DONE) != null) {
log.info("Flag {} found in ZooKeeper. Removing...", LOCAL_TO_GEO_DONE);
config.removeConfig(LOCAL_TO_GEO_DONE);
coordinatorClient.persistServiceConfiguration(coordinatorClient.getSiteId(), config);
log.info("Flag {} removed from ZooKeeper", LOCAL_TO_GEO_DONE);
} else {
log.info("Flag {} not found in ZooKeeper.", LOCAL_TO_GEO_DONE);
}
}
use of com.emc.storageos.coordinator.common.Configuration 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.common.Configuration 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);
}
Aggregations