From 7b9f31e35c0304bec191c5fbe2b880386e43f895 Mon Sep 17 00:00:00 2001 From: Hector Geraldino Date: Fri, 15 Mar 2024 06:56:36 -0400 Subject: [PATCH] KAFKA-16358: Sort transformations by name in documentation; add missing transformations to documentation; add hyperlinks (#15499) Reviewers: Yash Mayya --- .../connect/tools/TransformationDoc.java | 28 +++++++++--------- docs/connect.html | 29 ++++++++++--------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/connect/runtime/src/main/java/org/apache/kafka/connect/tools/TransformationDoc.java b/connect/runtime/src/main/java/org/apache/kafka/connect/tools/TransformationDoc.java index 543703a13ac..2c7250eb588 100644 --- a/connect/runtime/src/main/java/org/apache/kafka/connect/tools/TransformationDoc.java +++ b/connect/runtime/src/main/java/org/apache/kafka/connect/tools/TransformationDoc.java @@ -53,22 +53,22 @@ public class TransformationDoc { } private static final List TRANSFORMATIONS = Arrays.asList( - new DocInfo(InsertField.class.getName(), InsertField.OVERVIEW_DOC, InsertField.CONFIG_DEF), - new DocInfo(ReplaceField.class.getName(), ReplaceField.OVERVIEW_DOC, ReplaceField.CONFIG_DEF), - new DocInfo(MaskField.class.getName(), MaskField.OVERVIEW_DOC, MaskField.CONFIG_DEF), - new DocInfo(ValueToKey.class.getName(), ValueToKey.OVERVIEW_DOC, ValueToKey.CONFIG_DEF), - new DocInfo(HoistField.class.getName(), HoistField.OVERVIEW_DOC, HoistField.CONFIG_DEF), - new DocInfo(ExtractField.class.getName(), ExtractField.OVERVIEW_DOC, ExtractField.CONFIG_DEF), - new DocInfo(SetSchemaMetadata.class.getName(), SetSchemaMetadata.OVERVIEW_DOC, SetSchemaMetadata.CONFIG_DEF), - new DocInfo(TimestampRouter.class.getName(), TimestampRouter.OVERVIEW_DOC, TimestampRouter.CONFIG_DEF), - new DocInfo(RegexRouter.class.getName(), RegexRouter.OVERVIEW_DOC, RegexRouter.CONFIG_DEF), - new DocInfo(Flatten.class.getName(), Flatten.OVERVIEW_DOC, Flatten.CONFIG_DEF), new DocInfo(Cast.class.getName(), Cast.OVERVIEW_DOC, Cast.CONFIG_DEF), - new DocInfo(TimestampConverter.class.getName(), TimestampConverter.OVERVIEW_DOC, TimestampConverter.CONFIG_DEF), - new DocInfo(Filter.class.getName(), Filter.OVERVIEW_DOC, Filter.CONFIG_DEF), - new DocInfo(InsertHeader.class.getName(), InsertHeader.OVERVIEW_DOC, InsertHeader.CONFIG_DEF), new DocInfo(DropHeaders.class.getName(), DropHeaders.OVERVIEW_DOC, DropHeaders.CONFIG_DEF), - new DocInfo(HeaderFrom.class.getName(), HeaderFrom.OVERVIEW_DOC, HeaderFrom.CONFIG_DEF) + new DocInfo(ExtractField.class.getName(), ExtractField.OVERVIEW_DOC, ExtractField.CONFIG_DEF), + new DocInfo(Filter.class.getName(), Filter.OVERVIEW_DOC, Filter.CONFIG_DEF), + new DocInfo(Flatten.class.getName(), Flatten.OVERVIEW_DOC, Flatten.CONFIG_DEF), + new DocInfo(HeaderFrom.class.getName(), HeaderFrom.OVERVIEW_DOC, HeaderFrom.CONFIG_DEF), + new DocInfo(HoistField.class.getName(), HoistField.OVERVIEW_DOC, HoistField.CONFIG_DEF), + new DocInfo(InsertField.class.getName(), InsertField.OVERVIEW_DOC, InsertField.CONFIG_DEF), + new DocInfo(InsertHeader.class.getName(), InsertHeader.OVERVIEW_DOC, InsertHeader.CONFIG_DEF), + new DocInfo(MaskField.class.getName(), MaskField.OVERVIEW_DOC, MaskField.CONFIG_DEF), + new DocInfo(RegexRouter.class.getName(), RegexRouter.OVERVIEW_DOC, RegexRouter.CONFIG_DEF), + new DocInfo(ReplaceField.class.getName(), ReplaceField.OVERVIEW_DOC, ReplaceField.CONFIG_DEF), + new DocInfo(SetSchemaMetadata.class.getName(), SetSchemaMetadata.OVERVIEW_DOC, SetSchemaMetadata.CONFIG_DEF), + new DocInfo(TimestampConverter.class.getName(), TimestampConverter.OVERVIEW_DOC, TimestampConverter.CONFIG_DEF), + new DocInfo(TimestampRouter.class.getName(), TimestampRouter.OVERVIEW_DOC, TimestampRouter.CONFIG_DEF), + new DocInfo(ValueToKey.class.getName(), ValueToKey.OVERVIEW_DOC, ValueToKey.CONFIG_DEF) ); private static void printTransformationHtml(PrintStream out, DocInfo docInfo) { diff --git a/docs/connect.html b/docs/connect.html index 954c7c647d8..c06879813fb 100644 --- a/docs/connect.html +++ b/docs/connect.html @@ -162,19 +162,22 @@ transforms.InsertSource.static.value=test-file-source

Several widely-applicable data and routing transformations are included with Kafka Connect:

    -
  • InsertField - Add a field using either static data or record metadata
  • -
  • ReplaceField - Filter or rename fields
  • -
  • MaskField - Replace field with valid null value for the type (0, empty string, etc) or custom replacement (non-empty string or numeric value only)
  • -
  • ValueToKey - Replace the record key with a new key formed from a subset of fields in the record value
  • -
  • HoistField - Wrap the entire event as a single field inside a Struct or a Map
  • -
  • ExtractField - Extract a specific field from Struct and Map and include only this field in results
  • -
  • SetSchemaMetadata - modify the schema name or version
  • -
  • TimestampRouter - Modify the topic of a record based on original topic and timestamp. Useful when using a sink that needs to write to different tables or indexes based on timestamps
  • -
  • RegexRouter - modify the topic of a record based on original topic, replacement string and a regular expression
  • -
  • Filter - Removes messages from all further processing. This is used with a predicate to selectively filter certain messages.
  • -
  • InsertHeader - Add a header using static data
  • -
  • HeadersFrom - Copy or move fields in the key or value to the record headers
  • -
  • DropHeaders - Remove headers by name
  • +
  • Cast - Cast fields or the entire key or value to a specific type
  • +
  • DropHeaders - Remove headers by name
  • +
  • ExtractField - Extract a specific field from Struct and Map and include only this field in results
  • +
  • Filter - Removes messages from all further processing. This is used with a predicate to selectively filter certain messages
  • +
  • Flatten - Flatten a nested data structure
  • +
  • HeaderFrom - Copy or move fields in the key or value to the record headers
  • +
  • HoistField - Wrap the entire event as a single field inside a Struct or a Map
  • +
  • InsertField - Add a field using either static data or record metadata
  • +
  • InsertHeader - Add a header using static data
  • +
  • MaskField - Replace field with valid null value for the type (0, empty string, etc) or custom replacement (non-empty string or numeric value only)
  • +
  • RegexRouter - modify the topic of a record based on original topic, replacement string and a regular expression
  • +
  • ReplaceField - Filter or rename fields
  • +
  • SetSchemaMetadata - modify the schema name or version
  • +
  • TimestampConverter - Convert timestamps between different formats
  • +
  • TimestampRouter - Modify the topic of a record based on original topic and timestamp. Useful when using a sink that needs to write to different tables or indexes based on timestamps
  • +
  • ValueToKey - Replace the record key with a new key formed from a subset of fields in the record value

Details on how to configure each transformation are listed below: