lianetm commented on code in PR #14346:
URL: https://github.com/apache/kafka/pull/14346#discussion_r1322059077


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetsForLeaderEpochUtils.java:
##########
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.clients.consumer.internals;
+
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.common.errors.TopicAuthorizationException;
+import 
org.apache.kafka.common.message.OffsetForLeaderEpochRequestData.OffsetForLeaderPartition;
+import 
org.apache.kafka.common.message.OffsetForLeaderEpochRequestData.OffsetForLeaderTopic;
+import 
org.apache.kafka.common.message.OffsetForLeaderEpochRequestData.OffsetForLeaderTopicCollection;
+import 
org.apache.kafka.common.message.OffsetForLeaderEpochResponseData.EpochEndOffset;
+import 
org.apache.kafka.common.message.OffsetForLeaderEpochResponseData.OffsetForLeaderTopicResult;
+import org.apache.kafka.common.protocol.Errors;
+import org.apache.kafka.common.record.RecordBatch;
+import org.apache.kafka.common.requests.AbstractRequest;
+import org.apache.kafka.common.requests.OffsetsForLeaderEpochRequest;
+import org.apache.kafka.common.requests.OffsetsForLeaderEpochResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Utility methods for preparing requests to the OffsetsForLeaderEpoch API and 
handling responses.
+ */
+public final class OffsetsForLeaderEpochUtils {
+
+    private static final Logger LOG = 
LoggerFactory.getLogger(OffsetsForLeaderEpochUtils.class);
+
+    private OffsetsForLeaderEpochUtils(){}

Review Comment:
   `OffsetsForLeaderEpochUtils` was never an instantiate-able object, but the 
logic contained in its `handleResponse` function came from another class 
(`OffsetsForLeaderEpochClient`), and that one did have a log context passed 
through its constructor. 
   
   That being said, I saw the common pattern of utils classes using a logger 
for the class instead of retrieving from the log context so took the same 
approach here (ex. 
[ClientUtils](https://github.com/apache/kafka/blob/39cc19c9924cd5589dc5b98b75ec8d380c159205/clients/src/main/java/org/apache/kafka/clients/ClientUtils.java#L49),
 
[ConfigUtils](https://github.com/apache/kafka/blob/39cc19c9924cd5589dc5b98b75ec8d380c159205/clients/src/main/java/org/apache/kafka/common/utils/ConfigUtils.java#L38)).
   
   This seemed aligned with other utils classes but let me know if you think we 
should introduce a logContext here and I can totally make the change



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

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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

Reply via email to