smengcl commented on code in PR #3761:
URL: https://github.com/apache/ozone/pull/3761#discussion_r974497501
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/components/autoReloadPanel/autoReloadPanel.tsx:
##########
@@ -38,21 +42,39 @@ class AutoReloadPanel extends
React.Component<IAutoReloadPanelProps> {
};
render() {
- const {onReload, lastUpdated, isLoading} = this.props;
- const lastUpdatedText = lastUpdated === 0 ? 'NA' :
+ const {onReload, lastUpdated,
lastUpdatedOM,lastUpdateOMSync,isLoading,lastUpdatedOMText,lastUpdateOMSyncText}
= this.props;
+ const textOMSync= <span>{lastUpdatedOMText} :
{moment(lastUpdatedOM).format('ll LTS') }<br/>
+ {lastUpdateOMSyncText} : {moment(lastUpdateOMSync).format('ll
LTS')}</span>
+ const lastUpdatedText = lastUpdated === 0 || lastUpdated === undefined?
'NA' :
(
<Tooltip
placement='bottom' title={moment(lastUpdated).format('ll LTS')}
>
{moment(lastUpdated).format('LTS')}
</Tooltip>
);
+ const lastUpdatedOMInfo = lastUpdatedOM === 0 || lastUpdatedOM ===
undefined || lastUpdateOMSync===0 || lastUpdateOMSync=== undefined ? 'NA' :
+ (
+ <Tooltip
+ placement='bottom' title={textOMSync}
+ >
+ {moment(lastUpdatedOM).format('LTS')}
+ </Tooltip>
+ );
+ const lastUpdatedOMDisplay= lastUpdatedOM === 0 || lastUpdatedOM ===
undefined || lastUpdateOMSync===0 || lastUpdateOMSync=== undefined ? '' :
Review Comment:
nit
```suggestion
const lastUpdatedOMDisplay= lastUpdatedOM === 0 || lastUpdatedOM ===
undefined || lastUpdateOMSync === 0 || lastUpdateOMSync === undefined ? '' :
```
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/overview/overview.tsx:
##########
@@ -86,11 +95,15 @@ export class Overview extends
React.Component<Record<string, object>, IOverviewS
});
axios.all([
axios.get('/api/v1/clusterState'),
- axios.get('/api/v1/containers/missing')
- ]).then(axios.spread((clusterStateResponse, missingContainersResponse) => {
+ axios.get('/api/v1/containers/missing'),
+ axios.get('/api/v1/task/status')
+ ]).then(axios.spread((clusterStateResponse,
missingContainersResponse,taskstatusResponse) => {
+
const clusterState: IClusterStateResponse = clusterStateResponse.data;
- const missingContainers: IMissingContainersResponse =
missingContainersResponse.data;
+ const missingContainers: IMissingContainersResponse =
missingContainersResponse.data;
+ const taskStatus = taskstatusResponse.data &&
taskstatusResponse.data.filter((item:any) => item.taskName === 'OmDeltaRequest'
|| item.taskName === 'OmSnapshotRequest').sort((c1:any, c2:any) =>
c2.lastUpdatedTimestamp - c1.lastUpdatedTimestamp);
Review Comment:
Can we use two variables to hold values from `OmDeltaRequest` and
`OmSnapshotRequest` separately so the logic can be cleaner? Thx.
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/overview/overview.tsx:
##########
@@ -101,7 +114,12 @@ export class Overview extends
React.Component<Record<string, object>, IOverviewS
buckets: clusterState.buckets,
keys: clusterState.keys,
missingContainersCount,
- lastUpdated: Number(moment())
+ lastUpdated: Number(moment()),
+ lastUpdatedOM: taskStatus[0] ? taskStatus[0] &&
taskStatus[0].lastUpdatedTimestamp : 0,
Review Comment:
Can we simply use `taskStatus[0].lastUpdatedTimestamp`?
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/overview/overview.tsx:
##########
@@ -86,11 +95,15 @@ export class Overview extends
React.Component<Record<string, object>, IOverviewS
});
axios.all([
axios.get('/api/v1/clusterState'),
- axios.get('/api/v1/containers/missing')
- ]).then(axios.spread((clusterStateResponse, missingContainersResponse) => {
+ axios.get('/api/v1/containers/missing'),
+ axios.get('/api/v1/task/status')
+ ]).then(axios.spread((clusterStateResponse,
missingContainersResponse,taskstatusResponse) => {
+
const clusterState: IClusterStateResponse = clusterStateResponse.data;
- const missingContainers: IMissingContainersResponse =
missingContainersResponse.data;
+ const missingContainers: IMissingContainersResponse =
missingContainersResponse.data;
+ const taskStatus = taskstatusResponse.data &&
taskstatusResponse.data.filter((item:any) => item.taskName === 'OmDeltaRequest'
|| item.taskName === 'OmSnapshotRequest').sort((c1:any, c2:any) =>
c2.lastUpdatedTimestamp - c1.lastUpdatedTimestamp);
const missingContainersCount = missingContainers.totalCount;
+ console.log("radha2",taskStatus);
Review Comment:
nit: debugging message
```suggestion
```
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/overview/overview.tsx:
##########
@@ -101,7 +114,12 @@ export class Overview extends
React.Component<Record<string, object>, IOverviewS
buckets: clusterState.buckets,
keys: clusterState.keys,
missingContainersCount,
- lastUpdated: Number(moment())
+ lastUpdated: Number(moment()),
+ lastUpdatedOM: taskStatus[0] ? taskStatus[0] &&
taskStatus[0].lastUpdatedTimestamp : 0,
+ lastUpdateOMSync:taskStatus[1] ? taskStatus[1] &&
taskStatus[1].lastUpdatedTimestamp : 0,
+ lastUpdatedOMText:taskStatus[0] ? taskStatus[0] &&
taskStatus[0].taskName.toLowerCase() === 'OmDeltaRequest'.toLowerCase() ? 'Last
Delta Update': 'Last Full Update': '',
Review Comment:
I believe we could simply use `Last Delta Update` once we separate the two
variables?
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/components/autoReloadPanel/autoReloadPanel.tsx:
##########
@@ -38,21 +42,39 @@ class AutoReloadPanel extends
React.Component<IAutoReloadPanelProps> {
};
render() {
- const {onReload, lastUpdated, isLoading} = this.props;
- const lastUpdatedText = lastUpdated === 0 ? 'NA' :
+ const {onReload, lastUpdated,
lastUpdatedOM,lastUpdateOMSync,isLoading,lastUpdatedOMText,lastUpdateOMSyncText}
= this.props;
+ const textOMSync= <span>{lastUpdatedOMText} :
{moment(lastUpdatedOM).format('ll LTS') }<br/>
+ {lastUpdateOMSyncText} : {moment(lastUpdateOMSync).format('ll
LTS')}</span>
+ const lastUpdatedText = lastUpdated === 0 || lastUpdated === undefined?
'NA' :
(
<Tooltip
placement='bottom' title={moment(lastUpdated).format('ll LTS')}
>
{moment(lastUpdated).format('LTS')}
</Tooltip>
);
+ const lastUpdatedOMInfo = lastUpdatedOM === 0 || lastUpdatedOM ===
undefined || lastUpdateOMSync===0 || lastUpdateOMSync=== undefined ? 'NA' :
Review Comment:
nit
```suggestion
const lastUpdatedOMInfo = lastUpdatedOM === 0 || lastUpdatedOM ===
undefined || lastUpdateOMSync === 0 || lastUpdateOMSync === undefined ? 'NA' :
```
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/overview/overview.tsx:
##########
@@ -75,7 +79,12 @@ export class Overview extends React.Component<Record<string,
object>, IOverviewS
buckets: 0,
keys: 0,
missingContainersCount: 0,
- lastUpdated: 0
+ lastUpdated: 0,
+ lastUpdatedOM:0,
+ lastUpdateOMSync:0,
Review Comment:
Rename this to `lastUpdatedOMDBDelta` and `lastUpdatedOMDBFull` respectively.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]