Search in sources :

Example 1 with GeoReplicationStatus

use of com.emc.storageos.db.client.model.VirtualDataCenter.GeoReplicationStatus in project coprhd-controller by CoprHD.

the class InternalDbClient method shouldCheckDbStatus.

/**
 * Check if we need wait for geodbsvc up on given vdc
 */
private boolean shouldCheckDbStatus(VirtualDataCenter vdc) {
    // local vdc is always connected with itself
    if (vdc.getLocal()) {
        return true;
    }
    // incomplete vdc record
    if (vdc.getShortId() == null) {
        log.error("invalid record in db status check {}", vdc.getId());
        return false;
    }
    ConnectionStatus connStatus = vdc.getConnectionStatus();
    GeoReplicationStatus repStatus = vdc.getRepStatus();
    log.info("vdc connectionStatus {} repStatus {}", connStatus, repStatus);
    // geodb connected
    if (repStatus.equals(GeoReplicationStatus.REP_ALL)) {
        log.info("vdc {}, repStatus {}", vdc.getId(), repStatus);
        return true;
    }
    // connecting now, check db stable status as well
    if (connStatus.equals(ConnectionStatus.CONNECTING_SYNCED)) {
        return true;
    }
    return false;
}
Also used : GeoReplicationStatus(com.emc.storageos.db.client.model.VirtualDataCenter.GeoReplicationStatus) ConnectionStatus(com.emc.storageos.db.client.model.VirtualDataCenter.ConnectionStatus)

Aggregations

ConnectionStatus (com.emc.storageos.db.client.model.VirtualDataCenter.ConnectionStatus)1 GeoReplicationStatus (com.emc.storageos.db.client.model.VirtualDataCenter.GeoReplicationStatus)1