gguptp commented on code in PR #166:
URL: 
https://github.com/apache/flink-connector-aws/pull/166#discussion_r1762621737


##########
flink-connector-aws/flink-connector-dynamodb/src/main/java/org/apache/flink/connector/dynamodb/source/enumerator/tracker/SplitTracker.java:
##########
@@ -250,6 +252,24 @@ public Set<String> getKnownSplitIds() {
         return knownSplits.keySet();
     }
 
+    public List<Shard> getKnownShards() {
+        return knownSplits
+                .values()
+                .parallelStream()
+                .filter(
+                        split ->
+                                
!ShardUtils.isShardOlderThanInconsistencyDetectionRetentionPeriod(
+                                        split.splitId()))
+                .map(
+                        split ->
+                                Shard.builder()
+                                        .shardId(split.splitId())
+                                        
.parentShardId(split.getParentShardId())
+                                        
.sequenceNumberRange(SequenceNumberRange.builder().build())
+                                        .build())

Review Comment:
   yes, you're right, here we are under assumption that there's no inconsistent 
shard returend from splitTracker so all leaf nodes are open. The shard returned 
from incremental shard discovery will remove the open leaf node and add itself 
as a leaf node



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to