fix spelling of Algorithm (#1932)

* fix spelling of Algorithm

* Update JacksonSerializer.scala

* Create pr-4682-rename-internal-algoritm-class.backwards.excludes

* move file
This commit is contained in:
PJ Fanning 2025-07-06 11:52:39 +01:00 committed by GitHub
parent e83fa469f6
commit bca81b55ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 7 deletions

View file

@ -0,0 +1,22 @@
# 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.
# PR4682 renames an internal class called Algoritm (a typo)
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.serialization.jackson.Compression$Algoritm")
ProblemFilters.exclude[MissingTypesProblem]("org.apache.pekko.serialization.jackson.Compression$GZip")
ProblemFilters.exclude[MissingTypesProblem]("org.apache.pekko.serialization.jackson.Compression$LZ4")
ProblemFilters.exclude[MissingTypesProblem]("org.apache.pekko.serialization.jackson.Compression$Off$")

View file

@ -162,10 +162,10 @@ import pekko.util.OptionVal
JacksonObjectMapperProvider(system).getOrCreate(bindingName, Some(new CBORFactory)))
@InternalApi object Compression {
sealed trait Algoritm
object Off extends Algoritm
final case class GZip(largerThan: Long) extends Algoritm
final case class LZ4(largerThan: Long) extends Algoritm
sealed trait Algorithm
object Off extends Algorithm
final case class GZip(largerThan: Long) extends Algorithm
final case class LZ4(largerThan: Long) extends Algorithm
}
/**
@ -191,7 +191,7 @@ import pekko.util.OptionVal
private val conf = JacksonObjectMapperProvider.configForBinding(bindingName, system.settings.config)
private val isDebugEnabled = conf.getBoolean("verbose-debug-logging") && log.isDebugEnabled
private final val BufferSize = 1024 * 4
private val compressionAlgorithm: Compression.Algoritm = {
private val compressionAlgorithm: Compression.Algorithm = {
toRootLowerCase(conf.getString("compression.algorithm")) match {
case "off" => Compression.Off
case "gzip" =>
@ -298,7 +298,7 @@ import pekko.util.OptionVal
result
}
private def logToBinaryDuration(obj: AnyRef, startTime: Long, bytes: Array[Byte], result: Array[Byte]) = {
private def logToBinaryDuration(obj: AnyRef, startTime: Long, bytes: Array[Byte], result: Array[Byte]): Unit = {
if (isDebugEnabled) {
val durationMicros = (System.nanoTime - startTime) / 1000
if (bytes.length == result.length)
@ -395,7 +395,7 @@ import pekko.util.OptionVal
bytes: Array[Byte],
decompressBytes: Array[Byte],
startTime: Long,
clazz: Class[_ <: AnyRef]) = {
clazz: Class[_ <: AnyRef]): Unit = {
if (isDebugEnabled) {
val durationMicros = (System.nanoTime - startTime) / 1000
if (bytes.length == decompressBytes.length)