public class UploadStagingCache extends Object implements Closeable
The appropriate backend for this cache are wrapped in StagingUploader
implementations.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
UPLOAD_STAGING_DIR |
| Modifier and Type | Method and Description |
|---|---|
static UploadStagingCache |
build(File dir,
File home,
int uploadThreads,
long size,
org.apache.jackrabbit.oak.plugins.blob.StagingUploader uploader,
@Nullable FileCache cache,
org.apache.jackrabbit.oak.stats.StatisticsProvider statisticsProvider,
@Nullable com.google.common.util.concurrent.ListeningExecutorService executor,
@Nullable ScheduledExecutorService scheduledExecutor,
int purgeInterval,
int retryInterval) |
void |
close() |
protected Iterator<String> |
getAllIdentifiers()
Returns all identifiers presently staged.
|
@Nullable File |
getIfPresent(String key)
Returns the File if present or null otherwise.
|
DataStoreCacheStatsMBean |
getStats()
Cache related stats
|
protected void |
invalidate(String key)
Invalidate called externally.
|
com.google.common.base.Optional<com.google.common.util.concurrent.SettableFuture<Integer>> |
put(String id,
File input)
Puts the file into the staging cache if possible.
|
protected void |
setDownloadCache(@Nullable FileCache downloadCache) |
protected static final String UPLOAD_STAGING_DIR
public static UploadStagingCache build(File dir, File home, int uploadThreads, long size, org.apache.jackrabbit.oak.plugins.blob.StagingUploader uploader, @Nullable @Nullable FileCache cache, org.apache.jackrabbit.oak.stats.StatisticsProvider statisticsProvider, @Nullable @Nullable com.google.common.util.concurrent.ListeningExecutorService executor, @Nullable @Nullable ScheduledExecutorService scheduledExecutor, int purgeInterval, int retryInterval)
public com.google.common.base.Optional<com.google.common.util.concurrent.SettableFuture<Integer>> put(String id, File input)
id - the id of the file to be stagedinput - the file to be stagedprotected void invalidate(String key)
key - to invalidateprotected Iterator<String> getAllIdentifiers()
@Nullable public @Nullable File getIfPresent(String key)
key - of the file to checkpublic DataStoreCacheStatsMBean getStats()
DataStoreCacheStatsMBean.public void close()
close in interface Closeableclose in interface AutoCloseableprotected void setDownloadCache(@Nullable
@Nullable FileCache downloadCache)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.