apache / apache/gravitino

[FEATURE] Introduce Optimizer Service for table maintenance workflows

Open
#11,851 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2.0.0 feature
Dominant language
Java
Stars
3.2k
Forks
939
Avg merge
1d 16h
Merged PRs (30d)
342

Description

Describe the feature

Introduce a long-running Optimizer Service for Apache Gravitino Table Maintenance Service workflows.

The service should provide REST APIs for optimizer operations that are currently executed through local CLI commands, including:

  • update-statistics
  • append-metrics
  • submit-strategy-jobs
  • monitor-metrics
  • list-table-metrics
  • list-job-metrics

The service should support asynchronous task execution, request IDs, task status query, cancellation, and structured results.

Motivation

The current optimizer workflow is mainly local CLI driven. This makes it difficult to support centralized task tracking, retries, concurrency control, audit logging, service-level metrics, and structured automation APIs.

A long-running Optimizer Service would let users submit table maintenance work, disconnect from the CLI process, and later query task status and results through stable REST APIs.

Describe the solution

Add an independent Optimizer Service in the optimizer distribution.

High-level scope:

  • Add OptimizerServiceServer as a standalone optimizer service entry point.
  • Add a shared task runtime for async execution and task state management.
  • Add REST APIs for updater, recommender, monitor, and metrics-query operations.
  • Keep existing CLI commands and add service mode so the CLI can call the service when configured.
  • Preserve local CLI execution as the default for backward compatibility.
  • Keep submit-update-stats-job integrated with the existing Gravitino job framework.

A detailed design document is proposed in design-docs/optimizer-service-design.md.

Additional context

This is intended as an incremental evolution of the alpha Table Maintenance Service (Optimizer). The initial implementation can use an in-memory task store, with persistent task storage and stronger multi-node support added later.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with design-docs/optimizer-service-design.md and inspect the existing optimizer distribution and local CLI commands for update-statistics, append-metrics, submit-strategy-jobs, monitor-metrics, list-table-metrics, and list-job-metrics. Done means a standalone OptimizerServiceServer exposes these operations through REST with asynchronous task tracking, request IDs, status queries, cancellation, and structured results while preserving local CLI behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.