THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
def calculateRemoteTierSize() {
// Find the leader epochs from leader epoch cache.
val validLeaderEpochs = fromLeaderEpochCacheToEpochs(log)
// For each leader epoch in current lineage, calculate size of log
val remoteLogSizeBytes = validLeaderEpochs.map(epoch => rlmm.remoteLogSize(tp, epoch)).sum
remoteLogSizeBytes
}// the new API would be used for size based retention as:
val totalLogSize = remoteLogSizeBytes + log.localOnlyLogSegmentsSize
var remainingSize = if (shouldDeleteBySize) totalLogSize - retentionSize else 0
val segmentsIterator = remoteLogMetadataManager.listRemoteLogSegment
while (remainingSize > 0 && segmentsIterator.hasNext) { // delete segments } |
...