public class FreeListBlockStore extends Object implements BlockStore
| Modifier and Type | Class and Description |
|---|---|
class |
FreeListBlockStore.FreeListBlock |
BlockStore.Factory| Constructor and Description |
|---|
FreeListBlockStore(BlockStore store,
int maxBlockEntries) |
| Modifier and Type | Method and Description |
|---|---|
void |
attach(BlockPayload block)
Adds a new block to this store.
|
void |
clear()
Discards all blocks from this store.
|
void |
close()
Closes this store.
|
void |
flush()
Flushes any pending updates for this store.
|
void |
open(Runnable initAction,
BlockStore.Factory factory)
Opens this store, calling the given action if the store is empty.
|
<T extends BlockPayload> |
read(BlockPointer pos,
Class<T> payloadType)
Reads a block from this store.
|
<T extends BlockPayload> |
readFirst(Class<T> payloadType)
Reads the first block from this store.
|
void |
remove(BlockPayload block)
Removes the given block from this store.
|
void |
write(BlockPayload block)
Writes a block to this store, adding the block if required.
|
public FreeListBlockStore(BlockStore store, int maxBlockEntries)
public void open(Runnable initAction, BlockStore.Factory factory)
BlockStoreopen in interface BlockStorepublic void close()
BlockStoreclose in interface BlockStorepublic void clear()
BlockStoreclear in interface BlockStorepublic void remove(BlockPayload block)
BlockStoreremove in interface BlockStorepublic <T extends BlockPayload> T readFirst(Class<T> payloadType)
BlockStorereadFirst in interface BlockStorepublic <T extends BlockPayload> T read(BlockPointer pos, Class<T> payloadType)
BlockStoreread in interface BlockStorepublic void write(BlockPayload block)
BlockStorewrite in interface BlockStorepublic void attach(BlockPayload block)
BlockStoreBlockStore.write(BlockPayload) is called.attach in interface BlockStorepublic void flush()
BlockStoreflush in interface BlockStoreCopyright © 2013. All rights reserved