Skip to content

Commit

Permalink
fix build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
annie-mac committed Mar 28, 2024
1 parent 3b97b2f commit 6a25454
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import com.azure.cosmos.CosmosAsyncClient;
import com.azure.cosmos.CosmosAsyncContainer;
import com.azure.cosmos.implementation.ImplementationBridgeHelpers;
import com.azure.cosmos.implementation.Strings;
import com.azure.cosmos.implementation.Utils;
import com.azure.cosmos.implementation.apachecommons.lang.tuple.Pair;
import com.azure.cosmos.kafka.connect.implementation.CosmosClientStore;
import com.azure.cosmos.kafka.connect.implementation.CosmosConstants;
Expand All @@ -24,7 +22,6 @@
import com.azure.cosmos.kafka.connect.implementation.source.MetadataTaskUnit;
import com.azure.cosmos.models.CosmosContainerProperties;
import com.azure.cosmos.models.FeedRange;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.apache.kafka.common.config.ConfigDef;
import org.apache.kafka.connect.connector.Task;
import org.apache.kafka.connect.source.SourceConnector;
Expand Down Expand Up @@ -209,7 +206,7 @@ private Map<FeedRange, KafkaCosmosChangeFeedState> getEffectiveFeedRangesContinu
.flatMap(containerFeedRange -> {
if (feedRangesMetadataTopicOffset == null) {
return Mono.just(
Collections.singletonMap(containerFeedRange, (KafkaCosmosChangeFeedState)null));
Collections.singletonMap(containerFeedRange, (KafkaCosmosChangeFeedState) null));
} else {
// there is existing offsets, need to find out effective feedRanges based on the offset
return this.getEffectiveContinuationMapForSingleFeedRange(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,14 @@ public String getTopic() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}

if (o == null || getClass() != o.getClass()) {
return false;
}

FeedRangeTaskUnit that = (FeedRangeTaskUnit) o;
return Objects.equals(databaseName, that.databaseName)
&& Objects.equals(containerName, that.containerName)
Expand All @@ -101,14 +107,14 @@ public int hashCode() {

@Override
public String toString() {
return "FeedRangeTaskUnit{" +
"databaseName='" + databaseName + '\'' +
", containerName='" + containerName + '\'' +
", containerRid='" + containerRid + '\'' +
", feedRange=" + feedRange +
", continuationState=" + continuationState +
", topic='" + topic + '\'' +
'}';
return "FeedRangeTaskUnit{"
+ "databaseName='" + databaseName + '\''
+ ", containerName='" + containerName + '\''
+ ", containerRid='" + containerRid + '\''
+ ", feedRange=" + feedRange
+ ", continuationState=" + continuationState
+ ", topic='" + topic + '\''
+ '}';
}

public static class FeedRangeTaskUnitSerializer extends com.fasterxml.jackson.databind.JsonSerializer<FeedRangeTaskUnit> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ public String getItemLsn() {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}

if (o == null || getClass() != o.getClass()) {
return false;
}

KafkaCosmosChangeFeedState that = (KafkaCosmosChangeFeedState) o;
return Objects.equals(responseContinuation, that.responseContinuation)
&& Objects.equals(targetRange, that.targetRange)
Expand All @@ -64,11 +70,11 @@ public boolean equals(Object o) {

@Override
public String toString() {
return "KafkaCosmosChangeFeedState{" +
"responseContinuation='" + responseContinuation + '\'' +
", targetRange=" + targetRange +
", itemLsn='" + itemLsn + '\'' +
'}';
return "KafkaCosmosChangeFeedState{"
+ "responseContinuation='" + responseContinuation + '\''
+ ", targetRange=" + targetRange
+ ", itemLsn='" + itemLsn + '\''
+ '}';
}

@Override
Expand Down

0 comments on commit 6a25454

Please sign in to comment.