feature(hudi-query): 增加时间线压缩计划读取

This commit is contained in:
2023-07-05 19:07:48 +08:00
parent 7c2d6e5336
commit 317cb5d56f
7 changed files with 213 additions and 111 deletions

View File

@@ -8,6 +8,16 @@ function crudCommonOptions() {
}
}
function readOnlyDialogOptions() {
return {
actions: [],
showCloseButton: false,
closeOnEsc: true,
closeOnOutside: true,
disabled: true,
}
}
function paginationCommonOptions(perPage = true, maxButtons = 5) {
let option = {
type: 'pagination',
@@ -774,6 +784,134 @@ function timelineColumns() {
{
name: 'fileName',
label: '文件名',
type: 'wrapper',
size: 'none',
body: [
{
type: 'tpl',
tpl: '${fileName}'
},
{
visibleOn: "action === 'compaction'",
type: 'action',
icon: 'fa fa-eye',
level: 'link',
tooltip: '查看压缩计划',
size: 'sm',
actionType: 'dialog',
dialog: {
title: '压缩计划详情',
actions: [],
size: 'lg',
body: {
type: 'crud',
api: {
method: 'get',
url: '${base}/hudi/read_compaction_plan',
data: {
hdfs: '${hdfs|default:undefined}',
flink_job_id: '${flinkJobId|default:undefined}',
alias: '${tableMeta.alias|default:undefined}',
instant: '${timestamp|default:undefined}',
},
adaptor: (payload, response) => {
return {
items: (payload['data']['detail']['operations'] ? payload['data']['detail']['operations'] : [])
.map(operation => {
if (operation['deltaFilePaths']) {
operation.deltaFilePaths = operation.deltaFilePaths
.map(p => {
return {
path: p
}
})
}
return operation
})
}
}
},
...crudCommonOptions(),
loadDataOnce: true,
columns: [
{
name: 'fileId',
label: '文件 ID',
searchable: true,
},
{
name: 'baseInstantTime',
label: '版本时间点',
width: 120,
align: 'center',
},
{
name: 'partitionPath',
label: '分区',
width: 50,
align: 'center',
},
{
label: '读/写(MB)/数',
type: 'tpl',
tpl: '${metrics[\'TOTAL_IO_READ_MB\']} / ${metrics[\'TOTAL_IO_WRITE_MB\']} / ${metrics[\'TOTAL_LOG_FILES\']}',
align: 'center',
width: 90,
},
{
type: 'operation',
label: '操作',
width: 150,
buttons: [
{
label: '数据文件名',
type: 'action',
level: 'link',
actionType: 'copy',
content: '${dataFilePath}',
tooltip: '复制 ${dataFilePath}',
},
{
label: '日志文件',
type: 'action',
level: 'link',
actionType: 'dialog',
dialog: {
title: '操作日志文件列表',
size: 'md',
...readOnlyDialogOptions(),
body: {
type: 'crud',
source: '${deltaFilePaths}',
mode: 'list',
...crudCommonOptions(),
loadDataOnce: true,
title: null,
listItem: {
title: '${path}'
}
}
}
}
]
}
]
}
}
},
/*{
type: 'tpl',
tpl: '${hdfs}'
},
{
type: 'tpl',
tpl: '${flinkJobId}'
},
{
type: 'tpl',
tpl: '${tableMeta.alias}'
},*/
]
},
{
name: 'type',