[Feature] Support for querying the trash used capacity#6247
[Feature] Support for querying the trash used capacity#6247morningman merged 12 commits intoapache:masterfrom
Conversation
…djust query define at 'sql_parser' && remove duplicates input backend
| keywordMap.put("array", new Integer(SqlParserSymbols.KW_ARRAY)); | ||
| keywordMap.put("backend", new Integer(SqlParserSymbols.KW_BACKEND)); | ||
| keywordMap.put("backends", new Integer(SqlParserSymbols.KW_BACKENDS)); | ||
| keywordMap.put("trash", new Integer(SqlParserSymbols.KW_TRASH)); |
| trashUsedCapacityB, System.currentTimeMillis() - start); | ||
| ok = true; | ||
| } catch (Exception e) { | ||
| LOG.warn("task exec error. backend[{}]", backend.getId(), e); |
There was a problem hiding this comment.
Just a log without further processing?
There was a problem hiding this comment.
Just a log without further processing?
now will display null when program throw error
|
|
||
| public ShowTrashStmt(List<String> backends) { | ||
| ImmutableMap<Long, Backend> backendsInfo = Catalog.getCurrentSystemInfo().getIdToBackend(); | ||
| Map<String, Long> backendsID = new HashMap<String, Long>(); |
There was a problem hiding this comment.
Why not use backend id directly?
There was a problem hiding this comment.
Do you mean to directly use 'backend id' query instead of 'backend host':'backend heart beat port'?
|
|
||
| public class ShowTrashStmt extends ShowStmt { | ||
| public static final ImmutableList<String> TITLE_NAMES = new ImmutableList.Builder<String>().add("BackendId") | ||
| .add("Backend").add("TrashUsedCapacity").build(); |
There was a problem hiding this comment.
Would it be better to add the trash information to show proc as well?
There was a problem hiding this comment.
Would it be better to add the trash information to show proc as well?
now support 'show proc '/trash''
| {: | ||
| RESULT = new ShowBackendsStmt(); | ||
| :} | ||
| | KW_TRASH KW_ON LPAREN string_list:backends RPAREN |
There was a problem hiding this comment.
Please add document of show trash stmt
There was a problem hiding this comment.
Please add document of show trash stmt
done.
2. display null when connect fail to client 3. trash information to show proc, and support show proc '/trash' 4. add document of show trash stmt
Co-authored-by: Zhengguo Yang <780531911@qq.com>
Co-authored-by: Zhengguo Yang <780531911@qq.com>
| Pair<Double, String> trashUsedCapacity = DebugUtil.getByteUint(trashUsedCapacityB); | ||
| backendInfo.add(DebugUtil.DECIMAL_FORMAT_SCALE_3.format(trashUsedCapacity.first) + " " + trashUsedCapacity.second); | ||
| } else { | ||
| backendInfo.add("null"); |
2. Support for querying the specific disk information of a single backend. 3. Updated related interfaces and documents.
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
morningman
left a comment
There was a problem hiding this comment.
ShowTrashDiskStmt and ShowTrashStmt can be unified
| if (ConnectContext.get().getSessionVariable().getForwardToMaster()) { | ||
| return RedirectStatus.FORWARD_NO_SYNC; | ||
| } else { | ||
| return RedirectStatus.NO_FORWARD; |
| if (ConnectContext.get().getSessionVariable().getForwardToMaster()) { | ||
| return RedirectStatus.FORWARD_NO_SYNC; | ||
| } else { | ||
| return RedirectStatus.NO_FORWARD; |
There was a problem hiding this comment.
No need to forward
I fix it at c3f7c7e
|
PR approved by at least one committer and no changes requested. |
Proposed changes
Support for querying the trash used capacity.
Now user can proactively scan trash directory.
Types of changes
What types of changes does your code introduce to Doris?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.