Search in sources :

Example 6 with DbManagerOps

use of com.emc.storageos.management.jmx.recovery.DbManagerOps in project coprhd-controller by CoprHD.

the class CommandHandler method repairDb.

public static int repairDb(String[] args) throws Exception {
    boolean isGeodb = false;
    boolean canResume = true;
    boolean crossVdc = false;
    for (int i = 1; i < args.length; i++) {
        if (args[1].compareToIgnoreCase("-db") == 0) {
            isGeodb = false;
        } else if (args[1].compareToIgnoreCase("-geodb") == 0) {
            isGeodb = true;
        } else if (args[1].compareToIgnoreCase("-new") == 0) {
            canResume = false;
        } else if (args[1].compareToIgnoreCase("-crossVdc") == 0) {
            crossVdc = true;
        } else {
            throw new IllegalArgumentException(String.format("Invalid argument at #%d: %s", i, args[i]));
        }
    }
    try (DbManagerOps dbManagerOps = new DbManagerOps(isGeodb ? Constants.GEODBSVC_NAME : Constants.DBSVC_NAME)) {
        dbManagerOps.startNodeRepair(canResume, crossVdc);
    }
    return 0;
}
Also used : DbManagerOps(com.emc.storageos.management.jmx.recovery.DbManagerOps)

Aggregations

DbManagerOps (com.emc.storageos.management.jmx.recovery.DbManagerOps)6 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)1 SysClientException (com.emc.storageos.systemservices.exceptions.SysClientException)1 DbRepairStatus (com.emc.vipr.model.sys.recovery.DbRepairStatus)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 MBeanServerConnection (javax.management.MBeanServerConnection)1 JMXConnector (javax.management.remote.JMXConnector)1 JMXServiceURL (javax.management.remote.JMXServiceURL)1