Enum Class VtpHeaderEmissionMode
- All Implemented Interfaces:
Serializable,Comparable<VtpHeaderEmissionMode>,Constable
VeniceWriter attaches the
vtp
protocol-schema header to outbound messages.
The vtp header carries the Avro JSON for KafkaMessageEnvelope (~16 KB) and is only
useful to consumers that need to bootstrap the schema for forward compatibility. Pre-existing
behavior emits it on outbound messages whose producer metadata satisfies
segmentNumber == 0 && messageSequenceNumber == 0. On the data path that gate only
matches the very first segment-start record produced on a partition (segment 0, sequence 0);
subsequent data SOS records use non-zero segmentNumber and are not affected. Heartbeat
control messages, however, are synthesized with both coordinates pinned to 0 (see
VeniceWriter.getHeartbeatKME(long, com.linkedin.venice.writer.LeaderMetadataWrapper, com.linkedin.venice.kafka.protocol.ControlMessage, java.lang.String)), so every heartbeat matches the gate and picks up the
~16 KB header even though heartbeat consumers never use it for schema bootstrap. On busy
ingestion paths with many partitions and frequent heartbeats this dominates the per-record
memory footprint.
This mode lets writers opt out of the heartbeat case (or out entirely) without changing the semantics of regular data segment-start records.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionNever emit the vtp header.Emit the vtp header on every segment-start message, including heartbeat SOS records.Emit the vtp header on non-heartbeat segment-start messages (data SOS and DoL stamps); skip heartbeat SOS records. -
Method Summary
Modifier and TypeMethodDescriptionstatic VtpHeaderEmissionModeReturns the enum constant of this class with the specified name.static VtpHeaderEmissionMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SOS_AND_HB
Emit the vtp header on every segment-start message, including heartbeat SOS records. Default, preserves pre-existing behavior. -
SOS_ONLY
Emit the vtp header on non-heartbeat segment-start messages (data SOS and DoL stamps); skip heartbeat SOS records. DoL stamps are START_OF_SEGMENT control messages that carry segmentNumber=0 / messageSequenceNumber=0 (like heartbeats) but are not heartbeats — they need the vtp header so a forward-compat consumer hitting a DoL as the first record on a fresh VT can bootstrap the KME schema. Consumers are expected to obtain theKafkaMessageEnvelopeschema for heartbeat records by some other means (controller-side schema cache, classpath fallback, or an earlier data SOS on the same segment). -
NONE
Never emit the vtp header. Use only when all consumers can resolve theKafkaMessageEnvelopeschema without the per-segment hint.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-