Skip to content

Commit 38e19ec

Browse files
authored
HDDS-14544. OM DB Insights: Duplicate API calls triggered when changing limit selector (#10677).
1 parent cb9430d commit 38e19ec

5 files changed

Lines changed: 1 addition & 25 deletions

File tree

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/tables/insights/containerMismatchTable.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ const ContainerMismatchTable: React.FC<ContainerMismatchTableProps> = ({
8080
DEFAULT_MISMATCH_RESPONSE,
8181
{
8282
retryAttempts: 2,
83-
initialFetch: false,
8483
onError: (error) => showDataFetchError(error)
8584
}
8685
);
@@ -92,11 +91,6 @@ const ContainerMismatchTable: React.FC<ContainerMismatchTableProps> = ({
9291
}
9392
}, [mismatchData.data]);
9493

95-
// Refetch when limit or missingIn changes
96-
useEffect(() => {
97-
mismatchData.refetch();
98-
}, [limit.value, missingIn]);
99-
10094
const handleExistAtChange: FilterMenuProps['onClick'] = ({ key }) => {
10195
if (key === 'OM') {
10296
setMissingIn('SCM');

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/tables/insights/deletePendingDirsTable.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ const DeletePendingDirTable: React.FC<DeletePendingDirTableProps> = ({
8787
DEFAULT_DELETE_PENDING_DIRS_RESPONSE,
8888
{
8989
retryAttempts: 2,
90-
initialFetch: false,
9190
onError: (error) => showDataFetchError(error)
9291
}
9392
);
@@ -99,11 +98,6 @@ const DeletePendingDirTable: React.FC<DeletePendingDirTableProps> = ({
9998
}
10099
}, [deletePendingDirsData.data]);
101100

102-
// Refetch when limit changes
103-
useEffect(() => {
104-
deletePendingDirsData.refetch();
105-
}, [limit.value]);
106-
107101
function filterData(data: DeletedDirInfo[] | undefined) {
108102
return data?.filter(
109103
(data: DeletedDirInfo) => data.key.includes(debouncedSearch)

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/tables/insights/deletePendingKeysTable.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ const DeletePendingKeysTable: React.FC<DeletePendingKeysTableProps> = ({
101101
DEFAULT_DELETE_PENDING_KEYS_RESPONSE,
102102
{
103103
retryAttempts: 2,
104-
initialFetch: false,
105104
onError: (error) => showDataFetchError(error)
106105
}
107106
);
@@ -136,11 +135,6 @@ const DeletePendingKeysTable: React.FC<DeletePendingKeysTableProps> = ({
136135
}
137136
}, [deletePendingKeysData.data]);
138137

139-
// Refetch when limit changes
140-
useEffect(() => {
141-
deletePendingKeysData.refetch();
142-
}, [limit.value]);
143-
144138
function filterData(data: DeletePendingKeysColumns[] | undefined) {
145139
return data?.filter(
146140
(data: DeletePendingKeysColumns) => data.keyName.includes(debouncedSearch)

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/tables/insights/deletedContainerKeysTable.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ const DeletedContainerKeysTable: React.FC<DeletedContainerKeysTableProps> = ({
9898
DEFAULT_DELETED_CONTAINER_KEYS_RESPONSE,
9999
{
100100
retryAttempts: 2,
101-
initialFetch: false,
102101
onError: (error) => showDataFetchError(error)
103102
}
104103
);
@@ -110,11 +109,6 @@ const DeletedContainerKeysTable: React.FC<DeletedContainerKeysTableProps> = ({
110109
}
111110
}, [deletedContainerKeysData.data]);
112111

113-
// Refetch when limit changes
114-
useEffect(() => {
115-
deletedContainerKeysData.refetch();
116-
}, [limit.value]);
117-
118112
function filterData(data: Container[] | undefined) {
119113
return data?.filter(
120114
(data: Container) => data.containerId.toString().includes(debouncedSearch)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const OMDBInsights: React.FC<{}> = () => {
118118
</div>
119119
<div style={{ padding: '24px' }}>
120120
<div className='content-div'>
121-
<Tabs defaultActiveKey={activeTab ?? '1'}>
121+
<Tabs defaultActiveKey={activeTab ?? '1'} destroyInactiveTabPane>
122122
<Tabs.TabPane key='1' tab={
123123
<label>
124124
Container Mismatch Info

0 commit comments

Comments
 (0)