Skip to content

Commit

Permalink
Precommit null check (#34)
Browse files Browse the repository at this point in the history
* null check

* shouldnt hide appId

Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
  • Loading branch information
ohadbitt and ohbitton authored Aug 4, 2020
1 parent 51d8e34 commit 41f1513
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<groupId>com.microsoft.azure</groupId>
<artifactId>kafka-sink-azure-kusto</artifactId>
<packaging>jar</packaging>
<version>1.0.0</version>
<version>1.0.1</version>
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,11 @@ public Map<TopicPartition, OffsetAndMetadata> preCommit(
throw new ConnectException("Topic Partition not configured properly. " +
"verify your `topics` and `kusto.tables.topics.mapping` configurations");
}
Long offset = writers.get(tp).lastCommittedOffset + 1;

if (offset != null) {
Long lastCommittedOffset = writers.get(tp).lastCommittedOffset;

if (lastCommittedOffset != null) {
Long offset = lastCommittedOffset + 1L;
log.debug("Forwarding to framework request to commit offset: {} for {} while the offset is {}", offset, tp, offsets.get(tp));
offsetsToCommit.put(tp, new OffsetAndMetadata(offset));
}
Expand Down

0 comments on commit 41f1513

Please sign in to comment.