You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "smitajoshi12 (via GitHub)" <gi...@apache.org> on 2024/08/12 14:16:36 UTC
[PR] HDDS-11229. Recon Code Optimization for use of Optional Chaining Insi… [ozone]
smitajoshi12 opened a new pull request, #7064:
URL: https://github.com/apache/ozone/pull/7064
## What changes were proposed in this pull request?
Please describe your PR in detail:
Examples of well-written pull requests:
## What is the link to the Apache JIRA
## How was this patch tested?
Manually
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11229. Chain optionals in Recon Insight [ozone]
Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on code in PR #7064:
URL: https://github.com/apache/ozone/pull/7064#discussion_r1732461494
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/om/om.tsx:
##########
@@ -714,7 +714,7 @@ export class Om extends React.Component<Record<string, object>, IOmdbInsightsSta
cancelDeletedKeysSignal = controller
request.then(deletedKeysResponse => {
let deletedContainerKeys = [];
- deletedContainerKeys = deletedKeysResponse && deletedKeysResponse.data && deletedKeysResponse.data.containers;
+ deletedContainerKeys = deletedKeysResponse?.data?.containers;
Review Comment:
done changes in latest commit
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11229. Recon Code Optimization for use of Optional Chaining Insi… [ozone]
Posted by "devabhishekpal (via GitHub)" <gi...@apache.org>.
devabhishekpal commented on code in PR #7064:
URL: https://github.com/apache/ozone/pull/7064#discussion_r1732252241
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/om/om.tsx:
##########
@@ -748,7 +748,7 @@ export class Om extends React.Component<Record<string, object>, IOmdbInsightsSta
cancelDeletedPendingDirSignal = controller
request.then(deletePendingDirResponse => {
let deletedDirInfo = [];
- deletedDirInfo = deletePendingDirResponse && deletePendingDirResponse.data && deletePendingDirResponse.data.deletedDirInfo;
+ deletedDirInfo = deletePendingDirResponse?.data?.deletedDirInfo;
Review Comment:
```suggestion
deletedDirInfo = deletePendingDirResponse?.data?.deletedDirInfo ?? [];
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11229. Chain optionals in Recon Insight [ozone]
Posted by "ArafatKhan2198 (via GitHub)" <gi...@apache.org>.
ArafatKhan2198 commented on PR #7064:
URL: https://github.com/apache/ozone/pull/7064#issuecomment-2313385601
Thanks for the patch @smitajoshi12
Thanks @devabhishekpal for the review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11229. Recon Code Optimization for use of Optional Chaining Insi… [ozone]
Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on code in PR #7064:
URL: https://github.com/apache/ozone/pull/7064#discussion_r1732379009
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/om/om.tsx:
##########
@@ -567,7 +567,7 @@ export class Om extends React.Component<Record<string, object>, IOmdbInsightsSta
const { request, controller } = AxiosGetHelper(openKeysEndpoint, cancelOpenKeysSignal)
cancelOpenKeysSignal = controller
request.then(openKeysResponse => {
- const openKeys = openKeysResponse && openKeysResponse.data;
+ const openKeys = openKeysResponse?.data;
Review Comment:
@devabhishekpal
Done Changes in latest commit 5ae3e461eba37df92fbb93f5bb64f5439b36d3b8
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11229. Recon Code Optimization for use of Optional Chaining Insi… [ozone]
Posted by "devabhishekpal (via GitHub)" <gi...@apache.org>.
devabhishekpal commented on code in PR #7064:
URL: https://github.com/apache/ozone/pull/7064#discussion_r1732249296
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/om/om.tsx:
##########
@@ -567,7 +567,7 @@ export class Om extends React.Component<Record<string, object>, IOmdbInsightsSta
const { request, controller } = AxiosGetHelper(openKeysEndpoint, cancelOpenKeysSignal)
cancelOpenKeysSignal = controller
request.then(openKeysResponse => {
- const openKeys = openKeysResponse && openKeysResponse.data;
+ const openKeys = openKeysResponse?.data;
Review Comment:
This will short-circuit to undefined in case data is not defined.
Please add a fallback value to this
```suggestion
const openKeys = openKeysResponse?.data ?? {"fso": []};
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11229. Recon Code Optimization for use of Optional Chaining Insi… [ozone]
Posted by "devabhishekpal (via GitHub)" <gi...@apache.org>.
devabhishekpal commented on code in PR #7064:
URL: https://github.com/apache/ozone/pull/7064#discussion_r1732251899
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/om/om.tsx:
##########
@@ -714,7 +714,7 @@ export class Om extends React.Component<Record<string, object>, IOmdbInsightsSta
cancelDeletedKeysSignal = controller
request.then(deletedKeysResponse => {
let deletedContainerKeys = [];
- deletedContainerKeys = deletedKeysResponse && deletedKeysResponse.data && deletedKeysResponse.data.containers;
+ deletedContainerKeys = deletedKeysResponse?.data?.containers;
Review Comment:
```suggestion
deletedContainerKeys = deletedKeysResponse?.data?.containers ?? [];
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11229. Chain optionals in Recon Insight [ozone]
Posted by "ArafatKhan2198 (via GitHub)" <gi...@apache.org>.
ArafatKhan2198 merged PR #7064:
URL: https://github.com/apache/ozone/pull/7064
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11229. Recon Code Optimization for use of Optional Chaining Insi… [ozone]
Posted by "devabhishekpal (via GitHub)" <gi...@apache.org>.
devabhishekpal commented on code in PR #7064:
URL: https://github.com/apache/ozone/pull/7064#discussion_r1732250776
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/om/om.tsx:
##########
@@ -614,7 +614,7 @@ export class Om extends React.Component<Record<string, object>, IOmdbInsightsSta
cancelDeletePendingSignal = controller;
request.then(deletePendingKeysResponse => {
- const deletePendingKeys = deletePendingKeysResponse && deletePendingKeysResponse.data && deletePendingKeysResponse.data.deletedKeyInfo;
+ const deletePendingKeys = deletePendingKeysResponse?.data?.deletedKeyInfo;
Review Comment:
Similar over here, please add a fallback/default value
```suggestion
const deletePendingKeys = deletePendingKeysResponse?.data?.deletedKeyInfo ?? [];
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-11229. Chain optionals in Recon Insight [ozone]
Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on code in PR #7064:
URL: https://github.com/apache/ozone/pull/7064#discussion_r1732379009
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/om/om.tsx:
##########
@@ -567,7 +567,7 @@ export class Om extends React.Component<Record<string, object>, IOmdbInsightsSta
const { request, controller } = AxiosGetHelper(openKeysEndpoint, cancelOpenKeysSignal)
cancelOpenKeysSignal = controller
request.then(openKeysResponse => {
- const openKeys = openKeysResponse && openKeysResponse.data;
+ const openKeys = openKeysResponse?.data;
Review Comment:
@devabhishekpal
Done Changes in latest commit 02247d4b682d53a31a3a5d2dd3179f3c416249a7
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org