Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature](compaction) Add an http action for visibility of compaction score on each tablet (#38489) #40826

Merged
merged 10 commits into from
Sep 21, 2024

Conversation

TangSiyang2001
Copy link
Collaborator

pick: #38489

Usage:

  1. curl http://be_ip:be_host/api/compaction_score?top_n=10 Returns a json object contains compaction score for top n, n=top_n.
[
    {
        "compaction_score": "5",
        "tablet_id": "42595"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42587"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42593"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42597"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42589"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42599"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42601"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42591"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42585"
    },
    {
        "compaction_score": "4",
        "tablet_id": "10034"
    }
]

If top_n is not specified, return all compaction score for all tablets. If top_n is illegal, raise an error.

invalid argument: top_n=wrong
  1. curl http://be_ip:be_host/api/compaction_score?sync_meta=true sync_meta is only available on cloud mode, will sync meta from meta service. It can cooperate with top_n.
    If add param sync_meta on non-cloud mode, will raise an error.
sync meta is only available for cloud mode
  1. In the future, this endpoint may extend other utility, like fetching tablet compaction score by table id, etc.

Proposed changes

Issue Number: close #xxx

… score on each tablet (apache#38489)

As title.

Usage:
1. `curl http://be_ip:be_host/api/compaction_score?top_n=10`
Returns a json object contains compaction score for top n, n=top_n.
```
[
    {
        "compaction_score": "5",
        "tablet_id": "42595"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42587"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42593"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42597"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42589"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42599"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42601"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42591"
    },
    {
        "compaction_score": "5",
        "tablet_id": "42585"
    },
    {
        "compaction_score": "4",
        "tablet_id": "10034"
    }
]
```
If top_n is not specified, return all compaction score for all tablets.
If top_n is illegal, raise an error.
```
invalid argument: top_n=wrong
```

2. `curl http://be_ip:be_host/api/compaction_score?sync_meta=true`
`sync_meta` is only available on cloud mode, will sync meta from meta
service. It can cooperate with top_n.
If add param `sync_meta` on non-cloud mode, will raise an error.
```
sync meta is only available for cloud mode
```

3. In the future, this endpoint may extend other utility, like fetching
tablet compaction score by table id, etc.
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@TangSiyang2001
Copy link
Collaborator Author

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions


#pragma once

#include <gen_cpp/FrontendService_types.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'gen_cpp/FrontendService_types.h' file not found [clang-diagnostic-error]

#include <gen_cpp/FrontendService_types.h>
         ^

@TangSiyang2001
Copy link
Collaborator Author

run buildall

@TangSiyang2001
Copy link
Collaborator Author

run buildall

@TangSiyang2001
Copy link
Collaborator Author

run buildall

@TangSiyang2001
Copy link
Collaborator Author

run buildall

@TangSiyang2001
Copy link
Collaborator Author

run buildall

@TangSiyang2001
Copy link
Collaborator Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.15% (9329/25803)
Line Coverage: 27.72% (76647/276480)
Region Coverage: 26.50% (39362/148511)
Branch Coverage: 23.30% (20045/86018)
Coverage Report: http://coverage.selectdb-in.cc/coverage/660c599d7fcdd03f2b9cc50049dafcc03aa5c533_660c599d7fcdd03f2b9cc50049dafcc03aa5c533/report/index.html

@TangSiyang2001
Copy link
Collaborator Author

run p0

@yiguolei yiguolei merged commit d1d52ae into apache:branch-2.1 Sep 21, 2024
19 of 21 checks passed
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.

3 participants