Class ClassNameSerializer
java.lang.Object
com.esotericsoftware.kryo.kryo5.Serializer<String>
Serializer for logger names that compresses hierarchical names by storing
common prefixes separately and referencing them.
Logger names are typically hierarchical (e.g., "ch.qos.logback.classic.Logger",
"ch.qos.logback.classic.PatternLayout") and share common prefixes.
This serializer:
1. Caches full logger names (like StringSerializer)
2. For new entries, detects common prefixes and stores only the unique suffix
3. Reduces serialized size by 30-50% for typical logger hierarchies
-
Nested Class Summary
Nested classes/interfaces inherited from class SerializerBase
SerializerBase.BiMapType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringreadNewEntry(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Input input) protected voidwriteNewEntry(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Output output, String loggerName) Method called to write new entries.Methods inherited from class SerializerBase
read, writeMethods inherited from class com.esotericsoftware.kryo.kryo5.Serializer
copy, getAcceptsNull, isImmutable, setAcceptsNull, setImmutable
-
Constructor Details
-
ClassNameSerializer
-
-
Method Details
-
writeNewEntry
protected void writeNewEntry(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Output output, String loggerName) Description copied from class:SerializerBaseMethod called to write new entries.- Specified by:
writeNewEntryin classSerializerBase<String>- Parameters:
kryo-output-loggerName-
-
readNewEntry
protected String readNewEntry(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Input input) - Specified by:
readNewEntryin classSerializerBase<String>
-