-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
813a66f
commit a4dbded
Showing
5 changed files
with
105 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/com/snowflake/kafka/connector/internal/OffsetScanResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.snowflake.kafka.connector.internal; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import org.apache.commons.lang3.tuple.Pair; | ||
|
||
public class OffsetScanResult { | ||
private final List<Pair<Long, Long>> continuousOffsets; | ||
private final List<Pair<Long, Long>> missingOffsets; | ||
|
||
private static String parseList(List<Pair<Long, Long>> list) { | ||
return list.stream() | ||
.map(range -> "[" + range.getLeft() + "," + range.getRight() + "]") | ||
.collect(Collectors.joining("", "[", "]")); | ||
} | ||
|
||
public OffsetScanResult( | ||
List<Pair<Long, Long>> continuousOffsets, List<Pair<Long, Long>> missingOffsets) { | ||
this.continuousOffsets = continuousOffsets; | ||
this.missingOffsets = missingOffsets; | ||
} | ||
|
||
public String getContinuousOffsets() { | ||
return parseList(continuousOffsets); | ||
} | ||
|
||
public String getMissingOffsets() { | ||
return parseList(missingOffsets); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters