You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "AndrewJSchofield (via GitHub)" <gi...@apache.org> on 2024/05/30 12:01:24 UTC

[PR] KAFKA-16715: Create KafkaShareConsumer interfaces [kafka]

AndrewJSchofield opened a new pull request, #16134:
URL: https://github.com/apache/kafka/pull/16134

   This PR introduces ShareConsumer and KafkaShareConsumer. It is focused entirely on the minimal additions required to introduce the external programming interfaces.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-16715: Create KafkaShareConsumer interfaces [kafka]

Posted by "AndrewJSchofield (via GitHub)" <gi...@apache.org>.
AndrewJSchofield commented on PR #16134:
URL: https://github.com/apache/kafka/pull/16134#issuecomment-2139446089

   The build will not succeed until https://github.com/apache/kafka/pull/16022 is merged.


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-16715: Create KafkaShareConsumer interfaces [kafka]

Posted by "AndrewJSchofield (via GitHub)" <gi...@apache.org>.
AndrewJSchofield commented on PR #16134:
URL: https://github.com/apache/kafka/pull/16134#issuecomment-2144903896

   Closing and re-opening PR to force rebuild. This should fix the build failures because of a recent merge.


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-16715: Create KafkaShareConsumer interfaces [kafka]

Posted by "AndrewJSchofield (via GitHub)" <gi...@apache.org>.
AndrewJSchofield closed pull request #16134: KAFKA-16715: Create KafkaShareConsumer interfaces
URL: https://github.com/apache/kafka/pull/16134


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-16715: Create KafkaShareConsumer interfaces [kafka]

Posted by "omkreddy (via GitHub)" <gi...@apache.org>.
omkreddy commented on PR #16134:
URL: https://github.com/apache/kafka/pull/16134#issuecomment-2145321139

   there are checkstyle errors:
   
   ```
   [2024-06-03T13:13:54.181Z] * What went wrong:
   
   [2024-06-03T13:13:54.181Z] Execution failed for task ':clients:checkstyleMain'.
   
   [2024-06-03T13:13:54.181Z] > A failure occurred while executing org.gradle.api.plugins.quality.internal.CheckstyleAction
   
   [2024-06-03T13:13:54.181Z]    > Checkstyle rule violations were found. See the report at: file:///home/jenkins/workspace/Kafka_kafka-pr_PR-16134/clients/build/reports/checkstyle/main.html
   
   [2024-06-03T13:13:54.181Z]      Checkstyle files with violations: 1
   
   [2024-06-03T13:13:54.181Z]      Checkstyle violations by severity: [error:1]
   ```


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-16715: Create KafkaShareConsumer interfaces [kafka]

Posted by "omkreddy (via GitHub)" <gi...@apache.org>.
omkreddy commented on code in PR #16134:
URL: https://github.com/apache/kafka/pull/16134#discussion_r1624558823


##########
clients/src/main/java/org/apache/kafka/clients/consumer/MockShareConsumer.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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;
+
+import org.apache.kafka.clients.consumer.internals.SubscriptionState;
+import org.apache.kafka.common.KafkaException;
+import org.apache.kafka.common.Metric;
+import org.apache.kafka.common.MetricName;
+import org.apache.kafka.common.TopicIdPartition;
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.common.Uuid;
+import org.apache.kafka.common.utils.LogContext;
+
+import java.time.Duration;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import static org.apache.kafka.clients.consumer.internals.ConsumerUtils.DEFAULT_CLOSE_TIMEOUT_MS;
+
+/**
+ * A mock of the {@link ShareConsumer} interface you can use for testing code that uses Kafka. This class is <i> not
+ * thread-safe </i>.
+ */
+public class MockShareConsumer<K, V> implements ShareConsumer<K, V> {

Review Comment:
   Can we add tests to MockShareConsumer (similar to MockConsumerTest)?



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-16715: Create KafkaShareConsumer interfaces [kafka]

Posted by "AndrewJSchofield (via GitHub)" <gi...@apache.org>.
AndrewJSchofield commented on code in PR #16134:
URL: https://github.com/apache/kafka/pull/16134#discussion_r1624638311


##########
clients/src/main/java/org/apache/kafka/clients/consumer/MockShareConsumer.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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;
+
+import org.apache.kafka.clients.consumer.internals.SubscriptionState;
+import org.apache.kafka.common.KafkaException;
+import org.apache.kafka.common.Metric;
+import org.apache.kafka.common.MetricName;
+import org.apache.kafka.common.TopicIdPartition;
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.common.Uuid;
+import org.apache.kafka.common.utils.LogContext;
+
+import java.time.Duration;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import static org.apache.kafka.clients.consumer.internals.ConsumerUtils.DEFAULT_CLOSE_TIMEOUT_MS;
+
+/**
+ * A mock of the {@link ShareConsumer} interface you can use for testing code that uses Kafka. This class is <i> not
+ * thread-safe </i>.
+ */
+public class MockShareConsumer<K, V> implements ShareConsumer<K, V> {

Review Comment:
   Ah, I hadn't done that because I was putting this in as essentially just the interfaces, but I can do that. I'll do that in the next commit.



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-16715: Create KafkaShareConsumer interfaces [kafka]

Posted by "omkreddy (via GitHub)" <gi...@apache.org>.
omkreddy merged PR #16134:
URL: https://github.com/apache/kafka/pull/16134


-- 
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-unsubscribe@kafka.apache.org

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