Skip to content

Conversation

@imbajin
Copy link

@imbajin imbajin commented Aug 20, 2025

Check list

Summary by CodeRabbit

  • 新功能

    • 新增 HugeGraph 连接器模块,为 SeaTunnel v2 提供图数据库 Sink 支持(顶点/边写入、CDC 处理、批量与重试策略)。
  • 文档

    • 添加完整的设计、需求与实施任务文档,覆盖架构、数据映射、CDC 流程、配置示例、校验与监控、性能目标与测试方案及实现路线图。
  • 杂务

    • 将模块注册入构建清单,配置依赖与测试工具并排除冲突依赖以保障兼容性。

@coderabbitai
Copy link

coderabbitai bot commented Aug 20, 2025

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

新增 HugeGraph 连接器的设计、需求与任务文档,补充通用连接器架构说明,并在构建系统中新增并注册模块 connector-hugegraph(含依赖配置)。改动限于文档与父/子 POM,尚无运行时实现代码。

Changes

Cohort / File(s) Summary
HugeGraph 规格与计划
.vibedev/specs/hugegraph-connector/design.md, .vibedev/specs/hugegraph-connector/requirements.md, .vibedev/specs/hugegraph-connector/tasks.md
新增设计、需求与任务清单,包含架构与组件划分(HugeGraphSinkFactory/Writer/Mapper 等)、CDC 处理流程、数据映射模型、错误重试与批写策略、测试与 MVP 路线。
连接器通用架构说明
seatunnel-connectors-v2/CONNECTOR_ARCHITECTURE.md
新增连接器架构文档与 KV 示例,定义 SeaTunnelRow/SeaTunnelRowType、源/汇接口、键生成/序列化策略、批写与错误处理建议。
构建与模块集成
seatunnel-connectors-v2/connector-hugegraph/pom.xml, seatunnel-connectors-v2/pom.xml
新增 connector-hugegraph 子模块 POM(声明 hugegraph-client、commons-lang3 等依赖及测试依赖),并在父 POM 的 <modules> 中注册模块。

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User as 作业配置
    participant Engine as SeaTunnel 引擎
    participant Factory as HugeGraphSinkFactory
    participant Sink as HugeGraphSinkWriter
    participant Client as RetryableHugeGraphClient
    participant Server as HugeGraph 服务

    User->>Engine: 提交作业(含 HugeGraph Sink 配置)
    Engine->>Factory: 初始化 Factory(factoryIdentifier="HugeGraph")
    Factory-->>Engine: 返回 Sink 实例
    Engine->>Sink: 传入 SeaTunnelRow(含 RowKind)
    rect rgba(200,230,255,0.25)
      Note over Sink: 根据 RowKind 处理 CDC 分支\n(+I/+U 插入或更新,-U/-D 删除)
      Sink->>Client: 聚合并批量写入/删除(按批次或超时触发)
      Client->>Server: 调用 HugeGraph Java/REST API
      Server-->>Client: 应答(成功/失败)
    end
    alt 写入失败且可重试
      Sink->>Client: 指数退避重试(可配置次数)
    else 持续失败
      Sink-->>Engine: 记录/上报错误(部分失败/死信)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 分钟

Possibly related PRs

Poem

小兔划线绘巨图,点与边间跳轻步。
文档齐备 POM 新增,依赖整装待出土。
CDC 潺潺入顶点,映射规则描细路。
待到实现敲代码,万条同步笑春曙。 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 该标题采用“docs:”前缀,清晰指出了主要变更——初始化 SeaTunnel-HG 设计文档 V1,准确反映了 PR 的核心目标,同时保持简洁明了。虽然该 PR 还包含其他关联文档和模块骨架的创建,但标题聚焦于最关键的设计文档新增,符合 Pull Request 标题需突出主要改动的要求。
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f7681ec and 9dab4c3.

📒 Files selected for processing (1)
  • seatunnel-connectors-v2/pom.xml (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@imbajin imbajin requested a review from Copilot August 20, 2025 11:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces the initial design documentation and Maven module structure for the SeaTunnel HugeGraph connector, preparing the foundation for graph database sink capabilities in SeaTunnel v2.

  • Adds HugeGraph connector module with complete Maven configuration and dependencies
  • Creates comprehensive design documentation covering architecture, CDC processing, vertex/edge mapping configurations, batch processing, and retry mechanisms
  • Provides detailed implementation tasks, requirements, and configuration examples with roadmap for future development

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
seatunnel-connectors-v2/pom.xml Adds connector-hugegraph module to parent POM
seatunnel-connectors-v2/connector-hugegraph/pom.xml Creates complete Maven module with HugeGraph client dependencies and test framework
seatunnel-connectors-v2/CONNECTOR_ARCHITECTURE.md Adds comprehensive connector architecture analysis document
.vibedev/specs/hugegraph-connector/tasks.md Creates detailed implementation task breakdown with development commands
.vibedev/specs/hugegraph-connector/requirements.md Defines functional requirements for HugeGraph connector implementation
.vibedev/specs/hugegraph-connector/design.md Provides detailed technical design document with architecture diagrams

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

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

The property ${mockito.version} is referenced but not defined in the properties section. This will cause a build failure when the version cannot be resolved.

Copilot uses AI. Check for mistakes.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (17)
.vibedev/specs/hugegraph-connector/design.md (3)

56-83: 补充代码块语言标识,修复 markdownlint MD040

目录结构代码块缺少语言标识,建议使用 text 以通过规范校验。

请按以下方式调整:

-```
+```text
 seatunnel-connectors-v2/
 └── connector-hugegraph/
     ├── src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/
     │   ├── sink/
     │   │   ├── HugeGraphSinkFactory.java      # 工厂类
     │   │   ├── HugeGraphSink.java            # Sink 主类
     │   │   └── HugeGraphSinkWriter.java      # Writer 实现
     │   ├── config/
     │   │   ├── HugeGraphSinkConfig.java      # 配置管理
     │   │   ├── HugeGraphOptions.java         # 配置选项定义
     │   │   └── MappingConfig.java            # 映射配置
     │   ├── client/
     │   │   ├── HugeGraphClientManager.java   # 客户端管理
     │   │   └── HugeGraphWriteClient.java     # 写入客户端封装
     │   ├── mapper/
     │   │   ├── GraphDataMapper.java          # 数据映射接口
     │   │   ├── VertexMapper.java             # 顶点映射
     │   │   └── EdgeMapper.java               # 边映射
     │   ├── serializer/
     │   │   ├── RowToVertexConverter.java     # 行到顶点转换
     │   │   └── RowToEdgeConverter.java       # 行到边转换
     │   ├── state/
     │   │   └── HugeGraphSinkState.java       # 状态管理
     │   └── exception/
     │       └── HugeGraphConnectorException.java
     └── src/test/java/...                     # 测试代码
-```
+```

247-271: 明确重试语义与幂等性,核对 HugeGraph Client 事务 API 用法

  • 文档示例中使用 client.graph(graphName).tx().commit(() -> {...}),请确认 hugegraph-client 1.5 是否支持该式样的事务包装与批量提交回调,或是否应改用其推荐的批量/事务 API。
  • 建议在设计文档中明确:
    • 重试的幂等保障(顶点/边 upsert/删除的去重键与自然幂等性策略)。
    • 失败分片重试策略(整批失败 vs. 二分/单条降级重试)。
    • 与 SeaTunnel 提交语义的对应关系(至少一次/幂等写入 vs. 两阶段提交与精确一次)。

为便于实现对齐,可在该段落后追加设计要点:

     } catch (Exception e) {
         handleWriteError(elements, e);
     }
 }
 
 private void handleWriteError(List<GraphElement> elements, Exception e) {
     // 1. 记录失败的元素
     // 2. 决定是否重试
     // 3. 如果超过重试次数,记录到死信队列
 }
+
+// 设计说明(补充):
+// - 幂等性:通过顶点/边 ID 唯一键实现自然幂等;UPDATE/UPSERT 使用相同 ID 策略避免重复写入。
+// - 分片重试:批量失败时执行二分降级,直至定位到失败子集;最终对单条执行重试或落入死信队列。
+// - 事务语义:与 SeaTunnel SinkAggregatedCommitter 对齐,提交前确保所有批量写入成功;明确至少一次与精确一次的边界。

277-299: Schema 校验建议补充异常分支与兼容性提示

  • HugeGraph Client 的 schema 查询方法可能直接抛出异常而非返回 null。建议在设计中标注两种分支:null/Optional 返回与异常捕获,避免误用。
  • 对属性类型的兼容性校验建议列出常见映射表(int/long/string/date 等)与不兼容示例,便于实现与测试对齐。
.vibedev/specs/hugegraph-connector/requirements.md (3)

61-69: 补充批处理失败处理的明确验收标准

当前仅要求“优雅处理部分批次失败”。建议量化明确:

  • 失败分片降级策略(例如二分/单条降级)与最大降级深度。
  • 失败记录输出位置(日志级别/死信队列格式/可选落盘路径)。
  • 指标要求:批失败率、单条重试次数、最终落入死信队列的计数。

我可以补一版“失败处理”验收条款草案,是否需要我直接提交补充文本?


104-113: 性能指标建议更可执行:给出阈值与观察口径

  • 建议增加“P95 写入延迟(ms)”、“稳态吞吐(records/s)”的目标范围,结合 100 万记录基准。
  • 指标采集口径(滑动窗口/聚合周期)与导出方式(JMX/日志/自定义指标接口)一并定义,便于落地。

81-92: 配置校验与敏感信息处理需要操作性描述

  • 启动时验证配置完整性:建议明确“缺失必填项即 fail-fast 退出”,并列出必填项清单。
  • 环境变量替换:说明支持的占位符格式与解析顺序,避免歧义。
.vibedev/specs/hugegraph-connector/tasks.md (3)

24-28: 建议在格式化命令前增加校验与快速失败提示

Spotless 常在首次运行时下载插件,建议在文档中提示“首次运行需联网”,并建议在 CI 中执行 spotless:check。

可追加一行:

  • 在 CI 中执行: ./mvnw spotless:check

52-58: 提醒:AutoService 与 Lombok 的注解处理器需要 Maven 编译插件支持

任务中已包含 @AutoService(Factory.class),为确保 META-INF/services 正确生成,需确认父 POM 已配置 maven-compiler-plugin 的 annotationProcessorPaths。若父 POM 未统一配置,建议在模块内新增。

可以追加一个子任务:

  • 配置 maven-compiler-plugin 的 annotationProcessorPaths(auto-service 与 lombok),或在顶层统一管理。
    我可以提供兼容 SeaTunnel 父 POM 的最小化配置片段。

210-227: 性能优化阶段建议先用轻量实现,延后引入 Disruptor

在未证明必要性前引入 Disruptor 会增加复杂度与维护成本。建议先用基于 ArrayDeque/LinkedList 的简单批缓冲与限流实现,待性能验证不足时再引入环形缓冲。

seatunnel-connectors-v2/connector-hugegraph/pom.xml (1)

92-124: JUnit Jupiter 依赖可补充 junit-jupiter-api(若父 POM 未管理)

已引入 engine 与 params,通常还需 junit-jupiter-api(多数情况下父 POM 管理 BOM/版本并聚合)。请确认父 POM 已管理;若没有,建议追加以避免编译/运行期缺失。

可选补充:

 <dependency>
   <groupId>org.junit.jupiter</groupId>
   <artifactId>junit-jupiter-engine</artifactId>
   <scope>test</scope>
 </dependency>
 
+<dependency>
+  <groupId>org.junit.jupiter</groupId>
+  <artifactId>junit-jupiter-api</artifactId>
+  <scope>test</scope>
+  <!-- 版本通常由父 POM 管理;如未管理,请显式声明 -->
+</dependency>
seatunnel-connectors-v2/CONNECTOR_ARCHITECTURE.md (7)

62-69: 为“Sink 端架构”代码块补充语言标识(MD040)

同上,建议将代码块起始反引号补充语言为 text,消除 MD040 告警并改善渲染:

-```
+```text
 SeaTunnelSink<IN, StateT, CommitInfoT, AggregatedCommitInfoT>
     ├── createWriter()         // 创建写入器
     ├── createCommitter()      // 创建提交器(事务)
     ├── getSaveModeHandler()   // 保存模式处理
     └── getWriteCatalogTable() // 写入表信息

---

`236-244`: **AutoService 注解目标建议改为 TableSinkFactory.class**

示例中工厂实现为 TableSinkFactory。通常应将 @AutoService 的目标指向实际的服务接口,以生成正确的 SPI 元数据,便于通过 ServiceLoader/SeaTunnel 工厂加载机制发现实现。

```diff
-@AutoService(Factory.class)
+@AutoService(TableSinkFactory.class)
 public class MyKVSinkFactory implements TableSinkFactory {

293-313: 示例中的 Thread.sleep 未处理中断,建议恢复中断状态

在重试退避中直接调用 Thread.sleep(...) 而未处理 InterruptedException,可能导致中断被吞掉。建议捕获后恢复中断并及时失败。

-                if (attempts < maxRetries) {
-                    Thread.sleep(getBackoffTime(attempts));
-                }
+                if (attempts < maxRetries) {
+                    try {
+                        Thread.sleep(getBackoffTime(attempts));
+                    } catch (InterruptedException ie) {
+                        Thread.currentThread().interrupt();
+                        throw new RuntimeException("Interrupted during backoff", ie);
+                    }
+                }

142-148: 补充 clearBuffers 实现,避免示例不完整

当前示例中调用了 clearBuffers() 但未给出实现,可能让读者困惑。建议补上简单实现。

     private void flush() {
         // 批量写入实现
         client.batchWrite(keyBuffer, valueBuffer);
         clearBuffers();
     }
+
+    private void clearBuffers() {
+        keyBuffer.clear();
+        valueBuffer.clear();
+    }

224-226: 异步写入建议显式提供自定义线程池以避免默认公共池争用

CompletableFuture.runAsync 默认使用公共 ForkJoinPool,可能与其他异步任务竞争,影响延迟与背压控制。建议为写入定义独立 Executor。

可参考:

// 定义在 Writer 生命周期内复用的线程池
private final ExecutorService writeExecutor =
    Executors.newFixedThreadPool(connectionPoolSize);

// 使用自定义线程池
CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
    client.write(key, value);
}, writeExecutor);

1-3: 在引言中增加与 HugeGraph 设计文档的关联说明(增强可导航性)

当前文档聚焦通用 KV Connector 架构,但 PR 目标包含 HugeGraph 连接器设计。建议在引言处加入相关链接,便于读者从架构总览跳转到具体设计与任务分解。

 # SeaTunnel Connector 架构设计分析
+
+本文为 SeaTunnel Connector 的通用架构说明,并为 HugeGraph Connector 的设计提供背景与约束。相关设计与需求文档:
+ - [.vibedev/specs/hugegraph-connector/design.md](../../.vibedev/specs/hugegraph-connector/design.md)
+ - [.vibedev/specs/hugegraph-connector/requirements.md](../../.vibedev/specs/hugegraph-connector/requirements.md)
+ - [.vibedev/specs/hugegraph-connector/tasks.md](../../.vibedev/specs/hugegraph-connector/tasks.md)

99-118: Key/Value 生成示例建议补充空值与转义处理的提示

示例中直接从字段生成 Key/Value,实战中应考虑 null 值、非法字符与长度约束。建议在示例旁添加注解或示例实现,提示常见防御性处理。

可参考:

String toSafeString(Object v) {
    if (v == null) return "NULL";
    String s = v.toString();
    // 视目标 KV 的 Key 约束进行截断/转义
    return s.length() > MAX_KEY_LEN ? s.substring(0, MAX_KEY_LEN) : s;
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b2bb2f8 and 6f8c683.

📒 Files selected for processing (6)
  • .vibedev/specs/hugegraph-connector/design.md (1 hunks)
  • .vibedev/specs/hugegraph-connector/requirements.md (1 hunks)
  • .vibedev/specs/hugegraph-connector/tasks.md (1 hunks)
  • seatunnel-connectors-v2/CONNECTOR_ARCHITECTURE.md (1 hunks)
  • seatunnel-connectors-v2/connector-hugegraph/pom.xml (1 hunks)
  • seatunnel-connectors-v2/pom.xml (1 hunks)
🧰 Additional context used
🪛 LanguageTool
.vibedev/specs/hugegraph-connector/requirements.md

[uncategorized] ~64-~64: 数词与名词之间一般应存在量词,可能缺少量词。
Context: ...基于时间窗口的批处理,默认窗口为 5 秒 5.3. 系统应在批次大小或时间窗口任一阈值达到时触发批量写入 5.4. 批次大小应可通过连接器参数配置 5.5. 时间窗口...

(wa5)


[uncategorized] ~88-~88: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:边"地"映射
Context: ...geGraph 连接参数(主机、端口、图名、凭证) 7.3. 配置应包含顶点和边的映射规则 7.4. 系统应在启动时验证配置完整性 7.5. 连接器应为常见用例提...

(wb4)

.vibedev/specs/hugegraph-connector/design.md

[uncategorized] ~640-~640: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:新"地"映射
Context: .... 为什么分离映射逻辑 - 提高代码可维护性 - 便于扩展新的映射规则 - 支持复杂的转换场景

(wb4)

🪛 markdownlint-cli2 (0.17.2)
.vibedev/specs/hugegraph-connector/design.md

56-56: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

seatunnel-connectors-v2/CONNECTOR_ARCHITECTURE.md

51-51: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


62-62: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Run / unit-test (8, windows-latest)
  • GitHub Check: Run / unit-test (11, windows-latest)
  • GitHub Check: Run / unit-test (11, ubuntu-latest)
  • GitHub Check: Run / unit-test (8, ubuntu-latest)
🔇 Additional comments (2)
.vibedev/specs/hugegraph-connector/design.md (1)

90-116: factoryIdentifier 命名与插件映射保持一致,并在插件映射中注册

当前返回值为 "HugeGraph"。请确保:

  • plugin-mapping.properties 中的 key 使用一致大小写与命名(通常与 factoryIdentifier 对齐)。
  • 文档中的配置示例 sink 节点名称与实际识别名一致(示例中使用 HugeGraph)。

可后续在提交插件映射与示例配置时一并验证解析是否成功。

seatunnel-connectors-v2/connector-hugegraph/pom.xml (1)

37-55: 排除 log4j 1.x 依赖是正确的,建议同步关注 slf4j 绑定一致性

已排除 slf4j-log4j12log4j,与项目统一日志绑定策略更一致。构建后请检查是否还会引入其他冲突性日志实现(如 slf4j-simple)。

可以在后续集成构建中用 mvn -Dverbose dependency:tree 检查。

Comment on lines +78 to +90
<!-- Auto Service for SPI -->
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<scope>provided</scope>
</dependency>

<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

为 AutoService 与 Lombok 增加注解处理器配置,确保 SPI 与代码生成生效

当前仅声明了 provided 依赖,Maven 需要 annotationProcessorPaths 才会触发处理器。若父 POM未统一配置,请在本模块添加。否则会导致 @AutoService 未生成 META-INF/services,Lombok 也可能不生效。

建议补充如下(若父 POM已有全局配置,可忽略本建议):

 </dependencies>
 
+<build>
+  <plugins>
+    <plugin>
+      <groupId>org.apache.maven.plugins</groupId>
+      <artifactId>maven-compiler-plugin</artifactId>
+      <configuration>
+        <annotationProcessorPaths>
+          <path>
+            <groupId>com.google.auto.service</groupId>
+            <artifactId>auto-service</artifactId>
+            <version>${auto-service.version}</version>
+          </path>
+          <path>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>${lombok.version}</version>
+          </path>
+        </annotationProcessorPaths>
+      </configuration>
+    </plugin>
+  </plugins>
+</build>

如父 POM 未定义 ${auto-service.version}${lombok.version},请在父级或本模块 properties 中统一声明版本。

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<!-- Auto Service for SPI -->
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<scope>provided</scope>
</dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>${auto-service.version}</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
🤖 Prompt for AI Agents
In seatunnel-connectors-v2/connector-hugegraph/pom.xml around lines 78 to 90,
the POM only declares auto-service and lombok as provided dependencies so their
annotation processors will not run; add annotation processor configuration to
the module (e.g., configure the maven-compiler-plugin's annotationProcessorPaths
or add the corresponding annotationProcessor dependencies) so AutoService and
Lombok processors are executed during compile, and ensure
${auto-service.version} and ${lombok.version} are declared in this module or the
parent properties if not already present.

<module>connector-hive</module>
<module>connector-file</module>
<module>connector-hudi</module>
<module>connector-hugegraph</module>
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

新增模块条目合理,但请同步校验注册与分发配置是否齐全

  • 在 modules 中加入 connector-hugegraph 合理。后续需要确认:
    • 是否已在 seatunnel 的插件映射中注册(plugin-mapping.properties)。
    • 是否已在分发包聚合(seatunnel-dist/pom.xml)中包含该模块。

建议在仓库根目录执行以下脚本,自动检查模块存在性、插件映射与分发聚合是否齐全:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) 检查模块目录与 POM 是否存在:"
fd -p 'seatunnel-connectors-v2/connector-hugegraph/pom.xml' || { echo "缺少 connector-hugegraph/pom.xml"; exit 1; }
rg -nC2 -F '<artifactId>connector-hugegraph</artifactId>' seatunnel-connectors-v2/connector-hugegraph/pom.xml || { echo "connector-hugegraph/pom.xml 内 artifactId 未匹配"; exit 1; }

echo
echo "2) 检查插件映射(plugin-mapping.properties)是否包含 HugeGraph:"
if fd -p 'plugin-mapping.properties' | wc -l | grep -q '0'; then
  echo "未找到 plugin-mapping.properties(通常位于 connectors/plugin-mapping 等目录)——如文件路径与本仓库结构不同,请手动确认。"
else
  fd -p 'plugin-mapping.properties' --exec rg -nC1 -P '(?i)hugegraph|HugeGraph' {}
fi

echo
echo "3) 检查分发聚合(seatunnel-dist/pom.xml)是否包含 connector-hugegraph:"
if fd -p 'seatunnel-dist/pom.xml' | wc -l | grep -q '0'; then
  echo "未找到 seatunnel-dist/pom.xml——如果工程未包含 dist 聚合,此项可忽略。"
else
  rg -nC2 -F 'connector-hugegraph' seatunnel-dist/pom.xml || echo "seatunnel-dist/pom.xml 未显式包含 connector-hugegraph(如需进入发行包,请补充)。"
fi

echo
echo "完成。"

Length of output: 687


请执行以下脚本来进一步验证插件映射与分发聚合是否已包含 connector-hugegraph :


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) 查找 plugin-mapping.properties 文件:"
fd --full-path 'plugin-mapping.properties' || echo "⚠️ 未找到 plugin-mapping.properties"

echo
echo "2) 在 plugin-mapping.properties 中查找 HugeGraph 注册项:"
rg -nP --glob '**/plugin-mapping.properties' '(?i)hugegraph|HugeGraph' || echo "⚠️ plugin-mapping.properties 中未找到 HugeGraph 注册"

echo
echo "3) 查找 seatunnel-dist/pom.xml 文件:"
fd --full-path 'seatunnel-dist/pom.xml' || echo "⚠️ 未找到 seatunnel-dist/pom.xml"

echo
echo "4) 在 seatunnel-dist/pom.xml 中检查 connector-hugegraph:"
if fd --full-path 'seatunnel-dist/pom.xml'; then
  DIST_POM=$(fd --full-path 'seatunnel-dist/pom.xml')
  rg -nC2 -F 'connector-hugegraph' "$DIST_POM" \
    || echo "⚠️ seatunnel-dist/pom.xml 中未包含 connector-hugegraph"
else
  echo "ℹ️ 跳过分发包聚合检查"
fi

echo "✅ 校验完成。"

Length of output: 1488


请补充 HugeGraph 连接器的注册与分发配置

验证结果:

  • plugin-mapping.properties 中未发现任何 HugeGraph 注册
  • seatunnel-dist/pom.xml 未包含 connector-hugegraph 模块

请在提交前完成以下两处改动:

  • 在仓库中正确的 plugin-mapping.properties(如 connectors/plugin-mapping/plugin-mapping.properties 或根目录下)添加 HugeGraph 注册项,例如:

    # HugeGraph Connector
    hugegraph=connector-hugegraph
    
  • seatunnel-dist/pom.xml<modules> 列表中加入:

    <module>connector-hugegraph</module>
    

完成后再行打包与分发,确保新模块可以被识别与加载。

🤖 Prompt for AI Agents
In seatunnel-connectors-v2/pom.xml around line 47 add registration and
distribution updates: add a mapping entry in the repository's
plugin-mapping.properties (e.g.
connectors/plugin-mapping/plugin-mapping.properties or root
plugin-mapping.properties) with the line hugegraph=connector-hugegraph to
register the connector, and add the connector-hugegraph module to the
seatunnel-dist module list by inserting a module entry for connector-hugegraph
into seatunnel-dist/pom.xml <modules> section so the module is included in
packaging and distribution.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6f8c683 and f7681ec.

📒 Files selected for processing (2)
  • .vibedev/specs/hugegraph-connector/design.md (1 hunks)
  • .vibedev/specs/hugegraph-connector/tasks.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .vibedev/specs/hugegraph-connector/tasks.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
.vibedev/specs/hugegraph-connector/design.md

56-56: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Run / changes
  • GitHub Check: Run / Code style

Comment on lines +56 to +83
```
seatunnel-connectors-v2/
└── connector-hugegraph/
├── src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/
│ ├── sink/
│ │ ├── HugeGraphSinkFactory.java # 工厂类
│ │ ├── HugeGraphSink.java # Sink 主类
│ │ └── HugeGraphSinkWriter.java # Writer 实现
│ ├── config/
│ │ ├── HugeGraphSinkConfig.java # 配置管理
│ │ ├── HugeGraphOptions.java # 配置选项定义
│ │ └── MappingConfig.java # 映射配置
│ ├── client/
│ │ ├── HugeGraphClientManager.java # 客户端管理
│ │ └── HugeGraphWriteClient.java # 写入客户端封装
│ ├── mapper/
│ │ ├── GraphDataMapper.java # 数据映射接口
│ │ ├── VertexMapper.java # 顶点映射
│ │ └── EdgeMapper.java # 边映射
│ ├── state/
│ │ ├── HugeGraphCommitInfo.java # 提交信息
│ │ └── HugeGraphSinkState.java # 状态管理
│ ├── Validator/
│ │ └── HugeGraphValidator.java # 提交信息
│ └── exception/
│ └── HugeGraphConnectorException.java
└── src/test/java/... # 测试代码
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

修复缺失的代码块语言标注

此处使用了围栏代码块但未指定语言,触发了 markdownlint MD040,会导致文档校验失败。请为代码块添加合适的语言标识(如 text),以确保 CI 通过。

建议修改如下:

-```
+```text
 seatunnel-connectors-v2/
 └── connector-hugegraph/
     ├── src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

56-56: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
.vibedev/specs/hugegraph-connector/design.md around lines 56-83: the fenced code
block lacks a language tag which triggers markdownlint MD040; update the opening
fence from ``` to ```text (or another appropriate language identifier) so the
code block is explicitly annotated and then save the file so CI/lint will pass.

@imbajin imbajin merged commit 2c6e0e9 into dev Oct 23, 2025
5 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Oct 23, 2025
imbajin added a commit that referenced this pull request Oct 23, 2025
* docs: init SeaTunnel-HG design doc V1 🚧 (#4)

* docs: init hugegraph design doc V1 🚧

* update development docs

---------

Co-authored-by: Frui Guo <[email protected]>

* update docs

---------

Co-authored-by: imbajin <[email protected]>
@coderabbitai coderabbitai bot mentioned this pull request Nov 8, 2025
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.

3 participants