Oneal65 commented on code in PR #404: URL: https://github.com/apache/incubator-inlong-website/pull/404#discussion_r897886854
########## i18n/zh-CN/docusaurus-plugin-content-docs/current/design_and_concept/how_to_extend_extract_or_load_node_ch.md: ########## @@ -0,0 +1,205 @@ +--- +title: Sort 插件 +sidebar_position: 3 +--- + +# 总览 + +InLong-Sort是一个ETL系统,当前支持的extract或load包括elasticsearch、hbase、hive、iceberg、jdbc、kafka、mongodb、mysql、orcale、postgres、pulsar等。InLong-Sort是基于Flink SQL的ETL方案,Flink SQL强大的表达能力带来的高可扩展性、灵活性,基本上Flink SQL支持的语意,InLong-Sort都支持。在个别场景,Flink SQL内置的函数不满足需求时,还可通过各种UDF来扩展。同时对于曾经使用过SQL尤其是使用过Flink SQL的人而言,会更容易上手。 + +本文介绍如何在InLong-Sort中扩展一个新的source(在InLong中抽象为Extract Node)或一个新的sink(在InLong中抽象为Load Node)。在弄清楚InLong的架构之后,就可以明白source与Extract Node如何对应,sink与Load Node如何对应。InLong-Sort的架构可以由UML对象关系图表示为: + + + +其中各个组件的概念为: + +| **名称** | **描述** | +| ----------------- | ----------------------------------------------------------- | +| Group | 数据流组,包含多个数据流,一个Group 代表一个数据接入 | +| Stream | 数据流,一个数据流有具体的流向 | +| GroupInfo | Sort中对数据流向的封装,一个GroupInfo可包含多个DataFlowInfo | +| StreamInfo | Sort中数据流向的抽象,包含该数据流的各种来源、转换、去向等 | +| Node | 数据同步中数据源、数据转换、数据去向的抽象 | +| ExtractNode | 数据同步的来源端抽象 | +| TransformNode | 数据同步的转换过程抽象 | +| LoadNode | 数据同步的去向端抽象 | +| NodeRelationShip | 数据同步中各个节点关系抽象 | +| FieldRelationShip | 数据同步中上下游节点字段间关系的抽象 | +| FieldInfo | 节点字段 | +| MetaFieldInfo | 节点Meta字段 | +| Function | 转换函数的抽象 | +| FunctionParam | 函数的入参抽象 | +| ConstantParam | 常量参数 | + +扩展Extract Node 或 Load Node需要做的工作是: + +- 继承Node类(例如MyExtractNode),构建具体的extract 或 load使用逻辑; +- 在具体的Node类(例如MyExtractNode)中,指定对应Flink connector; +- 在具体的ETL实现逻辑中使用具体的Node类(例如MyExtractNode)。 + +其中第二步中可以使用已有的flink connector,或者用户自己扩展,如何扩展flink connector请参考flink官方文档[DataStream Connectors ](https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/connectors/datastream/overview/#datastream-connectors). Review Comment: DONE -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
