starrocks-connector-for-apache-flink
starrocks-connector-for-apache-flink copied to clipboard
Analyze v1.2.11
What type of PR is this:
- [x] BugFix
- [ ] Feature
- [ ] Enhancement
- [ ] Refactor
- [ ] UT
- [ ] Doc
- [ ] Tool
Which issues of this PR fixes :
Fixes #438
Problem Summary(Required) :
问题描述
在Docker环境中使用StarRocks Flink连接器时,当配置 'load-url' = 'starrocks:8030' 时,StarRocks FE会将Stream Load请求重定向到 127.0.0.1:8040(BE节点),但这个地址在容器间网络中无法访问,导致连接失败。
触发场景
- Docker/容器化环境部署
- 使用StarRocks官方推荐的单一FE地址配置
- Stream Load操作时FE重定向到BE节点
解决方案
- 新增ContainerAwareRedirectStrategy类:实现容器感知的HTTP重定向处理
- 自动地址转换:将localhost/127.0.0.1重定向自动转换为原始容器主机名
- 多节点支持:支持多BE节点的端口到主机名映射
- 向后兼容:保持现有非容器环境的正常工作
主要修改
ContainerAwareRedirectStrategy.java- 核心重定向策略实现DefaultStreamLoader.java- 集成新的重定向策略TransactionStreamLoader.java- 集成新的重定向策略ContainerAwareRedirectStrategyTest.java- 完整的单元测试覆盖
Checklist:
- [x] I have added test cases for my bug fix or my new feature
- [x] This pr will affect users' behaviors
- [x] This pr needs user documentation (for new or modified features or behaviors)
- [x] I have added documentation for my new feature or new function
Hi, all checks have passed. Could a maintainer please approve the workflow so this PR can proceed? Thanks in advance!