public final class PersistentRecordCache<K,V> extends Object implements RecordCache<K,V>
| Modifier and Type | Class and Description |
|---|---|
static class |
PersistentRecordCache.Builder<K,V> |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the cache.
|
V |
get(K key,
CacheStats cacheStats)
Performs lookup for single key.
|
Map<K,V> |
getAll(Collection<K> keys,
CacheStats cacheStats)
Performs batch lookup for multiple keys.
|
RecordLogDirectoryPoller.Functions |
getFunctions()
Update functions to be registered with a
RecordLogDirectoryPoller |
long |
getIndexActiveSpaceUsage() |
long |
getIndexFreeSpace() |
long |
getIndexReservedSpaceUsage() |
long |
getIndexTotalSpaceUsage() |
int |
getRepairedSegments() |
Iterator<com.indeed.util.core.Either<Exception,fj.P2<K,V>>> |
getStreaming(Iterator<K> keys,
AtomicInteger progress,
AtomicInteger skipped)
Performs lookup for multiple keys and returns a streaming iterator to results.
|
void |
waitForCompactions()
Blocks until compactions are complete.
|
public int getRepairedSegments()
public long getIndexActiveSpaceUsage()
throws IOException
IOExceptionpublic long getIndexTotalSpaceUsage()
throws IOException
IOExceptionpublic long getIndexReservedSpaceUsage()
public long getIndexFreeSpace()
throws IOException
IOException@Nullable public V get(@Nonnull K key, @Nonnull CacheStats cacheStats)
get in interface RecordCache<K,V>key - key to lookupcacheStats - stats@Nonnull public Map<K,V> getAll(@Nonnull Collection<K> keys, @Nonnull CacheStats cacheStats)
getAll in interface RecordCache<K,V>keys - keys to lookupcacheStats - statspublic Iterator<com.indeed.util.core.Either<Exception,fj.P2<K,V>>> getStreaming(@Nonnull Iterator<K> keys, @Nullable AtomicInteger progress, @Nullable AtomicInteger skipped)
keys - lookup keysprogress - (optional) an AtomicInteger for tracking progressskipped - (optional) an AtomicInteger for tracking missing keyspublic RecordLogDirectoryPoller.Functions getFunctions()
RecordLogDirectoryPollergetFunctions in interface RecordCache<K,V>public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - if an I/O error occurspublic void waitForCompactions()
throws InterruptedException
InterruptedException - when interrupted during operationCopyright © 2017. All Rights Reserved.