public class CacheIgfsPerBlockLruEvictionPolicy extends Object implements CacheEvictionPolicy<IgfsBlockKey,byte[]>, CacheIgfsPerBlockLruEvictionPolicyMXBean
| Constructor and Description |
|---|
CacheIgfsPerBlockLruEvictionPolicy()
Default constructor.
|
CacheIgfsPerBlockLruEvictionPolicy(long maxSize,
int maxBlocks)
Constructor.
|
CacheIgfsPerBlockLruEvictionPolicy(long maxSize,
int maxBlocks,
Collection<String> excludePaths)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
exclude(IgfsPath path)
Check whether provided path must be excluded from evictions.
|
int |
getCurrentBlocks()
Gets current amount of blocks.
|
long |
getCurrentSize()
Gets current size of data in all blocks.
|
Collection<String> |
getExcludePaths()
Gets collection of regex for paths whose blocks must not be evicted.
|
int |
getMaxBlocks()
Gets maximum allowed amount of blocks.
|
long |
getMaxSize()
Gets maximum allowed size of all blocks in bytes.
|
void |
onEntryAccessed(boolean rmv,
EvictableEntry<IgfsBlockKey,byte[]> entry)
Callback for whenever entry is accessed.
|
void |
setExcludePaths(Collection<String> excludePaths)
Sets collection of regex for paths whose blocks must not be evicted.
|
void |
setMaxBlocks(int maxBlocks)
Sets maximum allowed amount of blocks.
|
void |
setMaxSize(long maxSize)
Sets maximum allowed size of data in all blocks in bytes.
|
public CacheIgfsPerBlockLruEvictionPolicy()
public CacheIgfsPerBlockLruEvictionPolicy(long maxSize,
int maxBlocks)
maxSize - Maximum size. When reached, eviction begins.maxBlocks - Maximum amount of blocks. When reached, eviction begins.public CacheIgfsPerBlockLruEvictionPolicy(long maxSize,
int maxBlocks,
@Nullable
Collection<String> excludePaths)
maxSize - Maximum size. When reached, eviction begins.maxBlocks - Maximum amount of blocks. When reached, eviction begins.excludePaths - Collection of regex for path which must not be evicted.public void onEntryAccessed(boolean rmv,
EvictableEntry<IgfsBlockKey,byte[]> entry)
onEntryAccessed in interface CacheEvictionPolicy<IgfsBlockKey,byte[]>rmv - True if entry has been removed, false otherwise.entry - Accessed entry.public long getMaxSize()
getMaxSize in interface CacheIgfsPerBlockLruEvictionPolicyMXBeanpublic void setMaxSize(long maxSize)
setMaxSize in interface CacheIgfsPerBlockLruEvictionPolicyMXBeanmaxSize - Maximum allowed size of data in all blocks in bytes.public int getMaxBlocks()
getMaxBlocks in interface CacheIgfsPerBlockLruEvictionPolicyMXBeanpublic void setMaxBlocks(int maxBlocks)
setMaxBlocks in interface CacheIgfsPerBlockLruEvictionPolicyMXBeanmaxBlocks - Maximum allowed amount of blocks.public Collection<String> getExcludePaths()
getExcludePaths in interface CacheIgfsPerBlockLruEvictionPolicyMXBeanpublic void setExcludePaths(@Nullable Collection<String> excludePaths)
setExcludePaths in interface CacheIgfsPerBlockLruEvictionPolicyMXBeanexcludePaths - Collection of regex for paths whose blocks must not be evicted.public long getCurrentSize()
getCurrentSize in interface CacheIgfsPerBlockLruEvictionPolicyMXBeanpublic int getCurrentBlocks()
getCurrentBlocks in interface CacheIgfsPerBlockLruEvictionPolicyMXBeanpublic boolean exclude(IgfsPath path) throws IgniteCheckedException
path - Path.True in case non block of related file must be excluded.IgniteCheckedException - In case of faulty patterns.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015