Skip to content

Commit 87173b9

Browse files
Fix API references
1 parent 4831a10 commit 87173b9

File tree

3 files changed

+66
-42
lines changed

3 files changed

+66
-42
lines changed

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/db.json

Lines changed: 49 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6892,36 +6892,62 @@
68926892
},
68936893
"OM": {
68946894
"pendingKeyBytes": 1254500,
6895-
"pendingBytes": 4464500,
6895+
"totalBytes": 4464500,
68966896
"pendingDirectoryBytes": 3210000
68976897
}
68986898
}
68996899
}
69006900
},
69016901
"dataNodeUsage": [
69026902
{
6903-
"uuid": "1477a674-b86c-43b9-ae84-1586c5720125",
6904-
"capacity": 1080992018248,
6905-
"used": 4398612,
6906-
"remaining": 1019728228844,
6907-
"committed": 1073725932,
6908-
"pendingDeletion": 1013125932
6909-
},
6910-
{
6911-
"uuid": "c040c145-b44f-42a8-a3a3-b18171c8c01c",
6912-
"capacity": 1080992018248,
6913-
"used": 4382720,
6914-
"remaining": 1019728248832,
6915-
"committed": 0,
6916-
"pendingDeletion": 11025932
6917-
},
6918-
{
6919-
"uuid": "1d076fc9-ece2-43e7-9fca-bb1e8646a56d",
6920-
"capacity": 1080992018248,
6921-
"used": 4382720,
6922-
"remaining": 1019728248832,
6923-
"committed": 1023725932,
6924-
"pendingDeletion": 21125932
6903+
"datanodeUuid": "ec4d37e4-04d7-4d1b-b0bb-aafa05d86b3c",
6904+
"hostName": "ozone-datanode-2.ozone_default",
6905+
"capacity": 125645656770,
6906+
"used": 4382720,
6907+
"remaining": 104675287040,
6908+
"committed": 0,
6909+
"pendingDeletion": 0,
6910+
"minimumFreeSpace": 125645664
6911+
},
6912+
{
6913+
"datanodeUuid": "ed34b38a-88b0-4dde-8ef6-6d158339064e",
6914+
"hostName": "ozone-datanode-4.ozone_default",
6915+
"capacity": 125645656770,
6916+
"used": 4382720,
6917+
"remaining": 104675291136,
6918+
"committed": 0,
6919+
"pendingDeletion": 0,
6920+
"minimumFreeSpace": 125645664
6921+
},
6922+
{
6923+
"datanodeUuid": "49d5a41b-ffb4-426f-bd46-93d9263296ef",
6924+
"hostName": "ozone-datanode-5.ozone_default",
6925+
"capacity": 125645656770,
6926+
"used": 4382720,
6927+
"remaining": 104675291136,
6928+
"committed": 0,
6929+
"pendingDeletion": 0,
6930+
"minimumFreeSpace": 125645664
6931+
},
6932+
{
6933+
"datanodeUuid": "08b69287-6fd0-42e0-b944-f5d527607ac9",
6934+
"hostName": "ozone-datanode-1.ozone_default",
6935+
"capacity": 125645656770,
6936+
"used": 4382720,
6937+
"remaining": 104675282944,
6938+
"committed": 0,
6939+
"pendingDeletion": 0,
6940+
"minimumFreeSpace": 125645664
6941+
},
6942+
{
6943+
"datanodeUuid": "3be0d2dc-b068-46c9-a6df-ff086e94fec5",
6944+
"hostName": "ozone-datanode-3.ozone_default",
6945+
"capacity": 125645656770,
6946+
"used": 4382720,
6947+
"remaining": 104675282944,
6948+
"committed": 0,
6949+
"pendingDeletion": 0,
6950+
"minimumFreeSpace": 125645664
69256951
}
69266952
]
69276953
}

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/capacity/capacity.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const Capacity: React.FC<object> = () => {
101101
// setGlobalNamespace(utilizationResponse.globalNamespace);
102102
setUsageBreakdown(utilizationResponse.usedSpaceBreakdown);
103103
setDatanodeUsage(utilizationResponse.dataNodeUsage);
104-
setSelectedDatanode(utilizationResponse.dataNodeUsage[0].uuid);
104+
setSelectedDatanode(utilizationResponse.dataNodeUsage[0].hostName);
105105
setState({
106106
loading: false,
107107
lastUpdated: Number(moment())
@@ -128,8 +128,9 @@ const Capacity: React.FC<object> = () => {
128128
}, []);
129129

130130
const selectedDNDetails: DataNodeUsage = React.useMemo(() => {
131-
return datanodeUsage.find(datanode => datanode.uuid === selectedDatanode) ?? {
132-
uuid: "xxxx-xxxx-xxxx-xxxx",
131+
return datanodeUsage.find(datanode => datanode.hostName === selectedDatanode) ?? {
132+
datanodeUuid: "unknown-uuid",
133+
hostName: "unknown-host",
133134
capacity: 0,
134135
used: 0,
135136
remaining: 0,
@@ -237,7 +238,7 @@ const Capacity: React.FC<object> = () => {
237238
showDropdown={false}
238239
dataDetails={[{
239240
title: 'OZONE MANAGER',
240-
size: usageBreakdown.deletionPendingBytes.byStage.OM.pendingBytes,
241+
size: usageBreakdown.deletionPendingBytes.byStage.OM.totalBytes ?? 0,
241242
breakdown: [{
242243
label: 'KEYS',
243244
value: usageBreakdown.deletionPendingBytes.byStage.OM.pendingKeyBytes,
@@ -274,29 +275,29 @@ const Capacity: React.FC<object> = () => {
274275
loading={state.loading}
275276
showDropdown={true}
276277
handleSelect={setSelectedDatanode}
277-
dropdownItems={datanodeUsage.map(datanode => datanode.uuid)}
278+
dropdownItems={datanodeUsage.map(datanode => datanode.hostName)}
278279
dataDetails={[{
279280
title: 'USED SPACE',
280-
size: selectedDNDetails.used + selectedDNDetails.pendingDeletion,
281+
size: (selectedDNDetails.used ?? 0) + (selectedDNDetails.pendingDeletion ?? 0),
281282
breakdown: [{
282283
label: 'PENDING DELETION',
283-
value: selectedDNDetails.pendingDeletion,
284+
value: selectedDNDetails.pendingDeletion ?? 0,
284285
color: '#f4a233'
285286
}, {
286287
label: 'OZONE USED',
287-
value: selectedDNDetails.used,
288+
value: selectedDNDetails.used ?? 0,
288289
color: '#10073b'
289290
}]
290291
}, {
291292
title: 'FREE SPACE',
292-
size: selectedDNDetails.remaining + selectedDNDetails.committed,
293+
size: (selectedDNDetails.remaining ?? 0) + (selectedDNDetails.committed ?? 0),
293294
breakdown: [{
294295
label: unusedSpaceBreakdown,
295-
value: selectedDNDetails.remaining,
296+
value: selectedDNDetails.remaining ?? 0,
296297
color: '#f4a233'
297298
}, {
298299
label: 'OZONE PRE-ALLOCATED',
299-
value: selectedDNDetails.committed,
300+
value: selectedDNDetails.committed ?? 0,
300301
color: '#10073b'
301302
}]
302303
}]} />

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/capacity/components/CapacityDetail.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import { EChart } from '@/components/eChart/eChart';
2020
import { GraphLegendIcon } from '@/utils/themeIcons';
21-
import { cardBodyStyle, cardHeadStyle, statisticValueStyle } from '@/v2/pages/capacity/constants/styles.constants';
21+
import { cardHeadStyle, statisticValueStyle } from '@/v2/pages/capacity/constants/styles.constants';
2222
import { Card, Divider, Row, Select, Statistic } from 'antd';
2323
import filesize from 'filesize';
2424
import React from 'react';
@@ -47,9 +47,8 @@ const getEchartOptions = (title: string | React.ReactNode, data: DataDetailItem)
4747
bottom: 0
4848
},
4949
xAxis: {
50-
// We are using a log scale to make the chart more readable in case there are some value
51-
// which are too small or too large to be displayed in the chart
52-
type: 'log',
50+
// Use linear scale to support zero values safely
51+
type: 'value',
5352
axisLine: { show: false },
5453
axisTick: { show: false },
5554
axisLabel: { show: false }
@@ -77,12 +76,10 @@ const getEchartOptions = (title: string | React.ReactNode, data: DataDetailItem)
7776
barGap: '2px'
7877
}));
7978

80-
console.log(series);
81-
8279
return {
8380
...option,
8481
series
85-
}
82+
} as any
8683
}
8784

8885

@@ -99,7 +96,7 @@ const CapacityDetail: React.FC<CapacityDetailProps> = (
9996
<Card title={title} size='small' headStyle={cardHeadStyle} loading={loading}>
10097
{ showDropdown && options.length > 0 &&
10198
<div className='node-select-container'>
102-
Node Select:
99+
<strong>Node Selector:</strong>
103100
<Select
104101
defaultValue={options?.[0]?.value}
105102
options={options}

0 commit comments

Comments
 (0)