public class CacheIgfsPerBlockLruEvictionPolicy extends Object implements CacheEvictionPolicy<org.apache.ignite.internal.processors.igfs.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<org.apache.ignite.internal.processors.igfs.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<org.apache.ignite.internal.processors.igfs.IgfsBlockKey,byte[]> entry)
onEntryAccessed
in interface CacheEvictionPolicy<org.apache.ignite.internal.processors.igfs.IgfsBlockKey,byte[]>
rmv
- True
if entry has been removed, false
otherwise.entry
- Accessed entry.public long getMaxSize()
getMaxSize
in interface CacheIgfsPerBlockLruEvictionPolicyMXBean
public void setMaxSize(long maxSize)
setMaxSize
in interface CacheIgfsPerBlockLruEvictionPolicyMXBean
maxSize
- Maximum allowed size of data in all blocks in bytes.public int getMaxBlocks()
getMaxBlocks
in interface CacheIgfsPerBlockLruEvictionPolicyMXBean
public void setMaxBlocks(int maxBlocks)
setMaxBlocks
in interface CacheIgfsPerBlockLruEvictionPolicyMXBean
maxBlocks
- Maximum allowed amount of blocks.public Collection<String> getExcludePaths()
getExcludePaths
in interface CacheIgfsPerBlockLruEvictionPolicyMXBean
public void setExcludePaths(@Nullable Collection<String> excludePaths)
setExcludePaths
in interface CacheIgfsPerBlockLruEvictionPolicyMXBean
excludePaths
- Collection of regex for paths whose blocks must not be evicted.public long getCurrentSize()
getCurrentSize
in interface CacheIgfsPerBlockLruEvictionPolicyMXBean
public int getCurrentBlocks()
getCurrentBlocks
in interface CacheIgfsPerBlockLruEvictionPolicyMXBean
public 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
Apache Ignite Fabric : ver. 1.0.0-RC1 Release Date : February 16 2015