public CompositeDataStoreCache(String path, File home, long size, int uploadSplitPercentage, int uploadThreads, CacheLoader<String, InputStream> loader, final StagingUploader uploader, StatisticsProvider statsProvider, ListeningExecutorService listeningExecutor, ScheduledExecutorService scheduledExecutor /* purge scheduled executor */, ExecutorService executor /* File cache executor */, int purgeInterval /* async purge interval secs */, int stagingRetryInterval /* async retry interval secs */) { checkArgument(uploadSplitPercentage >= 0 && uploadSplitPercentage < 100, "Upload percentage should be between 0 and 100"); this.directory = new File(path); long uploadSize = (size * uploadSplitPercentage) / 100; this.stagingCache = UploadStagingCache .build(directory, home, uploadThreads, uploadSize, uploader, null, statsProvider, listeningExecutor, scheduledExecutor, purgeInterval, stagingRetryInterval); this.downloadCache = FileCache.build((size - uploadSize), directory, loader, executor); stagingCache.setDownloadCache(downloadCache); }
public CompositeDataStoreCache(String path, File home, long size, int uploadSplitPercentage, int uploadThreads, CacheLoader<String, InputStream> loader, final StagingUploader uploader, StatisticsProvider statsProvider, ListeningExecutorService listeningExecutor, ScheduledExecutorService scheduledExecutor /* purge scheduled executor */, ExecutorService executor /* File cache executor */, int purgeInterval /* async purge interval secs */, int stagingRetryInterval /* async retry interval secs */) { checkArgument(uploadSplitPercentage >= 0 && uploadSplitPercentage < 100, "Upload percentage should be between 0 and 100"); this.directory = new File(path); long uploadSize = (size * uploadSplitPercentage) / 100; this.stagingCache = UploadStagingCache .build(directory, home, uploadThreads, uploadSize, uploader, null, statsProvider, listeningExecutor, scheduledExecutor, purgeInterval, stagingRetryInterval); this.downloadCache = FileCache.build((size - uploadSize), directory, loader, executor); stagingCache.setDownloadCache(downloadCache); }
public CompositeDataStoreCache(String path, File home, long size, int uploadSplitPercentage, int uploadThreads, CacheLoader<String, InputStream> loader, final StagingUploader uploader, StatisticsProvider statsProvider, ListeningExecutorService listeningExecutor, ScheduledExecutorService scheduledExecutor /* purge scheduled executor */, ExecutorService executor /* File cache executor */, int purgeInterval /* async purge interval secs */, int stagingRetryInterval /* async retry interval secs */) { checkArgument(uploadSplitPercentage >= 0 && uploadSplitPercentage < 100, "Upload percentage should be between 0 and 100"); this.directory = new File(path); long uploadSize = (size * uploadSplitPercentage) / 100; this.stagingCache = UploadStagingCache .build(directory, home, uploadThreads, uploadSize, uploader, null, statsProvider, listeningExecutor, scheduledExecutor, purgeInterval, stagingRetryInterval); this.downloadCache = FileCache.build((size - uploadSize), directory, loader, executor); stagingCache.setDownloadCache(downloadCache); }