和顺 / 衡律 返回所属 Agent
23.6

时间、事件与唯一写者

原能力

统一时间、事件投递、处理水位和唯一写者,阻止过时代次继续写入或发送。(合同附件 R7 23.6)

首选项目

Debezium(Apache-2.0(仓库,连接器依赖另核))。 Debezium

匹配范围

消息事件顺序与持久工作流历史可保存时点。

源码

Debezium · interface OffsetContext

debezium-connector-common/src/main/java/io/debezium/pipeline/spi/OffsetContext.java · 33–46 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
public interface OffsetContext {

    /**
     * Implementations load a connector-specific offset context based on the offset values stored in Kafka.
     */
    interface Loader<O extends OffsetContext> {

        default Optional<SnapshotType> loadSnapshot(Map<String, ?> offset) {

            Object snapshot = offset.getOrDefault(AbstractSourceInfo.SNAPSHOT_KEY, null);
            // this is to manage transition from a boolean snapshot to SnapshotType
            if (Boolean.TRUE.equals(snapshot) || Boolean.TRUE.toString().equals(snapshot)) {
                return Optional.of(SnapshotType.INITIAL);
            }
  • * Copyright Debezium Authors.

Temporal Python SDK · def get_workflow_handle(

temporalio/client/_client.py · 868–881 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
    def get_workflow_handle(
        self,
        workflow_id: str,
        *,
        run_id: str | None = None,
        first_execution_run_id: str | None = None,
        result_type: type | None = None,
    ) -> WorkflowHandle[Any, Any]:
        """Get a workflow handle to an existing workflow by its ID.

        Args:
            workflow_id: Workflow ID to get a handle to.
            run_id: Run ID that will be used for all calls.
            first_execution_run_id: First execution run ID used for cancellation

实现与验收要点

两类时间、唯一写者、旧写者隔离和失败恢复证明。