BackupService { public HashSet<PersistentID> doBackup() throws IOException { BackupTask task = currentTask.get(); if (task == null) { throw new IOException("No backup currently in progress"); } task.notifyOtherMembersReady(); HashSet<PersistentID> result; try { result = taskFuture.get(); } catch (InterruptedException | ExecutionException e) { logger.warn("Backup failed with exception: ", e); result = new HashSet<>(); } finally { cleanup(); } return result; } BackupService(InternalCache cache); HashSet<PersistentID> prepareBackup(InternalDistributedMember sender, BackupWriter writer); HashSet<PersistentID> doBackup(); void waitForBackup(); DiskStoreBackup getBackupForDiskStore(DiskStoreImpl diskStore); boolean deferDrfDelete(DiskStoreImpl diskStore, Oplog oplog); boolean deferCrfDelete(DiskStoreImpl diskStore, Oplog oplog); void abortBackup(); static final String TEMPORARY_DIRECTORY_FOR_BACKUPS; }
@Test public void doBackupThrowsExceptionWhenNoBackupInProgress() throws Exception { assertThatThrownBy(() -> backupService.doBackup()).isInstanceOf(IOException.class); }