SteveYurongSu commented on code in PR #11478:
URL: https://github.com/apache/iotdb/pull/11478#discussion_r1383156111
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/consensus/index/ProgressIndex.java:
##########
@@ -121,4 +132,58 @@ static ProgressIndex blendProgressIndex(
return new HybridProgressIndex(progressIndex1.getType().getType(),
progressIndex1)
.updateToMinimumIsAfterProgressIndex(progressIndex2);
}
+
+ static void topologicalSort(List<ProgressIndex> progressIndexList) {
+
progressIndexList.sort(Comparator.comparing(ProgressIndex::getTotalOrderSumTuple));
+ }
+
+ class TotalOrderSumTuple implements Comparable<TotalOrderSumTuple> {
+ private final ImmutableList<Long> tuple;
+
+ public TotalOrderSumTuple(Long... args) {
+ tuple = ImmutableList.copyOf(args);
+ }
+
+ public TotalOrderSumTuple(List<Long> list) {
+ tuple = ImmutableList.copyOf(list);
+ }
Review Comment:
```suggestion
private TotalOrderSumTuple(Long... args) {
tuple = ImmutableList.copyOf(args);
}
private TotalOrderSumTuple(List<Long> list) {
tuple = ImmutableList.copyOf(list);
}
```
--
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]