public abstract class BlockStore
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
BlockStore.ChainLoopDetector
Used to detect if a chain has a loop in it, so we can bail out with an error rather than spinning away for ever...
(用于检测链中是否存在循环,因此我们可以通过错误退出而不是永远旋转...)
|
Constructor and Description |
---|
BlockStore() |
Modifier and Type | Method and Description |
---|---|
protected abstract java.nio.ByteBuffer |
createBlockIfNeeded(int offset)
Extends the file if required to hold blocks up to the specified offset, and return the block from there.
(如果需要,扩展文件以将块保存到指定的偏移量,并从那里返回块。)
|
protected abstract BATBlock.BATBlockAndIndex |
getBATBlockAndIndex(int offset)
Returns the BATBlock that handles the specified offset, and the relative index within it
(返回处理指定偏移量的 BATBlock,以及其中的相对索引)
|
protected abstract java.nio.ByteBuffer |
getBlockAt(int offset)
Load the block at the given offset.
(在给定的偏移量处加载块。)
|
protected abstract int |
getBlockStoreBlockSize()
Returns the size of the blocks managed through the block store.
(返回通过块存储管理的块的大小。)
|
protected abstract BlockStore.ChainLoopDetector |
getChainLoopDetector()
Creates a Detector for loops in the chain
(为链中的循环创建检测器)
|
protected abstract int |
getFreeBlock()
Finds a free block, and returns its offset.
(找到一个空闲块,并返回它的偏移量。)
|
protected abstract int |
getNextBlock(int offset)
Works out what block follows the specified one.
(计算出指定块后面的块。)
|
protected abstract void |
releaseBuffer(java.nio.ByteBuffer buffer)
Releases a mmap-ed buffer, which you are sure won't be used again
(释放一个 mmap-ed 缓冲区,您确定不会再次使用该缓冲区)
|
protected abstract void |
setNextBlock(int offset, int nextBlock)
Changes the record of what block follows the specified one.
(更改指定块后面的记录。)
|
protected abstract int getBlockStoreBlockSize()
protected abstract java.nio.ByteBuffer getBlockAt(int offset) throws java.io.IOException
java.io.IOException
(java.io.IOException)
protected abstract java.nio.ByteBuffer createBlockIfNeeded(int offset) throws java.io.IOException
java.io.IOException
(java.io.IOException)
protected abstract void releaseBuffer(java.nio.ByteBuffer buffer)
buffer
- the buffer
(缓冲区 - 缓冲区)
protected abstract BATBlock.BATBlockAndIndex getBATBlockAndIndex(int offset)
protected abstract int getNextBlock(int offset)
protected abstract void setNextBlock(int offset, int nextBlock)
protected abstract int getFreeBlock() throws java.io.IOException
java.io.IOException
(java.io.IOException)
protected abstract BlockStore.ChainLoopDetector getChainLoopDetector() throws java.io.IOException
java.io.IOException
(java.io.IOException)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.