|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.flatfile.DataBlockCache
public class DataBlockCache
Used to cache the location of a chunk.
The idea is that hasData or hasMetaData is used before get or set. If cache results, won't have to read in header from data block.
| Field Summary | |
|---|---|
static int |
CACHE_ENTRY_SIZE
The number of entries to keep in memory for data or meta data chunks. |
| Constructor Summary | |
|---|---|
DataBlockCache()
|
|
| Method Summary | |
|---|---|
void |
add(DataBlockCacheEntry e,
boolean isMetaData)
Add a DataBlockCacheEntry to the cache. |
void |
clear()
Clear out the cache resources. |
DataBlockCacheEntry |
get(BigHash hash,
boolean isMetaData)
Returns the DataBlockCacheEntry from the cache if exists, or null if not there. |
void |
remove(BigHash h,
boolean isMetaData)
Remove a specific DataBlockCacheEntry from the cache, if there. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CACHE_ENTRY_SIZE
The number of entries to keep in memory for data or meta data chunks.
| Constructor Detail |
|---|
public DataBlockCache()
| Method Detail |
|---|
public void add(DataBlockCacheEntry e,
boolean isMetaData)
Add a DataBlockCacheEntry to the cache. Removes oldest entries if maximum size is exceeded.
e - isMetaData -
public DataBlockCacheEntry get(BigHash hash,
boolean isMetaData)
throws AssertionFailedException,
java.lang.Exception
Returns the DataBlockCacheEntry from the cache if exists, or null if not there.
hash - isMetaData -
AssertionFailedException
java.lang.Exceptionpublic void clear()
Clear out the cache resources.
public void remove(BigHash h,
boolean isMetaData)
Remove a specific DataBlockCacheEntry from the cache, if there. Otherwise, do nothing.
h - isMetaData -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||