java.lang.AutoCloseable, java.io.CloseableSingleFilePerBlockCachepublic interface BlockCache
extends java.io.Closeable
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.Iterable<java.lang.Integer> |
blocks() |
Gets the blocks in this cache.
|
boolean |
containsBlock(int blockNumber) |
Indicates whether the given block is in this cache.
|
void |
get(int blockNumber,
java.nio.ByteBuffer buffer) |
Gets the block having the given
blockNumber. |
void |
put(int blockNumber,
java.nio.ByteBuffer buffer,
Configuration conf,
LocalDirAllocator localDirAllocator) |
Puts the given block in this cache.
|
int |
size() |
Gets the number of blocks in this cache.
|
boolean containsBlock(int blockNumber)
blockNumber - the id of the given block.java.lang.Iterable<java.lang.Integer> blocks()
int size()
void get(int blockNumber,
java.nio.ByteBuffer buffer)
throws java.io.IOException
blockNumber.blockNumber - the id of the desired block.buffer - contents of the desired block are copied to this buffer.java.io.IOException - if there is an error reading the given block.void put(int blockNumber,
java.nio.ByteBuffer buffer,
Configuration conf,
LocalDirAllocator localDirAllocator)
throws java.io.IOException
blockNumber - the id of the given block.buffer - contents of the given block to be added to this cache.conf - the configuration.localDirAllocator - the local dir allocator instance.java.io.IOException - if there is an error writing the given block.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.