in priam/src/main/java/com/netflix/priam/backup/AbstractFileSystem.java [75:114]
public AbstractFileSystem(
IConfiguration configuration,
BackupMetrics backupMetrics,
BackupNotificationMgr backupNotificationMgr,
Provider<AbstractBackupPath> pathProvider) {
this.configuration = configuration;
this.backupMetrics = backupMetrics;
this.pathProvider = pathProvider;
this.backupNotificationMgr = backupNotificationMgr;
this.objectCache =
CacheBuilder.newBuilder().maximumSize(configuration.getBackupQueueSize()).build();
tasksQueued = new ConcurrentHashMap<>().newKeySet();
/*
Note: We are using different queue for upload and download as with Backup V2.0 we might download all the meta
files for "sync" feature which might compete with backups for scheduling.
Also, we may want to have different TIMEOUT for each kind of operation (upload/download) based on our file system choices.
*/
BlockingQueue<Runnable> uploadQueue =
new ArrayBlockingQueue<>(configuration.getBackupQueueSize());
PolledMeter.using(backupMetrics.getRegistry())
.withName(backupMetrics.uploadQueueSize)
.monitorSize(uploadQueue);
this.fileUploadExecutor =
MoreExecutors.listeningDecorator(
new BlockingSubmitThreadPoolExecutor(
configuration.getBackupThreads(),
uploadQueue,
configuration.getUploadTimeout()));
BlockingQueue<Runnable> downloadQueue =
new ArrayBlockingQueue<>(configuration.getDownloadQueueSize());
PolledMeter.using(backupMetrics.getRegistry())
.withName(backupMetrics.downloadQueueSize)
.monitorSize(downloadQueue);
this.fileDownloadExecutor =
new BlockingSubmitThreadPoolExecutor(
configuration.getRestoreThreads(),
downloadQueue,
configuration.getDownloadTimeout());
}