diff --git a/build.gradle b/build.gradle index 2a8ab3a4be212..28ec61b5bfdb3 100644 --- a/build.gradle +++ b/build.gradle @@ -204,16 +204,11 @@ def determineCommitId() { def excludedSpotlessModules = [':clients', ':connect:runtime', ':core', - ':examples', - ':generator', ':group-coordinator:group-coordinator-api', // https://github.com/apache/kafka/pull/16198 ':group-coordinator', - ':jmh-benchmarks', - ':log4j-appender', ':metadata', ':raft', ':server', - ':shell', ':storage', ':storage:storage-api', // rename in settings.gradle ':streams', @@ -242,8 +237,7 @@ def excludedSpotlessModules = [':clients', ':streams:upgrade-system-tests-34', ':streams:upgrade-system-tests-35', ':streams:upgrade-system-tests-36', - ':streams:upgrade-system-tests-37', - ':trogdor'] + ':streams:upgrade-system-tests-37'] apply from: file('wrapper.gradle') diff --git a/generator/src/main/java/org/apache/kafka/message/MessageGenerator.java b/generator/src/main/java/org/apache/kafka/message/MessageGenerator.java index ebffb4d88d2da..8cc4b5077a6dd 100644 --- a/generator/src/main/java/org/apache/kafka/message/MessageGenerator.java +++ b/generator/src/main/java/org/apache/kafka/message/MessageGenerator.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; + import net.sourceforge.argparse4j.ArgumentParsers; import net.sourceforge.argparse4j.inf.ArgumentParser; import net.sourceforge.argparse4j.inf.Namespace; diff --git a/generator/src/test/java/org/apache/kafka/message/CodeBufferTest.java b/generator/src/test/java/org/apache/kafka/message/CodeBufferTest.java index 6dd2e646071c1..a4cfe65d5cfe0 100644 --- a/generator/src/test/java/org/apache/kafka/message/CodeBufferTest.java +++ b/generator/src/test/java/org/apache/kafka/message/CodeBufferTest.java @@ -24,8 +24,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; @Timeout(120) public class CodeBufferTest { diff --git a/generator/src/test/java/org/apache/kafka/message/MessageGeneratorTest.java b/generator/src/test/java/org/apache/kafka/message/MessageGeneratorTest.java index dcd602ca1fb3c..fd25d5e774bac 100644 --- a/generator/src/test/java/org/apache/kafka/message/MessageGeneratorTest.java +++ b/generator/src/test/java/org/apache/kafka/message/MessageGeneratorTest.java @@ -20,10 +20,10 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.assertEquals; @Timeout(120) public class MessageGeneratorTest { diff --git a/generator/src/test/java/org/apache/kafka/message/VersionConditionalTest.java b/generator/src/test/java/org/apache/kafka/message/VersionConditionalTest.java index 4dbfd0e3ed21a..833bd2ec3f9e1 100644 --- a/generator/src/test/java/org/apache/kafka/message/VersionConditionalTest.java +++ b/generator/src/test/java/org/apache/kafka/message/VersionConditionalTest.java @@ -22,8 +22,8 @@ import java.io.StringWriter; -import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; @Timeout(120) public class VersionConditionalTest { diff --git a/generator/src/test/java/org/apache/kafka/message/VersionsTest.java b/generator/src/test/java/org/apache/kafka/message/VersionsTest.java index 23e59afd68a81..a61a1390aae29 100644 --- a/generator/src/test/java/org/apache/kafka/message/VersionsTest.java +++ b/generator/src/test/java/org/apache/kafka/message/VersionsTest.java @@ -21,9 +21,9 @@ import org.junit.jupiter.api.Timeout; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; @Timeout(120) public class VersionsTest { diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/acl/AuthorizerBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/acl/AuthorizerBenchmark.java index 6b7d4285876cf..3002c579ba978 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/acl/AuthorizerBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/acl/AuthorizerBenchmark.java @@ -19,6 +19,7 @@ import kafka.security.authorizer.AclAuthorizer; import kafka.security.authorizer.AclAuthorizer.VersionedAcls; + import org.apache.kafka.common.Uuid; import org.apache.kafka.common.acl.AccessControlEntry; import org.apache.kafka.common.acl.AclBinding; @@ -35,11 +36,12 @@ import org.apache.kafka.common.resource.ResourceType; import org.apache.kafka.common.security.auth.KafkaPrincipal; import org.apache.kafka.common.security.auth.SecurityProtocol; -import org.apache.kafka.security.authorizer.AclEntry; import org.apache.kafka.metadata.authorizer.StandardAcl; import org.apache.kafka.metadata.authorizer.StandardAuthorizer; +import org.apache.kafka.security.authorizer.AclEntry; import org.apache.kafka.server.authorizer.Action; import org.apache.kafka.server.authorizer.Authorizer; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -53,7 +55,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; import org.openjdk.jmh.annotations.Warmup; -import scala.collection.JavaConverters; import java.io.IOException; import java.net.InetAddress; @@ -69,6 +70,8 @@ import java.util.concurrent.TimeUnit; import java.util.function.Supplier; +import scala.collection.JavaConverters; + @State(Scope.Benchmark) @Fork(value = 1) @Warmup(iterations = 5) diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/acl/StandardAuthorizerUpdateBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/acl/StandardAuthorizerUpdateBenchmark.java index 46c41908cf793..5a38fa77fe042 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/acl/StandardAuthorizerUpdateBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/acl/StandardAuthorizerUpdateBenchmark.java @@ -25,6 +25,7 @@ import org.apache.kafka.metadata.authorizer.StandardAcl; import org.apache.kafka.metadata.authorizer.StandardAclWithId; import org.apache.kafka.metadata.authorizer.StandardAuthorizer; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ClientSideAssignorBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ClientSideAssignorBenchmark.java index 9cee98371a7b8..4be40e2148c3b 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ClientSideAssignorBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ClientSideAssignorBenchmark.java @@ -24,6 +24,7 @@ import org.apache.kafka.common.PartitionInfo; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.coordinator.group.api.assignor.SubscriptionType; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ServerSideAssignorBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ServerSideAssignorBenchmark.java index 56d5142a3290f..ab16487b3785d 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ServerSideAssignorBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ServerSideAssignorBenchmark.java @@ -17,21 +17,20 @@ package org.apache.kafka.jmh.assignor; import org.apache.kafka.common.Uuid; -import org.apache.kafka.coordinator.group.consumer.MemberAssignmentImpl; -import org.apache.kafka.coordinator.group.consumer.GroupSpecImpl; import org.apache.kafka.coordinator.group.api.assignor.GroupAssignment; import org.apache.kafka.coordinator.group.api.assignor.MemberAssignment; -import org.apache.kafka.coordinator.group.consumer.MemberSubscriptionAndAssignmentImpl; import org.apache.kafka.coordinator.group.api.assignor.PartitionAssignor; -import org.apache.kafka.coordinator.group.assignor.RangeAssignor; import org.apache.kafka.coordinator.group.api.assignor.SubscribedTopicDescriber; import org.apache.kafka.coordinator.group.api.assignor.SubscriptionType; -import org.apache.kafka.coordinator.group.consumer.Assignment; -import org.apache.kafka.coordinator.group.consumer.TopicIds; +import org.apache.kafka.coordinator.group.assignor.RangeAssignor; import org.apache.kafka.coordinator.group.assignor.UniformAssignor; +import org.apache.kafka.coordinator.group.consumer.Assignment; +import org.apache.kafka.coordinator.group.consumer.GroupSpecImpl; +import org.apache.kafka.coordinator.group.consumer.MemberAssignmentImpl; +import org.apache.kafka.coordinator.group.consumer.MemberSubscriptionAndAssignmentImpl; import org.apache.kafka.coordinator.group.consumer.SubscribedTopicDescriberImpl; +import org.apache.kafka.coordinator.group.consumer.TopicIds; import org.apache.kafka.coordinator.group.consumer.TopicMetadata; - import org.apache.kafka.image.MetadataDelta; import org.apache.kafka.image.MetadataImage; import org.apache.kafka.image.MetadataProvenance; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/TargetAssignmentBuilderBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/TargetAssignmentBuilderBenchmark.java index 2731437771c31..0e361f1c095db 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/TargetAssignmentBuilderBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/TargetAssignmentBuilderBenchmark.java @@ -17,19 +17,18 @@ package org.apache.kafka.jmh.assignor; import org.apache.kafka.common.Uuid; -import org.apache.kafka.coordinator.group.consumer.GroupSpecImpl; import org.apache.kafka.coordinator.group.api.assignor.GroupAssignment; import org.apache.kafka.coordinator.group.api.assignor.MemberAssignment; -import org.apache.kafka.coordinator.group.consumer.MemberSubscriptionAndAssignmentImpl; import org.apache.kafka.coordinator.group.api.assignor.PartitionAssignor; -import org.apache.kafka.coordinator.group.consumer.TopicIds; import org.apache.kafka.coordinator.group.assignor.UniformAssignor; import org.apache.kafka.coordinator.group.consumer.Assignment; import org.apache.kafka.coordinator.group.consumer.ConsumerGroupMember; +import org.apache.kafka.coordinator.group.consumer.GroupSpecImpl; +import org.apache.kafka.coordinator.group.consumer.MemberSubscriptionAndAssignmentImpl; import org.apache.kafka.coordinator.group.consumer.SubscribedTopicDescriberImpl; import org.apache.kafka.coordinator.group.consumer.TargetAssignmentBuilder; +import org.apache.kafka.coordinator.group.consumer.TopicIds; import org.apache.kafka.coordinator.group.consumer.TopicMetadata; - import org.apache.kafka.image.MetadataDelta; import org.apache.kafka.image.MetadataImage; import org.apache.kafka.image.MetadataProvenance; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/cache/LRUCacheBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/cache/LRUCacheBenchmark.java index 5b2d004dcd562..209b498f92bba 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/cache/LRUCacheBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/cache/LRUCacheBenchmark.java @@ -17,8 +17,8 @@ package org.apache.kafka.jmh.cache; -import java.util.concurrent.TimeUnit; import org.apache.kafka.common.cache.LRUCache; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Level; import org.openjdk.jmh.annotations.OutputTimeUnit; @@ -30,6 +30,8 @@ import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; +import java.util.concurrent.TimeUnit; + /** * This is a simple example of a JMH benchmark. * diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/FetchRequestBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/FetchRequestBenchmark.java index f7321b5bc6582..eecb619c0e86d 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/FetchRequestBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/FetchRequestBenchmark.java @@ -18,6 +18,7 @@ package org.apache.kafka.jmh.common; import kafka.network.RequestConvertToJson; + import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.Uuid; import org.apache.kafka.common.network.Send; @@ -26,6 +27,7 @@ import org.apache.kafka.common.requests.ByteBufferChannel; import org.apache.kafka.common.requests.FetchRequest; import org.apache.kafka.common.requests.RequestHeader; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/FetchResponseBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/FetchResponseBenchmark.java index 0320310606c07..ed68202abe9c8 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/FetchResponseBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/FetchResponseBenchmark.java @@ -17,8 +17,8 @@ package org.apache.kafka.jmh.common; -import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.TopicIdPartition; +import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.Uuid; import org.apache.kafka.common.compress.Compression; import org.apache.kafka.common.message.FetchResponseData; @@ -30,6 +30,7 @@ import org.apache.kafka.common.requests.ByteBufferChannel; import org.apache.kafka.common.requests.FetchResponse; import org.apache.kafka.common.requests.ResponseHeader; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/ImplicitLinkedHashCollectionBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/ImplicitLinkedHashCollectionBenchmark.java index c79c7f8dc2668..8e814daa967f0 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/ImplicitLinkedHashCollectionBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/ImplicitLinkedHashCollectionBenchmark.java @@ -19,6 +19,7 @@ import org.apache.kafka.common.Uuid; import org.apache.kafka.common.utils.ImplicitLinkedHashCollection; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/ListOffsetRequestBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/ListOffsetRequestBenchmark.java index e6fc2dc141c17..fe791350a5dca 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/ListOffsetRequestBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/ListOffsetRequestBenchmark.java @@ -18,11 +18,13 @@ package org.apache.kafka.jmh.common; import kafka.network.RequestConvertToJson; + import org.apache.kafka.common.IsolationLevel; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.message.ListOffsetsRequestData; import org.apache.kafka.common.protocol.ApiKeys; import org.apache.kafka.common.requests.ListOffsetsRequest; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/ProduceRequestBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/ProduceRequestBenchmark.java index 405458fef0274..2fcafc5ada159 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/ProduceRequestBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/ProduceRequestBenchmark.java @@ -18,9 +18,11 @@ package org.apache.kafka.jmh.common; import kafka.network.RequestConvertToJson; + import org.apache.kafka.common.message.ProduceRequestData; import org.apache.kafka.common.protocol.ApiKeys; import org.apache.kafka.common.requests.ProduceRequest; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/TopicBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/TopicBenchmark.java index fde239ea1d168..0c86eaa580dfe 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/TopicBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/common/TopicBenchmark.java @@ -17,6 +17,7 @@ package org.apache.kafka.jmh.common; import org.apache.kafka.common.internals.Topic; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/connect/JsonConverterBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/connect/JsonConverterBenchmark.java index e24c23c673f6e..aa45a7e711b8b 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/connect/JsonConverterBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/connect/JsonConverterBenchmark.java @@ -19,6 +19,7 @@ import org.apache.kafka.connect.data.SchemaBuilder; import org.apache.kafka.connect.data.Struct; import org.apache.kafka.connect.json.JsonConverter; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/connect/ReplaceFieldBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/connect/ReplaceFieldBenchmark.java index 808441615066e..2ed64b2a98646 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/connect/ReplaceFieldBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/connect/ReplaceFieldBenchmark.java @@ -19,6 +19,7 @@ import org.apache.kafka.connect.source.SourceRecord; import org.apache.kafka.connect.transforms.ReplaceField; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/connect/ValuesBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/connect/ValuesBenchmark.java index ddcdb5e2418ff..92e37d6fba269 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/connect/ValuesBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/connect/ValuesBenchmark.java @@ -24,6 +24,7 @@ import org.apache.kafka.connect.data.Time; import org.apache.kafka.connect.data.Timestamp; import org.apache.kafka.connect.data.Values; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/consumer/SubscriptionStateBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/consumer/SubscriptionStateBenchmark.java index d88a32ba4f495..9652ce464c6d3 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/consumer/SubscriptionStateBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/consumer/SubscriptionStateBenchmark.java @@ -23,6 +23,7 @@ import org.apache.kafka.common.Node; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.utils.LogContext; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/fetcher/ReplicaFetcherThreadBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/fetcher/ReplicaFetcherThreadBenchmark.java index c1c36447c2940..5b30ed08fdd7c 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/fetcher/ReplicaFetcherThreadBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/fetcher/ReplicaFetcherThreadBenchmark.java @@ -17,14 +17,13 @@ package org.apache.kafka.jmh.fetcher; +import kafka.cluster.AlterPartitionListener; import kafka.cluster.BrokerEndPoint; import kafka.cluster.DelayedOperations; -import kafka.cluster.AlterPartitionListener; import kafka.cluster.Partition; -import org.apache.kafka.server.util.MockTime; -import org.apache.kafka.storage.internals.log.LogAppendInfo; import kafka.log.LogManager; import kafka.server.AlterPartitionManager; +import kafka.server.BrokerBlockingSender; import kafka.server.BrokerFeatures; import kafka.server.BrokerTopicStats; import kafka.server.FailedPartitions; @@ -34,7 +33,6 @@ import kafka.server.OffsetTruncationState; import kafka.server.QuotaFactory; import kafka.server.RemoteLeaderEndPoint; -import kafka.server.BrokerBlockingSender; import kafka.server.ReplicaFetcherThread; import kafka.server.ReplicaManager; import kafka.server.ReplicaQuota; @@ -46,9 +44,10 @@ import kafka.utils.Pool; import kafka.utils.TestUtils; import kafka.zk.KafkaZkClient; + import org.apache.kafka.clients.FetchSessionHandler; -import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.TopicIdPartition; +import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.Uuid; import org.apache.kafka.common.message.FetchResponseData; import org.apache.kafka.common.message.LeaderAndIsrRequestData; @@ -66,12 +65,15 @@ import org.apache.kafka.common.utils.LogContext; import org.apache.kafka.common.utils.Time; import org.apache.kafka.common.utils.Utils; -import org.apache.kafka.server.common.OffsetAndEpoch; import org.apache.kafka.server.common.MetadataVersion; +import org.apache.kafka.server.common.OffsetAndEpoch; +import org.apache.kafka.server.util.KafkaScheduler; +import org.apache.kafka.server.util.MockTime; import org.apache.kafka.storage.internals.log.CleanerConfig; +import org.apache.kafka.storage.internals.log.LogAppendInfo; import org.apache.kafka.storage.internals.log.LogConfig; import org.apache.kafka.storage.internals.log.LogDirFailureChannel; -import org.apache.kafka.server.util.KafkaScheduler; + import org.mockito.Mockito; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; @@ -98,6 +100,7 @@ import java.util.Properties; import java.util.UUID; import java.util.concurrent.TimeUnit; + import scala.Option; import scala.collection.Iterator; import scala.collection.Map; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/fetchsession/FetchSessionBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/fetchsession/FetchSessionBenchmark.java index 0dddf2d796e44..11d584446f44d 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/fetchsession/FetchSessionBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/fetchsession/FetchSessionBenchmark.java @@ -18,8 +18,8 @@ package org.apache.kafka.jmh.fetchsession; import org.apache.kafka.clients.FetchSessionHandler; -import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.TopicIdPartition; +import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.Uuid; import org.apache.kafka.common.message.FetchResponseData; import org.apache.kafka.common.protocol.ApiKeys; @@ -27,6 +27,7 @@ import org.apache.kafka.common.requests.FetchRequest; import org.apache.kafka.common.requests.FetchResponse; import org.apache.kafka.common.utils.LogContext; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/KRaftMetadataRequestBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/KRaftMetadataRequestBenchmark.java index 19b2f25d5a4b8..6b31224cf4c9b 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/KRaftMetadataRequestBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/KRaftMetadataRequestBenchmark.java @@ -38,6 +38,7 @@ import kafka.server.builders.KafkaApisBuilder; import kafka.server.metadata.KRaftMetadataCache; import kafka.server.metadata.MockConfigRepository; + import org.apache.kafka.common.Uuid; import org.apache.kafka.common.memory.MemoryPool; import org.apache.kafka.common.message.ApiMessageType; @@ -77,7 +78,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; import org.openjdk.jmh.annotations.Warmup; -import scala.Option; import java.nio.ByteBuffer; import java.util.Arrays; @@ -88,6 +88,8 @@ import java.util.concurrent.TimeUnit; import java.util.stream.IntStream; +import scala.Option; + @State(Scope.Benchmark) @Fork(value = 1) @Warmup(iterations = 5) diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/MetadataRequestBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/MetadataRequestBenchmark.java index 5d3591454bd50..a3202a761394a 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/MetadataRequestBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/MetadataRequestBenchmark.java @@ -22,7 +22,6 @@ import kafka.network.RequestChannel; import kafka.network.RequestConvertToJson; import kafka.server.AutoTopicCreationManager; -import kafka.server.ZkBrokerEpochManager; import kafka.server.BrokerFeatures; import kafka.server.BrokerTopicStats; import kafka.server.ClientQuotaManager; @@ -37,11 +36,13 @@ import kafka.server.ReplicationQuotaManager; import kafka.server.SimpleApiVersionManager; import kafka.server.ZkAdminManager; +import kafka.server.ZkBrokerEpochManager; import kafka.server.ZkSupport; import kafka.server.builders.KafkaApisBuilder; import kafka.server.metadata.MockConfigRepository; import kafka.server.metadata.ZkMetadataCache; import kafka.zk.KafkaZkClient; + import org.apache.kafka.common.memory.MemoryPool; import org.apache.kafka.common.message.ApiMessageType; import org.apache.kafka.common.message.UpdateMetadataRequestData.UpdateMetadataBroker; @@ -63,6 +64,7 @@ import org.apache.kafka.server.common.MetadataVersion; import org.apache.kafka.server.config.ServerConfigs; import org.apache.kafka.server.config.ZkConfigs; + import org.mockito.Mockito; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; @@ -77,7 +79,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; import org.openjdk.jmh.annotations.Warmup; -import scala.Option; import java.nio.ByteBuffer; import java.util.Arrays; @@ -89,6 +90,8 @@ import java.util.concurrent.TimeUnit; import java.util.stream.IntStream; +import scala.Option; + @State(Scope.Benchmark) @Fork(value = 1) @Warmup(iterations = 5) diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/TopicsImageSingleRecordChangeBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/TopicsImageSingleRecordChangeBenchmark.java index 8f88a7a1e6f52..dd20f3093284b 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/TopicsImageSingleRecordChangeBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/TopicsImageSingleRecordChangeBenchmark.java @@ -22,6 +22,7 @@ import org.apache.kafka.common.metadata.TopicRecord; import org.apache.kafka.image.TopicsDelta; import org.apache.kafka.image.TopicsImage; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/TopicsImageSnapshotLoadBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/TopicsImageSnapshotLoadBenchmark.java index 10961d9d0252b..1dc63002c829a 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/TopicsImageSnapshotLoadBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/TopicsImageSnapshotLoadBenchmark.java @@ -22,6 +22,7 @@ import org.apache.kafka.common.metadata.TopicRecord; import org.apache.kafka.image.TopicsDelta; import org.apache.kafka.image.TopicsImage; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/TopicsImageZonalOutageBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/TopicsImageZonalOutageBenchmark.java index 5890763397ac6..bccadbeebe51a 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/TopicsImageZonalOutageBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/metadata/TopicsImageZonalOutageBenchmark.java @@ -21,6 +21,7 @@ import org.apache.kafka.common.metadata.PartitionRecord; import org.apache.kafka.image.TopicsDelta; import org.apache.kafka.image.TopicsImage; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/partition/PartitionMakeFollowerBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/partition/PartitionMakeFollowerBenchmark.java index 62840ef9b86a0..7000b99e24abb 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/partition/PartitionMakeFollowerBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/partition/PartitionMakeFollowerBenchmark.java @@ -17,8 +17,8 @@ package org.apache.kafka.jmh.partition; -import kafka.cluster.DelayedOperations; import kafka.cluster.AlterPartitionListener; +import kafka.cluster.DelayedOperations; import kafka.cluster.Partition; import kafka.log.LogManager; import kafka.server.AlterPartitionManager; @@ -27,6 +27,7 @@ import kafka.server.builders.LogManagerBuilder; import kafka.server.checkpoints.OffsetCheckpoints; import kafka.server.metadata.MockConfigRepository; + import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.Uuid; import org.apache.kafka.common.compress.Compression; @@ -36,10 +37,11 @@ import org.apache.kafka.common.utils.Time; import org.apache.kafka.common.utils.Utils; import org.apache.kafka.server.common.MetadataVersion; +import org.apache.kafka.server.util.KafkaScheduler; import org.apache.kafka.storage.internals.log.CleanerConfig; import org.apache.kafka.storage.internals.log.LogConfig; import org.apache.kafka.storage.internals.log.LogDirFailureChannel; -import org.apache.kafka.server.util.KafkaScheduler; + import org.mockito.Mockito; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; @@ -66,6 +68,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; + import scala.Option; import scala.compat.java8.OptionConverters; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/partition/UpdateFollowerFetchStateBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/partition/UpdateFollowerFetchStateBenchmark.java index 686ee7acf67da..99b8347f3cfe3 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/partition/UpdateFollowerFetchStateBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/partition/UpdateFollowerFetchStateBenchmark.java @@ -17,8 +17,8 @@ package org.apache.kafka.jmh.partition; -import kafka.cluster.DelayedOperations; import kafka.cluster.AlterPartitionListener; +import kafka.cluster.DelayedOperations; import kafka.cluster.Partition; import kafka.cluster.Replica; import kafka.log.LogManager; @@ -28,16 +28,18 @@ import kafka.server.builders.LogManagerBuilder; import kafka.server.checkpoints.OffsetCheckpoints; import kafka.server.metadata.MockConfigRepository; + import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.Uuid; import org.apache.kafka.common.message.LeaderAndIsrRequestData.LeaderAndIsrPartitionState; import org.apache.kafka.common.utils.Time; import org.apache.kafka.server.common.MetadataVersion; +import org.apache.kafka.server.util.KafkaScheduler; import org.apache.kafka.storage.internals.log.CleanerConfig; import org.apache.kafka.storage.internals.log.LogConfig; import org.apache.kafka.storage.internals.log.LogDirFailureChannel; import org.apache.kafka.storage.internals.log.LogOffsetMetadata; -import org.apache.kafka.server.util.KafkaScheduler; + import org.mockito.Mockito; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; @@ -60,6 +62,7 @@ import java.util.Properties; import java.util.UUID; import java.util.concurrent.TimeUnit; + import scala.Option; import scala.compat.java8.OptionConverters; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/producer/ProducerRecordBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/producer/ProducerRecordBenchmark.java index 83d5c2b19c9f1..6346f3d0c8853 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/producer/ProducerRecordBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/producer/ProducerRecordBenchmark.java @@ -18,6 +18,7 @@ package org.apache.kafka.jmh.producer; import org.apache.kafka.clients.producer.ProducerRecord; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/producer/ProducerRequestBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/producer/ProducerRequestBenchmark.java index 4ea35a563f321..3bde86f827e4f 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/producer/ProducerRequestBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/producer/ProducerRequestBenchmark.java @@ -25,6 +25,7 @@ import org.apache.kafka.common.record.SimpleRecord; import org.apache.kafka.common.requests.ProduceRequest; import org.apache.kafka.common.requests.ProduceResponse; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/producer/ProducerResponseBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/producer/ProducerResponseBenchmark.java index 431880a96dc18..7bcf245b95821 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/producer/ProducerResponseBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/producer/ProducerResponseBenchmark.java @@ -21,6 +21,7 @@ import org.apache.kafka.common.protocol.Errors; import org.apache.kafka.common.requests.AbstractResponse; import org.apache.kafka.common.requests.ProduceResponse; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/BaseRecordBatchBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/BaseRecordBatchBenchmark.java index 1190854a339e0..44d7272068492 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/BaseRecordBatchBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/BaseRecordBatchBenchmark.java @@ -19,6 +19,7 @@ import kafka.log.UnifiedLog; import kafka.server.BrokerTopicStats; import kafka.server.RequestLocal; + import org.apache.kafka.common.compress.Compression; import org.apache.kafka.common.header.Header; import org.apache.kafka.common.record.AbstractRecords; @@ -28,6 +29,7 @@ import org.apache.kafka.common.record.RecordBatch; import org.apache.kafka.common.record.TimestampType; import org.apache.kafka.storage.internals.log.LogValidator; + import org.openjdk.jmh.annotations.Param; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/CompressedRecordBatchValidationBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/CompressedRecordBatchValidationBenchmark.java index b43d7a9271eea..a75a8a4ca2ce4 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/CompressedRecordBatchValidationBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/CompressedRecordBatchValidationBenchmark.java @@ -26,6 +26,7 @@ import org.apache.kafka.server.common.MetadataVersion; import org.apache.kafka.storage.internals.log.AppendOrigin; import org.apache.kafka.storage.internals.log.LogValidator; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Measurement; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/RecordBatchIterationBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/RecordBatchIterationBenchmark.java index d8a73d53d3051..1d7d155f6bb54 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/RecordBatchIterationBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/RecordBatchIterationBenchmark.java @@ -23,6 +23,7 @@ import org.apache.kafka.common.record.Record; import org.apache.kafka.common.record.RecordBatch; import org.apache.kafka.common.utils.CloseableIterator; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Measurement; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/UncompressedRecordBatchValidationBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/UncompressedRecordBatchValidationBenchmark.java index 66f74c7046737..fb05990b4dd37 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/UncompressedRecordBatchValidationBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/record/UncompressedRecordBatchValidationBenchmark.java @@ -26,6 +26,7 @@ import org.apache.kafka.server.common.MetadataVersion; import org.apache.kafka.storage.internals.log.AppendOrigin; import org.apache.kafka.storage.internals.log.LogValidator; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Measurement; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/server/CheckpointBench.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/server/CheckpointBench.java index 059e41dadec9d..dbc9731ff07bd 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/server/CheckpointBench.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/server/CheckpointBench.java @@ -22,11 +22,6 @@ import kafka.server.BrokerFeatures; import kafka.server.BrokerTopicStats; import kafka.server.KafkaConfig; -import org.apache.kafka.server.config.ServerLogConfigs; -import org.apache.kafka.server.util.MockTime; -import org.apache.kafka.storage.internals.log.CleanerConfig; -import org.apache.kafka.storage.internals.log.LogConfig; -import org.apache.kafka.storage.internals.log.LogDirFailureChannel; import kafka.server.MetadataCache; import kafka.server.QuotaFactory; import kafka.server.ReplicaManager; @@ -34,13 +29,20 @@ import kafka.server.checkpoints.OffsetCheckpoints; import kafka.server.metadata.MockConfigRepository; import kafka.utils.TestUtils; -import org.apache.kafka.common.Uuid; + import org.apache.kafka.common.TopicPartition; +import org.apache.kafka.common.Uuid; import org.apache.kafka.common.metrics.Metrics; import org.apache.kafka.common.utils.Utils; import org.apache.kafka.server.common.MetadataVersion; +import org.apache.kafka.server.config.ServerLogConfigs; import org.apache.kafka.server.util.KafkaScheduler; +import org.apache.kafka.server.util.MockTime; import org.apache.kafka.server.util.Scheduler; +import org.apache.kafka.storage.internals.log.CleanerConfig; +import org.apache.kafka.storage.internals.log.LogConfig; +import org.apache.kafka.storage.internals.log.LogDirFailureChannel; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Level; @@ -61,8 +63,8 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import scala.collection.JavaConverters; import scala.Option; +import scala.collection.JavaConverters; @Warmup(iterations = 5) @Measurement(iterations = 5) diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/server/PartitionCreationBench.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/server/PartitionCreationBench.java index 24261ba1071b6..f1af675c62857 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/server/PartitionCreationBench.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/server/PartitionCreationBench.java @@ -32,6 +32,7 @@ import kafka.server.metadata.MockConfigRepository; import kafka.utils.TestUtils; import kafka.zk.KafkaZkClient; + import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.Uuid; import org.apache.kafka.common.message.LeaderAndIsrRequestData; @@ -39,11 +40,12 @@ import org.apache.kafka.common.utils.Time; import org.apache.kafka.common.utils.Utils; import org.apache.kafka.server.common.MetadataVersion; +import org.apache.kafka.server.util.KafkaScheduler; +import org.apache.kafka.server.util.Scheduler; import org.apache.kafka.storage.internals.log.CleanerConfig; import org.apache.kafka.storage.internals.log.LogConfig; import org.apache.kafka.storage.internals.log.LogDirFailureChannel; -import org.apache.kafka.server.util.KafkaScheduler; -import org.apache.kafka.server.util.Scheduler; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -66,6 +68,7 @@ import java.util.Properties; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; + import scala.Option; import scala.collection.JavaConverters; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/storage/ProducerStateManagerBench.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/storage/ProducerStateManagerBench.java index 49744e0b29453..c534aede37816 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/storage/ProducerStateManagerBench.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/storage/ProducerStateManagerBench.java @@ -22,6 +22,7 @@ import org.apache.kafka.storage.internals.log.ProducerStateEntry; import org.apache.kafka.storage.internals.log.ProducerStateManager; import org.apache.kafka.storage.internals.log.ProducerStateManagerConfig; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/timeline/TimelineHashMapBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/timeline/TimelineHashMapBenchmark.java index ae6c56ee2e8dd..1139c193e2439 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/timeline/TimelineHashMapBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/timeline/TimelineHashMapBenchmark.java @@ -20,6 +20,7 @@ import org.apache.kafka.common.utils.LogContext; import org.apache.kafka.timeline.SnapshotRegistry; import org.apache.kafka.timeline.TimelineHashMap; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java index 88c867a953f04..e0184efcf42c7 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java @@ -17,12 +17,8 @@ package org.apache.kafka.jmh.util; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.security.SecureRandom; -import java.util.concurrent.TimeUnit; - import org.apache.kafka.common.utils.ByteUtils; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.CompilerControl; import org.openjdk.jmh.annotations.Fork; @@ -40,6 +36,11 @@ import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.SecureRandom; +import java.util.concurrent.TimeUnit; + @OutputTimeUnit(TimeUnit.SECONDS) @Fork(3) @Warmup(iterations = 3, time = 1) diff --git a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/Crc32CBenchmark.java b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/Crc32CBenchmark.java index 6f60a0f43e050..d7927676ec124 100644 --- a/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/Crc32CBenchmark.java +++ b/jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/Crc32CBenchmark.java @@ -18,9 +18,6 @@ import org.apache.kafka.common.utils.Crc32C; -import java.nio.ByteBuffer; -import java.util.SplittableRandom; -import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Measurement; @@ -31,6 +28,10 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Warmup; +import java.nio.ByteBuffer; +import java.util.SplittableRandom; +import java.util.concurrent.TimeUnit; + @State(Scope.Benchmark) @OutputTimeUnit(TimeUnit.MICROSECONDS) @Fork(2) diff --git a/log4j-appender/src/main/java/org/apache/kafka/log4jappender/KafkaLog4jAppender.java b/log4j-appender/src/main/java/org/apache/kafka/log4jappender/KafkaLog4jAppender.java index 64e7f9846b579..f77c18e21588c 100644 --- a/log4j-appender/src/main/java/org/apache/kafka/log4jappender/KafkaLog4jAppender.java +++ b/log4j-appender/src/main/java/org/apache/kafka/log4jappender/KafkaLog4jAppender.java @@ -22,6 +22,7 @@ import org.apache.kafka.clients.producer.RecordMetadata; import org.apache.kafka.common.config.ConfigException; import org.apache.kafka.common.serialization.ByteArraySerializer; + import org.apache.log4j.AppenderSkeleton; import org.apache.log4j.helpers.LogLog; import org.apache.log4j.spi.LoggingEvent; @@ -38,12 +39,12 @@ import static org.apache.kafka.clients.producer.ProducerConfig.BATCH_SIZE_CONFIG; import static org.apache.kafka.clients.producer.ProducerConfig.COMPRESSION_TYPE_CONFIG; import static org.apache.kafka.clients.producer.ProducerConfig.DELIVERY_TIMEOUT_MS_CONFIG; +import static org.apache.kafka.clients.producer.ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG; import static org.apache.kafka.clients.producer.ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG; import static org.apache.kafka.clients.producer.ProducerConfig.LINGER_MS_CONFIG; import static org.apache.kafka.clients.producer.ProducerConfig.MAX_BLOCK_MS_CONFIG; import static org.apache.kafka.clients.producer.ProducerConfig.RETRIES_CONFIG; import static org.apache.kafka.clients.producer.ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG; -import static org.apache.kafka.clients.producer.ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG; import static org.apache.kafka.common.config.SaslConfigs.SASL_JAAS_CONFIG; import static org.apache.kafka.common.config.SaslConfigs.SASL_KERBEROS_SERVICE_NAME; import static org.apache.kafka.common.config.SaslConfigs.SASL_MECHANISM; diff --git a/log4j-appender/src/test/java/org/apache/kafka/log4jappender/KafkaLog4jAppenderTest.java b/log4j-appender/src/test/java/org/apache/kafka/log4jappender/KafkaLog4jAppenderTest.java index eb64a85bd8869..5895f3705108d 100644 --- a/log4j-appender/src/test/java/org/apache/kafka/log4jappender/KafkaLog4jAppenderTest.java +++ b/log4j-appender/src/test/java/org/apache/kafka/log4jappender/KafkaLog4jAppenderTest.java @@ -16,14 +16,12 @@ */ package org.apache.kafka.log4jappender; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.MatcherAssert.assertThat; import org.apache.kafka.clients.producer.MockProducer; import org.apache.kafka.clients.producer.RecordMetadata; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.config.ConfigException; import org.apache.kafka.common.config.SaslConfigs; + import org.apache.log4j.Appender; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; @@ -37,6 +35,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeoutException; +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; @@ -227,4 +228,3 @@ private Properties getLog4jConfig(boolean syncSend) { return props; } } - diff --git a/log4j-appender/src/test/java/org/apache/kafka/log4jappender/MockKafkaLog4jAppender.java b/log4j-appender/src/test/java/org/apache/kafka/log4jappender/MockKafkaLog4jAppender.java index b8ac3cb989a3c..981c658b9a8ae 100644 --- a/log4j-appender/src/test/java/org/apache/kafka/log4jappender/MockKafkaLog4jAppender.java +++ b/log4j-appender/src/test/java/org/apache/kafka/log4jappender/MockKafkaLog4jAppender.java @@ -20,6 +20,7 @@ import org.apache.kafka.clients.producer.Producer; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.test.MockSerializer; + import org.apache.log4j.spi.LoggingEvent; import java.util.List; diff --git a/shell/src/main/java/org/apache/kafka/shell/InteractiveShell.java b/shell/src/main/java/org/apache/kafka/shell/InteractiveShell.java index bf786e09a58c7..c382d178da5da 100644 --- a/shell/src/main/java/org/apache/kafka/shell/InteractiveShell.java +++ b/shell/src/main/java/org/apache/kafka/shell/InteractiveShell.java @@ -20,6 +20,7 @@ import org.apache.kafka.shell.command.CommandUtils; import org.apache.kafka.shell.command.Commands; import org.apache.kafka.shell.state.MetadataShellState; + import org.jline.reader.Candidate; import org.jline.reader.Completer; import org.jline.reader.EndOfFileException; diff --git a/shell/src/main/java/org/apache/kafka/shell/MetadataShell.java b/shell/src/main/java/org/apache/kafka/shell/MetadataShell.java index 9fe12aa7fad9a..06ae528ed8867 100644 --- a/shell/src/main/java/org/apache/kafka/shell/MetadataShell.java +++ b/shell/src/main/java/org/apache/kafka/shell/MetadataShell.java @@ -20,9 +20,7 @@ import kafka.raft.KafkaRaftManager; import kafka.tools.TerseFailure; import kafka.utils.FileLock; -import net.sourceforge.argparse4j.ArgumentParsers; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.Namespace; + import org.apache.kafka.common.utils.Exit; import org.apache.kafka.common.utils.Utils; import org.apache.kafka.image.loader.MetadataLoader; @@ -33,6 +31,11 @@ import org.apache.kafka.shell.command.Commands; import org.apache.kafka.shell.state.MetadataShellPublisher; import org.apache.kafka.shell.state.MetadataShellState; + +import net.sourceforge.argparse4j.ArgumentParsers; +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.Namespace; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/shell/src/main/java/org/apache/kafka/shell/command/CatCommandHandler.java b/shell/src/main/java/org/apache/kafka/shell/command/CatCommandHandler.java index 51b2f6d3cb78d..c8e5fef7cf78e 100644 --- a/shell/src/main/java/org/apache/kafka/shell/command/CatCommandHandler.java +++ b/shell/src/main/java/org/apache/kafka/shell/command/CatCommandHandler.java @@ -17,13 +17,15 @@ package org.apache.kafka.shell.command; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.Namespace; import org.apache.kafka.image.node.MetadataNode; import org.apache.kafka.shell.InteractiveShell; import org.apache.kafka.shell.glob.GlobVisitor; import org.apache.kafka.shell.node.printer.ShellNodePrinter; import org.apache.kafka.shell.state.MetadataShellState; + +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.Namespace; + import org.jline.reader.Candidate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/shell/src/main/java/org/apache/kafka/shell/command/CdCommandHandler.java b/shell/src/main/java/org/apache/kafka/shell/command/CdCommandHandler.java index ba22c0bb8ecf6..a07e242ab0360 100644 --- a/shell/src/main/java/org/apache/kafka/shell/command/CdCommandHandler.java +++ b/shell/src/main/java/org/apache/kafka/shell/command/CdCommandHandler.java @@ -17,11 +17,13 @@ package org.apache.kafka.shell.command; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.Namespace; import org.apache.kafka.shell.InteractiveShell; import org.apache.kafka.shell.glob.GlobVisitor; import org.apache.kafka.shell.state.MetadataShellState; + +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.Namespace; + import org.jline.reader.Candidate; import java.io.PrintWriter; diff --git a/shell/src/main/java/org/apache/kafka/shell/command/CommandUtils.java b/shell/src/main/java/org/apache/kafka/shell/command/CommandUtils.java index 156e65acdbd76..ce04003d82625 100644 --- a/shell/src/main/java/org/apache/kafka/shell/command/CommandUtils.java +++ b/shell/src/main/java/org/apache/kafka/shell/command/CommandUtils.java @@ -19,6 +19,7 @@ import org.apache.kafka.image.node.MetadataNode; import org.apache.kafka.shell.state.MetadataShellState; + import org.jline.reader.Candidate; import java.util.ArrayList; diff --git a/shell/src/main/java/org/apache/kafka/shell/command/Commands.java b/shell/src/main/java/org/apache/kafka/shell/command/Commands.java index ddafb5e692013..77b142c635369 100644 --- a/shell/src/main/java/org/apache/kafka/shell/command/Commands.java +++ b/shell/src/main/java/org/apache/kafka/shell/command/Commands.java @@ -17,6 +17,9 @@ package org.apache.kafka.shell.command; +import org.apache.kafka.shell.InteractiveShell; +import org.apache.kafka.shell.state.MetadataShellState; + import net.sourceforge.argparse4j.ArgumentParsers; import net.sourceforge.argparse4j.inf.ArgumentParser; import net.sourceforge.argparse4j.inf.ArgumentParserException; @@ -24,8 +27,7 @@ import net.sourceforge.argparse4j.inf.Subparser; import net.sourceforge.argparse4j.inf.Subparsers; import net.sourceforge.argparse4j.internal.HelpScreenException; -import org.apache.kafka.shell.InteractiveShell; -import org.apache.kafka.shell.state.MetadataShellState; + import org.jline.reader.Candidate; import java.io.PrintWriter; diff --git a/shell/src/main/java/org/apache/kafka/shell/command/ExitCommandHandler.java b/shell/src/main/java/org/apache/kafka/shell/command/ExitCommandHandler.java index fab54be2c98be..b369d445b9afe 100644 --- a/shell/src/main/java/org/apache/kafka/shell/command/ExitCommandHandler.java +++ b/shell/src/main/java/org/apache/kafka/shell/command/ExitCommandHandler.java @@ -17,11 +17,13 @@ package org.apache.kafka.shell.command; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.Namespace; import org.apache.kafka.common.utils.Exit; import org.apache.kafka.shell.InteractiveShell; import org.apache.kafka.shell.state.MetadataShellState; + +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.Namespace; + import org.jline.reader.Candidate; import java.io.PrintWriter; diff --git a/shell/src/main/java/org/apache/kafka/shell/command/FindCommandHandler.java b/shell/src/main/java/org/apache/kafka/shell/command/FindCommandHandler.java index 133cb988d01f9..ccc52a7b43758 100644 --- a/shell/src/main/java/org/apache/kafka/shell/command/FindCommandHandler.java +++ b/shell/src/main/java/org/apache/kafka/shell/command/FindCommandHandler.java @@ -17,12 +17,14 @@ package org.apache.kafka.shell.command; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.Namespace; import org.apache.kafka.image.node.MetadataNode; import org.apache.kafka.shell.InteractiveShell; import org.apache.kafka.shell.glob.GlobVisitor; import org.apache.kafka.shell.state.MetadataShellState; + +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.Namespace; + import org.jline.reader.Candidate; import java.io.PrintWriter; diff --git a/shell/src/main/java/org/apache/kafka/shell/command/HelpCommandHandler.java b/shell/src/main/java/org/apache/kafka/shell/command/HelpCommandHandler.java index e0a5aa03288b0..5d2a14ed013c0 100644 --- a/shell/src/main/java/org/apache/kafka/shell/command/HelpCommandHandler.java +++ b/shell/src/main/java/org/apache/kafka/shell/command/HelpCommandHandler.java @@ -17,10 +17,12 @@ package org.apache.kafka.shell.command; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.Namespace; import org.apache.kafka.shell.InteractiveShell; import org.apache.kafka.shell.state.MetadataShellState; + +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.Namespace; + import org.jline.reader.Candidate; import java.io.PrintWriter; diff --git a/shell/src/main/java/org/apache/kafka/shell/command/HistoryCommandHandler.java b/shell/src/main/java/org/apache/kafka/shell/command/HistoryCommandHandler.java index c3b299983ce78..f233fe695ef22 100644 --- a/shell/src/main/java/org/apache/kafka/shell/command/HistoryCommandHandler.java +++ b/shell/src/main/java/org/apache/kafka/shell/command/HistoryCommandHandler.java @@ -17,10 +17,12 @@ package org.apache.kafka.shell.command; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.Namespace; import org.apache.kafka.shell.InteractiveShell; import org.apache.kafka.shell.state.MetadataShellState; + +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.Namespace; + import org.jline.reader.Candidate; import java.io.PrintWriter; diff --git a/shell/src/main/java/org/apache/kafka/shell/command/LsCommandHandler.java b/shell/src/main/java/org/apache/kafka/shell/command/LsCommandHandler.java index 24840502e514d..9e81bcf8bf0a9 100644 --- a/shell/src/main/java/org/apache/kafka/shell/command/LsCommandHandler.java +++ b/shell/src/main/java/org/apache/kafka/shell/command/LsCommandHandler.java @@ -17,13 +17,15 @@ package org.apache.kafka.shell.command; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.Namespace; import org.apache.kafka.image.node.MetadataNode; import org.apache.kafka.shell.InteractiveShell; import org.apache.kafka.shell.glob.GlobVisitor; import org.apache.kafka.shell.glob.GlobVisitor.MetadataNodeInfo; import org.apache.kafka.shell.state.MetadataShellState; + +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.Namespace; + import org.jline.reader.Candidate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/shell/src/main/java/org/apache/kafka/shell/command/ManCommandHandler.java b/shell/src/main/java/org/apache/kafka/shell/command/ManCommandHandler.java index 5892cdff4c5ad..df1c20292452e 100644 --- a/shell/src/main/java/org/apache/kafka/shell/command/ManCommandHandler.java +++ b/shell/src/main/java/org/apache/kafka/shell/command/ManCommandHandler.java @@ -17,11 +17,13 @@ package org.apache.kafka.shell.command; +import org.apache.kafka.shell.InteractiveShell; +import org.apache.kafka.shell.state.MetadataShellState; + import net.sourceforge.argparse4j.ArgumentParsers; import net.sourceforge.argparse4j.inf.ArgumentParser; import net.sourceforge.argparse4j.inf.Namespace; -import org.apache.kafka.shell.InteractiveShell; -import org.apache.kafka.shell.state.MetadataShellState; + import org.jline.reader.Candidate; import java.io.PrintWriter; diff --git a/shell/src/main/java/org/apache/kafka/shell/command/PwdCommandHandler.java b/shell/src/main/java/org/apache/kafka/shell/command/PwdCommandHandler.java index 55046cf5e7243..4b09ad1fd344d 100644 --- a/shell/src/main/java/org/apache/kafka/shell/command/PwdCommandHandler.java +++ b/shell/src/main/java/org/apache/kafka/shell/command/PwdCommandHandler.java @@ -17,10 +17,12 @@ package org.apache.kafka.shell.command; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.Namespace; import org.apache.kafka.shell.InteractiveShell; import org.apache.kafka.shell.state.MetadataShellState; + +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.Namespace; + import org.jline.reader.Candidate; import java.io.PrintWriter; diff --git a/shell/src/main/java/org/apache/kafka/shell/command/TreeCommandHandler.java b/shell/src/main/java/org/apache/kafka/shell/command/TreeCommandHandler.java index ee937d1c2f5bb..43d2ba2a1baa3 100644 --- a/shell/src/main/java/org/apache/kafka/shell/command/TreeCommandHandler.java +++ b/shell/src/main/java/org/apache/kafka/shell/command/TreeCommandHandler.java @@ -17,13 +17,15 @@ package org.apache.kafka.shell.command; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.Namespace; import org.apache.kafka.image.node.MetadataNode; import org.apache.kafka.shell.InteractiveShell; import org.apache.kafka.shell.glob.GlobVisitor; import org.apache.kafka.shell.node.printer.ShellNodePrinter; import org.apache.kafka.shell.state.MetadataShellState; + +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.Namespace; + import org.jline.reader.Candidate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/shell/src/main/java/org/apache/kafka/shell/state/MetadataShellPublisher.java b/shell/src/main/java/org/apache/kafka/shell/state/MetadataShellPublisher.java index ec4998edca720..1878d1068c85b 100644 --- a/shell/src/main/java/org/apache/kafka/shell/state/MetadataShellPublisher.java +++ b/shell/src/main/java/org/apache/kafka/shell/state/MetadataShellPublisher.java @@ -22,6 +22,7 @@ import org.apache.kafka.image.loader.LoaderManifest; import org.apache.kafka.image.publisher.MetadataPublisher; import org.apache.kafka.shell.node.RootShellNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/shell/src/test/java/org/apache/kafka/shell/MetadataShellIntegrationTest.java b/shell/src/test/java/org/apache/kafka/shell/MetadataShellIntegrationTest.java index 3ef5044a82dae..b9a2b47d09e8f 100644 --- a/shell/src/test/java/org/apache/kafka/shell/MetadataShellIntegrationTest.java +++ b/shell/src/test/java/org/apache/kafka/shell/MetadataShellIntegrationTest.java @@ -17,16 +17,11 @@ package org.apache.kafka.shell; -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.NoSuchFileException; -import java.util.Collections; -import java.util.concurrent.ExecutionException; - import kafka.utils.FileLock; + import org.apache.kafka.common.utils.Utils; import org.apache.kafka.server.fault.MockFaultHandler; + import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; @@ -35,6 +30,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.NoSuchFileException; +import java.util.Collections; +import java.util.concurrent.ExecutionException; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/shell/src/test/java/org/apache/kafka/shell/command/CommandTest.java b/shell/src/test/java/org/apache/kafka/shell/command/CommandTest.java index 58528335c4be8..3be8036ca0d45 100644 --- a/shell/src/test/java/org/apache/kafka/shell/command/CommandTest.java +++ b/shell/src/test/java/org/apache/kafka/shell/command/CommandTest.java @@ -17,8 +17,6 @@ package org.apache.kafka.shell.command; -import static org.junit.jupiter.api.Assertions.assertEquals; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; @@ -26,6 +24,8 @@ import java.util.Collections; import java.util.Optional; +import static org.junit.jupiter.api.Assertions.assertEquals; + @Timeout(value = 120) public class CommandTest { @Test diff --git a/shell/src/test/java/org/apache/kafka/shell/command/CommandUtilsTest.java b/shell/src/test/java/org/apache/kafka/shell/command/CommandUtilsTest.java index 7ee36a9e91ab8..52277719c90de 100644 --- a/shell/src/test/java/org/apache/kafka/shell/command/CommandUtilsTest.java +++ b/shell/src/test/java/org/apache/kafka/shell/command/CommandUtilsTest.java @@ -17,14 +17,14 @@ package org.apache.kafka.shell.command; -import static java.util.concurrent.TimeUnit.MINUTES; -import static org.junit.jupiter.api.Assertions.assertEquals; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; import java.util.Arrays; +import static java.util.concurrent.TimeUnit.MINUTES; +import static org.junit.jupiter.api.Assertions.assertEquals; + @Timeout(value = 5, unit = MINUTES) public class CommandUtilsTest { @Test diff --git a/shell/src/test/java/org/apache/kafka/shell/command/LsCommandHandlerTest.java b/shell/src/test/java/org/apache/kafka/shell/command/LsCommandHandlerTest.java index 0a8864bca43cf..b7bdf2f37f059 100644 --- a/shell/src/test/java/org/apache/kafka/shell/command/LsCommandHandlerTest.java +++ b/shell/src/test/java/org/apache/kafka/shell/command/LsCommandHandlerTest.java @@ -17,8 +17,6 @@ package org.apache.kafka.shell.command; -import static org.junit.jupiter.api.Assertions.assertEquals; - import org.apache.kafka.shell.command.LsCommandHandler.ColumnSchema; import org.apache.kafka.shell.command.LsCommandHandler.TargetDirectory; @@ -33,6 +31,8 @@ import java.util.Collections; import java.util.OptionalInt; +import static org.junit.jupiter.api.Assertions.assertEquals; + @Timeout(value = 120) public class LsCommandHandlerTest { @Test @@ -95,4 +95,3 @@ public void testPrintTargets() throws Exception { } } } - diff --git a/shell/src/test/java/org/apache/kafka/shell/glob/GlobComponentTest.java b/shell/src/test/java/org/apache/kafka/shell/glob/GlobComponentTest.java index 9e935e12a9819..e86b471e30154 100644 --- a/shell/src/test/java/org/apache/kafka/shell/glob/GlobComponentTest.java +++ b/shell/src/test/java/org/apache/kafka/shell/glob/GlobComponentTest.java @@ -17,14 +17,14 @@ package org.apache.kafka.shell.glob; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; - @Timeout(value = 120) public class GlobComponentTest { private void verifyIsLiteral(GlobComponent globComponent, String component) { diff --git a/shell/src/test/java/org/apache/kafka/shell/glob/GlobVisitorTest.java b/shell/src/test/java/org/apache/kafka/shell/glob/GlobVisitorTest.java index fb54cdf85f8fb..fd9ffd8934a94 100644 --- a/shell/src/test/java/org/apache/kafka/shell/glob/GlobVisitorTest.java +++ b/shell/src/test/java/org/apache/kafka/shell/glob/GlobVisitorTest.java @@ -17,12 +17,10 @@ package org.apache.kafka.shell.glob; -import static java.util.concurrent.TimeUnit.MINUTES; -import static org.junit.jupiter.api.Assertions.assertEquals; - import org.apache.kafka.image.node.MetadataNode; import org.apache.kafka.shell.glob.GlobVisitor.MetadataNodeInfo; import org.apache.kafka.shell.state.MetadataShellState; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; @@ -36,6 +34,9 @@ import java.util.Optional; import java.util.function.Consumer; +import static java.util.concurrent.TimeUnit.MINUTES; +import static org.junit.jupiter.api.Assertions.assertEquals; + @Timeout(value = 5, unit = MINUTES) public class GlobVisitorTest { static private final MetadataShellState DATA; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/agent/Agent.java b/trogdor/src/main/java/org/apache/kafka/trogdor/agent/Agent.java index c3fe33249b1f8..25199f7a9b46e 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/agent/Agent.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/agent/Agent.java @@ -17,12 +17,6 @@ package org.apache.kafka.trogdor.agent; -import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import net.sourceforge.argparse4j.ArgumentParsers; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.ArgumentParserException; -import net.sourceforge.argparse4j.inf.Namespace; import org.apache.kafka.common.KafkaFuture; import org.apache.kafka.common.utils.Exit; import org.apache.kafka.common.utils.Scheduler; @@ -35,9 +29,18 @@ import org.apache.kafka.trogdor.rest.DestroyWorkerRequest; import org.apache.kafka.trogdor.rest.JsonRestServer; import org.apache.kafka.trogdor.rest.StopWorkerRequest; +import org.apache.kafka.trogdor.rest.UptimeResponse; import org.apache.kafka.trogdor.task.TaskController; import org.apache.kafka.trogdor.task.TaskSpec; -import org.apache.kafka.trogdor.rest.UptimeResponse; + +import com.fasterxml.jackson.databind.node.LongNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + +import net.sourceforge.argparse4j.ArgumentParsers; +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.ArgumentParserException; +import net.sourceforge.argparse4j.inf.Namespace; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/agent/AgentClient.java b/trogdor/src/main/java/org/apache/kafka/trogdor/agent/AgentClient.java index cdeba84a36880..91dd6ee1d9787 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/agent/AgentClient.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/agent/AgentClient.java @@ -17,12 +17,6 @@ package org.apache.kafka.trogdor.agent; -import com.fasterxml.jackson.core.type.TypeReference; -import net.sourceforge.argparse4j.ArgumentParsers; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.Namespace; -import net.sourceforge.argparse4j.inf.Subparser; -import net.sourceforge.argparse4j.inf.Subparsers; import org.apache.kafka.common.utils.Exit; import org.apache.kafka.trogdor.common.JsonUtil; import org.apache.kafka.trogdor.common.StringFormatter; @@ -33,14 +27,21 @@ import org.apache.kafka.trogdor.rest.JsonRestServer; import org.apache.kafka.trogdor.rest.JsonRestServer.HttpResponse; import org.apache.kafka.trogdor.rest.StopWorkerRequest; +import org.apache.kafka.trogdor.rest.UptimeResponse; import org.apache.kafka.trogdor.rest.WorkerState; import org.apache.kafka.trogdor.task.TaskSpec; -import org.apache.kafka.trogdor.rest.UptimeResponse; + +import com.fasterxml.jackson.core.type.TypeReference; + +import net.sourceforge.argparse4j.ArgumentParsers; +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.Namespace; +import net.sourceforge.argparse4j.inf.Subparser; +import net.sourceforge.argparse4j.inf.Subparsers; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.core.UriBuilder; - import java.time.OffsetDateTime; import java.time.ZoneOffset; import java.util.ArrayList; @@ -48,6 +49,8 @@ import java.util.List; import java.util.Map; +import javax.ws.rs.core.UriBuilder; + import static net.sourceforge.argparse4j.impl.Arguments.store; import static net.sourceforge.argparse4j.impl.Arguments.storeTrue; import static org.apache.kafka.trogdor.common.StringFormatter.dateString; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/agent/AgentRestResource.java b/trogdor/src/main/java/org/apache/kafka/trogdor/agent/AgentRestResource.java index ec3df8bf84696..09f5d5bb3ebb9 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/agent/AgentRestResource.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/agent/AgentRestResource.java @@ -23,6 +23,8 @@ import org.apache.kafka.trogdor.rest.StopWorkerRequest; import org.apache.kafka.trogdor.rest.UptimeResponse; +import java.util.concurrent.atomic.AtomicReference; + import javax.servlet.ServletContext; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -34,7 +36,6 @@ import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; -import java.util.concurrent.atomic.AtomicReference; /** * The REST resource for the Agent. This describes the RPCs which the agent can accept. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/agent/WorkerManager.java b/trogdor/src/main/java/org/apache/kafka/trogdor/agent/WorkerManager.java index 4510e1bb9221e..7a955e359af55 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/agent/WorkerManager.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/agent/WorkerManager.java @@ -29,11 +29,12 @@ import org.apache.kafka.trogdor.rest.WorkerDone; import org.apache.kafka.trogdor.rest.WorkerRunning; import org.apache.kafka.trogdor.rest.WorkerStarting; -import org.apache.kafka.trogdor.rest.WorkerStopping; import org.apache.kafka.trogdor.rest.WorkerState; +import org.apache.kafka.trogdor.rest.WorkerStopping; import org.apache.kafka.trogdor.task.AgentWorkerStatusTracker; import org.apache.kafka.trogdor.task.TaskSpec; import org.apache.kafka.trogdor.task.TaskWorker; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/basic/BasicNode.java b/trogdor/src/main/java/org/apache/kafka/trogdor/basic/BasicNode.java index 232a64db80b00..2c0b7faa946e7 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/basic/BasicNode.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/basic/BasicNode.java @@ -17,9 +17,10 @@ package org.apache.kafka.trogdor.basic; -import com.fasterxml.jackson.databind.JsonNode; import org.apache.kafka.trogdor.common.Node; +import com.fasterxml.jackson.databind.JsonNode; + import java.util.Collections; import java.util.HashMap; import java.util.HashSet; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/basic/BasicPlatform.java b/trogdor/src/main/java/org/apache/kafka/trogdor/basic/BasicPlatform.java index 3552e4b30896b..1968be27096a4 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/basic/BasicPlatform.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/basic/BasicPlatform.java @@ -17,12 +17,14 @@ package org.apache.kafka.trogdor.basic; -import com.fasterxml.jackson.databind.JsonNode; import org.apache.kafka.common.utils.Scheduler; import org.apache.kafka.common.utils.Shell; import org.apache.kafka.trogdor.common.Node; import org.apache.kafka.trogdor.common.Platform; import org.apache.kafka.trogdor.common.Topology; + +import com.fasterxml.jackson.databind.JsonNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/basic/BasicTopology.java b/trogdor/src/main/java/org/apache/kafka/trogdor/basic/BasicTopology.java index 1f291503e9190..1c3e2ef1caf24 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/basic/BasicTopology.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/basic/BasicTopology.java @@ -17,10 +17,11 @@ package org.apache.kafka.trogdor.basic; -import com.fasterxml.jackson.databind.JsonNode; import org.apache.kafka.trogdor.common.Node; import org.apache.kafka.trogdor.common.Topology; +import com.fasterxml.jackson.databind.JsonNode; + import java.util.Iterator; import java.util.NavigableMap; import java.util.TreeMap; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/common/Platform.java b/trogdor/src/main/java/org/apache/kafka/trogdor/common/Platform.java index cb2062086a6f8..defed06c32309 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/common/Platform.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/common/Platform.java @@ -17,14 +17,14 @@ package org.apache.kafka.trogdor.common; +import org.apache.kafka.common.utils.Scheduler; +import org.apache.kafka.common.utils.Utils; + import com.fasterxml.jackson.databind.JsonNode; import java.io.File; import java.io.IOException; -import org.apache.kafka.common.utils.Scheduler; -import org.apache.kafka.common.utils.Utils; - /** * Defines a cluster topology */ diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/common/WorkerUtils.java b/trogdor/src/main/java/org/apache/kafka/trogdor/common/WorkerUtils.java index cd0e09ee63822..693ae2e6d3b81 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/common/WorkerUtils.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/common/WorkerUtils.java @@ -36,6 +36,7 @@ import org.apache.kafka.common.internals.KafkaFutureImpl; import org.apache.kafka.common.requests.CreateTopicsRequest; import org.apache.kafka.common.utils.Time; + import org.slf4j.Logger; import java.util.ArrayList; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/Coordinator.java b/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/Coordinator.java index dcb838b4e0a0b..9bf8a767cd0c5 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/Coordinator.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/Coordinator.java @@ -17,10 +17,6 @@ package org.apache.kafka.trogdor.coordinator; -import net.sourceforge.argparse4j.ArgumentParsers; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.ArgumentParserException; -import net.sourceforge.argparse4j.inf.Namespace; import org.apache.kafka.common.utils.Exit; import org.apache.kafka.common.utils.Scheduler; import org.apache.kafka.common.utils.Time; @@ -36,6 +32,12 @@ import org.apache.kafka.trogdor.rest.TasksRequest; import org.apache.kafka.trogdor.rest.TasksResponse; import org.apache.kafka.trogdor.rest.UptimeResponse; + +import net.sourceforge.argparse4j.ArgumentParsers; +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.ArgumentParserException; +import net.sourceforge.argparse4j.inf.Namespace; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/CoordinatorClient.java b/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/CoordinatorClient.java index 57797ec80a537..00c26adc4c4c8 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/CoordinatorClient.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/CoordinatorClient.java @@ -17,13 +17,6 @@ package org.apache.kafka.trogdor.coordinator; -import com.fasterxml.jackson.core.type.TypeReference; -import net.sourceforge.argparse4j.ArgumentParsers; -import net.sourceforge.argparse4j.inf.ArgumentParser; -import net.sourceforge.argparse4j.inf.MutuallyExclusiveGroup; -import net.sourceforge.argparse4j.inf.Namespace; -import net.sourceforge.argparse4j.inf.Subparser; -import net.sourceforge.argparse4j.inf.Subparsers; import org.apache.kafka.common.utils.Exit; import org.apache.kafka.trogdor.common.JsonUtil; import org.apache.kafka.trogdor.common.StringFormatter; @@ -33,25 +26,32 @@ import org.apache.kafka.trogdor.rest.Empty; import org.apache.kafka.trogdor.rest.JsonRestServer; import org.apache.kafka.trogdor.rest.JsonRestServer.HttpResponse; +import org.apache.kafka.trogdor.rest.RequestConflictException; import org.apache.kafka.trogdor.rest.StopTaskRequest; import org.apache.kafka.trogdor.rest.TaskDone; import org.apache.kafka.trogdor.rest.TaskPending; import org.apache.kafka.trogdor.rest.TaskRequest; import org.apache.kafka.trogdor.rest.TaskRunning; +import org.apache.kafka.trogdor.rest.TaskState; import org.apache.kafka.trogdor.rest.TaskStateType; import org.apache.kafka.trogdor.rest.TaskStopping; import org.apache.kafka.trogdor.rest.TasksRequest; -import org.apache.kafka.trogdor.rest.TaskState; import org.apache.kafka.trogdor.rest.TasksResponse; -import org.apache.kafka.trogdor.task.TaskSpec; -import org.apache.kafka.trogdor.rest.RequestConflictException; import org.apache.kafka.trogdor.rest.UptimeResponse; +import org.apache.kafka.trogdor.task.TaskSpec; + +import com.fasterxml.jackson.core.type.TypeReference; + +import net.sourceforge.argparse4j.ArgumentParsers; +import net.sourceforge.argparse4j.inf.ArgumentParser; +import net.sourceforge.argparse4j.inf.MutuallyExclusiveGroup; +import net.sourceforge.argparse4j.inf.Namespace; +import net.sourceforge.argparse4j.inf.Subparser; +import net.sourceforge.argparse4j.inf.Subparsers; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.UriBuilder; - import java.time.OffsetDateTime; import java.time.ZoneOffset; import java.util.ArrayList; @@ -63,6 +63,9 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.UriBuilder; + import static net.sourceforge.argparse4j.impl.Arguments.append; import static net.sourceforge.argparse4j.impl.Arguments.store; import static net.sourceforge.argparse4j.impl.Arguments.storeTrue; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/CoordinatorRestResource.java b/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/CoordinatorRestResource.java index c44b696da0b5d..a65c4d26a73a1 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/CoordinatorRestResource.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/CoordinatorRestResource.java @@ -29,6 +29,10 @@ import org.apache.kafka.trogdor.rest.TasksResponse; import org.apache.kafka.trogdor.rest.UptimeResponse; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicReference; + import javax.servlet.ServletContext; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -43,9 +47,6 @@ import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import java.util.List; -import java.util.Optional; -import java.util.concurrent.atomic.AtomicReference; /** * The REST resource for the Coordinator. This describes the RPCs which the coordinator diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/NodeManager.java b/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/NodeManager.java index e85708a514366..577b22b8c67fe 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/NodeManager.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/NodeManager.java @@ -56,6 +56,7 @@ import org.apache.kafka.trogdor.rest.WorkerState; import org.apache.kafka.trogdor.rest.WorkerStopping; import org.apache.kafka.trogdor.task.TaskSpec; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/TaskManager.java b/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/TaskManager.java index b270a377305b1..9c2a13cb68f77 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/TaskManager.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/TaskManager.java @@ -17,11 +17,6 @@ package org.apache.kafka.trogdor.coordinator; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.kafka.common.KafkaException; import org.apache.kafka.common.errors.InvalidRequestException; import org.apache.kafka.common.utils.Scheduler; @@ -46,6 +41,13 @@ import org.apache.kafka.trogdor.rest.WorkerState; import org.apache.kafka.trogdor.task.TaskController; import org.apache.kafka.trogdor.task.TaskSpec; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.LongNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/DegradedNetworkFaultSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/DegradedNetworkFaultSpec.java index 127a4da5ddb26..59a2eb00eb0e6 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/DegradedNetworkFaultSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/DegradedNetworkFaultSpec.java @@ -17,12 +17,13 @@ package org.apache.kafka.trogdor.fault; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.trogdor.task.TaskController; import org.apache.kafka.trogdor.task.TaskSpec; import org.apache.kafka.trogdor.task.TaskWorker; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.Collections; import java.util.Map; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/DegradedNetworkFaultWorker.java b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/DegradedNetworkFaultWorker.java index d071d12a845e1..f9657d042e6ef 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/DegradedNetworkFaultWorker.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/DegradedNetworkFaultWorker.java @@ -17,12 +17,14 @@ package org.apache.kafka.trogdor.fault; -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.common.internals.KafkaFutureImpl; import org.apache.kafka.trogdor.common.Node; import org.apache.kafka.trogdor.common.Platform; import org.apache.kafka.trogdor.task.TaskWorker; import org.apache.kafka.trogdor.task.WorkerStatusTracker; + +import com.fasterxml.jackson.databind.node.TextNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/FilesUnreadableFaultSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/FilesUnreadableFaultSpec.java index f38a89b5178b1..41c63acd217bc 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/FilesUnreadableFaultSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/FilesUnreadableFaultSpec.java @@ -17,13 +17,14 @@ package org.apache.kafka.trogdor.fault; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.trogdor.fault.Kibosh.KiboshFilesUnreadableFaultSpec; import org.apache.kafka.trogdor.task.TaskController; import org.apache.kafka.trogdor.task.TaskSpec; import org.apache.kafka.trogdor.task.TaskWorker; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.HashSet; import java.util.Set; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/Kibosh.java b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/Kibosh.java index 95356c5209e35..df8f5c485ecf3 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/Kibosh.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/Kibosh.java @@ -17,11 +17,12 @@ package org.apache.kafka.trogdor.fault; +import org.apache.kafka.trogdor.common.JsonUtil; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.apache.kafka.trogdor.common.JsonUtil; import java.io.IOException; import java.nio.file.Files; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/KiboshFaultWorker.java b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/KiboshFaultWorker.java index 97934a88bbdea..4da42fd2cd268 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/KiboshFaultWorker.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/KiboshFaultWorker.java @@ -17,12 +17,14 @@ package org.apache.kafka.trogdor.fault; -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.common.internals.KafkaFutureImpl; import org.apache.kafka.trogdor.common.Platform; import org.apache.kafka.trogdor.fault.Kibosh.KiboshFaultSpec; import org.apache.kafka.trogdor.task.TaskWorker; import org.apache.kafka.trogdor.task.WorkerStatusTracker; + +import com.fasterxml.jackson.databind.node.TextNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/NetworkPartitionFaultSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/NetworkPartitionFaultSpec.java index 445ed92b2e63f..d49317d7d2743 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/NetworkPartitionFaultSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/NetworkPartitionFaultSpec.java @@ -17,12 +17,13 @@ package org.apache.kafka.trogdor.fault; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.trogdor.task.TaskController; import org.apache.kafka.trogdor.task.TaskSpec; import org.apache.kafka.trogdor.task.TaskWorker; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.ArrayList; import java.util.HashSet; import java.util.List; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/NetworkPartitionFaultWorker.java b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/NetworkPartitionFaultWorker.java index 1b99a93d8fbd0..9cb8b5724a22d 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/NetworkPartitionFaultWorker.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/NetworkPartitionFaultWorker.java @@ -17,13 +17,15 @@ package org.apache.kafka.trogdor.fault; -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.common.internals.KafkaFutureImpl; import org.apache.kafka.trogdor.common.Node; import org.apache.kafka.trogdor.common.Platform; import org.apache.kafka.trogdor.common.Topology; import org.apache.kafka.trogdor.task.TaskWorker; import org.apache.kafka.trogdor.task.WorkerStatusTracker; + +import com.fasterxml.jackson.databind.node.TextNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultController.java b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultController.java index 6ec803a3588cc..2499e903706bf 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultController.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultController.java @@ -19,6 +19,7 @@ import org.apache.kafka.trogdor.common.Topology; import org.apache.kafka.trogdor.task.TaskController; + import java.util.Set; public class ProcessStopFaultController implements TaskController { diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultSpec.java index a99cb7cb2e22e..7bb00f2ee9031 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultSpec.java @@ -17,12 +17,13 @@ package org.apache.kafka.trogdor.fault; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.trogdor.task.TaskController; import org.apache.kafka.trogdor.task.TaskSpec; import org.apache.kafka.trogdor.task.TaskWorker; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.HashSet; import java.util.List; import java.util.Set; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultWorker.java b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultWorker.java index 5d9d68e443c08..ffab9f72f994e 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultWorker.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultWorker.java @@ -17,11 +17,13 @@ package org.apache.kafka.trogdor.fault; -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.common.internals.KafkaFutureImpl; import org.apache.kafka.trogdor.common.Platform; import org.apache.kafka.trogdor.task.TaskWorker; import org.apache.kafka.trogdor.task.WorkerStatusTracker; + +import com.fasterxml.jackson.databind.node.TextNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/CreateTaskRequest.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/CreateTaskRequest.java index f3c216e02e0d3..8b786f17d2d29 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/CreateTaskRequest.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/CreateTaskRequest.java @@ -17,9 +17,10 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.kafka.trogdor.task.TaskSpec; /** * A request to the Trogdor coordinator to create a task. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/CreateWorkerRequest.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/CreateWorkerRequest.java index 4acc943251e40..ee49a2ffebd53 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/CreateWorkerRequest.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/CreateWorkerRequest.java @@ -17,9 +17,10 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.kafka.trogdor.task.TaskSpec; /** * A request to the Trogdor agent to create a worker. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/Empty.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/Empty.java index 68547930ad016..55bcd1f85da2f 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/Empty.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/Empty.java @@ -17,9 +17,10 @@ package org.apache.kafka.trogdor.rest; -import com.fasterxml.jackson.annotation.JsonCreator; import org.apache.kafka.trogdor.common.JsonUtil; +import com.fasterxml.jackson.annotation.JsonCreator; + /** * An empty request or response. */ diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/ErrorResponse.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/ErrorResponse.java index 08bf6cdad12b2..fa8df147b8423 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/ErrorResponse.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/ErrorResponse.java @@ -17,9 +17,10 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.common.JsonUtil; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.kafka.trogdor.common.JsonUtil; import java.util.Objects; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/JsonRestServer.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/JsonRestServer.java index cc3bbc0cc6de4..44e69ee2dc77f 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/JsonRestServer.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/JsonRestServer.java @@ -17,11 +17,12 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.common.utils.ThreadUtils; +import org.apache.kafka.trogdor.common.JsonUtil; + import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; -import org.apache.kafka.common.utils.ThreadUtils; -import org.apache.kafka.trogdor.common.JsonUtil; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.CustomRequestLog; import org.eclipse.jetty.server.Handler; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/RestExceptionMapper.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/RestExceptionMapper.java index 57c54ec04d846..2c1a046b480bf 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/RestExceptionMapper.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/RestExceptionMapper.java @@ -16,10 +16,12 @@ */ package org.apache.kafka.trogdor.rest; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.exc.InvalidTypeIdException; import org.apache.kafka.common.errors.InvalidRequestException; import org.apache.kafka.common.errors.SerializationException; + +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.exc.InvalidTypeIdException; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskDone.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskDone.java index 6e9761bf5e59b..f888d46ff4d9e 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskDone.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskDone.java @@ -16,10 +16,11 @@ */ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; -import org.apache.kafka.trogdor.task.TaskSpec; /** * The state a task is in once it's done. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskPending.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskPending.java index ca1d314a53acd..3c20227d2791d 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskPending.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskPending.java @@ -17,10 +17,11 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.node.NullNode; -import org.apache.kafka.trogdor.task.TaskSpec; /** * The state for a task which is still pending. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskRunning.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskRunning.java index 8487bc39d1691..baee886a721ac 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskRunning.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskRunning.java @@ -17,10 +17,11 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; -import org.apache.kafka.trogdor.task.TaskSpec; /** * The state for a task which is being run by the agent. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskState.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskState.java index 6484d0692e3ba..6bb9e7f4f1f26 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskState.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskState.java @@ -17,12 +17,13 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.NullNode; -import org.apache.kafka.trogdor.task.TaskSpec; /** * The state which a task is in on the Coordinator. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskStopping.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskStopping.java index 2b2c4c4ec0b07..a54d6cdbf58cf 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskStopping.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/TaskStopping.java @@ -17,10 +17,11 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; -import org.apache.kafka.trogdor.task.TaskSpec; /** * The state for a task which is being stopped on the coordinator. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerDone.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerDone.java index 5f773bba5c443..5b6f1501cc6bb 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerDone.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerDone.java @@ -17,11 +17,12 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.NullNode; -import org.apache.kafka.trogdor.task.TaskSpec; /** * The state a worker is in once it's done. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerReceiving.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerReceiving.java index 1babcce2a5762..8196359d10b0b 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerReceiving.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerReceiving.java @@ -17,11 +17,12 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.TextNode; -import org.apache.kafka.trogdor.task.TaskSpec; /** * When we're in the process of sending a TaskSpec to the Agent, the Worker is regarded diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerRunning.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerRunning.java index 15e77528d6229..49bc0160a29bb 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerRunning.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerRunning.java @@ -17,11 +17,12 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.NullNode; -import org.apache.kafka.trogdor.task.TaskSpec; /** * The state for a task which is being run by the agent. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerStarting.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerStarting.java index 7a06eac5b7d08..a6c58a376c9e0 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerStarting.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerStarting.java @@ -17,11 +17,12 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.TextNode; -import org.apache.kafka.trogdor.task.TaskSpec; /** * When we have just started a worker. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerState.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerState.java index aa97d5706e0d6..d1dfe5cb60364 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerState.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerState.java @@ -17,12 +17,13 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.common.KafkaException; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.JsonNode; -import org.apache.kafka.common.KafkaException; -import org.apache.kafka.trogdor.task.TaskSpec; /** * The state which a worker is in on the Agent. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerStopping.java b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerStopping.java index 2942e118ac6bf..bfac86857ed06 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerStopping.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/rest/WorkerStopping.java @@ -17,11 +17,12 @@ package org.apache.kafka.trogdor.rest; +import org.apache.kafka.trogdor.task.TaskSpec; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.NullNode; -import org.apache.kafka.trogdor.task.TaskSpec; /** * The state for a worker which is being stopped on the agent. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/task/NoOpTaskWorker.java b/trogdor/src/main/java/org/apache/kafka/trogdor/task/NoOpTaskWorker.java index 77336d87059f3..c2c3c057e470f 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/task/NoOpTaskWorker.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/task/NoOpTaskWorker.java @@ -17,9 +17,11 @@ package org.apache.kafka.trogdor.task; -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.common.internals.KafkaFutureImpl; import org.apache.kafka.trogdor.common.Platform; + +import com.fasterxml.jackson.databind.node.TextNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/task/TaskSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/task/TaskSpec.java index 7b67c4ee78967..670030acc67b4 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/task/TaskSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/task/TaskSpec.java @@ -17,9 +17,10 @@ package org.apache.kafka.trogdor.task; +import org.apache.kafka.trogdor.common.JsonUtil; + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.apache.kafka.trogdor.common.JsonUtil; import java.util.Collections; import java.util.Map; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConfigurableProducerSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConfigurableProducerSpec.java index 29d4a451f57f4..64332e13f5b4b 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConfigurableProducerSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConfigurableProducerSpec.java @@ -17,11 +17,13 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.trogdor.task.TaskController; import org.apache.kafka.trogdor.task.TaskSpec; import org.apache.kafka.trogdor.task.TaskWorker; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.Collections; import java.util.Map; import java.util.Optional; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConfigurableProducerWorker.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConfigurableProducerWorker.java index b08ef44d6388e..9fc930585d195 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConfigurableProducerWorker.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConfigurableProducerWorker.java @@ -17,9 +17,6 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.clients.admin.NewTopic; import org.apache.kafka.clients.producer.Callback; import org.apache.kafka.clients.producer.KafkaProducer; @@ -36,6 +33,11 @@ import org.apache.kafka.trogdor.common.WorkerUtils; import org.apache.kafka.trogdor.task.TaskWorker; import org.apache.kafka.trogdor.task.WorkerStatusTracker; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.node.TextNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConnectionStressSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConnectionStressSpec.java index 8738091b4990d..aa6cf7e5dae9c 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConnectionStressSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConnectionStressSpec.java @@ -17,12 +17,13 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.trogdor.task.TaskController; import org.apache.kafka.trogdor.task.TaskSpec; import org.apache.kafka.trogdor.task.TaskWorker; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConnectionStressWorker.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConnectionStressWorker.java index 6cd367c06d9f2..34d683af7f3c1 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConnectionStressWorker.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConnectionStressWorker.java @@ -17,9 +17,6 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; import org.apache.kafka.clients.ApiVersions; import org.apache.kafka.clients.ClientUtils; import org.apache.kafka.clients.ManualMetadataUpdater; @@ -43,6 +40,11 @@ import org.apache.kafka.trogdor.common.WorkerUtils; import org.apache.kafka.trogdor.task.TaskWorker; import org.apache.kafka.trogdor.task.WorkerStatusTracker; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConstantFlushGenerator.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConstantFlushGenerator.java index 9d656b219a1be..9de6dd738b957 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConstantFlushGenerator.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConstantFlushGenerator.java @@ -16,11 +16,12 @@ */ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.common.errors.InterruptException; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + /** * This generator will flush the producer after a specific number of messages. This is useful to simulate a specific * number of messages in a batch regardless of the message size, since batch flushing is not exposed in the diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConstantThroughputGenerator.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConstantThroughputGenerator.java index 9e5eeb967e96e..d46594cbe9406 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConstantThroughputGenerator.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConstantThroughputGenerator.java @@ -16,9 +16,10 @@ */ package org.apache.kafka.trogdor.workload; +import org.apache.kafka.common.utils.Time; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.kafka.common.utils.Time; /** * This throughput generator configures constant throughput. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConsumeBenchSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConsumeBenchSpec.java index 294b251dedd2e..3813b418fba59 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConsumeBenchSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConsumeBenchSpec.java @@ -17,9 +17,6 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.config.ConfigException; import org.apache.kafka.trogdor.common.StringExpander; @@ -27,15 +24,18 @@ import org.apache.kafka.trogdor.task.TaskSpec; import org.apache.kafka.trogdor.task.TaskWorker; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.List; -import java.util.Map; import java.util.HashMap; -import java.util.Set; import java.util.HashSet; +import java.util.List; +import java.util.Map; import java.util.Optional; +import java.util.Set; /** * The specification for a benchmark that consumer messages from a set of topic/partitions. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConsumeBenchWorker.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConsumeBenchWorker.java index 83e73db1a7b66..da2de44074e28 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConsumeBenchWorker.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConsumeBenchWorker.java @@ -17,9 +17,6 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.ConsumerRecords; @@ -34,22 +31,26 @@ import org.apache.kafka.trogdor.common.JsonUtil; import org.apache.kafka.trogdor.common.Platform; import org.apache.kafka.trogdor.common.WorkerUtils; +import org.apache.kafka.trogdor.task.TaskWorker; import org.apache.kafka.trogdor.task.WorkerStatusTracker; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.apache.kafka.trogdor.task.TaskWorker; - import java.time.Duration; import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.UUID; import java.util.Optional; import java.util.Properties; -import java.util.HashMap; +import java.util.Set; +import java.util.UUID; import java.util.concurrent.Callable; import java.util.concurrent.Executors; import java.util.concurrent.Future; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ExternalCommandSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ExternalCommandSpec.java index f6a738d01448a..838beb62cff27 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ExternalCommandSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ExternalCommandSpec.java @@ -17,14 +17,14 @@ package org.apache.kafka.trogdor.workload; +import org.apache.kafka.trogdor.task.TaskController; +import org.apache.kafka.trogdor.task.TaskSpec; +import org.apache.kafka.trogdor.task.TaskWorker; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; - import com.fasterxml.jackson.databind.node.NullNode; -import org.apache.kafka.trogdor.task.TaskController; -import org.apache.kafka.trogdor.task.TaskSpec; -import org.apache.kafka.trogdor.task.TaskWorker; import java.util.ArrayList; import java.util.Collections; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ExternalCommandWorker.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ExternalCommandWorker.java index 6543e22798865..be9046235218d 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ExternalCommandWorker.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ExternalCommandWorker.java @@ -17,33 +17,34 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.common.internals.KafkaFutureImpl; import org.apache.kafka.common.utils.ThreadUtils; import org.apache.kafka.trogdor.common.JsonUtil; import org.apache.kafka.trogdor.common.Platform; import org.apache.kafka.trogdor.task.TaskWorker; import org.apache.kafka.trogdor.task.WorkerStatusTracker; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.NullNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.BufferedReader; import java.io.IOException; - import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; +import java.util.Optional; +import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.Optional; /** * ExternalCommandWorker starts an external process to run a Trogdor command. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/FlushGenerator.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/FlushGenerator.java index a0cea563524da..0dc55d45208c2 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/FlushGenerator.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/FlushGenerator.java @@ -17,9 +17,10 @@ package org.apache.kafka.trogdor.workload; +import org.apache.kafka.clients.producer.KafkaProducer; + import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.apache.kafka.clients.producer.KafkaProducer; /** * This interface is used to facilitate flushing the KafkaProducers on a cadence specified by the user. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianFlushGenerator.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianFlushGenerator.java index eb6845e38046e..9e9fe4ae3cc34 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianFlushGenerator.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianFlushGenerator.java @@ -17,10 +17,12 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.common.errors.InterruptException; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.Random; /** diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianThroughputGenerator.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianThroughputGenerator.java index a77298f0be8b0..5e064f58e417a 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianThroughputGenerator.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianThroughputGenerator.java @@ -17,9 +17,11 @@ package org.apache.kafka.trogdor.workload; +import org.apache.kafka.common.utils.Time; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.kafka.common.utils.Time; + import java.util.Random; /* diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianTimestampConstantPayloadGenerator.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianTimestampConstantPayloadGenerator.java index 8660ed329a293..fef98d619ed86 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianTimestampConstantPayloadGenerator.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianTimestampConstantPayloadGenerator.java @@ -17,9 +17,10 @@ package org.apache.kafka.trogdor.workload; +import org.apache.kafka.common.utils.Time; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.kafka.common.utils.Time; import java.nio.ByteBuffer; import java.nio.ByteOrder; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianTimestampRandomPayloadGenerator.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianTimestampRandomPayloadGenerator.java index 48261a454f32a..6b7f38047cb6c 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianTimestampRandomPayloadGenerator.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/GaussianTimestampRandomPayloadGenerator.java @@ -17,9 +17,10 @@ package org.apache.kafka.trogdor.workload; +import org.apache.kafka.common.utils.Time; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.kafka.common.utils.Time; import java.nio.ByteBuffer; import java.nio.ByteOrder; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/PartitionsSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/PartitionsSpec.java index c1dc7c68761e8..1bd2f788a3017 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/PartitionsSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/PartitionsSpec.java @@ -17,11 +17,12 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.clients.admin.NewTopic; import org.apache.kafka.trogdor.rest.Message; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ProduceBenchSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ProduceBenchSpec.java index 540ae763e6677..653fa9cddb6f4 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ProduceBenchSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ProduceBenchSpec.java @@ -17,12 +17,13 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.trogdor.task.TaskController; import org.apache.kafka.trogdor.task.TaskSpec; import org.apache.kafka.trogdor.task.TaskWorker; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.Collections; import java.util.Map; import java.util.Optional; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ProduceBenchWorker.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ProduceBenchWorker.java index d1f6ad75f6533..7cdcf2e45df4f 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ProduceBenchWorker.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/ProduceBenchWorker.java @@ -17,9 +17,6 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.clients.admin.NewTopic; import org.apache.kafka.clients.producer.Callback; import org.apache.kafka.clients.producer.KafkaProducer; @@ -37,6 +34,11 @@ import org.apache.kafka.trogdor.task.TaskWorker; import org.apache.kafka.trogdor.task.WorkerStatusTracker; import org.apache.kafka.trogdor.workload.TransactionGenerator.TransactionAction; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.node.TextNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RandomComponent.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RandomComponent.java index b5973a8c74443..5f5da5735dea0 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RandomComponent.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RandomComponent.java @@ -46,4 +46,3 @@ public PayloadGenerator component() { return component; } } - diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RecordProcessor.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RecordProcessor.java index 451ce1271c915..39a2f8b56b623 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RecordProcessor.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RecordProcessor.java @@ -17,10 +17,11 @@ package org.apache.kafka.trogdor.workload; +import org.apache.kafka.clients.consumer.ConsumerRecords; + import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.JsonNode; -import org.apache.kafka.clients.consumer.ConsumerRecords; /** * RecordProcessor allows for acting on data polled from ConsumeBench workloads. @@ -33,4 +34,3 @@ public interface RecordProcessor { void processRecords(ConsumerRecords consumerRecords); JsonNode processorStatus(); } - diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RoundTripWorker.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RoundTripWorker.java index 241bda0c5d066..385e14162ee83 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RoundTripWorker.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RoundTripWorker.java @@ -17,9 +17,6 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.clients.admin.NewTopic; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.consumer.ConsumerRecord; @@ -43,6 +40,11 @@ import org.apache.kafka.trogdor.common.WorkerUtils; import org.apache.kafka.trogdor.task.TaskWorker; import org.apache.kafka.trogdor.task.WorkerStatusTracker; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.node.TextNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RoundTripWorkloadSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RoundTripWorkloadSpec.java index 296c47f23d3ef..1000fb32ead42 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RoundTripWorkloadSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/RoundTripWorkloadSpec.java @@ -17,12 +17,13 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.trogdor.task.TaskController; import org.apache.kafka.trogdor.task.TaskSpec; import org.apache.kafka.trogdor.task.TaskWorker; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.Collections; import java.util.Map; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/SustainedConnectionSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/SustainedConnectionSpec.java index 94ce71eea12ac..516de304f2f11 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/SustainedConnectionSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/SustainedConnectionSpec.java @@ -17,12 +17,13 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.trogdor.task.TaskController; import org.apache.kafka.trogdor.task.TaskSpec; import org.apache.kafka.trogdor.task.TaskWorker; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.Collections; import java.util.Map; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/SustainedConnectionWorker.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/SustainedConnectionWorker.java index aad02d8f7deb6..9ac4ac68b35e8 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/SustainedConnectionWorker.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/SustainedConnectionWorker.java @@ -17,9 +17,6 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; import org.apache.kafka.clients.admin.Admin; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.consumer.KafkaConsumer; @@ -38,6 +35,11 @@ import org.apache.kafka.trogdor.common.WorkerUtils; import org.apache.kafka.trogdor.task.TaskWorker; import org.apache.kafka.trogdor.task.WorkerStatusTracker; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimeIntervalTransactionsGenerator.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimeIntervalTransactionsGenerator.java index 8d5f05b1ee001..4672bcafbf219 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimeIntervalTransactionsGenerator.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimeIntervalTransactionsGenerator.java @@ -16,9 +16,10 @@ */ package org.apache.kafka.trogdor.workload; +import org.apache.kafka.common.utils.Time; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.kafka.common.utils.Time; /** * A transactions generator where we commit a transaction every N milliseconds diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimestampConstantPayloadGenerator.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimestampConstantPayloadGenerator.java index e9c4bc8a54068..a2f6793a3248b 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimestampConstantPayloadGenerator.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimestampConstantPayloadGenerator.java @@ -17,12 +17,13 @@ package org.apache.kafka.trogdor.workload; +import org.apache.kafka.common.utils.Time; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.kafka.common.utils.Time; -import java.nio.ByteOrder; import java.nio.ByteBuffer; +import java.nio.ByteOrder; /** * A PayloadGenerator which generates a timestamped constant payload. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimestampRandomPayloadGenerator.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimestampRandomPayloadGenerator.java index d2cfdc702b500..6cefefc9b7168 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimestampRandomPayloadGenerator.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimestampRandomPayloadGenerator.java @@ -17,13 +17,14 @@ package org.apache.kafka.trogdor.workload; +import org.apache.kafka.common.utils.Time; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.kafka.common.utils.Time; +import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Random; -import java.nio.ByteBuffer; /** * A PayloadGenerator which generates a timestamped uniform random payload. diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimestampRecordProcessor.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimestampRecordProcessor.java index 035d45928398a..edbcefc4b8c34 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimestampRecordProcessor.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TimestampRecordProcessor.java @@ -17,13 +17,14 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.ConsumerRecords; -import org.apache.kafka.trogdor.common.JsonUtil; import org.apache.kafka.common.utils.Time; +import org.apache.kafka.trogdor.common.JsonUtil; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TopicsSpec.java b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TopicsSpec.java index dcb8d8ad50b11..600fd46f21fcc 100644 --- a/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TopicsSpec.java +++ b/trogdor/src/main/java/org/apache/kafka/trogdor/workload/TopicsSpec.java @@ -17,11 +17,12 @@ package org.apache.kafka.trogdor.workload; +import org.apache.kafka.trogdor.common.StringExpander; +import org.apache.kafka.trogdor.rest.Message; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonCreator; -import org.apache.kafka.trogdor.common.StringExpander; -import org.apache.kafka.trogdor.rest.Message; import java.util.Collections; import java.util.HashMap; diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/agent/AgentTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/agent/AgentTest.java index 652780ca53f9e..070de473056e7 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/agent/AgentTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/agent/AgentTest.java @@ -17,12 +17,6 @@ package org.apache.kafka.trogdor.agent; -import static java.util.Arrays.asList; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; - -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.common.utils.MockScheduler; import org.apache.kafka.common.utils.MockTime; import org.apache.kafka.common.utils.Scheduler; @@ -53,8 +47,12 @@ import org.apache.kafka.trogdor.task.NoOpTaskSpec; import org.apache.kafka.trogdor.task.SampleTaskSpec; import org.apache.kafka.trogdor.task.TaskSpec; + +import com.fasterxml.jackson.databind.node.TextNode; + import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.io.ByteArrayOutputStream; import java.io.File; @@ -66,7 +64,11 @@ import java.util.Collections; import java.util.HashMap; import java.util.TreeMap; -import org.junit.jupiter.api.Timeout; + +import static java.util.Arrays.asList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; @Timeout(value = 120) public class AgentTest { diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/basic/BasicPlatformTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/basic/BasicPlatformTest.java index 7277fb6db4a4c..eaba1124fd60f 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/basic/BasicPlatformTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/basic/BasicPlatformTest.java @@ -17,17 +17,18 @@ package org.apache.kafka.trogdor.basic; -import static org.junit.jupiter.api.Assertions.assertEquals; import org.apache.kafka.test.TestUtils; import org.apache.kafka.trogdor.common.Platform; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.io.File; import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; import java.nio.file.Files; -import org.junit.jupiter.api.Timeout; + +import static org.junit.jupiter.api.Assertions.assertEquals; @Timeout(value = 120) public class BasicPlatformTest { diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/common/CapturingCommandRunner.java b/trogdor/src/test/java/org/apache/kafka/trogdor/common/CapturingCommandRunner.java index 654f14b26a03b..d05c73b7ebf00 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/common/CapturingCommandRunner.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/common/CapturingCommandRunner.java @@ -18,6 +18,7 @@ package org.apache.kafka.trogdor.common; import org.apache.kafka.trogdor.basic.BasicPlatform; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/common/ExpectedTasks.java b/trogdor/src/test/java/org/apache/kafka/trogdor/common/ExpectedTasks.java index 3fdffd5adceed..87f818018c80e 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/common/ExpectedTasks.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/common/ExpectedTasks.java @@ -17,8 +17,6 @@ package org.apache.kafka.trogdor.common; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.kafka.test.TestUtils; import org.apache.kafka.trogdor.agent.AgentClient; import org.apache.kafka.trogdor.coordinator.CoordinatorClient; @@ -28,6 +26,10 @@ import org.apache.kafka.trogdor.rest.TasksResponse; import org.apache.kafka.trogdor.rest.WorkerState; import org.apache.kafka.trogdor.task.TaskSpec; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/common/JsonSerializationTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/common/JsonSerializationTest.java index 584acbae7faf9..4605e66ef1783 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/common/JsonSerializationTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/common/JsonSerializationTest.java @@ -17,8 +17,6 @@ package org.apache.kafka.trogdor.common; -import static org.junit.jupiter.api.Assertions.assertNotNull; - import org.apache.kafka.trogdor.fault.FilesUnreadableFaultSpec; import org.apache.kafka.trogdor.fault.Kibosh; import org.apache.kafka.trogdor.fault.NetworkPartitionFaultSpec; @@ -33,13 +31,16 @@ import org.apache.kafka.trogdor.workload.RoundTripWorkloadSpec; import org.apache.kafka.trogdor.workload.TopicsSpec; +import org.junit.jupiter.api.Test; + import java.lang.reflect.Field; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertNotNull; public class JsonSerializationTest { @Test diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/common/JsonUtilTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/common/JsonUtilTest.java index 922222df655f3..85059bb2b4af0 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/common/JsonUtilTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/common/JsonUtilTest.java @@ -17,13 +17,11 @@ package org.apache.kafka.trogdor.common; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import org.apache.kafka.test.TestUtils; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.kafka.test.TestUtils; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; @@ -31,6 +29,10 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + @Timeout(value = 120) public class JsonUtilTest { diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/common/MiniTrogdorCluster.java b/trogdor/src/test/java/org/apache/kafka/trogdor/common/MiniTrogdorCluster.java index 7f5cfc998ce9f..64e8c5def1ce3 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/common/MiniTrogdorCluster.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/common/MiniTrogdorCluster.java @@ -26,10 +26,10 @@ import org.apache.kafka.trogdor.basic.BasicPlatform; import org.apache.kafka.trogdor.basic.BasicTopology; import org.apache.kafka.trogdor.coordinator.Coordinator; - import org.apache.kafka.trogdor.coordinator.CoordinatorClient; import org.apache.kafka.trogdor.coordinator.CoordinatorRestResource; import org.apache.kafka.trogdor.rest.JsonRestServer; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/common/StringExpanderTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/common/StringExpanderTest.java index 22da4987c3015..0464db269a113 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/common/StringExpanderTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/common/StringExpanderTest.java @@ -17,14 +17,14 @@ package org.apache.kafka.trogdor.common; -import static org.junit.jupiter.api.Assertions.assertEquals; - import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; -import org.junit.jupiter.api.Timeout; + +import static org.junit.jupiter.api.Assertions.assertEquals; @Timeout(value = 120) public class StringExpanderTest { diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/common/StringFormatterTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/common/StringFormatterTest.java index f950dbcaf032a..2c78f61aac0a9 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/common/StringFormatterTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/common/StringFormatterTest.java @@ -17,14 +17,14 @@ package org.apache.kafka.trogdor.common; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.time.ZoneOffset; import java.util.Arrays; -import static org.apache.kafka.trogdor.common.StringFormatter.durationString; import static org.apache.kafka.trogdor.common.StringFormatter.dateString; +import static org.apache.kafka.trogdor.common.StringFormatter.durationString; import static org.junit.jupiter.api.Assertions.assertEquals; @Timeout(value = 120) diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/common/TopologyTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/common/TopologyTest.java index 7c1d695ddaa9f..3acca80baa935 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/common/TopologyTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/common/TopologyTest.java @@ -17,22 +17,22 @@ package org.apache.kafka.trogdor.common; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - import org.apache.kafka.trogdor.agent.Agent; import org.apache.kafka.trogdor.basic.BasicNode; import org.apache.kafka.trogdor.basic.BasicTopology; - import org.apache.kafka.trogdor.coordinator.Coordinator; + import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.TreeMap; -import org.junit.jupiter.api.Timeout; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; @Timeout(value = 120) public class TopologyTest { diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/common/WorkerUtilsTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/common/WorkerUtilsTest.java index e48590450d52d..a826bcf3988ae 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/common/WorkerUtilsTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/common/WorkerUtilsTest.java @@ -17,9 +17,6 @@ package org.apache.kafka.trogdor.common; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; - import org.apache.kafka.clients.admin.MockAdminClient; import org.apache.kafka.clients.admin.NewTopic; import org.apache.kafka.clients.admin.TopicDescription; @@ -30,6 +27,7 @@ import org.apache.kafka.common.errors.TopicExistsException; import org.apache.kafka.common.errors.UnknownTopicOrPartitionException; import org.apache.kafka.common.utils.Utils; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.slf4j.Logger; @@ -45,6 +43,9 @@ import java.util.Map; import java.util.Properties; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + public class WorkerUtilsTest { private static final Logger log = LoggerFactory.getLogger(WorkerUtilsTest.class); diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/coordinator/CoordinatorClientTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/coordinator/CoordinatorClientTest.java index d5f5d86c1ff9c..12449b185a2bd 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/coordinator/CoordinatorClientTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/coordinator/CoordinatorClientTest.java @@ -17,17 +17,19 @@ package org.apache.kafka.trogdor.coordinator; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; import org.apache.kafka.trogdor.rest.TaskDone; import org.apache.kafka.trogdor.rest.TaskPending; import org.apache.kafka.trogdor.rest.TaskRunning; import org.apache.kafka.trogdor.rest.TaskStopping; import org.apache.kafka.trogdor.task.NoOpTaskSpec; -import java.time.ZoneOffset; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; +import java.time.ZoneOffset; + import static org.junit.jupiter.api.Assertions.assertEquals; @Timeout(value = 120) diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/coordinator/CoordinatorTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/coordinator/CoordinatorTest.java index 9a84f1aa2e4d4..849e2713d9e85 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/coordinator/CoordinatorTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/coordinator/CoordinatorTest.java @@ -17,9 +17,6 @@ package org.apache.kafka.trogdor.coordinator; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.common.utils.MockScheduler; import org.apache.kafka.common.utils.MockTime; import org.apache.kafka.common.utils.Scheduler; @@ -48,19 +45,25 @@ import org.apache.kafka.trogdor.rest.WorkerRunning; import org.apache.kafka.trogdor.task.NoOpTaskSpec; import org.apache.kafka.trogdor.task.SampleTaskSpec; + +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; + import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.NotFoundException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Optional; +import javax.ws.rs.NotFoundException; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/rest/RestExceptionMapperTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/rest/RestExceptionMapperTest.java index ed3d1ed34ca1c..e446fec68b701 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/rest/RestExceptionMapperTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/rest/RestExceptionMapperTest.java @@ -16,19 +16,21 @@ */ package org.apache.kafka.trogdor.rest; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; +import org.apache.kafka.common.errors.InvalidRequestException; +import org.apache.kafka.common.errors.SerializationException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.exc.InvalidTypeIdException; + +import org.junit.jupiter.api.Test; + import javax.ws.rs.NotFoundException; import javax.ws.rs.core.Response; -import org.apache.kafka.common.errors.InvalidRequestException; -import org.apache.kafka.common.errors.SerializationException; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class RestExceptionMapperTest { diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/task/SampleTaskWorker.java b/trogdor/src/test/java/org/apache/kafka/trogdor/task/SampleTaskWorker.java index 9d4fa916986f5..f3bd2a22fe12b 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/task/SampleTaskWorker.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/task/SampleTaskWorker.java @@ -17,11 +17,12 @@ package org.apache.kafka.trogdor.task; -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.common.internals.KafkaFutureImpl; import org.apache.kafka.common.utils.ThreadUtils; import org.apache.kafka.trogdor.common.Platform; +import com.fasterxml.jackson.databind.node.TextNode; + import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService; diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/task/TaskSpecTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/task/TaskSpecTest.java index ad9189182358f..2593afa74905f 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/task/TaskSpecTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/task/TaskSpecTest.java @@ -17,8 +17,10 @@ package org.apache.kafka.trogdor.task; -import com.fasterxml.jackson.databind.exc.InvalidTypeIdException; import org.apache.kafka.trogdor.common.JsonUtil; + +import com.fasterxml.jackson.databind.exc.InvalidTypeIdException; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/ConsumeBenchSpecTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/ConsumeBenchSpecTest.java index a0e3eb0dd15d7..e07991d3bf021 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/ConsumeBenchSpecTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/ConsumeBenchSpecTest.java @@ -17,22 +17,23 @@ package org.apache.kafka.trogdor.workload; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; - import org.apache.kafka.common.TopicPartition; + import org.junit.jupiter.api.Test; -import java.util.Arrays; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.HashMap; import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.IntStream; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + public class ConsumeBenchSpecTest { @Test diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/ExternalCommandWorkerTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/ExternalCommandWorkerTest.java index b57fd59a8670c..852dd3c3b473b 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/ExternalCommandWorkerTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/ExternalCommandWorkerTest.java @@ -17,16 +17,20 @@ package org.apache.kafka.trogdor.workload; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.databind.node.TextNode; import org.apache.kafka.common.internals.KafkaFutureImpl; import org.apache.kafka.common.utils.OperatingSystem; import org.apache.kafka.test.TestUtils; import org.apache.kafka.trogdor.task.AgentWorkerStatusTracker; import org.apache.kafka.trogdor.task.WorkerStatusTracker; +import com.fasterxml.jackson.databind.node.IntNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; + import java.io.File; import java.io.OutputStream; import java.nio.charset.StandardCharsets; @@ -34,8 +38,6 @@ import java.util.Arrays; import java.util.Optional; import java.util.concurrent.CompletableFuture; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/HistogramTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/HistogramTest.java index 1afaf7587d01c..7002a4106a499 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/HistogramTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/HistogramTest.java @@ -17,10 +17,10 @@ package org.apache.kafka.trogdor.workload; -import static org.junit.jupiter.api.Assertions.assertEquals; - import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + public class HistogramTest { private static Histogram createHistogram(int maxValue, int... values) { Histogram histogram = new Histogram(maxValue); @@ -83,4 +83,3 @@ public void testHistogramPercentiles() { assertEquals(200, summary.percentiles().get(2).value()); } } - diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/PayloadGeneratorTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/PayloadGeneratorTest.java index bcb08db9eaba5..999cc51ef7656 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/PayloadGeneratorTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/PayloadGeneratorTest.java @@ -17,18 +17,19 @@ package org.apache.kafka.trogdor.workload; -import static org.junit.jupiter.api.Assertions.assertArrayEquals; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import java.util.Arrays; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; @Timeout(value = 120) public class PayloadGeneratorTest { diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/ThrottleTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/ThrottleTest.java index 1fef2ae4a64a5..32801680358b6 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/ThrottleTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/ThrottleTest.java @@ -17,14 +17,15 @@ package org.apache.kafka.trogdor.workload; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - import org.apache.kafka.common.utils.MockTime; import org.apache.kafka.common.utils.Time; + import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + public class ThrottleTest { /** * ThrottleMock is a subclass of Throttle that uses a MockTime object. It calls @@ -70,4 +71,3 @@ public void testThrottle() throws Exception { assertEquals(200, time.milliseconds()); } } - diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/TimeIntervalTransactionsGeneratorTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/TimeIntervalTransactionsGeneratorTest.java index a5fa5903697a9..877d4e2aed7a9 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/TimeIntervalTransactionsGeneratorTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/TimeIntervalTransactionsGeneratorTest.java @@ -17,11 +17,12 @@ package org.apache.kafka.trogdor.workload; -import static org.junit.jupiter.api.Assertions.assertEquals; - import org.apache.kafka.common.utils.MockTime; + import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + public class TimeIntervalTransactionsGeneratorTest { @Test public void testCommitsTransactionAfterIntervalPasses() { diff --git a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/TopicsSpecTest.java b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/TopicsSpecTest.java index f1c50d7a3a5a7..16d14659a4c3a 100644 --- a/trogdor/src/test/java/org/apache/kafka/trogdor/workload/TopicsSpecTest.java +++ b/trogdor/src/test/java/org/apache/kafka/trogdor/workload/TopicsSpecTest.java @@ -17,17 +17,18 @@ package org.apache.kafka.trogdor.workload; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import org.apache.kafka.trogdor.common.JsonUtil; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.kafka.trogdor.common.JsonUtil; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; @Timeout(value = 120) public class TopicsSpecTest {