public class IgfsPerBlockLruEvictionPolicy extends Object implements EvictionPolicy<org.apache.ignite.internal.processors.igfs.IgfsBlockKey,byte[]>, IgfsPerBlockLruEvictionPolicyMXBean, Externalizable
Constructor and Description |
---|
IgfsPerBlockLruEvictionPolicy()
Default constructor.
|
IgfsPerBlockLruEvictionPolicy(long maxSize,
int maxBlocks)
Constructor.
|
IgfsPerBlockLruEvictionPolicy(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 |
readExternal(ObjectInput in) |
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.
|
void |
writeExternal(ObjectOutput out) |
public IgfsPerBlockLruEvictionPolicy()
public IgfsPerBlockLruEvictionPolicy(long maxSize, int maxBlocks)
maxSize
- Maximum size. When reached, eviction begins.maxBlocks
- Maximum amount of blocks. When reached, eviction begins.public IgfsPerBlockLruEvictionPolicy(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 EvictionPolicy<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 IgfsPerBlockLruEvictionPolicyMXBean
public void setMaxSize(long maxSize)
setMaxSize
in interface IgfsPerBlockLruEvictionPolicyMXBean
maxSize
- Maximum allowed size of data in all blocks in bytes.public int getMaxBlocks()
getMaxBlocks
in interface IgfsPerBlockLruEvictionPolicyMXBean
public void setMaxBlocks(int maxBlocks)
setMaxBlocks
in interface IgfsPerBlockLruEvictionPolicyMXBean
maxBlocks
- Maximum allowed amount of blocks.public Collection<String> getExcludePaths()
getExcludePaths
in interface IgfsPerBlockLruEvictionPolicyMXBean
public void setExcludePaths(@Nullable Collection<String> excludePaths)
setExcludePaths
in interface IgfsPerBlockLruEvictionPolicyMXBean
excludePaths
- Collection of regex for paths whose blocks must not be evicted.public long getCurrentSize()
getCurrentSize
in interface IgfsPerBlockLruEvictionPolicyMXBean
public int getCurrentBlocks()
getCurrentBlocks
in interface IgfsPerBlockLruEvictionPolicyMXBean
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
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
Ignite Fabric : ver. 1.1.0-incubating Release Date : May 20 2015