public class BlockStoreBase extends Object implements AutoCloseable
BlockStore
.
It is intended for use case of comparing performance of different BlockStore implementations,
where only one of the stores will be actually used. For this reason, UFS is shared among all
the objects. Users should be careful about this for different kinds of use cases.Modifier and Type | Field and Description |
---|---|
MonoBlockStore |
mMonoBlockStore
MonoBlockStore backed by TieredBlockStore as local storage. |
PagedBlockStore |
mPagedBlockStore
PagedBlockStore that uses page cache as local storage. |
UfsManager |
mUfsManager
The shared
UfsManager used for block stores. |
Constructor and Description |
---|
BlockStoreBase(MonoBlockStore monoBlockStore,
PagedBlockStore pagedBlockStore,
UfsManager ufs) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static BlockStoreBase |
create()
Create a new instance with initialized block store objects.
|
void |
mountUfs(long mountId,
String rootDir)
Mount an ufs to
UfsManager , which is shared for both stores. |
void |
prepareLocalBlock(long blockId,
long blockSize,
byte[] data)
Create a local block to both Mono and Paged block store.
|
void |
prepareUfsFile(String ufsFilePath,
byte[] data)
Flush some data to the local file located at ufsFilePath.
|
public MonoBlockStore mMonoBlockStore
MonoBlockStore
backed by TieredBlockStore
as local storage.public PagedBlockStore mPagedBlockStore
PagedBlockStore
that uses page cache as local storage.public UfsManager mUfsManager
UfsManager
used for block stores.public BlockStoreBase(MonoBlockStore monoBlockStore, PagedBlockStore pagedBlockStore, UfsManager ufs)
public static BlockStoreBase create()
BlockStoreBase
public void prepareLocalBlock(long blockId, long blockSize, byte[] data) throws Exception
blockId
- block idblockSize
- size of blockdata
- read-only data to flush to blockException
- if I/O error happenspublic void mountUfs(long mountId, String rootDir)
UfsManager
, which is shared for both stores.mountId
- mount idrootDir
- directory path of ufspublic void prepareUfsFile(String ufsFilePath, byte[] data) throws Exception
ufsFilePath
- file pathdata
- ufs file dataException
- if error occurspublic void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2023. All Rights Reserved.