{
  "repo": "tikv/migration",
  "binary": "cdc",
  "binary_path": "cdc/cmd/cdc/main.go",
  "dependencies": {
    "Runtime CDC.server": {
      "infrastructure": {
        "http": {
          "conditions": [
            "Always after the server subcommand reaches startStatusHTTP"
          ],
          "operations": [
            {
              "operation": "SERVE STATUS AND METRICS",
              "trigger": "Expose status, admin, and /metrics endpoints on the HTTP listener",
              "conditions": [
                "The CDC server has started successfully"
              ],
              "implementation": "startStatusHTTP in cdc/cdc/http_status.go"
            }
          ]
        },
        "grpc": {
          "conditions": [
            "Always after tcpserver.NewTCPServer succeeds"
          ],
          "operations": [
            {
              "operation": "SERVE CDC GRPC FRONTEND",
              "trigger": "Expose the unified CDC gRPC and REST frontend over tcpserver",
              "conditions": [
                "The server process reaches cdc.NewServer and Run"
              ],
              "implementation": "cdc.NewServer / Server.Run in cdc/cdc/server.go"
            }
          ]
        },
        "etcd": {
          "conditions": [
            "Always while the capture server is running"
          ],
          "operations": [
            {
              "operation": "STORE CDC METADATA",
              "trigger": "Create the CDC etcd client and coordinate capture state",
              "conditions": [
                "PD endpoints and TLS config validate"
              ],
              "implementation": "createEtcdClient in cdc/cdc/server.go"
            }
          ]
        }
      },
      "services": [
        {
          "name": "pd",
          "protocol": "grpc",
          "target_interface": "PD client",
          "purpose": "Fetch timestamps and cluster metadata for capture coordination"
        },
        {
          "name": "tikv",
          "protocol": "grpc",
          "target_interface": "TiKV KV store client",
          "purpose": "Read change data and interact with the TiKV storage layer"
        }
      ]
    }
  }
}
