/** * Returns Map with a {@link JournalFile} for all existing files. * * These are the files needed to be sent to a backup in order to synchronize it. * * @param fileIds * @return map with the IDs and corresponding {@link JournalFile}s * @throws Exception */ @Override public synchronized Map<Long, JournalFile> createFilesForBackupSync(long[] fileIds) throws Exception { synchronizationLock(); try { Map<Long, JournalFile> map = new HashMap<>(); long maxID = -1; for (long id : fileIds) { maxID = Math.max(maxID, id); map.put(id, filesRepository.createRemoteBackupSyncFile(id)); } filesRepository.setNextFileID(maxID); return map; } finally { synchronizationUnlock(); } }
/** * Returns Map with a {@link JournalFile} for all existing files. * * These are the files needed to be sent to a backup in order to synchronize it. * * @param fileIds * @return map with the IDs and corresponding {@link JournalFile}s * @throws Exception */ @Override public synchronized Map<Long, JournalFile> createFilesForBackupSync(long[] fileIds) throws Exception { synchronizationLock(); try { Map<Long, JournalFile> map = new HashMap<>(); long maxID = -1; for (long id : fileIds) { maxID = Math.max(maxID, id); map.put(id, filesRepository.createRemoteBackupSyncFile(id)); } filesRepository.setNextFileID(maxID); return map; } finally { synchronizationUnlock(); } }