public interface DataCache
Modifier and Type | Interface and Description |
---|---|
static class |
DataCache.BooleanRef |
static interface |
DataCache.DiskRangeListFactory
Disk range factory used during cache retrieval.
|
Modifier and Type | Method and Description |
---|---|
Allocator |
getAllocator()
Gets the allocator associated with this DataCache.
|
DiskRangeList |
getFileData(Object fileKey,
DiskRangeList range,
long baseOffset,
DataCache.DiskRangeListFactory factory,
DataCache.BooleanRef gotAllData)
Gets file data for particular offsets.
|
long[] |
putFileData(Object fileKey,
DiskRange[] ranges,
MemoryBuffer[] data,
long baseOffset)
Puts file data into cache, or gets older data in case of collisions.
|
void |
releaseBuffer(MemoryBuffer buffer)
Releases the buffer returned by getFileData/provided to putFileData back to cache.
|
void |
reuseBuffer(MemoryBuffer buffer)
Notifies the cache that the buffer returned from getFileData/provided to putFileData will
be used by another consumer and therefore released multiple times (one more time per call).
|
DiskRangeList getFileData(Object fileKey, DiskRangeList range, long baseOffset, DataCache.DiskRangeListFactory factory, DataCache.BooleanRef gotAllData)
fileKey
- Unique ID of the target file on the file system.range
- A set of DiskRange-s (linked list) that is to be retrieved. May be modified.baseOffset
- base offset for the ranges (stripe/stream offset in case of ORC).factory
- A factory to produce DiskRangeList-s out of cached MemoryBuffer-s.gotAllData
- An out param - whether all the requested data was found in cache.long[] putFileData(Object fileKey, DiskRange[] ranges, MemoryBuffer[] data, long baseOffset)
fileKey
- Unique ID of the target file on the file system.ranges
- The ranges for which the data is being cached. These objects will not be stored.data
- The data for the corresponding ranges.baseOffset
- base offset for the ranges (stripe/stream offset in case of ORC).void releaseBuffer(MemoryBuffer buffer)
void reuseBuffer(MemoryBuffer buffer)
Allocator getAllocator()
Copyright © 2016 The Apache Software Foundation. All rights reserved.