final class DeltaBaseCache
extends java.lang.Object
DfsReader
.
This cache is not thread-safe. Each reader should have its own cache.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
DeltaBaseCache.Entry |
Modifier and Type | Field and Description |
---|---|
private int |
curByteCount |
private DeltaBaseCache.Entry |
lruHead |
private DeltaBaseCache.Entry |
lruTail |
private static int |
MASK_BITS |
private int |
maxByteCount |
private DeltaBaseCache.Entry[] |
table |
private static int |
TABLE_BITS |
Constructor and Description |
---|
DeltaBaseCache(DfsReader reader) |
DeltaBaseCache(int maxBytes) |
Modifier and Type | Method and Description |
---|---|
(package private) DeltaBaseCache.Entry |
get(DfsStreamKey key,
long position) |
(package private) int |
getMemoryUsed() |
(package private) int |
getMemoryUsedByLruChainForTest() |
(package private) int |
getMemoryUsedByTableForTest() |
private static int |
hash(long position) |
private void |
lruPushHead(DeltaBaseCache.Entry e) |
private void |
lruRemove(DeltaBaseCache.Entry e) |
private void |
moveToHead(DeltaBaseCache.Entry e) |
(package private) void |
put(DfsStreamKey key,
long offset,
int objectType,
byte[] data) |
private void |
releaseMemory() |
private void |
removeFromTable(DeltaBaseCache.Entry e) |
private static final int TABLE_BITS
private static final int MASK_BITS
private int maxByteCount
private int curByteCount
private final DeltaBaseCache.Entry[] table
private DeltaBaseCache.Entry lruHead
private DeltaBaseCache.Entry lruTail
DeltaBaseCache(DfsReader reader)
DeltaBaseCache(int maxBytes)
private static int hash(long position)
DeltaBaseCache.Entry get(DfsStreamKey key, long position)
void put(DfsStreamKey key, long offset, int objectType, byte[] data)
private void releaseMemory()
private void removeFromTable(DeltaBaseCache.Entry e)
private void moveToHead(DeltaBaseCache.Entry e)
private void lruRemove(DeltaBaseCache.Entry e)
private void lruPushHead(DeltaBaseCache.Entry e)
int getMemoryUsed()
int getMemoryUsedByLruChainForTest()
int getMemoryUsedByTableForTest()