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