From 8f819f933423ac74c3fcc2f55e00929c5d2cd0a7 Mon Sep 17 00:00:00 2001 From: annie-mac Date: Thu, 28 Mar 2024 22:29:32 -0700 Subject: [PATCH] resolve comments --- .../resources/checkstyle/checkstyle-suppressions.xml | 4 ++-- sdk/cosmos/azure-cosmos-kafka-connect/pom.xml | 12 ++++++------ .../cosmos/kafka/connect/CosmosSinkConnector.java | 2 +- .../implementation/KafkaCosmosSchedulers.java | 2 +- .../connect/implementation/sink/CosmosSinkTask.java | 6 ++---- .../implementation/sink/CosmosWriteException.java | 3 --- 6 files changed, 12 insertions(+), 17 deletions(-) diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index b11579484fd0a..4e3e273ce58ce 100755 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -318,8 +318,8 @@ the main ServiceBusClientBuilder. --> - - + + diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml b/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml index 96977cfb7e6ca..09e1447d9d227 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml +++ b/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml @@ -44,16 +44,16 @@ Licensed under the MIT License. true + --add-opens com.azure.cosmos/com.azure.cosmos.implementation=ALL-UNNAMED + --add-opens com.azure.cosmos/com.azure.cosmos.implementation.apachecommons.lang=ALL-UNNAMED + --add-opens com.azure.cosmos/com.azure.cosmos.implementation.caches=ALL-UNNAMED + --add-opens com.azure.cosmos/com.azure.cosmos.implementation.faultinjection=ALL-UNNAMED + --add-opens com.azure.cosmos/com.azure.cosmos.implementation.routing=ALL-UNNAMED --add-opens com.azure.cosmos.kafka.connect/com.azure.cosmos.kafka.connect=ALL-UNNAMED --add-opens com.azure.cosmos.kafka.connect/com.azure.cosmos.kafka.connect.implementation=ALL-UNNAMED - --add-opens com.azure.cosmos.kafka.connect/com.azure.cosmos.kafka.connect.implementation.source=com.fasterxml.jackson.databind,ALL-UNNAMED --add-opens com.azure.cosmos.kafka.connect/com.azure.cosmos.kafka.connect.implementation.sink=ALL-UNNAMED --add-opens com.azure.cosmos.kafka.connect/com.azure.cosmos.kafka.connect.implementation.sink.idStrategy=ALL-UNNAMED - --add-opens com.azure.cosmos/com.azure.cosmos.implementation=ALL-UNNAMED - --add-opens com.azure.cosmos/com.azure.cosmos.implementation.routing=ALL-UNNAMED - --add-opens com.azure.cosmos/com.azure.cosmos.implementation.caches=ALL-UNNAMED - --add-opens com.azure.cosmos/com.azure.cosmos.implementation.faultinjection=ALL-UNNAMED - --add-opens com.azure.cosmos/com.azure.cosmos.implementation.apachecommons.lang=ALL-UNNAMED + --add-opens com.azure.cosmos.kafka.connect/com.azure.cosmos.kafka.connect.implementation.source=com.fasterxml.jackson.databind,ALL-UNNAMED diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosSinkConnector.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosSinkConnector.java index d713030b15c3f..ef38399c74396 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosSinkConnector.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosSinkConnector.java @@ -48,7 +48,7 @@ public List> taskConfigs(int maxTasks) { @Override public void stop() { - LOGGER.debug("Kafka Cosmos sink connector {} is stopped."); + LOGGER.info("Kafka Cosmos sink connector {} is stopped."); } @Override diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosSchedulers.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosSchedulers.java index 081d0baa30f2a..58784644d9620 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosSchedulers.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosSchedulers.java @@ -7,7 +7,7 @@ import reactor.core.scheduler.Schedulers; public class KafkaCosmosSchedulers { - private static final String SINK_BOUNDED_ELASTIC_THREAD_NAME = "sink-bounded-elastic"; + private static final String SINK_BOUNDED_ELASTIC_THREAD_NAME = "kafka-cosmos-sink-bounded-elastic"; private static final int TTL_FOR_SCHEDULER_WORKER_IN_SECONDS = 60; // same as BoundedElasticScheduler.DEFAULT_TTL_SECONDS public static final Scheduler SINK_BOUNDED_ELASTIC = Schedulers.newBoundedElastic( Schedulers.DEFAULT_BOUNDED_ELASTIC_SIZE, diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTask.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTask.java index 79d881169b3da..eba1e942732c8 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTask.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTask.java @@ -32,7 +32,7 @@ public String version() { @Override public void start(Map props) { - LOGGER.info("Starting the kafka cosmos sink task..."); + LOGGER.info("Starting the kafka cosmos sink task"); this.sinkTaskConfig = new CosmosSinkTaskConfig(props); this.cosmosClient = CosmosClientStore.getCosmosClient(this.sinkTaskConfig.getAccountConfig()); this.sinkRecordTransformer = new SinkRecordTransformer(this.sinkTaskConfig); @@ -85,11 +85,9 @@ record -> this.sinkTaskConfig @Override public void stop() { - LOGGER.info("Stopping Kafka CosmosDB sink task..."); + LOGGER.info("Stopping Kafka CosmosDB sink task"); if (this.cosmosClient != null) { this.cosmosClient.close(); } - - this.cosmosClient = null; } } diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosWriteException.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosWriteException.java index 11ee3d6d4a117..7892212fb2e47 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosWriteException.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosWriteException.java @@ -9,9 +9,6 @@ * Generic CosmosDb sink write exceptions. */ public class CosmosWriteException extends ConnectException { - /** - * - */ private static final long serialVersionUID = 1L; public CosmosWriteException(String message) {