All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.deephaven.kafka.protobuf.Protocol Maven / Gradle / Ivy

The newest version!
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.kafka.protobuf;

/**
 * The serialization / deserialization protocol.
 *
 * @see #serdes()
 * @see #raw()
 */
public interface Protocol {

    /**
     * The Kafka Protobuf serdes protocol. The payload's first byte is the serdes magic byte, the next 4-bytes are the
     * schema ID, the next variable-sized bytes are the message indexes, followed by the normal binary encoding of the
     * Protobuf data.
     *
     * @return the Kafka Protobuf serdes protocol
     * @see Kafka
     *      Protobuf serdes
     * @see wire-format
     * @see Protobuf encoding
     */
    static Protocol serdes() {
        return Impl.SERDES;
    }

    /**
     * The raw Protobuf protocol. The full payload is the normal binary encoding of the Protobuf data.
     *
     * @return the raw Protobuf protocol
     * @see Protobuf encoding
     */
    static Protocol raw() {
        return Impl.RAW;
    }

    enum Impl implements Protocol {
        RAW, SERDES;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy