java.io.Closeable, java.lang.AutoCloseablepublic abstract class CachingBlockManager extends BlockManager
| Constructor | Description |
|---|---|
CachingBlockManager(BlockManagerParameters blockManagerParameters) |
Constructs an instance of a
CachingBlockManager. |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
cachePut(int blockNumber,
java.nio.ByteBuffer buffer) |
|
void |
cancelPrefetches() |
Requests cancellation of any previously issued prefetch requests.
|
void |
close() |
|
protected BlockCache |
createCache(int maxBlocksCount,
DurationTrackerFactory trackerFactory) |
|
BufferData |
get(int blockNumber) |
Gets the block having the given
blockNumber. |
int |
numAvailable() |
Number of ByteBuffers available to be acquired.
|
int |
numCached() |
Number of caching operations completed.
|
int |
numCachingErrors() |
Number of errors encountered when caching.
|
int |
numReadErrors() |
Number of errors encountered when reading.
|
void |
release(BufferData data) |
Releases resources allocated to the given block.
|
void |
requestCaching(BufferData data) |
Requests that the given block should be copied to the local cache.
|
void |
requestPrefetch(int blockNumber) |
Requests optional prefetching of the given block.
|
java.lang.String |
toString() |
getBlockData, readpublic CachingBlockManager(@Nonnull
BlockManagerParameters blockManagerParameters)
CachingBlockManager.blockManagerParameters - params for block manager.java.lang.IllegalArgumentException - if bufferPoolSize is zero or negative.public BufferData get(int blockNumber) throws java.io.IOException
blockNumber.get in class BlockManagerblockNumber - the number of the block to be read and returned.BufferData having data from the given block.java.lang.IllegalArgumentException - if blockNumber is negative.java.io.IOException - if there an error reading the given block.public void release(BufferData data)
release in class BlockManagerdata - the BufferData to release.java.lang.IllegalArgumentException - if data is null.public void close()
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class BlockManagerpublic void requestPrefetch(int blockNumber)
requestPrefetch in class BlockManagerblockNumber - the id of the block to prefetch.java.lang.IllegalArgumentException - if blockNumber is negative.public void cancelPrefetches()
cancelPrefetches in class BlockManagerpublic void requestCaching(BufferData data)
requestCaching in class BlockManagerdata - the BufferData instance to optionally cache.java.lang.IllegalArgumentException - if data is null.protected BlockCache createCache(int maxBlocksCount, DurationTrackerFactory trackerFactory)
protected void cachePut(int blockNumber,
java.nio.ByteBuffer buffer)
throws java.io.IOException
java.io.IOExceptionpublic int numAvailable()
public int numCached()
public int numCachingErrors()
public int numReadErrors()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.