Constructor and Description |
---|
BlockDirectoryCache(BlockCache blockCache,
String path,
Metrics metrics) |
BlockDirectoryCache(BlockCache blockCache,
String path,
Metrics metrics,
boolean releaseBlocks) |
Modifier and Type | Method and Description |
---|---|
void |
delete(String name)
Remove a file from the cache.
|
boolean |
fetch(String name,
long blockId,
int blockOffset,
byte[] b,
int off,
int lengthToReadInBlock)
Fetch the specified cache file content.
|
BlockCache |
getBlockCache()
Expert: mostly for tests
|
void |
releaseResources()
Release any resources associated with the cache.
|
void |
renameCacheFile(String source,
String dest)
Expert: Rename the specified file in the cache.
|
long |
size()
Number of entries in the cache.
|
void |
update(String name,
long blockId,
int blockOffset,
byte[] buffer,
int offset,
int length)
Update the content of the specified cache file.
|
public BlockDirectoryCache(BlockCache blockCache, String path, Metrics metrics)
public BlockDirectoryCache(BlockCache blockCache, String path, Metrics metrics, boolean releaseBlocks)
public BlockCache getBlockCache()
public void delete(String name)
Cache
public void update(String name, long blockId, int blockOffset, byte[] buffer, int offset, int length)
Cache
public boolean fetch(String name, long blockId, int blockOffset, byte[] b, int off, int lengthToReadInBlock)
Cache
public long size()
Cache
public void renameCacheFile(String source, String dest)
Cache
renameCacheFile
in interface Cache
source
- original namedest
- final namepublic void releaseResources()
Cache
releaseResources
in interface Cache
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.