Skip to content

Unified --Json output#6419

Open
ArbaazKhan1 wants to merge 8 commits into
apache:mainfrom
ArbaazKhan1:accumulo-6391
Open

Unified --Json output#6419
ArbaazKhan1 wants to merge 8 commits into
apache:mainfrom
ArbaazKhan1:accumulo-6391

Conversation

@ArbaazKhan1

@ArbaazKhan1 ArbaazKhan1 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

addresses issue #6391

To make a universal --json flag I moved it from Fate and ServiceStatus and into ServerOpts so all commands inherit it. Added a new CommandOutputEnvelope class that will take accumulo JSON outputs and wraps them in an envelope for a unified output and a new CommandReport interface that report classes will inherit so they can produce both human-readable and computer readable lines. Started by wiring up fate --summary and service-status as the two proof-of-concept commands since both already have partial JSON support

@ArbaazKhan1

ArbaazKhan1 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

What the Json output would look like for `accumulo inst service-status --json

{
  "command": "accumulo admin service-status",
  "version": "1.0",
  "reportTime": "2026-06-09T20:20:01Z",
  "status": "OK",
  "data": {
    "reportTime": "2026-06-09T20:20:01.889Z",
    "zkReadErrors": 0,
    "showHosts": false,
    "summaries": {
      "COMPACTOR": {
        "resourceGroups": {
          "default": 1
        },
        "serviceByGroups": {
          "default": [
            "localhost:9600"
          ]
        },
        "serviceCount": 1,
        "errorCount": 0
      },
      "GC": {
        "resourceGroups": {
          "default": 1
        },
        "serviceByGroups": {
          "default": [
            "localhost:9998"
          ]
        },
        "serviceCount": 1,
        "errorCount": 0
      },
      "MANAGER": {
        "resourceGroups": {
          "default": 1
        },
        "serviceByGroups": {
          "default": [
            "localhost:9999"
          ]
        },
        "serviceCount": 1,
        "errorCount": 0
      },
      "MONITOR": {
        "resourceGroups": {
          "default": 1
        },
        "serviceByGroups": {
          "default": [
            "localhost:9995"
          ]
        },
        "serviceCount": 1,
        "errorCount": 0
      },
      "S_SERVER": {
        "resourceGroups": {
          "default": 1
        },
        "serviceByGroups": {
          "default": [
            "localhost:9700"
          ]
        },
        "serviceCount": 1,
        "errorCount": 0
      },
      "T_SERVER": {
        "resourceGroups": {
          "default": 1
        },
        "serviceByGroups": {
          "default": [
            "localhost:9800"
          ]
        },
        "serviceCount": 1,
        "errorCount": 0
      }
    }
  }
}

@ArbaazKhan1 ArbaazKhan1 marked this pull request as ready for review June 11, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant