public class IgfsPerBlockLruEvictionPolicy extends Object implements EvictionPolicy<org.apache.ignite.internal.processors.igfs.IgfsBlockKey,byte[]>, IgniteMBeanAware, Externalizable
Constructor and Description |
---|
IgfsPerBlockLruEvictionPolicy()
Default constructor.
|
IgfsPerBlockLruEvictionPolicy(long maxSize,
int maxBlocks)
Constructor.
|
IgfsPerBlockLruEvictionPolicy(long maxSize,
int maxBlocks,
@Nullable 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.
|
Object |
getMBean() |
void |
onEntryAccessed(boolean rmv,
EvictableEntry<org.apache.ignite.internal.processors.igfs.IgfsBlockKey,byte[]> entry)
Callback for whenever entry is accessed.
|
void |
readExternal(ObjectInput in) |
IgfsPerBlockLruEvictionPolicy |
setExcludePaths(@Nullable Collection<String> excludePaths)
Sets collection of regex for paths whose blocks must not be evicted.
|
IgfsPerBlockLruEvictionPolicy |
setMaxBlocks(int maxBlocks)
Sets maximum allowed amount of blocks.
|
IgfsPerBlockLruEvictionPolicy |
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 @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()
public IgfsPerBlockLruEvictionPolicy setMaxSize(long maxSize)
maxSize
- Maximum allowed size of data in all blocks in bytes.this
for chaining.public int getMaxBlocks()
public IgfsPerBlockLruEvictionPolicy setMaxBlocks(int maxBlocks)
maxBlocks
- Maximum allowed amount of blocks.this
for chaining.public Collection<String> getExcludePaths()
public IgfsPerBlockLruEvictionPolicy setExcludePaths(@Nullable @Nullable Collection<String> excludePaths)
excludePaths
- Collection of regex for paths whose blocks must not be evicted.this
for chaining.public long getCurrentSize()
public int getCurrentBlocks()
public Object getMBean()
getMBean
in interface IgniteMBeanAware
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 Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019