diff --git a/build.gradle b/build.gradle index 1b407bfdaf2c..3bdb243ec2b9 100644 --- a/build.gradle +++ b/build.gradle @@ -203,7 +203,6 @@ def determineCommitId() { def excludedSpotlessModules = [':clients', ':connect:runtime', - ':core', ':streams'] diff --git a/core/src/main/java/kafka/log/remote/RemoteLogManager.java b/core/src/main/java/kafka/log/remote/RemoteLogManager.java index 11aba6d64a53..2b8f36ba5014 100644 --- a/core/src/main/java/kafka/log/remote/RemoteLogManager.java +++ b/core/src/main/java/kafka/log/remote/RemoteLogManager.java @@ -16,8 +16,6 @@ */ package kafka.log.remote; -import com.yammer.metrics.core.Gauge; -import com.yammer.metrics.core.Timer; import kafka.cluster.EndPoint; import kafka.cluster.Partition; import kafka.log.UnifiedLog; @@ -27,6 +25,7 @@ import kafka.server.KafkaConfig; import kafka.server.QuotaType; import kafka.server.StopPartition; + import org.apache.kafka.common.KafkaException; import org.apache.kafka.common.TopicIdPartition; import org.apache.kafka.common.TopicPartition; @@ -82,10 +81,11 @@ import org.apache.kafka.storage.internals.log.TransactionIndex; import org.apache.kafka.storage.internals.log.TxnIndexSearchResult; +import com.yammer.metrics.core.Gauge; +import com.yammer.metrics.core.Timer; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import scala.Option; -import scala.collection.JavaConverters; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; @@ -108,8 +108,8 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.NavigableMap; +import java.util.Objects; import java.util.Optional; import java.util.OptionalInt; import java.util.OptionalLong; @@ -135,10 +135,13 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import scala.Option; +import scala.collection.JavaConverters; + +import static org.apache.kafka.server.config.ServerLogConfigs.LOG_DIR_CONFIG; import static org.apache.kafka.server.log.remote.metadata.storage.TopicBasedRemoteLogMetadataManagerConfig.REMOTE_LOG_METADATA_COMMON_CLIENT_PREFIX; import static org.apache.kafka.server.log.remote.storage.RemoteStorageMetrics.REMOTE_LOG_MANAGER_TASKS_AVG_IDLE_PERCENT_METRIC; import static org.apache.kafka.server.log.remote.storage.RemoteStorageMetrics.REMOTE_LOG_READER_FETCH_RATE_AND_TIME_METRIC; -import static org.apache.kafka.server.config.ServerLogConfigs.LOG_DIR_CONFIG; /** * This class is responsible for diff --git a/core/src/main/java/kafka/log/remote/RemoteLogReader.java b/core/src/main/java/kafka/log/remote/RemoteLogReader.java index c28677459ef2..9a873574d307 100644 --- a/core/src/main/java/kafka/log/remote/RemoteLogReader.java +++ b/core/src/main/java/kafka/log/remote/RemoteLogReader.java @@ -16,14 +16,17 @@ */ package kafka.log.remote; -import com.yammer.metrics.core.Timer; import kafka.log.remote.quota.RLMQuotaManager; import kafka.server.BrokerTopicStats; + import org.apache.kafka.common.errors.OffsetOutOfRangeException; import org.apache.kafka.common.utils.LogContext; import org.apache.kafka.storage.internals.log.FetchDataInfo; import org.apache.kafka.storage.internals.log.RemoteLogReadResult; import org.apache.kafka.storage.internals.log.RemoteStorageFetchInfo; + +import com.yammer.metrics.core.Timer; + import org.slf4j.Logger; import java.util.Optional; diff --git a/core/src/main/java/kafka/log/remote/quota/RLMQuotaManager.java b/core/src/main/java/kafka/log/remote/quota/RLMQuotaManager.java index e21f00f1f5b0..68513dd4215c 100644 --- a/core/src/main/java/kafka/log/remote/quota/RLMQuotaManager.java +++ b/core/src/main/java/kafka/log/remote/quota/RLMQuotaManager.java @@ -18,6 +18,7 @@ import kafka.server.QuotaType; import kafka.server.SensorAccess; + import org.apache.kafka.common.MetricName; import org.apache.kafka.common.metrics.KafkaMetric; import org.apache.kafka.common.metrics.MetricConfig; @@ -27,15 +28,17 @@ import org.apache.kafka.common.metrics.Sensor; import org.apache.kafka.common.metrics.stats.SimpleRate; import org.apache.kafka.common.utils.Time; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import scala.runtime.BoxedUnit; import java.util.Collections; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.ReentrantReadWriteLock; +import scala.runtime.BoxedUnit; + public class RLMQuotaManager { private static final Logger LOGGER = LoggerFactory.getLogger(RLMQuotaManager.class); diff --git a/core/src/main/java/kafka/server/TierStateMachine.java b/core/src/main/java/kafka/server/TierStateMachine.java index 085e6c025dd4..a7b1835b0b2f 100644 --- a/core/src/main/java/kafka/server/TierStateMachine.java +++ b/core/src/main/java/kafka/server/TierStateMachine.java @@ -17,23 +17,10 @@ package kafka.server; -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import kafka.cluster.Partition; import kafka.log.UnifiedLog; import kafka.log.remote.RemoteLogManager; + import org.apache.kafka.common.KafkaException; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.message.FetchResponseData.PartitionData; @@ -49,8 +36,24 @@ import org.apache.kafka.storage.internals.checkpoint.LeaderEpochCheckpointFile; import org.apache.kafka.storage.internals.log.EpochEntry; import org.apache.kafka.storage.internals.log.LogFileUtils; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import scala.Option; import scala.collection.JavaConverters; diff --git a/core/src/main/java/kafka/server/builders/KafkaApisBuilder.java b/core/src/main/java/kafka/server/builders/KafkaApisBuilder.java index 566077236041..d140cb5465e2 100644 --- a/core/src/main/java/kafka/server/builders/KafkaApisBuilder.java +++ b/core/src/main/java/kafka/server/builders/KafkaApisBuilder.java @@ -31,6 +31,7 @@ import kafka.server.QuotaFactory.QuotaManagers; import kafka.server.ReplicaManager; import kafka.server.metadata.ConfigRepository; + import org.apache.kafka.common.metrics.Metrics; import org.apache.kafka.common.utils.Time; import org.apache.kafka.coordinator.group.GroupCoordinator; diff --git a/core/src/main/java/kafka/server/builders/LogManagerBuilder.java b/core/src/main/java/kafka/server/builders/LogManagerBuilder.java index 629293e36536..977e914bc05f 100644 --- a/core/src/main/java/kafka/server/builders/LogManagerBuilder.java +++ b/core/src/main/java/kafka/server/builders/LogManagerBuilder.java @@ -20,20 +20,22 @@ import kafka.log.LogManager; import kafka.server.BrokerTopicStats; import kafka.server.metadata.ConfigRepository; + import org.apache.kafka.common.utils.Time; import org.apache.kafka.server.common.MetadataVersion; import org.apache.kafka.server.config.ServerLogConfigs; +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.Scheduler; import org.apache.kafka.storage.internals.log.ProducerStateManagerConfig; -import scala.collection.JavaConverters; import java.io.File; import java.util.Collections; import java.util.List; +import scala.collection.JavaConverters; + public class LogManagerBuilder { private static final int PRODUCER_ID_EXPIRATION_CHECK_INTERVAL_MS = 600000; diff --git a/core/src/main/java/kafka/server/builders/ReplicaManagerBuilder.java b/core/src/main/java/kafka/server/builders/ReplicaManagerBuilder.java index 7cac33200d2c..163978197194 100644 --- a/core/src/main/java/kafka/server/builders/ReplicaManagerBuilder.java +++ b/core/src/main/java/kafka/server/builders/ReplicaManagerBuilder.java @@ -18,6 +18,7 @@ package kafka.server.builders; import kafka.log.LogManager; +import kafka.log.remote.RemoteLogManager; import kafka.server.AddPartitionsToTxnManager; import kafka.server.AlterPartitionManager; import kafka.server.BrokerTopicStats; @@ -31,19 +32,20 @@ import kafka.server.MetadataCache; import kafka.server.QuotaFactory.QuotaManagers; import kafka.server.ReplicaManager; -import kafka.log.remote.RemoteLogManager; import kafka.zk.KafkaZkClient; + import org.apache.kafka.common.metrics.Metrics; import org.apache.kafka.common.utils.Time; import org.apache.kafka.server.common.DirectoryEventHandler; -import org.apache.kafka.storage.internals.log.LogDirFailureChannel; import org.apache.kafka.server.util.Scheduler; -import scala.compat.java8.OptionConverters; +import org.apache.kafka.storage.internals.log.LogDirFailureChannel; import java.util.Collections; import java.util.Optional; import java.util.concurrent.atomic.AtomicBoolean; +import scala.compat.java8.OptionConverters; + public class ReplicaManagerBuilder { private KafkaConfig config = null; diff --git a/core/src/main/java/kafka/server/handlers/DescribeTopicPartitionsRequestHandler.java b/core/src/main/java/kafka/server/handlers/DescribeTopicPartitionsRequestHandler.java index fbe0900606e4..3e65628e0593 100644 --- a/core/src/main/java/kafka/server/handlers/DescribeTopicPartitionsRequestHandler.java +++ b/core/src/main/java/kafka/server/handlers/DescribeTopicPartitionsRequestHandler.java @@ -21,6 +21,7 @@ import kafka.server.AuthHelper; import kafka.server.KafkaConfig; import kafka.server.metadata.KRaftMetadataCache; + import org.apache.kafka.common.Uuid; import org.apache.kafka.common.errors.InvalidRequestException; import org.apache.kafka.common.message.DescribeTopicPartitionsRequestData; @@ -30,7 +31,6 @@ import org.apache.kafka.common.protocol.Errors; import org.apache.kafka.common.requests.DescribeTopicPartitionsRequest; import org.apache.kafka.common.resource.Resource; -import scala.collection.JavaConverters; import java.util.Collections; import java.util.HashSet; @@ -38,6 +38,8 @@ import java.util.Set; import java.util.stream.Stream; +import scala.collection.JavaConverters; + import static org.apache.kafka.common.acl.AclOperation.DESCRIBE; import static org.apache.kafka.common.resource.ResourceType.TOPIC; diff --git a/core/src/main/java/kafka/server/logger/RuntimeLoggerManager.java b/core/src/main/java/kafka/server/logger/RuntimeLoggerManager.java index 1eff13b5f24e..14d1b72c1094 100644 --- a/core/src/main/java/kafka/server/logger/RuntimeLoggerManager.java +++ b/core/src/main/java/kafka/server/logger/RuntimeLoggerManager.java @@ -18,6 +18,7 @@ package kafka.server.logger; import kafka.utils.Log4jController; + import org.apache.kafka.clients.admin.AlterConfigOp.OpType; import org.apache.kafka.common.config.LogLevelConfig; import org.apache.kafka.common.errors.ClusterAuthorizationException; @@ -26,6 +27,7 @@ import org.apache.kafka.common.message.IncrementalAlterConfigsRequestData.AlterConfigsResource; import org.apache.kafka.common.message.IncrementalAlterConfigsRequestData.AlterableConfig; import org.apache.kafka.common.protocol.Errors; + import org.slf4j.Logger; import java.util.ArrayList; diff --git a/core/src/main/java/kafka/server/share/ErroneousAndValidPartitionData.java b/core/src/main/java/kafka/server/share/ErroneousAndValidPartitionData.java index 3aa8c84245ed..3ba18536fc6c 100644 --- a/core/src/main/java/kafka/server/share/ErroneousAndValidPartitionData.java +++ b/core/src/main/java/kafka/server/share/ErroneousAndValidPartitionData.java @@ -22,12 +22,13 @@ import org.apache.kafka.common.protocol.Errors; import org.apache.kafka.common.requests.ShareFetchRequest; import org.apache.kafka.common.requests.ShareFetchResponse; -import scala.Tuple2; import java.util.ArrayList; import java.util.List; import java.util.Map; +import scala.Tuple2; + /** * Helper class to return the erroneous partitions and valid partition data */ diff --git a/core/src/main/java/kafka/server/share/FinalContext.java b/core/src/main/java/kafka/server/share/FinalContext.java index a28b519050e9..f7f6817c2cf3 100644 --- a/core/src/main/java/kafka/server/share/FinalContext.java +++ b/core/src/main/java/kafka/server/share/FinalContext.java @@ -22,6 +22,7 @@ import org.apache.kafka.common.message.ShareFetchResponseData; import org.apache.kafka.common.protocol.Errors; import org.apache.kafka.common.requests.ShareFetchResponse; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/core/src/main/java/kafka/server/share/ShareFetchContext.java b/core/src/main/java/kafka/server/share/ShareFetchContext.java index 09638e87ebb7..df0391f85175 100644 --- a/core/src/main/java/kafka/server/share/ShareFetchContext.java +++ b/core/src/main/java/kafka/server/share/ShareFetchContext.java @@ -17,6 +17,7 @@ package kafka.server.share; import kafka.server.FetchSession; + import org.apache.kafka.common.TopicIdPartition; import org.apache.kafka.common.Uuid; import org.apache.kafka.common.message.ShareFetchResponseData; diff --git a/core/src/main/java/kafka/server/share/SharePartition.java b/core/src/main/java/kafka/server/share/SharePartition.java index ab9f5abc6f68..d198466bd8a2 100644 --- a/core/src/main/java/kafka/server/share/SharePartition.java +++ b/core/src/main/java/kafka/server/share/SharePartition.java @@ -17,6 +17,7 @@ package kafka.server.share; import kafka.server.ReplicaManager; + import org.apache.kafka.common.TopicIdPartition; import org.apache.kafka.common.Uuid; import org.apache.kafka.common.errors.InvalidRecordStateException; @@ -38,6 +39,7 @@ import org.apache.kafka.server.util.timer.Timer; import org.apache.kafka.server.util.timer.TimerTask; import org.apache.kafka.storage.internals.log.FetchPartitionData; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/core/src/main/java/kafka/server/share/SharePartitionManager.java b/core/src/main/java/kafka/server/share/SharePartitionManager.java index da8b5ec0bb8b..7aa16cce63cd 100644 --- a/core/src/main/java/kafka/server/share/SharePartitionManager.java +++ b/core/src/main/java/kafka/server/share/SharePartitionManager.java @@ -18,6 +18,7 @@ import kafka.server.FetchSession; import kafka.server.ReplicaManager; + import org.apache.kafka.common.TopicIdPartition; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.Uuid; @@ -31,11 +32,12 @@ import org.apache.kafka.common.utils.Time; import org.apache.kafka.server.group.share.Persister; import org.apache.kafka.server.share.CachedSharePartition; +import org.apache.kafka.server.share.ShareAcknowledgementBatch; import org.apache.kafka.server.share.ShareSession; import org.apache.kafka.server.share.ShareSessionCache; import org.apache.kafka.server.share.ShareSessionKey; -import org.apache.kafka.server.share.ShareAcknowledgementBatch; import org.apache.kafka.storage.internals.log.FetchParams; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/core/src/main/java/kafka/server/share/ShareSessionContext.java b/core/src/main/java/kafka/server/share/ShareSessionContext.java index f95763c881a0..6d1dbebbd554 100644 --- a/core/src/main/java/kafka/server/share/ShareSessionContext.java +++ b/core/src/main/java/kafka/server/share/ShareSessionContext.java @@ -29,9 +29,9 @@ import org.apache.kafka.common.requests.ShareFetchResponse; import org.apache.kafka.server.share.CachedSharePartition; import org.apache.kafka.server.share.ShareSession; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import scala.Tuple2; import java.util.ArrayList; import java.util.Collections; @@ -42,6 +42,8 @@ import java.util.Map.Entry; import java.util.NoSuchElementException; +import scala.Tuple2; + /** * The context for a share session fetch request. */ diff --git a/core/src/test/java/kafka/admin/ConfigCommandIntegrationTest.java b/core/src/test/java/kafka/admin/ConfigCommandIntegrationTest.java index 23c250a764ec..fc88424b842d 100644 --- a/core/src/test/java/kafka/admin/ConfigCommandIntegrationTest.java +++ b/core/src/test/java/kafka/admin/ConfigCommandIntegrationTest.java @@ -26,6 +26,7 @@ import kafka.zk.AdminZkClient; import kafka.zk.BrokerInfo; import kafka.zk.KafkaZkClient; + import org.apache.kafka.clients.admin.Admin; import org.apache.kafka.common.config.ConfigException; import org.apache.kafka.common.config.ConfigResource; @@ -36,6 +37,7 @@ import org.apache.kafka.server.common.MetadataVersion; import org.apache.kafka.server.config.ZooKeeperInternals; import org.apache.kafka.test.TestUtils; + import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.platform.commons.util.StringUtils; diff --git a/core/src/test/java/kafka/admin/ConfigCommandTest.java b/core/src/test/java/kafka/admin/ConfigCommandTest.java index 5968f3706a1c..fccccff1f7a3 100644 --- a/core/src/test/java/kafka/admin/ConfigCommandTest.java +++ b/core/src/test/java/kafka/admin/ConfigCommandTest.java @@ -19,6 +19,7 @@ import kafka.cluster.Broker; import kafka.zk.AdminZkClient; import kafka.zk.KafkaZkClient; + import org.apache.kafka.clients.admin.Admin; import org.apache.kafka.clients.admin.AlterClientQuotasOptions; import org.apache.kafka.clients.admin.AlterClientQuotasResult; @@ -50,11 +51,10 @@ import org.apache.kafka.server.config.ConfigType; import org.apache.kafka.server.config.ZooKeeperInternals; import org.apache.kafka.test.TestUtils; + import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import scala.collection.JavaConverters; -import scala.collection.Seq; import java.io.File; import java.io.IOException; @@ -79,6 +79,9 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import scala.collection.JavaConverters; +import scala.collection.Seq; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/core/src/test/java/kafka/admin/UserScramCredentialsCommandTest.java b/core/src/test/java/kafka/admin/UserScramCredentialsCommandTest.java index b9406f56b86b..771369e2419a 100644 --- a/core/src/test/java/kafka/admin/UserScramCredentialsCommandTest.java +++ b/core/src/test/java/kafka/admin/UserScramCredentialsCommandTest.java @@ -20,10 +20,11 @@ import kafka.test.annotation.ClusterTest; import kafka.test.junit.ClusterTestExtensions; import kafka.utils.Exit; + import org.apache.kafka.test.NoRetryException; import org.apache.kafka.test.TestUtils; + import org.junit.jupiter.api.extension.ExtendWith; -import scala.Console; import java.io.ByteArrayOutputStream; import java.io.PrintStream; @@ -36,6 +37,8 @@ import java.util.OptionalInt; import java.util.concurrent.atomic.AtomicReference; +import scala.Console; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java b/core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java index bfb490d77da8..7e3eb2dad6fb 100644 --- a/core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java +++ b/core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java @@ -16,8 +16,6 @@ */ package kafka.log.remote; -import com.yammer.metrics.core.Gauge; -import com.yammer.metrics.core.MetricName; import kafka.cluster.EndPoint; import kafka.cluster.Partition; import kafka.log.UnifiedLog; @@ -26,6 +24,7 @@ import kafka.server.BrokerTopicStats; import kafka.server.KafkaConfig; import kafka.server.StopPartition; + import org.apache.kafka.common.KafkaException; import org.apache.kafka.common.TopicIdPartition; import org.apache.kafka.common.TopicPartition; @@ -78,6 +77,10 @@ import org.apache.kafka.storage.internals.log.TimeIndex; import org.apache.kafka.storage.internals.log.TransactionIndex; import org.apache.kafka.test.TestUtils; + +import com.yammer.metrics.core.Gauge; +import com.yammer.metrics.core.MetricName; + import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -89,15 +92,13 @@ import org.mockito.MockedConstruction; import org.mockito.Mockito; import org.opentest4j.AssertionFailedError; -import scala.Option; -import scala.collection.JavaConverters; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.File; -import java.io.InputStream; import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStream; import java.io.InputStreamReader; import java.io.UncheckedIOException; import java.nio.ByteBuffer; @@ -128,6 +129,10 @@ import java.util.function.Supplier; import java.util.stream.Collectors; +import scala.Option; +import scala.collection.JavaConverters; + +import static kafka.log.remote.RemoteLogManager.isRemoteSegmentWithinLeaderEpochs; import static org.apache.kafka.server.log.remote.metadata.storage.TopicBasedRemoteLogMetadataManagerConfig.REMOTE_LOG_METADATA_COMMON_CLIENT_PREFIX; import static org.apache.kafka.server.log.remote.metadata.storage.TopicBasedRemoteLogMetadataManagerConfig.REMOTE_LOG_METADATA_CONSUMER_PREFIX; import static org.apache.kafka.server.log.remote.metadata.storage.TopicBasedRemoteLogMetadataManagerConfig.REMOTE_LOG_METADATA_PRODUCER_PREFIX; @@ -171,8 +176,6 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import static kafka.log.remote.RemoteLogManager.isRemoteSegmentWithinLeaderEpochs; - public class RemoteLogManagerTest { private final Time time = new MockTime(); private final int brokerId = 0; diff --git a/core/src/test/java/kafka/log/remote/RemoteLogReaderTest.java b/core/src/test/java/kafka/log/remote/RemoteLogReaderTest.java index 2d82f78ec545..befc7a56bb51 100644 --- a/core/src/test/java/kafka/log/remote/RemoteLogReaderTest.java +++ b/core/src/test/java/kafka/log/remote/RemoteLogReaderTest.java @@ -16,10 +16,10 @@ */ package kafka.log.remote; -import com.yammer.metrics.core.Timer; import kafka.log.remote.quota.RLMQuotaManager; import kafka.server.BrokerTopicStats; import kafka.utils.TestUtils; + import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.record.Records; import org.apache.kafka.server.log.remote.storage.RemoteStorageException; @@ -27,6 +27,9 @@ import org.apache.kafka.storage.internals.log.LogOffsetMetadata; import org.apache.kafka.storage.internals.log.RemoteLogReadResult; import org.apache.kafka.storage.internals.log.RemoteStorageFetchInfo; + +import com.yammer.metrics.core.Timer; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; diff --git a/core/src/test/java/kafka/log/remote/quota/RLMQuotaManagerTest.java b/core/src/test/java/kafka/log/remote/quota/RLMQuotaManagerTest.java index 2dd5ddaaf2a0..2d639d4f2419 100644 --- a/core/src/test/java/kafka/log/remote/quota/RLMQuotaManagerTest.java +++ b/core/src/test/java/kafka/log/remote/quota/RLMQuotaManagerTest.java @@ -17,12 +17,14 @@ package kafka.log.remote.quota; import kafka.server.QuotaType; + import org.apache.kafka.common.MetricName; import org.apache.kafka.common.metrics.KafkaMetric; import org.apache.kafka.common.metrics.MetricConfig; import org.apache.kafka.common.metrics.Metrics; import org.apache.kafka.common.metrics.Quota; import org.apache.kafka.common.utils.MockTime; + import org.junit.jupiter.api.Test; import java.util.Collections; diff --git a/core/src/test/java/kafka/server/LogManagerIntegrationTest.java b/core/src/test/java/kafka/server/LogManagerIntegrationTest.java index 709454beccd6..de9a5f512679 100644 --- a/core/src/test/java/kafka/server/LogManagerIntegrationTest.java +++ b/core/src/test/java/kafka/server/LogManagerIntegrationTest.java @@ -21,6 +21,7 @@ import kafka.test.annotation.Type; import kafka.test.junit.ClusterTestExtensions; import kafka.test.junit.RaftClusterInvocationContext; + import org.apache.kafka.clients.admin.Admin; import org.apache.kafka.clients.admin.NewTopic; import org.apache.kafka.clients.consumer.Consumer; @@ -38,6 +39,7 @@ import org.apache.kafka.common.serialization.StringSerializer; import org.apache.kafka.storage.internals.checkpoint.PartitionMetadataFile; import org.apache.kafka.test.TestUtils; + import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/core/src/test/java/kafka/server/MetadataVersionConfigValidatorTest.java b/core/src/test/java/kafka/server/MetadataVersionConfigValidatorTest.java index 168c3298343d..a776e3fe10af 100644 --- a/core/src/test/java/kafka/server/MetadataVersionConfigValidatorTest.java +++ b/core/src/test/java/kafka/server/MetadataVersionConfigValidatorTest.java @@ -25,6 +25,7 @@ import org.apache.kafka.raft.LeaderAndEpoch; import org.apache.kafka.server.common.MetadataVersion; import org.apache.kafka.server.fault.FaultHandler; + import org.junit.jupiter.api.Test; import static org.mockito.ArgumentMatchers.any; diff --git a/core/src/test/java/kafka/server/handlers/DescribeTopicPartitionsRequestHandlerTest.java b/core/src/test/java/kafka/server/handlers/DescribeTopicPartitionsRequestHandlerTest.java index 5c1cfc2f59f1..d8ee999a2d64 100644 --- a/core/src/test/java/kafka/server/handlers/DescribeTopicPartitionsRequestHandlerTest.java +++ b/core/src/test/java/kafka/server/handlers/DescribeTopicPartitionsRequestHandlerTest.java @@ -22,6 +22,7 @@ import kafka.server.KafkaConfig; import kafka.server.metadata.KRaftMetadataCache; import kafka.utils.TestUtils; + import org.apache.kafka.common.Uuid; import org.apache.kafka.common.acl.AclOperation; import org.apache.kafka.common.errors.InvalidRequestException; diff --git a/core/src/test/java/kafka/server/logger/RuntimeLoggerManagerTest.java b/core/src/test/java/kafka/server/logger/RuntimeLoggerManagerTest.java index 66bd8afc75ed..e2a05fc65f6a 100644 --- a/core/src/test/java/kafka/server/logger/RuntimeLoggerManagerTest.java +++ b/core/src/test/java/kafka/server/logger/RuntimeLoggerManagerTest.java @@ -17,11 +17,13 @@ package kafka.server.logger; import kafka.utils.Log4jController; + import org.apache.kafka.clients.admin.AlterConfigOp; import org.apache.kafka.clients.admin.AlterConfigOp.OpType; import org.apache.kafka.common.errors.InvalidConfigurationException; import org.apache.kafka.common.errors.InvalidRequestException; import org.apache.kafka.common.message.IncrementalAlterConfigsRequestData.AlterableConfig; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/core/src/test/java/kafka/server/share/SharePartitionManagerTest.java b/core/src/test/java/kafka/server/share/SharePartitionManagerTest.java index bf73886c0faf..6bb20c51bdc1 100644 --- a/core/src/test/java/kafka/server/share/SharePartitionManagerTest.java +++ b/core/src/test/java/kafka/server/share/SharePartitionManagerTest.java @@ -17,6 +17,7 @@ package kafka.server.share; import kafka.server.ReplicaManager; + import org.apache.kafka.common.TopicIdPartition; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.Uuid; @@ -36,23 +37,24 @@ import org.apache.kafka.server.group.share.Persister; import org.apache.kafka.server.share.ShareSessionCache; import org.apache.kafka.server.share.ShareSessionKey; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; -import java.util.Collections; +import java.util.LinkedHashMap; import java.util.List; -import java.util.ArrayList; -import java.util.Arrays; import java.util.Map; -import java.util.LinkedHashMap; import java.util.Set; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/core/src/test/java/kafka/server/share/SharePartitionTest.java b/core/src/test/java/kafka/server/share/SharePartitionTest.java index ef983a9f2416..744d1d580434 100644 --- a/core/src/test/java/kafka/server/share/SharePartitionTest.java +++ b/core/src/test/java/kafka/server/share/SharePartitionTest.java @@ -19,6 +19,7 @@ import kafka.server.ReplicaManager; import kafka.server.share.SharePartition.InFlightState; import kafka.server.share.SharePartition.RecordState; + import org.apache.kafka.common.TopicIdPartition; import org.apache.kafka.common.Uuid; import org.apache.kafka.common.compress.Compression; @@ -39,6 +40,7 @@ import org.apache.kafka.server.util.timer.Timer; import org.apache.kafka.storage.internals.log.FetchPartitionData; import org.apache.kafka.test.TestUtils; + import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/kafka/test/ClusterConfig.java b/core/src/test/java/kafka/test/ClusterConfig.java index b72bb1a5787d..4e9e469705e2 100644 --- a/core/src/test/java/kafka/test/ClusterConfig.java +++ b/core/src/test/java/kafka/test/ClusterConfig.java @@ -18,21 +18,22 @@ package kafka.test; import kafka.test.annotation.Type; + import org.apache.kafka.common.security.auth.SecurityProtocol; import org.apache.kafka.server.common.Features; import org.apache.kafka.server.common.MetadataVersion; import java.io.File; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; -import java.util.Set; import java.util.LinkedHashSet; -import java.util.Map; import java.util.List; -import java.util.ArrayList; +import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; diff --git a/core/src/test/java/kafka/test/ClusterConfigTest.java b/core/src/test/java/kafka/test/ClusterConfigTest.java index 9d5ac4957b7f..78de2d37a66c 100644 --- a/core/src/test/java/kafka/test/ClusterConfigTest.java +++ b/core/src/test/java/kafka/test/ClusterConfigTest.java @@ -18,9 +18,11 @@ package kafka.test; import kafka.test.annotation.Type; + import org.apache.kafka.common.security.auth.SecurityProtocol; import org.apache.kafka.server.common.MetadataVersion; import org.apache.kafka.test.TestUtils; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -30,8 +32,8 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import java.util.Set; import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; public class ClusterConfigTest { diff --git a/core/src/test/java/kafka/test/ClusterInstance.java b/core/src/test/java/kafka/test/ClusterInstance.java index 03e19f39b62b..6b85f12ba1be 100644 --- a/core/src/test/java/kafka/test/ClusterInstance.java +++ b/core/src/test/java/kafka/test/ClusterInstance.java @@ -23,6 +23,7 @@ import kafka.server.KafkaBroker; import kafka.test.annotation.ClusterTest; import kafka.test.annotation.Type; + import org.apache.kafka.clients.admin.Admin; import org.apache.kafka.clients.consumer.GroupProtocol; import org.apache.kafka.common.network.ListenerName; diff --git a/core/src/test/java/kafka/test/ClusterTestExtensionsTest.java b/core/src/test/java/kafka/test/ClusterTestExtensionsTest.java index aba96eccdd81..49add6ab3531 100644 --- a/core/src/test/java/kafka/test/ClusterTestExtensionsTest.java +++ b/core/src/test/java/kafka/test/ClusterTestExtensionsTest.java @@ -25,24 +25,26 @@ import kafka.test.annotation.ClusterTests; import kafka.test.annotation.Type; import kafka.test.junit.ClusterTestExtensions; + import org.apache.kafka.clients.admin.Admin; import org.apache.kafka.clients.admin.AdminClientConfig; import org.apache.kafka.clients.admin.Config; -import org.apache.kafka.common.config.ConfigResource; import org.apache.kafka.clients.admin.DescribeLogDirsResult; import org.apache.kafka.clients.consumer.GroupProtocol; +import org.apache.kafka.common.config.ConfigResource; import org.apache.kafka.server.common.MetadataVersion; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.extension.ExtendWith; -import java.util.Map; -import java.util.List; +import java.util.Arrays; import java.util.Collections; -import java.util.concurrent.ExecutionException; import java.util.HashMap; -import java.util.Set; import java.util.HashSet; -import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ExecutionException; import static org.apache.kafka.clients.consumer.GroupProtocol.CLASSIC; import static org.apache.kafka.clients.consumer.GroupProtocol.CONSUMER; diff --git a/core/src/test/java/kafka/test/MockController.java b/core/src/test/java/kafka/test/MockController.java index d531e9c62ae2..f6ac33a1a18e 100644 --- a/core/src/test/java/kafka/test/MockController.java +++ b/core/src/test/java/kafka/test/MockController.java @@ -26,10 +26,10 @@ import org.apache.kafka.common.errors.ThrottlingQuotaExceededException; import org.apache.kafka.common.message.AllocateProducerIdsRequestData; import org.apache.kafka.common.message.AllocateProducerIdsResponseData; -import org.apache.kafka.common.message.AlterPartitionRequestData; -import org.apache.kafka.common.message.AlterPartitionResponseData; import org.apache.kafka.common.message.AlterPartitionReassignmentsRequestData; import org.apache.kafka.common.message.AlterPartitionReassignmentsResponseData; +import org.apache.kafka.common.message.AlterPartitionRequestData; +import org.apache.kafka.common.message.AlterPartitionResponseData; import org.apache.kafka.common.message.AlterUserScramCredentialsRequestData; import org.apache.kafka.common.message.AlterUserScramCredentialsResponseData; import org.apache.kafka.common.message.AssignReplicasToDirsRequestData; diff --git a/core/src/test/java/kafka/test/annotation/ClusterTemplate.java b/core/src/test/java/kafka/test/annotation/ClusterTemplate.java index f776b4e83223..998b49e1a21a 100644 --- a/core/src/test/java/kafka/test/annotation/ClusterTemplate.java +++ b/core/src/test/java/kafka/test/annotation/ClusterTemplate.java @@ -19,6 +19,7 @@ import kafka.test.ClusterConfig; import kafka.test.ClusterGenerator; + import org.junit.jupiter.api.TestTemplate; import java.lang.annotation.Documented; diff --git a/core/src/test/java/kafka/test/annotation/ClusterTest.java b/core/src/test/java/kafka/test/annotation/ClusterTest.java index 5557abeb335d..7b7ca17069a1 100644 --- a/core/src/test/java/kafka/test/annotation/ClusterTest.java +++ b/core/src/test/java/kafka/test/annotation/ClusterTest.java @@ -19,6 +19,7 @@ import org.apache.kafka.common.security.auth.SecurityProtocol; import org.apache.kafka.server.common.MetadataVersion; + import org.junit.jupiter.api.TestTemplate; import java.lang.annotation.Documented; diff --git a/core/src/test/java/kafka/test/annotation/Type.java b/core/src/test/java/kafka/test/annotation/Type.java index f93e5753bfe4..7e03047e5766 100644 --- a/core/src/test/java/kafka/test/annotation/Type.java +++ b/core/src/test/java/kafka/test/annotation/Type.java @@ -20,6 +20,7 @@ import kafka.test.ClusterConfig; import kafka.test.junit.RaftClusterInvocationContext; import kafka.test.junit.ZkClusterInvocationContext; + import org.junit.jupiter.api.extension.TestTemplateInvocationContext; diff --git a/core/src/test/java/kafka/test/junit/ClusterInstanceParameterResolver.java b/core/src/test/java/kafka/test/junit/ClusterInstanceParameterResolver.java index 3329e328b595..7caa43fa5d9b 100644 --- a/core/src/test/java/kafka/test/junit/ClusterInstanceParameterResolver.java +++ b/core/src/test/java/kafka/test/junit/ClusterInstanceParameterResolver.java @@ -18,6 +18,7 @@ package kafka.test.junit; import kafka.test.ClusterInstance; + import org.junit.jupiter.api.TestTemplate; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.ParameterContext; diff --git a/core/src/test/java/kafka/test/junit/ClusterTestExtensions.java b/core/src/test/java/kafka/test/junit/ClusterTestExtensions.java index 4a4b1d6a2d2d..b252a88d8eae 100644 --- a/core/src/test/java/kafka/test/junit/ClusterTestExtensions.java +++ b/core/src/test/java/kafka/test/junit/ClusterTestExtensions.java @@ -18,15 +18,17 @@ package kafka.test.junit; import kafka.test.ClusterConfig; +import kafka.test.annotation.AutoStart; +import kafka.test.annotation.ClusterConfigProperty; import kafka.test.annotation.ClusterFeature; +import kafka.test.annotation.ClusterTemplate; import kafka.test.annotation.ClusterTest; import kafka.test.annotation.ClusterTestDefaults; import kafka.test.annotation.ClusterTests; -import kafka.test.annotation.ClusterTemplate; -import kafka.test.annotation.ClusterConfigProperty; import kafka.test.annotation.Type; -import kafka.test.annotation.AutoStart; + import org.apache.kafka.server.common.Features; + import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.TestTemplateInvocationContext; import org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider; diff --git a/core/src/test/java/kafka/test/junit/ClusterTestExtensionsUnitTest.java b/core/src/test/java/kafka/test/junit/ClusterTestExtensionsUnitTest.java index c0944080547d..badbc24348d9 100644 --- a/core/src/test/java/kafka/test/junit/ClusterTestExtensionsUnitTest.java +++ b/core/src/test/java/kafka/test/junit/ClusterTestExtensionsUnitTest.java @@ -20,8 +20,8 @@ import kafka.test.ClusterConfig; import kafka.test.annotation.ClusterTemplate; -import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtensionContext; import java.lang.reflect.Method; diff --git a/core/src/test/java/kafka/test/junit/RaftClusterInvocationContext.java b/core/src/test/java/kafka/test/junit/RaftClusterInvocationContext.java index 3a7bac5aad5e..9234323d6fef 100644 --- a/core/src/test/java/kafka/test/junit/RaftClusterInvocationContext.java +++ b/core/src/test/java/kafka/test/junit/RaftClusterInvocationContext.java @@ -21,12 +21,13 @@ import kafka.server.BrokerServer; import kafka.server.ControllerServer; import kafka.server.KafkaBroker; -import kafka.test.annotation.Type; import kafka.test.ClusterConfig; import kafka.test.ClusterInstance; +import kafka.test.annotation.Type; import kafka.testkit.KafkaClusterTestKit; import kafka.testkit.TestKitNodes; import kafka.zk.EmbeddedZookeeper; + import org.apache.kafka.clients.admin.Admin; import org.apache.kafka.common.metadata.FeatureLevelRecord; import org.apache.kafka.common.network.ListenerName; @@ -35,11 +36,11 @@ import org.apache.kafka.metadata.bootstrap.BootstrapMetadata; import org.apache.kafka.server.common.ApiMessageAndVersion; import org.apache.kafka.server.common.MetadataVersion; + import org.junit.jupiter.api.extension.AfterTestExecutionCallback; import org.junit.jupiter.api.extension.BeforeTestExecutionCallback; import org.junit.jupiter.api.extension.Extension; import org.junit.jupiter.api.extension.TestTemplateInvocationContext; -import scala.compat.java8.OptionConverters; import java.util.ArrayList; import java.util.Arrays; @@ -56,6 +57,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import scala.compat.java8.OptionConverters; + /** * Wraps a {@link KafkaClusterTestKit} inside lifecycle methods for a test invocation. Each instance of this * class is provided with a configuration for the cluster. diff --git a/core/src/test/java/kafka/test/junit/ZkClusterInvocationContext.java b/core/src/test/java/kafka/test/junit/ZkClusterInvocationContext.java index 4eecfa7bf214..e85cbacc075a 100644 --- a/core/src/test/java/kafka/test/junit/ZkClusterInvocationContext.java +++ b/core/src/test/java/kafka/test/junit/ZkClusterInvocationContext.java @@ -22,23 +22,21 @@ import kafka.server.ControllerServer; import kafka.server.KafkaBroker; import kafka.server.KafkaServer; -import kafka.test.annotation.Type; import kafka.test.ClusterConfig; import kafka.test.ClusterInstance; +import kafka.test.annotation.Type; import kafka.utils.EmptyTestInfo; import kafka.utils.TestUtils; + import org.apache.kafka.clients.admin.Admin; import org.apache.kafka.clients.admin.AdminClientConfig; import org.apache.kafka.common.network.ListenerName; import org.apache.kafka.common.security.auth.SecurityProtocol; + import org.junit.jupiter.api.extension.AfterTestExecutionCallback; import org.junit.jupiter.api.extension.BeforeTestExecutionCallback; import org.junit.jupiter.api.extension.Extension; import org.junit.jupiter.api.extension.TestTemplateInvocationContext; -import scala.Option; -import scala.collection.JavaConverters; -import scala.collection.Seq; -import scala.compat.java8.OptionConverters; import java.io.File; import java.util.Arrays; @@ -54,6 +52,11 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; +import scala.Option; +import scala.collection.JavaConverters; +import scala.collection.Seq; +import scala.compat.java8.OptionConverters; + import static java.util.Objects.requireNonNull; import static org.apache.kafka.server.config.ReplicationConfigs.INTER_BROKER_PROTOCOL_VERSION_CONFIG; diff --git a/core/src/test/java/kafka/test/server/BootstrapControllersIntegrationTest.java b/core/src/test/java/kafka/test/server/BootstrapControllersIntegrationTest.java index 5182293f4b7f..08484572dd9b 100644 --- a/core/src/test/java/kafka/test/server/BootstrapControllersIntegrationTest.java +++ b/core/src/test/java/kafka/test/server/BootstrapControllersIntegrationTest.java @@ -20,6 +20,7 @@ import kafka.server.ControllerServer; import kafka.testkit.KafkaClusterTestKit; import kafka.testkit.TestKitNodes; + import org.apache.kafka.clients.admin.Admin; import org.apache.kafka.clients.admin.AlterConfigOp; import org.apache.kafka.clients.admin.Config; @@ -41,6 +42,7 @@ import org.apache.kafka.controller.QuorumController; import org.apache.kafka.server.common.MetadataVersion; import org.apache.kafka.test.TestUtils; + import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; diff --git a/core/src/test/java/kafka/testkit/BrokerNodeTest.java b/core/src/test/java/kafka/testkit/BrokerNodeTest.java index 12d7fd36da5e..afc829736d54 100644 --- a/core/src/test/java/kafka/testkit/BrokerNodeTest.java +++ b/core/src/test/java/kafka/testkit/BrokerNodeTest.java @@ -18,6 +18,7 @@ package kafka.testkit; import org.apache.kafka.common.Uuid; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/core/src/test/java/kafka/testkit/KafkaClusterTestKit.java b/core/src/test/java/kafka/testkit/KafkaClusterTestKit.java index 9b2a2602de43..00f4eaee9105 100644 --- a/core/src/test/java/kafka/testkit/KafkaClusterTestKit.java +++ b/core/src/test/java/kafka/testkit/KafkaClusterTestKit.java @@ -21,9 +21,10 @@ import kafka.server.BrokerServer; import kafka.server.ControllerServer; import kafka.server.FaultHandlerFactory; -import kafka.server.SharedServer; import kafka.server.KafkaConfig; import kafka.server.KafkaRaftServer; +import kafka.server.SharedServer; + import org.apache.kafka.clients.CommonClientConfigs; import org.apache.kafka.clients.admin.AdminClientConfig; import org.apache.kafka.common.Node; @@ -45,10 +46,10 @@ import org.apache.kafka.server.fault.MockFaultHandler; import org.apache.kafka.storage.internals.log.CleanerConfig; import org.apache.kafka.test.TestUtils; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; -import scala.Option; import java.io.File; import java.net.InetSocketAddress; @@ -74,9 +75,11 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.apache.kafka.server.config.ServerLogConfigs.LOG_DIRS_CONFIG; +import scala.Option; + import static org.apache.kafka.server.config.ReplicationConfigs.INTER_BROKER_LISTENER_NAME_CONFIG; +import static org.apache.kafka.server.config.ServerLogConfigs.LOG_DIRS_CONFIG; +import static org.junit.jupiter.api.Assertions.assertNotNull; @SuppressWarnings("deprecation") // Needed for Scala 2.12 compatibility