use of com.emc.storageos.geo.vdccontroller.impl.InternalDbClient in project coprhd-controller by CoprHD.
the class DBClient method resetGeoBlacklist.
/**
* Remove geo blacklist for geo
*
* @param vdcShortId
*/
public void resetGeoBlacklist(String vdcShortId) {
InternalDbClient geoDbClient = (InternalDbClient) ctx.getBean("geodbclient");
List<URI> vdcList = geoDbClient.queryByType(VirtualDataCenter.class, true);
for (URI vdcId : vdcList) {
VirtualDataCenter vdc = geoDbClient.queryObject(VirtualDataCenter.class, vdcId);
if (vdc.getShortId().equals(vdcShortId)) {
System.out.println("Remove black list for vdc: " + vdcShortId);
geoDbClient.removeVdcNodesFromBlacklist(vdc);
break;
}
}
}
use of com.emc.storageos.geo.vdccontroller.impl.InternalDbClient in project coprhd-controller by CoprHD.
the class DBClient method recoverVdcConfigFromRecoverFile.
/**
* Recover the system after add/remove vdc failures from recover file
*
* @param recoverFileName
*/
public void recoverVdcConfigFromRecoverFile(String recoverFileName) {
List<VdcConfig> newVdcConfigList = loadRecoverFileToRecoverInfo(recoverFileName);
InternalDbClient geoDbClient = (InternalDbClient) ctx.getBean("geodbclient");
geoDbClient.stopClusterGossiping();
// Don't recover version and ipsec key. Need to reconsider once all vdc data moving to ZK.
vdcConfHelper.syncVdcConfig(newVdcConfigList, null, true, DrUtil.newVdcConfigVersion(), "");
try {
Thread.sleep(30000);
} catch (InterruptedException e) {
log.error("Error in recover Vdc Config, e=" + e);
}
System.out.println("Recover successfully, please wait for the whole vdc reboot.");
}
use of com.emc.storageos.geo.vdccontroller.impl.InternalDbClient in project coprhd-controller by CoprHD.
the class DBClient method setGeoBlacklist.
/**
* Set geo blacklist
*
* @param vdcShortId
*/
public void setGeoBlacklist(String vdcShortId) {
InternalDbClient geoDbClient = (InternalDbClient) ctx.getBean("geodbclient");
List<URI> vdcList = geoDbClient.queryByType(VirtualDataCenter.class, true);
for (URI vdcId : vdcList) {
VirtualDataCenter vdc = geoDbClient.queryObject(VirtualDataCenter.class, vdcId);
if (vdc.getShortId().equals(vdcShortId)) {
System.out.println("Add black list for vdc: " + vdcShortId);
geoDbClient.addVdcNodesToBlacklist(vdc);
break;
}
}
}
Aggregations