public final class BitCaskDiskMap<T extends Serializable,R extends Serializable> extends DiskMap<T,R>
Inspired by https://github.com/basho/bitcask
| Modifier and Type | Class and Description |
|---|---|
static class |
BitCaskDiskMap.FileEntry
The file metadata that should be spilled to disk.
|
static class |
BitCaskDiskMap.ValueMetadata
The value relevant metadata.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
BUFFER_SIZE |
diskMapPath| Constructor and Description |
|---|
BitCaskDiskMap(String baseFilePath) |
BitCaskDiskMap(String baseFilePath,
boolean isCompressionEnabled) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
close()
Close and cleanup the Map.
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<T,R>> |
entrySet() |
static <R> R |
get(BitCaskDiskMap.ValueMetadata entry,
RandomAccessFile file,
boolean isCompressionEnabled) |
R |
get(Object key) |
boolean |
isEmpty() |
Iterator<R> |
iterator()
Custom iterator to iterate over values written to disk.
|
Set<T> |
keySet() |
R |
put(T key,
R value) |
void |
putAll(Map<? extends T,? extends R> m) |
R |
remove(Object key) |
int |
size() |
long |
sizeOfFileOnDiskInBytes()
Number of bytes spilled to disk.
|
Collection<R> |
values() |
Stream<R> |
valueStream() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllforEach, spliteratorpublic static final int BUFFER_SIZE
public BitCaskDiskMap(String baseFilePath, boolean isCompressionEnabled) throws IOException
IOExceptionpublic BitCaskDiskMap(String baseFilePath) throws IOException
IOExceptionpublic long sizeOfFileOnDiskInBytes()
public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
public boolean containsValue(Object value)
public static <R> R get(BitCaskDiskMap.ValueMetadata entry, RandomAccessFile file, boolean isCompressionEnabled)
public void clear()
public void close()
DiskMapclose in class DiskMap<T extends Serializable,R extends Serializable>public Collection<R> values()
Copyright © 2024 The Apache Software Foundation. All rights reserved.