commonlib/src/main/java/com/streamsets/pipeline/lib/util/ProtobufTypeUtil.java
public static DynamicMessage sdcFieldToProtobufMsg(
      Record record,
      Descriptors.Descriptor desc,
      Map<String, Set<Descriptors.FieldDescriptor>> messageTypeToExtensionMap,
      Map<String, Object> defaultValueMap
  ) throws DataGeneratorException {
    return sdcFieldToProtobufMsg(record, record.get(), "", desc, messageTypeToExtensionMap, defaultValueMap);
  }
public static DynamicMessage sdcFieldToProtobufMsg(
      Record record,
      Descriptors.Descriptor desc,
      Map<String, Set<Descriptors.FieldDescriptor>> messageTypeToExtensionMap,
      Map<String, Object> defaultValueMap
  ) throws DataGeneratorException {
    return sdcFieldToProtobufMsg(record, record.get(), "", desc, messageTypeToExtensionMap, defaultValueMap);
  }
Serializes a record to a protobuf message using the specified descriptor.

@param record                    Record to serialize
@param desc                      Protobuf descriptor
@param messageTypeToExtensionMap Protobuf extension map
@param defaultValueMap           Protobuf default field values
@return serialized message
@throws DataGeneratorException