BackupService { public HashSet<PersistentID> prepareBackup(InternalDistributedMember sender, BackupWriter writer) throws IOException, InterruptedException { validateRequestingSender(sender); BackupTask backupTask = new BackupTask(cache, writer); if (!currentTask.compareAndSet(null, backupTask)) { throw new IOException("Another backup is already in progress"); } taskFuture = executor.submit(() -> backupTask.backup()); return backupTask.getPreparedDiskStores(); } 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 prepareBackupReturnsEmptyPersistentIdsWhenBackupNotInProgress() throws Exception { assertThat(backupService.prepareBackup(sender, null).size()).isEqualTo(0); }