public static class CacheInvalidationPolicy.CacheInvalidationPolicyDefault extends Object implements CacheInvalidationPolicy
CacheInvalidationPolicy.CacheInvalidationPolicyDefault| 构造器和说明 |
|---|
CacheInvalidationPolicyDefault() |
| 限定符和类型 | 方法和说明 |
|---|---|
List<LogSegment> |
evict(long[] followerNextIndices,
long safeEvictIndex,
long lastAppliedIndex,
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogCache.LogSegmentList segments,
int maxCachedSegments)
Determine which log segments should evict their log entry cache
|
public List<LogSegment> evict(long[] followerNextIndices, long safeEvictIndex, long lastAppliedIndex, org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogCache.LogSegmentList segments, int maxCachedSegments)
CacheInvalidationPolicyevict 在接口中 CacheInvalidationPolicyfollowerNextIndices - the next indices of all the follower peers. Null
if the local peer is not a leader.safeEvictIndex - the index up to which cache can be evicted. This
index depends on two factors:
1. the largest index belonging to a closed segment
2. the latest snapshotIndex
Logs with endIndex less than the max of these two
indices can be evicted.lastAppliedIndex - the last index that has been applied to state machinesegments - The list of log segments. The segments should be sorted in
ascending order according to log index.maxCachedSegments - the max number of segments with cached log entriesCopyright © 2017–2025 The Apache Software Foundation. All rights reserved.