OneSizeFitsQuorum commented on code in PR #14934:
URL: https://github.com/apache/iotdb/pull/14934#discussion_r1967471038
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/partition/SeriesPartitionTable.java:
##########
@@ -245,10 +246,19 @@ public TConsensusGroupId getLastConsensusGroupId() {
* @param TTL The Time To Live
* @param currentTimeSlot The current TimeSlot
*/
- public void autoCleanPartitionTable(long TTL, TTimePartitionSlot
currentTimeSlot) {
+ public List<TTimePartitionSlot> autoCleanPartitionTable(
+ long TTL, TTimePartitionSlot currentTimeSlot) {
+ List<TTimePartitionSlot> removedTimePartitions = new ArrayList<>();
Review Comment:
```
List<TTimePartitionSlot> removedTimePartitions = new ArrayList<>();
Iterator<Entry<TTimePartitionSlot, List<TConsensusGroupId>>> iterator =
seriesPartitionMap.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<TTimePartitionSlot, List<TConsensusGroupId>> entry =
iterator.next();
TTimePartitionSlot timePartitionSlot = entry.getKey();
if (timePartitionSlot.getStartTime() + TTL <
currentTimeSlot.getStartTime()) {
removedTimePartitions.add(timePartitionSlot);
iterator.remove();
}
}
return removedTimePartitions;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]