devmadhuu commented on code in PR #7912:
URL: https://github.com/apache/ozone/pull/7912#discussion_r1965407198


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/overview/components/SummaryCardGroup.tsx:
##########
@@ -0,0 +1,149 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import OverviewSummaryCard from 
"@/v2/components/overviewCard/overviewSummaryCard";
+import { getTaskIndicatorIcon } from "@/v2/pages/overview/overview.utils";
+import { Col } from "antd";
+import filesize from "filesize";
+import React from "react";
+
+type OverviewSummaryCardGroupProps = {
+  loading?: boolean;
+  openSummarytotalRepSize: number;
+  openSummarytotalUnrepSize: number;
+  openSummarytotalOpenKeys: number;
+  deletePendingSummarytotalRepSize: number;
+  deletePendingSummarytotalUnrepSize: number;
+  deletePendingSummarytotalDeletedKeys: number;
+  taskRunning: boolean;
+  taskStatus: boolean;
+}
+
+const size = filesize.partial({ round: 1 });
+
+const getSummaryTableValue = (
+  value: number | string | undefined,
+  colType: 'value' | undefined = undefined
+): string => {
+  if (!value) return 'N/A';
+  if (colType === 'value') return String(value as string)
+  return size(value as number)
+}
+
+const OverviewSummaryCardGroup: React.FC<OverviewSummaryCardGroupProps> = ({
+  loading = true,
+  openSummarytotalRepSize,
+  openSummarytotalUnrepSize,
+  openSummarytotalOpenKeys,
+  deletePendingSummarytotalRepSize,
+  deletePendingSummarytotalUnrepSize,
+  deletePendingSummarytotalDeletedKeys,
+  taskRunning,
+  taskStatus
+}) => {
+
+  const taskIcon: React.ReactElement = getTaskIndicatorIcon(taskRunning, 
taskStatus);

Review Comment:
   For open keys and delete pending keys also, data correctness relies on 
`OmTableInsightTask`.



##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/overview/components/OmDataCardGroup.tsx:
##########
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import OverviewSimpleCard from 
"@/v2/components/overviewCard/overviewSimpleCard";
+import { getTaskIndicatorIcon } from "@/v2/pages/overview/overview.utils";
+import { Col } from "antd";
+import React, { JSXElementConstructor, ReactElement } from "react";
+
+// ------------- Types -------------- //
+type OmData = {
+  volumes: number | ReactElement<any, string | JSXElementConstructor<any>>;
+  buckets: number | ReactElement<any, string | JSXElementConstructor<any>>;
+  keys: number | ReactElement<any, string | JSXElementConstructor<any>>;
+};
+
+type OverviewOMCardProps = {
+  data: OmData;
+  taskRunning: boolean;
+  taskStatus: boolean;
+  loading?: boolean;
+};
+
+
+const OverviewOMCardGroup: React.FC<OverviewOMCardProps> = ({
+  loading = true,
+  data,
+  taskRunning,
+  taskStatus
+}) => {
+  const taskIcon: ReactElement = getTaskIndicatorIcon(taskRunning, taskStatus);

Review Comment:
   Volumes, Buckets and Keys count is determined based on `OmTableInsightTask`, 
after `OmDeltaRequest` or `OmSnapshotRequest` task finishes, so possible that 
even if `OmDeltaRequest` or `OmSnapshotRequest` task finishes successfully and 
`OmTableInsightTask` still running, volumes, buckets and keys data may be 
stale. So last run status of `OmTableInsightTask` makes more sense. Another 
edge case could be that , after delta task finishes, and before even start of 
`OmTableInsightTask` , recon crashed or someone restarted recon, then also 
possible that , last status of `OmTableInsightTask`  may give success and your 
tooltip will show that data is accurate. So IMO, we should also compare the 
`lastUpdatedSequence` number of `OmTableInsightTask` with `lastUpdatedSequence` 
of number of `OmDeltaRequest` or `OmSnapshotRequest`, this way it will give 
more reliability and guarantee that tooltip shows correct status.



-- 
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]

Reply via email to