Skip to content

Conversation

@XiaoYou201
Copy link
Contributor

@XiaoYou201 XiaoYou201 commented Mar 17, 2024

Prepare a Pull Request

Motivation

Due to the version of flink update to 1.15.4, the redis connector should be updated and tested.

Modifications

According to the official website(https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/sourcessinks/) introduce.The Metadata, Planning, and Runtime please refer to official website.

Accomplish customize source and sink about the redis-connector of flink 1.15.4. This work includes three main parts as follow.

H7EYD7DP~8D@DH20{VBQ7

1. RedisDynamicTableFactory

This part mainly override two methods.

  • createDynamicTableSource()

This method firtst validate the support commands and then return a RedisDynamicTableSource object.

  • createDynamicTableSink()

This method firtst validate the support commands and then return a RedisDynamicTableSink object.

2. RedisDynamicTableSource And RedisDynamicTableSink

  • RedisDynamicTableSource

This class validate the config properties and pass those properties and RedisRowDataLookupFunction object into TableFunctionProvider.of() method to generate a LookupRuntimeProvider object which get data from redis servers.

  • RedisDynamicTableSink

This class validate the config properties and pass those properties and RedisSinkFunction object into SinkFunctionProvider.of() method to generate SinkRuntimeProvider object which sink data to redis servers.

3. RedisLookupFunction And RedisSinkFunction

  • RedisLookupFunction

This class has a method called eval(), the eval() include the logical that get data from redis servers.Now, it has four request types to get different data (GET, HGET, ZREVRANK, ZSCORE).Due to flexible interface design, The request type can be quickly expand.

  • RedisSinkFunction

This class has a method called flushInternal(), include the logical that sink data to redis servers.Now, it has three request types to sink different data (PLAIN, HASH, BITMAP).

Documentation

  • Does this pull request introduce a new feature? (yes)

@XiaoYou201 XiaoYou201 changed the title Add Redis connector on flink 1.15 [INLONG-9835][Sort] Add Redis connector on flink 1.15 Mar 18, 2024
@aloyszhang aloyszhang added this to the 1.12.0 milestone Mar 18, 2024
@dockerzhang
Copy link
Contributor

@XiaoYou201 please add more details about this PR.

@EMsnap
Copy link
Member

EMsnap commented Mar 18, 2024

Please fix your uts and build

aloyszhang
aloyszhang previously approved these changes Mar 19, 2024
Copy link
Member

@EMsnap EMsnap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should put declaration for copied codes under licenses/inlong-sort-connectors/LICENSE , thanks

Copy link
Member

@EMsnap EMsnap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add dependency in inlong-sort/sort-core/pom.xml under flink v1.15 , and also add in src/main/assemblies/sort-connectors-v1.15.xml

@dockerzhang dockerzhang changed the title [INLONG-9835][Sort] Add Redis connector on flink 1.15 [INLONG-8948][Sort] Add Redis connector on flink 1.15 Mar 20, 2024
@dockerzhang dockerzhang merged commit f2dd0d6 into apache:master Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature][Sort] Add Redis connector on flink 1.15

4 participants