Class ProtobufConsumerRecordToTableWriterAdapter.Builder

java.lang.Object
io.deephaven.kafka.ingest.ProtobufConsumerRecordToTableWriterAdapter.Builder
Enclosing class:
ProtobufConsumerRecordToTableWriterAdapter

public static class ProtobufConsumerRecordToTableWriterAdapter.Builder
extends Object
A builder to map key and value fields to table columns.
  • Constructor Details

    • Builder

      @ScriptApi public Builder​(String protoDescriptor)
      Creates a new builder instance which will use a pre-compiled ProtoBuf descriptor file for parsing. To create a descriptor file, execute the following command against your .proto file:

      protoc --descriptor_set_out=${protoName}.desc ${protoName}.proto

      Parameters:
      protoDescriptor - filesystem path to a pre-compiled ProtoBuf descriptor file
    • Builder

      @ScriptApi public Builder​(Function<byte[],​com.google.protobuf.Message> protoConstructor)
      Creates a new builder instance which will use a user-defined function for ProtoBuf parsing. This allows for the message to be cast to the pre-defined java class created by executing the following command against your .proto file:

      protoc --java_out=. ${protoName}.proto

      Parameters:
      protoConstructor - a method which is provided with the message as a byte[] and returns a Message. If the appropriate class is within the classpath, this can be a basic `.parseForm(...)` of the byte[] within the pre-defined class (ie: `return MyClass.parseFrom(pBufBytes)`)
  • Method Details