VGalaxies commented on code in PR #15515:
URL: https://github.com/apache/iotdb/pull/15515#discussion_r2094763670
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/dataregion/realtime/assigner/PipeTimePartitionProgressIndexKeeper.java:
##########
@@ -31,51 +29,36 @@
public class PipeTimePartitionProgressIndexKeeper {
// data region id -> (time partition id, <max progress index, is valid>)
- private final Map<String, Map<Long, Pair<ProgressIndex, Boolean>>>
progressIndexKeeper =
+ private final Map<String, Map<String, ProgressIndex>> progressIndexKeeper =
new ConcurrentHashMap<>();
public synchronized void updateProgressIndex(
- final String dataRegionId, final long timePartitionId, final
ProgressIndex progressIndex) {
+ final String dataRegionId, final String tsFileName, final ProgressIndex
progressIndex) {
progressIndexKeeper
.computeIfAbsent(dataRegionId, k -> new ConcurrentHashMap<>())
.compute(
- timePartitionId,
- (k, v) -> {
- if (v == null) {
- return new Pair<>(progressIndex, true);
- }
- return new Pair<>(
-
v.getLeft().updateToMinimumEqualOrIsAfterProgressIndex(progressIndex), true);
- });
+ tsFileName,
+ (k, v) ->
+ v == null
+ ? progressIndex
+ :
v.updateToMinimumEqualOrIsAfterProgressIndex(progressIndex));
}
public synchronized void eliminateProgressIndex(
- final String dataRegionId, final long timePartitionId, final
ProgressIndex progressIndex) {
+ final String dataRegionId, final String filePath) {
progressIndexKeeper
.computeIfAbsent(dataRegionId, k -> new ConcurrentHashMap<>())
- .compute(
- timePartitionId,
- (k, v) -> {
- if (v == null) {
- return null;
- }
- if (v.getRight() && !v.getLeft().isAfter(progressIndex)) {
- return new Pair<>(v.getLeft(), false);
- }
- return v;
- });
+ .remove(filePath);
Review Comment:
Why is the corresponding progress index directly eliminated here, instead of
after a tsfile epoch ends?
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/dataregion/realtime/assigner/PipeTimePartitionProgressIndexKeeper.java:
##########
@@ -31,51 +29,36 @@
public class PipeTimePartitionProgressIndexKeeper {
// data region id -> (time partition id, <max progress index, is valid>)
- private final Map<String, Map<Long, Pair<ProgressIndex, Boolean>>>
progressIndexKeeper =
+ private final Map<String, Map<String, ProgressIndex>> progressIndexKeeper =
new ConcurrentHashMap<>();
public synchronized void updateProgressIndex(
- final String dataRegionId, final long timePartitionId, final
ProgressIndex progressIndex) {
+ final String dataRegionId, final String tsFileName, final ProgressIndex
progressIndex) {
progressIndexKeeper
.computeIfAbsent(dataRegionId, k -> new ConcurrentHashMap<>())
.compute(
- timePartitionId,
- (k, v) -> {
- if (v == null) {
- return new Pair<>(progressIndex, true);
- }
- return new Pair<>(
-
v.getLeft().updateToMinimumEqualOrIsAfterProgressIndex(progressIndex), true);
- });
+ tsFileName,
+ (k, v) ->
+ v == null
+ ? progressIndex
+ :
v.updateToMinimumEqualOrIsAfterProgressIndex(progressIndex));
}
public synchronized void eliminateProgressIndex(
- final String dataRegionId, final long timePartitionId, final
ProgressIndex progressIndex) {
+ final String dataRegionId, final String filePath) {
progressIndexKeeper
.computeIfAbsent(dataRegionId, k -> new ConcurrentHashMap<>())
- .compute(
- timePartitionId,
- (k, v) -> {
- if (v == null) {
- return null;
- }
- if (v.getRight() && !v.getLeft().isAfter(progressIndex)) {
- return new Pair<>(v.getLeft(), false);
- }
- return v;
- });
+ .remove(filePath);
Review Comment:
Why is the corresponding progress index directly eliminated here, instead of
after the tsfile epoch ends?
--
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]