public interface CacheInvalidationPolicy
| Modifier and Type | Interface and Description |
|---|---|
static class |
CacheInvalidationPolicy.CacheInvalidationPolicyDefault |
| Modifier and Type | Method and Description |
|---|---|
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
|
List<LogSegment> evict(long[] followerNextIndices, long safeEvictIndex, long lastAppliedIndex, org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogCache.LogSegmentList segments, int maxCachedSegments)
followerNextIndices - 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–2023 The Apache Software Foundation. All rights reserved.