Class KryoEncoder
- All Implemented Interfaces:
Encoder<ILoggingEvent>, ContextAware, LifeCycle
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class EncoderBase
startedFields inherited from class ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encode(ILoggingEvent loggingEvent) Encode an event as bytes.byte[]Get footer bytes.intbytebyte[]Fixed stream preamble: magic (4) + version (1) + flags (1).booleanReturns true if the encoder is stateful, false otherwise.voidsetMaxEventsBeforeReset(int maxEventsBeforeReset) voidsetSerializerType(KryoEncoder.SerializerType serializerType) voidsetStreamVersion(int streamVersion) Stream format version written into the header:KryoClassicConstants.STREAM_VERSION_0for Vanilla,KryoClassicConstants.STREAM_VERSION_5for Custom (LoggingEventKryoVOSerializerV5, framed withStreamFrameV5).voidstart()Methods inherited from class EncoderBase
isStarted, stopMethods inherited from class ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Constructor Details
-
KryoEncoder
public KryoEncoder()
-
-
Method Details
-
start
- Specified by:
startin interfaceLifeCycle- Overrides:
startin classEncoderBase<ILoggingEvent>
-
isStateful
Description copied from interface:EncoderReturns true if the encoder is stateful, false otherwise.A stateful encoder keeps state between invocation of
Encoder.encode(E event)method.A stateful encoder may produce different output for the same input event depending on its internal state. A stateless encoder will always produce the same output for the same input event.
- Returns:
- true if the encoder is stateful, false otherwise.
-
getMaxEventsBeforeReset
-
setMaxEventsBeforeReset
-
setSerializerType
-
getSerializerType
-
setStreamVersion
Stream format version written into the header:KryoClassicConstants.STREAM_VERSION_0for Vanilla,KryoClassicConstants.STREAM_VERSION_5for Custom (LoggingEventKryoVOSerializerV5, framed withStreamFrameV5). -
getStreamVersion
-
headerBytes
Fixed stream preamble: magic (4) + version (1) + flags (1). Written once at the start of the stream by the appender.- Returns:
- header bytes. Null values are allowed.
-
encode
Description copied from interface:EncoderEncode an event as bytes.- Parameters:
loggingEvent- the event to encode- Returns:
- the encoded bytes. Null values are allowed.
-