Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues relating deprecated interfaces in upstream kafka #3395

Draft
wants to merge 2 commits into
base: 7.8.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
package io.confluent.kafka.serializers;

import io.confluent.kafka.schemaregistry.client.SchemaRegistryClient;
import kafka.serializer.Decoder;
import kafka.utils.VerifiableProperties;

import org.apache.avro.Schema;
import org.apache.kafka.tools.api.Decoder;

public class KafkaAvroDecoder extends AbstractKafkaAvroDeserializer implements Decoder<Object> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.confluent.kafka.schemaregistry.storage.StoreUpdateHandler.ValidationStatus;
import io.confluent.kafka.schemaregistry.utils.ShutdownableThread;
import java.io.IOException;
import java.time.Duration;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -194,7 +195,7 @@ public Map<TopicPartition, Long> checkpoints() {
@Override
public void doWork() {
try {
ConsumerRecords<byte[], byte[]> records = consumer.poll(Long.MAX_VALUE);
ConsumerRecords<byte[], byte[]> records = consumer.poll(Duration.ofMillis(Long.MAX_VALUE));
storeUpdateHandler.startBatch(records.count());
for (ConsumerRecord<byte[], byte[]> record : records) {
K messageKey = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void setUp() throws Exception {

private void createPrincipal(File keytab, String principalNoRealm) throws Exception {
Seq<String> principals = JavaConverters.asScalaBuffer(
Arrays.asList(principalNoRealm)
Arrays.asList(principalNoRealm)
).toList();
kdc.createPrincipal(keytab, principals);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package io.confluent.kafka.schemaregistry.client;

import io.confluent.kafka.serializers.context.strategy.ContextNameStrategy;
import java.time.Duration;
import java.util.Map;
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericData;
Expand Down Expand Up @@ -84,7 +85,7 @@ private ArrayList<Object> consume(Consumer<String, Object> consumer, String topi

int i = 0;
while (i < numMessages) {
ConsumerRecords<String, Object> records = consumer.poll(1000);
ConsumerRecords<String, Object> records = consumer.poll(Duration.ofMillis(1000));
for (ConsumerRecord<String, Object> record : records) {
recordList.add(record.value());
i++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.confluent.kafka.schemaregistry.avro.AvroSchema;
import io.confluent.kafka.schemaregistry.avro.AvroSchemaProvider;
import io.confluent.kafka.schemaregistry.client.rest.entities.SubjectVersion;
import java.time.Duration;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
Expand Down Expand Up @@ -81,7 +82,7 @@ private ArrayList<Object> consume(Consumer<String, Object> consumer, String topi

int i = 0;
while (i < numMessages) {
ConsumerRecords<String, Object> records = consumer.poll(1000);
ConsumerRecords<String, Object> records = consumer.poll(Duration.ofMillis(1000));
for (ConsumerRecord<String, Object> record : records) {
recordList.add(record.value());
i++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

package io.confluent.kafka.serializers;

import kafka.serializer.Decoder;
import kafka.utils.VerifiableProperties;

import org.apache.kafka.tools.api.Decoder;

/**
* Decode JSON data to an Object.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import io.confluent.kafka.serializers.KafkaAvroSerializer;
import io.confluent.kafka.serializers.WrapperKeyDeserializer;
import io.confluent.kafka.serializers.WrapperKeySerializer;
import java.time.Duration;
import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -166,7 +167,7 @@ private static List<Map.Entry<String, Object>> consume(Consumer<String, Object>

int i = 0;
do {
ConsumerRecords<String, Object> records = consumer.poll(1000);
ConsumerRecords<String, Object> records = consumer.poll(Duration.ofMillis(1000));
for (ConsumerRecord<String, Object> record : records) {
recordList.add(new SimpleEntry<>(record.key(), record.value()));
i++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import io.confluent.kafka.serializers.protobuf.KafkaProtobufDeserializer;
import io.confluent.kafka.serializers.protobuf.KafkaProtobufDeserializerConfig;
import io.confluent.kafka.serializers.protobuf.KafkaProtobufSerializer;
import java.time.Duration;
import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -159,7 +160,7 @@ private static List<Map.Entry<String, Object>> consume(Consumer<String, Object>

int i = 0;
do {
ConsumerRecords<String, Object> records = consumer.poll(1000);
ConsumerRecords<String, Object> records = consumer.poll(Duration.ofMillis(1000));
for (ConsumerRecord<String, Object> record : records) {
recordList.add(new SimpleEntry<>(record.key(), record.value()));
i++;
Expand Down