@ThreadSafe public final class TtlBucket extends Object implements Comparable<TtlBucket>
PropertyKey.MASTER_TTL_CHECKER_INTERVAL_MS
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_RETRY_ATTEMPTS |
Constructor and Description |
---|
TtlBucket(long startTimeMs)
Creates a new instance of
TtlBucket . |
Modifier and Type | Method and Description |
---|---|
void |
addInode(Inode inode)
Adds an inode with default num of retry attempt to expire.
|
void |
addInode(Inode inode,
int numOfRetry)
Adds an inode to the bucket with a specific left retry number.
|
int |
compareTo(TtlBucket ttlBucket)
Compares this bucket's TTL interval start time to that of another bucket.
|
boolean |
equals(Object o)
Compares to a specific object.
|
Collection<Map.Entry<Long,Integer>> |
getInodeExpiries()
Get collection of inode to its left ttl process retry attempts.
|
Collection<Long> |
getInodeIds() |
long |
getTtlIntervalEndTimeMs() |
static long |
getTtlIntervalMs() |
long |
getTtlIntervalStartTimeMs() |
int |
hashCode()
Returns the hash code for the
TtlBucket . |
void |
removeInode(InodeView inode)
Removes an inode from the bucket.
|
int |
size() |
public static final int DEFAULT_RETRY_ATTEMPTS
public TtlBucket(long startTimeMs)
TtlBucket
.startTimeMs
- the start time to usepublic long getTtlIntervalStartTimeMs()
public long getTtlIntervalEndTimeMs()
public static long getTtlIntervalMs()
public Collection<Long> getInodeIds()
public Collection<Map.Entry<Long,Integer>> getInodeExpiries()
public void addInode(Inode inode)
inode
- public void addInode(Inode inode, int numOfRetry)
inode
- the inode to be addednumOfRetry
- num of retries left when added to the ttlbucketpublic void removeInode(InodeView inode)
inode
- the inode to be removedpublic int size()
public int compareTo(TtlBucket ttlBucket)
compareTo
in interface Comparable<TtlBucket>
ttlBucket
- the bucket to be compared togetTtlIntervalStartTimeMs()
from the two buckets are
the same, -1 when that value of current instance is smaller, otherwise, 1public boolean equals(Object o)
Copyright © 2023. All Rights Reserved.