public final class SegmentCacheWorker extends Object
SegmentCache
.SegmentCache
Constructor and Description |
---|
SegmentCacheWorker(SegmentCache cache,
Thread cacheMgrThread)
Creates a worker.
|
Modifier and Type | Method and Description |
---|---|
SegmentBody |
get(SegmentHeader header)
Returns a segment body corresponding to a header.
|
List<SegmentHeader> |
getSegmentHeaders()
Returns a list of segments present in the cache.
|
static List<SegmentCache> |
initCache()
Instantiates a cache.
|
void |
put(SegmentHeader header,
SegmentBody body)
Places a segment in the cache.
|
boolean |
remove(SegmentHeader header)
Removes a segment from the cache.
|
void |
shutdown() |
boolean |
supportsRichIndex() |
public SegmentCacheWorker(SegmentCache cache, Thread cacheMgrThread)
cache
- Cache managed by this workercacheMgrThread
- Thread that the cache manager actor is running on,
and which therefore should not be used for
potentially long-running calls this this cache.
Pass null if methods can be called from any thread.public static List<SegmentCache> initCache()
public SegmentBody get(SegmentHeader header)
If no cache is configured or there is an error while querying the cache, null is returned none the less.
header
- Header to search.public void put(SegmentHeader header, SegmentBody body)
header
- A header to search for in the segment cache.body
- The segment body to cache.public boolean remove(SegmentHeader header)
header
- A header to remove in the segment cache.public List<SegmentHeader> getSegmentHeaders()
public boolean supportsRichIndex()
public void shutdown()
Copyright © 2019 Hitachi Vantara. All rights reserved.