public class GridCacheGgfsPerBlockLruEvictionPolicy extends Object implements org.gridgain.grid.cache.eviction.GridCacheEvictionPolicy<GridGgfsBlockKey,byte[]>, GridCacheGgfsPerBlockLruEvictionPolicyMBean
| Modifier and Type | Field and Description |
|---|---|
static String |
META_NODE
Meta denoting node in the queue.
|
| Constructor and Description |
|---|
GridCacheGgfsPerBlockLruEvictionPolicy()
Default constructor.
|
GridCacheGgfsPerBlockLruEvictionPolicy(long maxSize,
int maxBlocks)
Constructor.
|
GridCacheGgfsPerBlockLruEvictionPolicy(long maxSize,
int maxBlocks,
Collection<String> excludePaths)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
exclude(org.gridgain.grid.ggfs.GridGgfsPath 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,
org.gridgain.grid.cache.GridCacheEntry<GridGgfsBlockKey,byte[]> entry) |
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 static final String META_NODE
public GridCacheGgfsPerBlockLruEvictionPolicy()
public GridCacheGgfsPerBlockLruEvictionPolicy(long maxSize,
int maxBlocks)
maxSize - Maximum size. When reached, eviction begins.maxBlocks - Maximum amount of blocks. When reached, eviction begins.public GridCacheGgfsPerBlockLruEvictionPolicy(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,
org.gridgain.grid.cache.GridCacheEntry<GridGgfsBlockKey,byte[]> entry)
onEntryAccessed in interface org.gridgain.grid.cache.eviction.GridCacheEvictionPolicy<GridGgfsBlockKey,byte[]>public long getMaxSize()
getMaxSize in interface GridCacheGgfsPerBlockLruEvictionPolicyMBeanpublic void setMaxSize(long maxSize)
setMaxSize in interface GridCacheGgfsPerBlockLruEvictionPolicyMBeanmaxSize - Maximum allowed size of data in all blocks in bytes.public int getMaxBlocks()
getMaxBlocks in interface GridCacheGgfsPerBlockLruEvictionPolicyMBeanpublic void setMaxBlocks(int maxBlocks)
setMaxBlocks in interface GridCacheGgfsPerBlockLruEvictionPolicyMBeanmaxBlocks - Maximum allowed amount of blocks.public Collection<String> getExcludePaths()
getExcludePaths in interface GridCacheGgfsPerBlockLruEvictionPolicyMBeanpublic void setExcludePaths(@Nullable
Collection<String> excludePaths)
setExcludePaths in interface GridCacheGgfsPerBlockLruEvictionPolicyMBeanexcludePaths - Collection of regex for paths whose blocks must not be evicted.public long getCurrentSize()
getCurrentSize in interface GridCacheGgfsPerBlockLruEvictionPolicyMBeanpublic int getCurrentBlocks()
getCurrentBlocks in interface GridCacheGgfsPerBlockLruEvictionPolicyMBeanpublic boolean exclude(org.gridgain.grid.ggfs.GridGgfsPath path)
throws org.gridgain.grid.GridException
path - Path.True in case non block of related file must be excluded.org.gridgain.grid.GridException - In case of faulty patterns.Copyright © 2014. All rights reserved.