Search in sources :

Example 1 with VdcConfigVersion

use of com.emc.storageos.coordinator.client.model.VdcConfigVersion in project coprhd-controller by CoprHD.

the class CoordinatorClientImpl method getDifferentVdcConfigVersionCommon.

/**
 * Common method to compare vdcConfigVersions with target's vdcConfigVersion
 *
 * @param vdcConfigVersions
 *            nodes' vdcConfigVersions
 * @return list of nodes which configVersions are different from the target's
 */
private List<String> getDifferentVdcConfigVersionCommon(final Map<Service, VdcConfigVersion> vdcConfigVersions) {
    List<String> differentConfigVersions = new ArrayList<String>();
    SiteInfo targetSiteInfo = getTargetInfo(SiteInfo.class);
    if (targetSiteInfo == null) {
        return differentConfigVersions;
    }
    String targetVdcConfigVersion = String.valueOf(targetSiteInfo.getVdcConfigVersion());
    for (Map.Entry<Service, VdcConfigVersion> entry : vdcConfigVersions.entrySet()) {
        if (!StringUtils.equals(targetVdcConfigVersion, entry.getValue().getConfigVersion())) {
            differentConfigVersions.add(entry.getKey().getId());
        }
    }
    return differentConfigVersions;
}
Also used : SiteInfo(com.emc.storageos.coordinator.client.model.SiteInfo) ArrayList(java.util.ArrayList) Service(com.emc.storageos.coordinator.common.Service) ExecutorService(java.util.concurrent.ExecutorService) PropertyInfoMapper.decodeFromString(com.emc.storageos.coordinator.mapper.PropertyInfoMapper.decodeFromString) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) VdcConfigVersion(com.emc.storageos.coordinator.client.model.VdcConfigVersion)

Example 2 with VdcConfigVersion

use of com.emc.storageos.coordinator.client.model.VdcConfigVersion in project coprhd-controller by CoprHD.

the class CoordinatorClientImpl method getControlNodesState.

@Override
public ClusterInfo.ClusterState getControlNodesState(String siteId) {
    try {
        // get target repository and configVersion
        final RepositoryInfo targetRepository = getTargetInfo(RepositoryInfo.class);
        final PropertyInfoRestRep targetProperty = getTargetInfo(PropertyInfoExt.class);
        final PowerOffState targetPowerOffState = getTargetInfo(PowerOffState.class);
        final StorageDriversInfo targetDrivers = getTargetInfo(StorageDriversInfo.class);
        // get control nodes' repository and configVersion info
        final Map<Service, RepositoryInfo> controlNodesInfo = getAllNodeInfos(RepositoryInfo.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
        final Map<Service, ConfigVersion> controlNodesConfigVersions = getAllNodeInfos(ConfigVersion.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
        final Map<Service, VdcConfigVersion> controlNodesVdcConfigVersions = getAllNodeInfos(VdcConfigVersion.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
        final Map<Service, StorageDriversInfo> controlNodesDrivers = getAllNodeInfos(StorageDriversInfo.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
        return getControlNodesState(targetRepository, controlNodesInfo, targetProperty, controlNodesConfigVersions, controlNodesVdcConfigVersions, targetPowerOffState, targetDrivers, controlNodesDrivers, siteId);
    } catch (Exception e) {
        log.info("Fail to get the control node information ", e);
        return ClusterInfo.ClusterState.UNKNOWN;
    }
}
Also used : PropertyInfoRestRep(com.emc.storageos.model.property.PropertyInfoRestRep) RepositoryInfo(com.emc.storageos.coordinator.client.model.RepositoryInfo) VdcConfigVersion(com.emc.storageos.coordinator.client.model.VdcConfigVersion) ConfigVersion(com.emc.storageos.coordinator.client.model.ConfigVersion) Service(com.emc.storageos.coordinator.common.Service) ExecutorService(java.util.concurrent.ExecutorService) StorageDriversInfo(com.emc.storageos.coordinator.client.model.StorageDriversInfo) VdcConfigVersion(com.emc.storageos.coordinator.client.model.VdcConfigVersion) PowerOffState(com.emc.storageos.coordinator.client.model.PowerOffState) CoordinatorException(com.emc.storageos.coordinator.exceptions.CoordinatorException) RetryableCoordinatorException(com.emc.storageos.coordinator.exceptions.RetryableCoordinatorException) KeeperException(org.apache.zookeeper.KeeperException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException)

Aggregations

VdcConfigVersion (com.emc.storageos.coordinator.client.model.VdcConfigVersion)2 Service (com.emc.storageos.coordinator.common.Service)2 ExecutorService (java.util.concurrent.ExecutorService)2 ConfigVersion (com.emc.storageos.coordinator.client.model.ConfigVersion)1 PowerOffState (com.emc.storageos.coordinator.client.model.PowerOffState)1 RepositoryInfo (com.emc.storageos.coordinator.client.model.RepositoryInfo)1 SiteInfo (com.emc.storageos.coordinator.client.model.SiteInfo)1 StorageDriversInfo (com.emc.storageos.coordinator.client.model.StorageDriversInfo)1 CoordinatorException (com.emc.storageos.coordinator.exceptions.CoordinatorException)1 RetryableCoordinatorException (com.emc.storageos.coordinator.exceptions.RetryableCoordinatorException)1 PropertyInfoMapper.decodeFromString (com.emc.storageos.coordinator.mapper.PropertyInfoMapper.decodeFromString)1 PropertyInfoRestRep (com.emc.storageos.model.property.PropertyInfoRestRep)1 IOException (java.io.IOException)1 UnknownHostException (java.net.UnknownHostException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1 KeeperException (org.apache.zookeeper.KeeperException)1