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:
parent
e83fa469f6
commit
bca81b55ec
2 changed files with 29 additions and 7 deletions
|
|
@ -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$")
|
||||||
|
|
@ -162,10 +162,10 @@ import pekko.util.OptionVal
|
||||||
JacksonObjectMapperProvider(system).getOrCreate(bindingName, Some(new CBORFactory)))
|
JacksonObjectMapperProvider(system).getOrCreate(bindingName, Some(new CBORFactory)))
|
||||||
|
|
||||||
@InternalApi object Compression {
|
@InternalApi object Compression {
|
||||||
sealed trait Algoritm
|
sealed trait Algorithm
|
||||||
object Off extends Algoritm
|
object Off extends Algorithm
|
||||||
final case class GZip(largerThan: Long) extends Algoritm
|
final case class GZip(largerThan: Long) extends Algorithm
|
||||||
final case class LZ4(largerThan: Long) extends Algoritm
|
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 conf = JacksonObjectMapperProvider.configForBinding(bindingName, system.settings.config)
|
||||||
private val isDebugEnabled = conf.getBoolean("verbose-debug-logging") && log.isDebugEnabled
|
private val isDebugEnabled = conf.getBoolean("verbose-debug-logging") && log.isDebugEnabled
|
||||||
private final val BufferSize = 1024 * 4
|
private final val BufferSize = 1024 * 4
|
||||||
private val compressionAlgorithm: Compression.Algoritm = {
|
private val compressionAlgorithm: Compression.Algorithm = {
|
||||||
toRootLowerCase(conf.getString("compression.algorithm")) match {
|
toRootLowerCase(conf.getString("compression.algorithm")) match {
|
||||||
case "off" => Compression.Off
|
case "off" => Compression.Off
|
||||||
case "gzip" =>
|
case "gzip" =>
|
||||||
|
|
@ -298,7 +298,7 @@ import pekko.util.OptionVal
|
||||||
result
|
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) {
|
if (isDebugEnabled) {
|
||||||
val durationMicros = (System.nanoTime - startTime) / 1000
|
val durationMicros = (System.nanoTime - startTime) / 1000
|
||||||
if (bytes.length == result.length)
|
if (bytes.length == result.length)
|
||||||
|
|
@ -395,7 +395,7 @@ import pekko.util.OptionVal
|
||||||
bytes: Array[Byte],
|
bytes: Array[Byte],
|
||||||
decompressBytes: Array[Byte],
|
decompressBytes: Array[Byte],
|
||||||
startTime: Long,
|
startTime: Long,
|
||||||
clazz: Class[_ <: AnyRef]) = {
|
clazz: Class[_ <: AnyRef]): Unit = {
|
||||||
if (isDebugEnabled) {
|
if (isDebugEnabled) {
|
||||||
val durationMicros = (System.nanoTime - startTime) / 1000
|
val durationMicros = (System.nanoTime - startTime) / 1000
|
||||||
if (bytes.length == decompressBytes.length)
|
if (bytes.length == decompressBytes.length)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue