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

[KSQL-12787] Fix master build #10596

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions ksqldb-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@

<dependencies>

<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.2</version>
hrishabhg marked this conversation as resolved.
Show resolved Hide resolved
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import com.google.common.collect.ImmutableMap;
import io.vertx.core.buffer.Buffer;
import jakarta.xml.bind.DatatypeConverter;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.StandardCharsets;
Expand All @@ -25,7 +26,6 @@
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import javax.xml.bind.DatatypeConverter;

public final class BytesUtils {
public enum Encoding {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static io.confluent.ksql.internal.MetricsTagUtils.SHARED_RUNTIME_THREAD_PATTERN;
import static io.confluent.ksql.internal.MetricsTagUtils.UNSHARED_RUNTIME_THREAD_PATTERN;
import static java.util.Objects.requireNonNull;
import static org.apache.kafka.common.utils.Utils.mkSet;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableMap;
Expand Down Expand Up @@ -52,7 +51,7 @@ public class ThroughputMetricsReporter implements MetricsReporter {
private static final String RECORDS_PRODUCED = "records-produced-total";
private static final String BYTES_PRODUCED = "bytes-produced-total";
private static final Set<String> THROUGHPUT_METRIC_NAMES =
mkSet(RECORDS_CONSUMED, BYTES_CONSUMED, RECORDS_PRODUCED, BYTES_PRODUCED);
Set.of(RECORDS_CONSUMED, BYTES_CONSUMED, RECORDS_PRODUCED, BYTES_PRODUCED);

private static final Map<String, Map<String, Map<MetricName, ThroughputTotalMetric>>> metrics =
new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import java.util.concurrent.TimeUnit;
import org.apache.kafka.clients.admin.Admin;
import org.apache.kafka.clients.admin.ElectLeadersOptions;
import org.apache.kafka.common.metrics.KafkaMetric;
import org.apache.kafka.common.metrics.Measurable;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
Expand All @@ -47,6 +49,12 @@ public static Collection<TestCase<Admin>> getMethodsToTest() {
.ignoreUnchecked("close", long.class, TimeUnit.class)
.setDefault(ElectLeadersOptions.class, new ElectLeadersOptions())
.setDefault(Optional.class, Optional.empty())
.setDefault(KafkaMetric.class, new KafkaMetric(
null,
null,
(Measurable) (config, now) -> 0,
null,
null))
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.util.concurrent.TimeUnit;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.metrics.KafkaMetric;
import org.apache.kafka.common.metrics.Measurable;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
Expand All @@ -48,6 +50,12 @@ public static Collection<TestCase<Consumer>> getMethodsToTest() {
.ignore("wakeup")
.ignore("groupMetadata")
.setDefault(TopicPartition.class, new TopicPartition("t", 1))
.setDefault(KafkaMetric.class, new KafkaMetric(
null,
null,
(Measurable) (config, now) -> 0,
null,
null))
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.fail;
import static org.junit.Assert.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code style change, should be reverted.

import static org.junit.internal.matchers.ThrowableMessageMatcher.hasMessage;

import com.google.common.collect.ImmutableList;
Expand All @@ -39,7 +38,6 @@
import io.confluent.ksql.util.DecimalUtil;
import io.confluent.ksql.util.KsqlConfig;
import io.confluent.ksql.util.KsqlException;
import io.confluent.ksql.util.KsqlPreconditions;
import java.math.BigDecimal;
import java.nio.ByteBuffer;
import java.time.LocalDate;
Expand All @@ -53,7 +51,6 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.avro.Conversions.DecimalConversion;
import org.apache.avro.LogicalTypes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.fail;
import static org.junit.Assert.*;
import static org.junit.internal.matchers.ThrowableMessageMatcher.hasMessage;

import com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -987,7 +986,6 @@ public void shouldSerializeMapOfStruct() {
ImmutableMap.of(new Utf8("k"), avroOrder),
MAP_VALUE_ORDER_AVRO_SCHEMA
);

final GenericArray<?> actual = deserialize(bytes);
assertThat(actual, is(expected));
}
Expand Down