{
  "repo": "tidbcloud/dataservices",
  "binary": "dataapi_executor",
  "binary_path": "cmd/dataapi_executor/main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "extensions": {
    "notes": [
      "AliCloud regional mode switches this binary from Redis+DynamoDB to local session cache plus static-route user metadata.",
      "This binary exposes only gRPC business methods plus a separate metrics listener."
    ]
  },
  "services": [
    {
      "name": "DataAPIExecutorLifecycle",
      "package": "cmd/dataapi_executor",
      "methods": [
        {
          "name": "LoadConfigAndLogger",
          "name_key": "DataAPIExecutorLifecycle.LoadConfigAndLogger",
          "input": "config-path and sentry config",
          "output": "global config initialized and logger/sentry configured",
          "type": "local"
        },
        {
          "name": "ValidateRegionalConfig",
          "name_key": "DataAPIExecutorLifecycle.ValidateRegionalConfig",
          "input": "global config",
          "output": "AliCloud regional configuration validated",
          "type": "local"
        },
        {
          "name": "InitCachesAndBackends",
          "name_key": "DataAPIExecutorLifecycle.InitCachesAndBackends",
          "input": "session cache size, regional mode, Redis config, DynamoDB config, and DBHub SDK config",
          "output": "session cache plus regional DBHub SDK and backend stores initialized",
          "type": "local"
        },
        {
          "name": "InitHubPoolAndMeasureReport",
          "name_key": "DataAPIExecutorLifecycle.InitHubPoolAndMeasureReport",
          "input": "global config and current environment",
          "output": "DB hub pool and measure report initialized",
          "type": "local"
        },
        {
          "name": "StartTracing",
          "name_key": "DataAPIExecutorLifecycle.StartTracing",
          "input": "component name dataservices-dataapi-executor",
          "output": "Jaeger tracer provider initialized",
          "type": "local"
        },
        {
          "name": "StartMetricsServer",
          "name_key": "DataAPIExecutorLifecycle.StartMetricsServer",
          "input": "metrics port from config",
          "output": "HTTP metrics listener exposing /metrics",
          "type": "background_worker"
        },
        {
          "name": "StartGrpcServer",
          "name_key": "DataAPIExecutorLifecycle.StartGrpcServer",
          "input": "gRPC port from config",
          "output": "DataAPIExecutorService gRPC server running with keepalive, metrics, and error interceptors",
          "type": "local"
        }
      ]
    },
    {
      "name": "DataAPIExecutorHTTP",
      "package": "cmd/dataapi_executor",
      "type": "http",
      "methods": [
        {
          "name": "GET /metrics",
          "name_key": "HTTP GET /metrics",
          "path": "/metrics",
          "http_method": "GET",
          "input": "none",
          "output": "Prometheus metrics",
          "type": "http"
        }
      ]
    },
    {
      "name": "DataAPIExecutorService",
      "package": "internal/controller/dataapi_executor",
      "type": "grpc",
      "methods": [
        {"name": "CreateSession", "name_key": "DataAPIExecutorService.CreateSession", "input": "CreateSessionReq", "output": "CreateSessionResp", "type": "grpc"},
        {"name": "CloseSession", "name_key": "DataAPIExecutorService.CloseSession", "input": "CloseSessionReq", "output": "CloseSessionResp", "type": "grpc"},
        {"name": "ExecSql", "name_key": "DataAPIExecutorService.ExecSql", "input": "BasicEndpointReqV2", "output": "ExecSqlRespV2", "type": "grpc"},
        {"name": "GetDatabaseMeta", "name_key": "DataAPIExecutorService.GetDatabaseMeta", "input": "GetDatabaseMetaReq", "output": "GetDatabaseMetaResp", "type": "grpc"},
        {"name": "ParseOneStmt", "name_key": "DataAPIExecutorService.ParseOneStmt", "input": "ParseOneStmtReq", "output": "ParseOneStmtResp", "type": "grpc"}
      ]
    }
  ]
}
