Search in sources :

Example 1 with RetryableBackupException

use of com.emc.storageos.management.backup.exceptions.RetryableBackupException in project coprhd-controller by CoprHD.

the class BackupOps method queryLocalBackupInfo.

public BackupInfo queryLocalBackupInfo(String backupTag) {
    BackupInfo backupInfo = new BackupInfo();
    backupInfo.setBackupName(backupTag);
    for (int retryCnt = 0; retryCnt < BackupConstants.RETRY_MAX_CNT; retryCnt++) {
        try {
            BackupRestoreStatus s = queryBackupRestoreStatus(backupTag, true);
            backupInfo.setRestoreStatus(s);
            List<BackupProcessor.BackupTask<BackupInfo>> backupTasks = new BackupProcessor(getHosts(), Arrays.asList(ports.get(2)), backupTag).process(new QueryBackupCallable(), true);
            for (BackupProcessor.BackupTask task : backupTasks) {
                BackupInfo backupInfoFromNode = (BackupInfo) task.getResponse().getFuture().get();
                log.info("Query backup({}) success", backupTag);
                mergeBackupInfo(backupInfo, backupInfoFromNode);
            }
        } catch (RetryableBackupException e) {
            log.info("Retry to query backup {}", backupTag);
            continue;
        } catch (Exception e) {
            log.warn("Query local backup({}) info got an error", backupTag, e);
        }
        break;
    }
    return backupInfo;
}
Also used : BackupInfo(com.emc.vipr.model.sys.backup.BackupInfo) BackupRestoreStatus(com.emc.vipr.model.sys.backup.BackupRestoreStatus) RetryableBackupException(com.emc.storageos.management.backup.exceptions.RetryableBackupException) URISyntaxException(java.net.URISyntaxException) CancellationException(java.util.concurrent.CancellationException) MalformedObjectNameException(javax.management.MalformedObjectNameException) RetryableBackupException(com.emc.storageos.management.backup.exceptions.RetryableBackupException) KeeperException(org.apache.zookeeper.KeeperException) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) ExecutionException(java.util.concurrent.ExecutionException) BackupException(com.emc.storageos.management.backup.exceptions.BackupException)

Aggregations

BackupException (com.emc.storageos.management.backup.exceptions.BackupException)1 RetryableBackupException (com.emc.storageos.management.backup.exceptions.RetryableBackupException)1 BackupInfo (com.emc.vipr.model.sys.backup.BackupInfo)1 BackupRestoreStatus (com.emc.vipr.model.sys.backup.BackupRestoreStatus)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 UnknownHostException (java.net.UnknownHostException)1 CancellationException (java.util.concurrent.CancellationException)1 ExecutionException (java.util.concurrent.ExecutionException)1 MalformedObjectNameException (javax.management.MalformedObjectNameException)1 KeeperException (org.apache.zookeeper.KeeperException)1