Browse Source

MINOR: Remove scala KafkaException (#11913)

Use the standard org.apache.kafka.common.KafkaException instead of kafka.common.KafkaException.

Reviewers: Colin P. McCabe <cmccabe@apache.org>, Ismael Juma <ismael@confluent.io>
pull/11934/head
dengziming 3 years ago committed by GitHub
parent
commit
c9c03dd7ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      core/src/main/scala/kafka/common/KafkaException.scala
  2. 6
      core/src/main/scala/kafka/log/LogCleanerManager.scala
  3. 3
      core/src/main/scala/kafka/server/BrokerMetadataCheckpoint.scala
  4. 6
      core/src/main/scala/kafka/server/KafkaRaftServer.scala
  5. 5
      core/src/test/scala/unit/kafka/server/KafkaRaftServerTest.scala

27
core/src/main/scala/kafka/common/KafkaException.scala

@ -1,27 +0,0 @@ @@ -1,27 +0,0 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kafka.common
/**
* Usage of this class is discouraged. Use org.apache.kafka.common.KafkaException instead.
*
* This class will be removed once kafka.security.auth classes are removed.
*/
class KafkaException(message: String, t: Throwable) extends RuntimeException(message, t) {
def this(message: String) = this(message, null)
def this(t: Throwable) = this("", t)
}

6
core/src/main/scala/kafka/log/LogCleanerManager.scala

@ -21,15 +21,15 @@ import java.io.File @@ -21,15 +21,15 @@ import java.io.File
import java.util.concurrent.TimeUnit
import java.util.concurrent.locks.ReentrantLock
import kafka.common.{KafkaException, LogCleaningAbortedException}
import kafka.common.LogCleaningAbortedException
import kafka.metrics.KafkaMetricsGroup
import kafka.server.LogDirFailureChannel
import kafka.server.checkpoints.OffsetCheckpointFile
import kafka.utils.CoreUtils._
import kafka.utils.{Logging, Pool}
import org.apache.kafka.common.TopicPartition
import org.apache.kafka.common.utils.Time
import org.apache.kafka.common.{KafkaException, TopicPartition}
import org.apache.kafka.common.errors.KafkaStorageException
import org.apache.kafka.common.utils.Time
import scala.collection.{Iterable, Seq, mutable}

3
core/src/main/scala/kafka/server/BrokerMetadataCheckpoint.scala

@ -21,9 +21,10 @@ import java.io._ @@ -21,9 +21,10 @@ import java.io._
import java.nio.file.{Files, NoSuchFileException}
import java.util.Properties
import kafka.common.{InconsistentBrokerMetadataException, KafkaException}
import kafka.common.InconsistentBrokerMetadataException
import kafka.server.RawMetaProperties._
import kafka.utils._
import org.apache.kafka.common.KafkaException
import org.apache.kafka.common.utils.Utils
import scala.collection.mutable

6
core/src/main/scala/kafka/server/KafkaRaftServer.scala

@ -19,15 +19,15 @@ package kafka.server @@ -19,15 +19,15 @@ package kafka.server
import java.io.File
import java.util.concurrent.CompletableFuture
import kafka.common.{InconsistentNodeIdException, KafkaException}
import kafka.common.InconsistentNodeIdException
import kafka.log.{LogConfig, UnifiedLog}
import kafka.metrics.{KafkaMetricsReporter, KafkaYammerMetrics}
import kafka.raft.KafkaRaftManager
import kafka.server.KafkaRaftServer.{BrokerRole, ControllerRole}
import kafka.utils.{CoreUtils, Logging, Mx4jLoader, VerifiableProperties}
import org.apache.kafka.common.utils.{AppInfoParser, Time}
import org.apache.kafka.common.{TopicPartition, Uuid}
import org.apache.kafka.common.config.{ConfigDef, ConfigResource}
import org.apache.kafka.common.utils.{AppInfoParser, Time}
import org.apache.kafka.common.{KafkaException, TopicPartition, Uuid}
import org.apache.kafka.metadata.{KafkaConfigSchema, MetadataRecordSerde}
import org.apache.kafka.raft.RaftConfig
import org.apache.kafka.server.common.ApiMessageAndVersion

5
core/src/test/scala/unit/kafka/server/KafkaRaftServerTest.scala

@ -19,9 +19,10 @@ package kafka.server @@ -19,9 +19,10 @@ package kafka.server
import java.io.File
import java.nio.file.Files
import java.util.Properties
import kafka.common.{InconsistentBrokerMetadataException, InconsistentNodeIdException, KafkaException}
import kafka.common.{InconsistentBrokerMetadataException, InconsistentNodeIdException}
import kafka.log.UnifiedLog
import org.apache.kafka.common.Uuid
import org.apache.kafka.common.{KafkaException, Uuid}
import org.apache.kafka.common.utils.Utils
import org.apache.kafka.test.TestUtils
import org.junit.jupiter.api.Assertions._

Loading…
Cancel
Save