You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/08/25 04:22:30 UTC

[GitHub] [druid] suneet-s commented on a change in pull request #10315: Handle internal kinesis sequence numbers when reporting lag

suneet-s commented on a change in pull request #10315:
URL: https://github.com/apache/druid/pull/10315#discussion_r476149085



##########
File path: extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java
##########
@@ -718,9 +718,11 @@ public String getEarliestSequenceNumber(StreamPartition<String> partition)
   {
     Map<String, Long> partitionLag = Maps.newHashMapWithExpectedSize(currentOffsets.size());
     for (Map.Entry<String, String> partitionOffset : currentOffsets.entrySet()) {
-      StreamPartition<String> partition = new StreamPartition<>(stream, partitionOffset.getKey());
-      long currentLag = getPartitionTimeLag(partition, partitionOffset.getValue());
-      partitionLag.put(partitionOffset.getKey(), currentLag);
+      if (KinesisSequenceNumber.isValidAWSKinesisSequence(partitionOffset.getValue())) {

Review comment:
       Can we add some tests for this? I don't know if we can simulate this scenario in an integration test, but can we add a unit test for this

##########
File path: extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisSequenceNumber.java
##########
@@ -62,7 +62,9 @@
   private KinesisSequenceNumber(String sequenceNumber, boolean isExclusive)
   {
     super(sequenceNumber, isExclusive);
-    if (END_OF_SHARD_MARKER.equals(sequenceNumber) || NO_END_SEQUENCE_NUMBER.equals(sequenceNumber)) {
+    if (END_OF_SHARD_MARKER.equals(sequenceNumber)
+        || NO_END_SEQUENCE_NUMBER.equals(sequenceNumber)
+        || EXPIRED_MARKER.equals(sequenceNumber)) {

Review comment:
       nit: use `isValidAWSKinesisSequence` instead
   ```suggestion
       if (!isValidAWSKinesisSequence(sequenceNumber)) {
   ```




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org