Class DeltaBaseCache
java.lang.Object
org.eclipse.jgit.internal.storage.dfs.DeltaBaseCache
Caches recently used objects for
DfsReader
.
This cache is not thread-safe. Each reader should have its own cache.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private DeltaBaseCache.Entry
private DeltaBaseCache.Entry
private static final int
private int
private final DeltaBaseCache.Entry[]
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) DeltaBaseCache.Entry
get
(DfsStreamKey key, long position) (package private) int
(package private) int
(package private) int
private static int
hash
(long position) private void
private void
private void
(package private) void
put
(DfsStreamKey key, long offset, int objectType, byte[] data) private void
private void
-
Field Details
-
TABLE_BITS
private static final int TABLE_BITS- See Also:
-
MASK_BITS
private static final int MASK_BITS- See Also:
-
maxByteCount
private int maxByteCount -
curByteCount
private int curByteCount -
table
-
lruHead
-
lruTail
-
-
Constructor Details
-
DeltaBaseCache
DeltaBaseCache(DfsReader reader) -
DeltaBaseCache
DeltaBaseCache(int maxBytes)
-
-
Method Details
-
hash
private static int hash(long position) -
get
-
put
-
releaseMemory
private void releaseMemory() -
removeFromTable
-
moveToHead
-
lruRemove
-
lruPushHead
-
getMemoryUsed
int getMemoryUsed() -
getMemoryUsedByLruChainForTest
int getMemoryUsedByLruChainForTest() -
getMemoryUsedByTableForTest
int getMemoryUsedByTableForTest()
-