You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "himanish-star (via GitHub)" <gi...@apache.org> on 2025/03/28 16:22:41 UTC
[PR] Feature: New UI to monitor Rebalance Server Status [pinot]
himanish-star opened a new pull request, #15400:
URL: https://github.com/apache/pinot/pull/15400
### Description
Uploading Rebalance Phase 3.mp4…
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "klsince (via GitHub)" <gi...@apache.org>.
klsince merged PR #15400:
URL: https://github.com/apache/pinot/pull/15400
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #15400:
URL: https://github.com/apache/pinot/pull/15400#issuecomment-2761943377
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/15400?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 56.17%. Comparing base [(`59551e4`)](https://app.codecov.io/gh/apache/pinot/commit/59551e45224f1535c4863fd577622b37366ccc97?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`8c33a2a`)](https://app.codecov.io/gh/apache/pinot/commit/8c33a2ae3bb380a6d92bc43e4490c28d649ccc46?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 1940 commits behind head on master.
> :exclamation: There is a different number of reports uploaded between BASE (59551e4) and HEAD (8c33a2a). Click for more details.
>
> <details><summary>HEAD has 53 uploads less than BASE</summary>
>
>| Flag | BASE (59551e4) | HEAD (8c33a2a) |
>|------|------|------|
>|integration|7|0|
>|integration2|3|0|
>|temurin|12|1|
>|java-21|7|1|
>|skip-bytebuffers-true|3|0|
>|skip-bytebuffers-false|7|1|
>|unittests|5|1|
>|unittests1|2|1|
>|java-11|5|0|
>|unittests2|3|0|
>|integration1|2|0|
>|custom-integration1|2|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #15400 +/- ##
============================================
- Coverage 61.75% 56.17% -5.58%
- Complexity 207 684 +477
============================================
Files 2436 2188 -248
Lines 133233 118143 -15090
Branches 20636 18882 -1754
============================================
- Hits 82274 66370 -15904
- Misses 44911 46310 +1399
+ Partials 6048 5463 -585
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration1](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [integration2](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [java-11](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [java-21](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.17% <ø> (-5.45%)` | :arrow_down: |
| [skip-bytebuffers-false](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.17% <ø> (-5.57%)` | :arrow_down: |
| [skip-bytebuffers-true](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [temurin](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.17% <ø> (-5.58%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.17% <ø> (-5.57%)` | :arrow_down: |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.17% <ø> (+9.28%)` | :arrow_up: |
| [unittests2](https://app.codecov.io/gh/apache/pinot/pull/15400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/pinot/pull/15400?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "jayeshchoudhary (via GitHub)" <gi...@apache.org>.
jayeshchoudhary commented on code in PR #15400:
URL: https://github.com/apache/pinot/pull/15400#discussion_r2019991319
##########
pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx:
##########
@@ -0,0 +1,128 @@
+/**
+ * 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 {
+ Button,
+ DialogContent,
+ Grid
+} from "@material-ui/core";
+import Dialog from "../../CustomDialog";
+import React, {useState} from "react";
+import moment from "moment/moment";
+import {RebalanceServerSection} from "./RebalanceServer/RebalanceServerSection";
+import CustomCodemirror from "../../CustomCodemirror";
+import './RebalanceServer/RebalanceServerResponses/CustomCodeMirror.css';
+import {RebalanceServerResponseCard} from "./RebalanceServer/RebalanceServerResponses/RebalanceServerResponseCard";
+import CustomizedTables from "../../Table";
+
+export type RebalanceTableSegmentJobs = {
+ [key: string]: {
+ jobId: string,
+ messageCount: number,
+ submissionTimeMs: number,
+ jobType: string,
+ tableName: string,
+ REBALANCE_PROGRESS_STATS: string,
+ REBALANCE_CONTEXT: string;
+ }
+}
+
+type RebalanceServerStatusOpProps = {
+ rebalanceServerStatus: RebalanceTableSegmentJobs;
+ hideModal: () => void;
+};
+
+export const RebalanceServerStatusOp = (
+ { rebalanceServerStatus, hideModal } : RebalanceServerStatusOpProps
+) => {
+ const [jobSelected, setJobSelected] = useState<string | null>(null);
+
+ const BackAction = () => {
+ return (
+ <Button
+ style={{ textTransform: 'none' }}
Review Comment:
buttons are default capitalized across project. either we should change the default behaviour or keep it as is.
##########
pinot-controller/src/main/resources/app/pages/TenantDetails.tsx:
##########
@@ -445,6 +450,17 @@ const TenantPageDetails = ({ match }: RouteComponentProps<Props>) => {
}
};
+ const handleRebalanceTableStatus = async () => {
+ try{
+ setShowRebalanceServerStatus(true);
+ const rebalanceServerJobs = await PinotMethodUtils.fetchTableJobs(tableName, "TABLE_REBALANCE");
+ setRebalanceTableJobsData(rebalanceServerJobs as RebalanceTableSegmentJobs);
+ } catch(error) {
+ dispatch({type: 'error', message: error, show: true});
+ setShowRebalanceServerStatus(false);
+ }
+ };
+
Review Comment:
Are we showing loading until api fetch is complete?
user clicks on rebalance status button -> open dialog -> call api -> api fails -> close dialog ??
what if api takes 3 seconds? what about loading indicator ?
##########
pinot-controller/src/main/resources/app/pages/TenantDetails.tsx:
##########
@@ -445,6 +450,17 @@ const TenantPageDetails = ({ match }: RouteComponentProps<Props>) => {
}
};
+ const handleRebalanceTableStatus = async () => {
+ try{
+ setShowRebalanceServerStatus(true);
+ const rebalanceServerJobs = await PinotMethodUtils.fetchTableJobs(tableName, "TABLE_REBALANCE");
+ setRebalanceTableJobsData(rebalanceServerJobs as RebalanceTableSegmentJobs);
+ } catch(error) {
+ dispatch({type: 'error', message: error, show: true});
+ setShowRebalanceServerStatus(false);
+ }
+ };
+
Review Comment:
IMO we should make api call in the Dialog itself in useEffect
##########
pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx:
##########
@@ -0,0 +1,128 @@
+/**
+ * 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 {
+ Button,
+ DialogContent,
+ Grid
+} from "@material-ui/core";
+import Dialog from "../../CustomDialog";
+import React, {useState} from "react";
+import moment from "moment/moment";
+import {RebalanceServerSection} from "./RebalanceServer/RebalanceServerSection";
+import CustomCodemirror from "../../CustomCodemirror";
+import './RebalanceServer/RebalanceServerResponses/CustomCodeMirror.css';
+import {RebalanceServerResponseCard} from "./RebalanceServer/RebalanceServerResponses/RebalanceServerResponseCard";
+import CustomizedTables from "../../Table";
+
+export type RebalanceTableSegmentJobs = {
+ [key: string]: {
+ jobId: string,
+ messageCount: number,
+ submissionTimeMs: number,
+ jobType: string,
+ tableName: string,
+ REBALANCE_PROGRESS_STATS: string,
+ REBALANCE_CONTEXT: string;
+ }
+}
+
+type RebalanceServerStatusOpProps = {
+ rebalanceServerStatus: RebalanceTableSegmentJobs;
+ hideModal: () => void;
+};
+
+export const RebalanceServerStatusOp = (
+ { rebalanceServerStatus, hideModal } : RebalanceServerStatusOpProps
+) => {
+ const [jobSelected, setJobSelected] = useState<string | null>(null);
+
+ const BackAction = () => {
+ return (
+ <Button
+ style={{ textTransform: 'none' }}
+ variant='outlined'
+ color='primary'
+ onClick={() => setJobSelected(null)}
+ >
+ Back
+ </Button>
+ );
+ }
+ return (
+ <Dialog
+ open={true}
+ handleClose={hideModal}
+ title="Rebalance Table Status"
+ showOkBtn={false}
+ size='lg'
+ moreActions={jobSelected ? <BackAction /> : null}
+ >
+ <DialogContent>
+ {
+ !jobSelected ?
+ <CustomizedTables
+ title='Job Status'
+ isCellClickable
+ makeOnlyFirstCellClickable
+ cellClickCallback={(cell: string) => {
+ setJobSelected(cell);
+ }}
+ data={{
+ records: Object.keys(rebalanceServerStatus).map(jobId => {
+ const progressStats = JSON.parse(rebalanceServerStatus[jobId].REBALANCE_PROGRESS_STATS);
+ return [
+ rebalanceServerStatus[jobId].jobId,
+ rebalanceServerStatus[jobId].tableName,
+ progressStats.status,
+ moment(+rebalanceServerStatus[jobId].submissionTimeMs).format("MMMM Do YYYY, HH:mm:ss")
+ ];
+ }),
+ columns: ['Job id', 'Table name', 'Status', 'Started at']
+ }}
+ showSearchBox
+ /> :
+ <Grid container spacing={2}>
+ <Grid item xs={12}>
+ <RebalanceServerResponseCard>
+ <RebalanceServerSection sectionTitle={"Progress Stats"} canHideSection showSectionByDefault={true}>
+ <CustomCodemirror
+ customClass='rebalance_server_response_section'
+ data={JSON.parse(rebalanceServerStatus[jobSelected].REBALANCE_PROGRESS_STATS)}
+ isEditable={false}
Review Comment:
JSON.parse can throw exception. need handle exception somewhere
##########
pinot-controller/src/main/resources/app/components/Table.tsx:
##########
@@ -562,7 +564,7 @@ export default function CustomizedTables({
) : (
<StyledTableCell
key={idx}
- className={isCellClickable ? classes.isCellClickable : (isSticky ? classes.isSticky : '')}
+ className={isCellClickable && (!makeOnlyFirstCellClickable || !idx) ? classes.isCellClickable : (isSticky ? classes.isSticky : '')}
Review Comment:
what is the usecase here?
I don't see this in the reload segment table
all the other columns are not clickable
<img width="1387" alt="image" src="https://github.com/user-attachments/assets/5ea03c02-848b-4ef9-a417-69d9b1bdbe69" />
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "jayeshchoudhary (via GitHub)" <gi...@apache.org>.
jayeshchoudhary commented on PR #15400:
URL: https://github.com/apache/pinot/pull/15400#issuecomment-2764265333
also, screenshot seems missing in the description.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "jayeshchoudhary (via GitHub)" <gi...@apache.org>.
jayeshchoudhary commented on code in PR #15400:
URL: https://github.com/apache/pinot/pull/15400#discussion_r2019989751
##########
pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx:
##########
@@ -0,0 +1,128 @@
+/**
+ * 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 {
+ Button,
+ DialogContent,
+ Grid
+} from "@material-ui/core";
+import Dialog from "../../CustomDialog";
+import React, {useState} from "react";
+import moment from "moment/moment";
+import {RebalanceServerSection} from "./RebalanceServer/RebalanceServerSection";
+import CustomCodemirror from "../../CustomCodemirror";
+import './RebalanceServer/RebalanceServerResponses/CustomCodeMirror.css';
+import {RebalanceServerResponseCard} from "./RebalanceServer/RebalanceServerResponses/RebalanceServerResponseCard";
+import CustomizedTables from "../../Table";
+
+export type RebalanceTableSegmentJobs = {
+ [key: string]: {
+ jobId: string,
+ messageCount: number,
+ submissionTimeMs: number,
+ jobType: string,
+ tableName: string,
+ REBALANCE_PROGRESS_STATS: string,
+ REBALANCE_CONTEXT: string;
+ }
+}
+
+type RebalanceServerStatusOpProps = {
+ rebalanceServerStatus: RebalanceTableSegmentJobs;
+ hideModal: () => void;
+};
+
+export const RebalanceServerStatusOp = (
+ { rebalanceServerStatus, hideModal } : RebalanceServerStatusOpProps
+) => {
+ const [jobSelected, setJobSelected] = useState<string | null>(null);
+
+ const BackAction = () => {
+ return (
+ <Button
+ style={{ textTransform: 'none' }}
+ variant='outlined'
+ color='primary'
+ onClick={() => setJobSelected(null)}
+ >
+ Back
+ </Button>
+ );
+ }
+ return (
+ <Dialog
+ open={true}
+ handleClose={hideModal}
+ title="Rebalance Table Status"
+ showOkBtn={false}
+ size='lg'
+ moreActions={jobSelected ? <BackAction /> : null}
+ >
+ <DialogContent>
+ {
+ !jobSelected ?
+ <CustomizedTables
+ title='Job Status'
+ isCellClickable
+ makeOnlyFirstCellClickable
+ cellClickCallback={(cell: string) => {
+ setJobSelected(cell);
+ }}
+ data={{
+ records: Object.keys(rebalanceServerStatus).map(jobId => {
+ const progressStats = JSON.parse(rebalanceServerStatus[jobId].REBALANCE_PROGRESS_STATS);
+ return [
+ rebalanceServerStatus[jobId].jobId,
+ rebalanceServerStatus[jobId].tableName,
+ progressStats.status,
+ moment(+rebalanceServerStatus[jobId].submissionTimeMs).format("MMMM Do YYYY, HH:mm:ss")
+ ];
Review Comment:
make sure this time format is consistent across project
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "himanish-star (via GitHub)" <gi...@apache.org>.
himanish-star commented on code in PR #15400:
URL: https://github.com/apache/pinot/pull/15400#discussion_r2024546605
##########
pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx:
##########
@@ -0,0 +1,128 @@
+/**
+ * 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 {
+ Button,
+ DialogContent,
+ Grid
+} from "@material-ui/core";
+import Dialog from "../../CustomDialog";
+import React, {useState} from "react";
+import moment from "moment/moment";
+import {RebalanceServerSection} from "./RebalanceServer/RebalanceServerSection";
+import CustomCodemirror from "../../CustomCodemirror";
+import './RebalanceServer/RebalanceServerResponses/CustomCodeMirror.css';
+import {RebalanceServerResponseCard} from "./RebalanceServer/RebalanceServerResponses/RebalanceServerResponseCard";
+import CustomizedTables from "../../Table";
+
+export type RebalanceTableSegmentJobs = {
+ [key: string]: {
+ jobId: string,
+ messageCount: number,
+ submissionTimeMs: number,
+ jobType: string,
+ tableName: string,
+ REBALANCE_PROGRESS_STATS: string,
+ REBALANCE_CONTEXT: string;
+ }
+}
+
+type RebalanceServerStatusOpProps = {
+ rebalanceServerStatus: RebalanceTableSegmentJobs;
+ hideModal: () => void;
+};
+
+export const RebalanceServerStatusOp = (
+ { rebalanceServerStatus, hideModal } : RebalanceServerStatusOpProps
+) => {
+ const [jobSelected, setJobSelected] = useState<string | null>(null);
+
+ const BackAction = () => {
+ return (
+ <Button
+ style={{ textTransform: 'none' }}
Review Comment:
Kept it as it is!
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "jayeshchoudhary (via GitHub)" <gi...@apache.org>.
jayeshchoudhary commented on code in PR #15400:
URL: https://github.com/apache/pinot/pull/15400#discussion_r2019989751
##########
pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx:
##########
@@ -0,0 +1,128 @@
+/**
+ * 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 {
+ Button,
+ DialogContent,
+ Grid
+} from "@material-ui/core";
+import Dialog from "../../CustomDialog";
+import React, {useState} from "react";
+import moment from "moment/moment";
+import {RebalanceServerSection} from "./RebalanceServer/RebalanceServerSection";
+import CustomCodemirror from "../../CustomCodemirror";
+import './RebalanceServer/RebalanceServerResponses/CustomCodeMirror.css';
+import {RebalanceServerResponseCard} from "./RebalanceServer/RebalanceServerResponses/RebalanceServerResponseCard";
+import CustomizedTables from "../../Table";
+
+export type RebalanceTableSegmentJobs = {
+ [key: string]: {
+ jobId: string,
+ messageCount: number,
+ submissionTimeMs: number,
+ jobType: string,
+ tableName: string,
+ REBALANCE_PROGRESS_STATS: string,
+ REBALANCE_CONTEXT: string;
+ }
+}
+
+type RebalanceServerStatusOpProps = {
+ rebalanceServerStatus: RebalanceTableSegmentJobs;
+ hideModal: () => void;
+};
+
+export const RebalanceServerStatusOp = (
+ { rebalanceServerStatus, hideModal } : RebalanceServerStatusOpProps
+) => {
+ const [jobSelected, setJobSelected] = useState<string | null>(null);
+
+ const BackAction = () => {
+ return (
+ <Button
+ style={{ textTransform: 'none' }}
+ variant='outlined'
+ color='primary'
+ onClick={() => setJobSelected(null)}
+ >
+ Back
+ </Button>
+ );
+ }
+ return (
+ <Dialog
+ open={true}
+ handleClose={hideModal}
+ title="Rebalance Table Status"
+ showOkBtn={false}
+ size='lg'
+ moreActions={jobSelected ? <BackAction /> : null}
+ >
+ <DialogContent>
+ {
+ !jobSelected ?
+ <CustomizedTables
+ title='Job Status'
+ isCellClickable
+ makeOnlyFirstCellClickable
+ cellClickCallback={(cell: string) => {
+ setJobSelected(cell);
+ }}
+ data={{
+ records: Object.keys(rebalanceServerStatus).map(jobId => {
+ const progressStats = JSON.parse(rebalanceServerStatus[jobId].REBALANCE_PROGRESS_STATS);
+ return [
+ rebalanceServerStatus[jobId].jobId,
+ rebalanceServerStatus[jobId].tableName,
+ progressStats.status,
+ moment(+rebalanceServerStatus[jobId].submissionTimeMs).format("MMMM Do YYYY, HH:mm:ss")
+ ];
Review Comment:
make sure this time format is consistent across project, better create a util function which can be used across project.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "himanish-star (via GitHub)" <gi...@apache.org>.
himanish-star commented on code in PR #15400:
URL: https://github.com/apache/pinot/pull/15400#discussion_r2024546878
##########
pinot-controller/src/main/resources/app/pages/TenantDetails.tsx:
##########
@@ -445,6 +450,17 @@ const TenantPageDetails = ({ match }: RouteComponentProps<Props>) => {
}
};
+ const handleRebalanceTableStatus = async () => {
+ try{
+ setShowRebalanceServerStatus(true);
+ const rebalanceServerJobs = await PinotMethodUtils.fetchTableJobs(tableName, "TABLE_REBALANCE");
+ setRebalanceTableJobsData(rebalanceServerJobs as RebalanceTableSegmentJobs);
+ } catch(error) {
+ dispatch({type: 'error', message: error, show: true});
+ setShowRebalanceServerStatus(false);
+ }
+ };
+
Review Comment:
Moved API call to dialog!
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "himanish-star (via GitHub)" <gi...@apache.org>.
himanish-star commented on code in PR #15400:
URL: https://github.com/apache/pinot/pull/15400#discussion_r2024465728
##########
pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx:
##########
@@ -0,0 +1,128 @@
+/**
+ * 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 {
+ Button,
+ DialogContent,
+ Grid
+} from "@material-ui/core";
+import Dialog from "../../CustomDialog";
+import React, {useState} from "react";
+import moment from "moment/moment";
+import {RebalanceServerSection} from "./RebalanceServer/RebalanceServerSection";
+import CustomCodemirror from "../../CustomCodemirror";
+import './RebalanceServer/RebalanceServerResponses/CustomCodeMirror.css';
+import {RebalanceServerResponseCard} from "./RebalanceServer/RebalanceServerResponses/RebalanceServerResponseCard";
+import CustomizedTables from "../../Table";
+
+export type RebalanceTableSegmentJobs = {
+ [key: string]: {
+ jobId: string,
+ messageCount: number,
+ submissionTimeMs: number,
+ jobType: string,
+ tableName: string,
+ REBALANCE_PROGRESS_STATS: string,
+ REBALANCE_CONTEXT: string;
+ }
+}
+
+type RebalanceServerStatusOpProps = {
+ rebalanceServerStatus: RebalanceTableSegmentJobs;
+ hideModal: () => void;
+};
+
+export const RebalanceServerStatusOp = (
+ { rebalanceServerStatus, hideModal } : RebalanceServerStatusOpProps
+) => {
+ const [jobSelected, setJobSelected] = useState<string | null>(null);
+
+ const BackAction = () => {
+ return (
+ <Button
+ style={{ textTransform: 'none' }}
+ variant='outlined'
+ color='primary'
+ onClick={() => setJobSelected(null)}
+ >
+ Back
+ </Button>
+ );
+ }
+ return (
+ <Dialog
+ open={true}
+ handleClose={hideModal}
+ title="Rebalance Table Status"
+ showOkBtn={false}
+ size='lg'
+ moreActions={jobSelected ? <BackAction /> : null}
+ >
+ <DialogContent>
+ {
+ !jobSelected ?
+ <CustomizedTables
+ title='Job Status'
+ isCellClickable
+ makeOnlyFirstCellClickable
+ cellClickCallback={(cell: string) => {
+ setJobSelected(cell);
+ }}
+ data={{
+ records: Object.keys(rebalanceServerStatus).map(jobId => {
+ const progressStats = JSON.parse(rebalanceServerStatus[jobId].REBALANCE_PROGRESS_STATS);
+ return [
+ rebalanceServerStatus[jobId].jobId,
+ rebalanceServerStatus[jobId].tableName,
+ progressStats.status,
+ moment(+rebalanceServerStatus[jobId].submissionTimeMs).format("MMMM Do YYYY, HH:mm:ss")
+ ];
+ }),
+ columns: ['Job id', 'Table name', 'Status', 'Started at']
+ }}
+ showSearchBox
+ /> :
+ <Grid container spacing={2}>
+ <Grid item xs={12}>
+ <RebalanceServerResponseCard>
+ <RebalanceServerSection sectionTitle={"Progress Stats"} canHideSection showSectionByDefault={true}>
+ <CustomCodemirror
+ customClass='rebalance_server_response_section'
+ data={JSON.parse(rebalanceServerStatus[jobSelected].REBALANCE_PROGRESS_STATS)}
+ isEditable={false}
Review Comment:
Done
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "himanish-star (via GitHub)" <gi...@apache.org>.
himanish-star commented on code in PR #15400:
URL: https://github.com/apache/pinot/pull/15400#discussion_r2018979032
##########
pinot-controller/src/main/resources/app/components/Table.tsx:
##########
@@ -562,7 +564,7 @@ export default function CustomizedTables({
) : (
<StyledTableCell
key={idx}
- className={isCellClickable ? classes.isCellClickable : (isSticky ? classes.isSticky : '')}
+ className={isCellClickable && (!makeOnlyFirstCellClickable || !idx) ? classes.isCellClickable : (isSticky ? classes.isSticky : '')}
Review Comment:
Since `isCellClickable` makes all cells clickable and underlined and that is what may not be wanted in some scenarios. I've added this new `makeOnlyFirstCellClickable` which makes sure that only the first cell is clickable if the flag is set to true
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "jayeshchoudhary (via GitHub)" <gi...@apache.org>.
jayeshchoudhary commented on code in PR #15400:
URL: https://github.com/apache/pinot/pull/15400#discussion_r2019989824
##########
pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx:
##########
@@ -0,0 +1,128 @@
+/**
+ * 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 {
+ Button,
+ DialogContent,
+ Grid
+} from "@material-ui/core";
+import Dialog from "../../CustomDialog";
+import React, {useState} from "react";
+import moment from "moment/moment";
+import {RebalanceServerSection} from "./RebalanceServer/RebalanceServerSection";
+import CustomCodemirror from "../../CustomCodemirror";
+import './RebalanceServer/RebalanceServerResponses/CustomCodeMirror.css';
+import {RebalanceServerResponseCard} from "./RebalanceServer/RebalanceServerResponses/RebalanceServerResponseCard";
+import CustomizedTables from "../../Table";
+
+export type RebalanceTableSegmentJobs = {
+ [key: string]: {
+ jobId: string,
+ messageCount: number,
+ submissionTimeMs: number,
+ jobType: string,
+ tableName: string,
+ REBALANCE_PROGRESS_STATS: string,
+ REBALANCE_CONTEXT: string;
+ }
+}
+
+type RebalanceServerStatusOpProps = {
+ rebalanceServerStatus: RebalanceTableSegmentJobs;
+ hideModal: () => void;
+};
+
+export const RebalanceServerStatusOp = (
+ { rebalanceServerStatus, hideModal } : RebalanceServerStatusOpProps
+) => {
+ const [jobSelected, setJobSelected] = useState<string | null>(null);
+
+ const BackAction = () => {
+ return (
+ <Button
+ style={{ textTransform: 'none' }}
+ variant='outlined'
+ color='primary'
+ onClick={() => setJobSelected(null)}
+ >
+ Back
+ </Button>
+ );
+ }
+ return (
+ <Dialog
+ open={true}
+ handleClose={hideModal}
+ title="Rebalance Table Status"
+ showOkBtn={false}
+ size='lg'
+ moreActions={jobSelected ? <BackAction /> : null}
+ >
+ <DialogContent>
+ {
+ !jobSelected ?
+ <CustomizedTables
+ title='Job Status'
+ isCellClickable
+ makeOnlyFirstCellClickable
+ cellClickCallback={(cell: string) => {
+ setJobSelected(cell);
+ }}
+ data={{
+ records: Object.keys(rebalanceServerStatus).map(jobId => {
+ const progressStats = JSON.parse(rebalanceServerStatus[jobId].REBALANCE_PROGRESS_STATS);
+ return [
+ rebalanceServerStatus[jobId].jobId,
+ rebalanceServerStatus[jobId].tableName,
+ progressStats.status,
+ moment(+rebalanceServerStatus[jobId].submissionTimeMs).format("MMMM Do YYYY, HH:mm:ss")
+ ];
+ }),
+ columns: ['Job id', 'Table name', 'Status', 'Started at']
+ }}
+ showSearchBox
+ /> :
+ <Grid container spacing={2}>
+ <Grid item xs={12}>
+ <RebalanceServerResponseCard>
+ <RebalanceServerSection sectionTitle={"Progress Stats"} canHideSection showSectionByDefault={true}>
+ <CustomCodemirror
+ customClass='rebalance_server_response_section'
+ data={JSON.parse(rebalanceServerStatus[jobSelected].REBALANCE_PROGRESS_STATS)}
+ isEditable={false}
Review Comment:
JSON.parse can throw exception. need to handle exception somewhere
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "jayeshchoudhary (via GitHub)" <gi...@apache.org>.
jayeshchoudhary commented on code in PR #15400:
URL: https://github.com/apache/pinot/pull/15400#discussion_r2020181103
##########
pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx:
##########
@@ -0,0 +1,128 @@
+/**
+ * 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 {
+ Button,
+ DialogContent,
+ Grid
+} from "@material-ui/core";
+import Dialog from "../../CustomDialog";
+import React, {useState} from "react";
+import moment from "moment/moment";
+import {RebalanceServerSection} from "./RebalanceServer/RebalanceServerSection";
+import CustomCodemirror from "../../CustomCodemirror";
+import './RebalanceServer/RebalanceServerResponses/CustomCodeMirror.css';
+import {RebalanceServerResponseCard} from "./RebalanceServer/RebalanceServerResponses/RebalanceServerResponseCard";
+import CustomizedTables from "../../Table";
+
+export type RebalanceTableSegmentJobs = {
+ [key: string]: {
+ jobId: string,
+ messageCount: number,
+ submissionTimeMs: number,
+ jobType: string,
+ tableName: string,
+ REBALANCE_PROGRESS_STATS: string,
+ REBALANCE_CONTEXT: string;
+ }
+}
+
+type RebalanceServerStatusOpProps = {
+ rebalanceServerStatus: RebalanceTableSegmentJobs;
+ hideModal: () => void;
+};
+
+export const RebalanceServerStatusOp = (
+ { rebalanceServerStatus, hideModal } : RebalanceServerStatusOpProps
+) => {
+ const [jobSelected, setJobSelected] = useState<string | null>(null);
+
+ const BackAction = () => {
+ return (
+ <Button
+ style={{ textTransform: 'none' }}
+ variant='outlined'
+ color='primary'
+ onClick={() => setJobSelected(null)}
+ >
+ Back
+ </Button>
+ );
+ }
+ return (
+ <Dialog
+ open={true}
+ handleClose={hideModal}
+ title="Rebalance Table Status"
+ showOkBtn={false}
+ size='lg'
+ moreActions={jobSelected ? <BackAction /> : null}
+ >
+ <DialogContent>
+ {
+ !jobSelected ?
+ <CustomizedTables
+ title='Job Status'
+ isCellClickable
+ makeOnlyFirstCellClickable
+ cellClickCallback={(cell: string) => {
+ setJobSelected(cell);
+ }}
+ data={{
+ records: Object.keys(rebalanceServerStatus).map(jobId => {
+ const progressStats = JSON.parse(rebalanceServerStatus[jobId].REBALANCE_PROGRESS_STATS);
+ return [
+ rebalanceServerStatus[jobId].jobId,
+ rebalanceServerStatus[jobId].tableName,
+ progressStats.status,
+ moment(+rebalanceServerStatus[jobId].submissionTimeMs).format("MMMM Do YYYY, HH:mm:ss")
+ ];
Review Comment:
can we calculate this in the variable somewhere
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "himanish-star (via GitHub)" <gi...@apache.org>.
himanish-star commented on code in PR #15400:
URL: https://github.com/apache/pinot/pull/15400#discussion_r2026166219
##########
pinot-controller/src/main/resources/app/components/Table.tsx:
##########
@@ -562,7 +564,7 @@ export default function CustomizedTables({
) : (
<StyledTableCell
key={idx}
- className={isCellClickable ? classes.isCellClickable : (isSticky ? classes.isSticky : '')}
+ className={isCellClickable && (!makeOnlyFirstCellClickable || !idx) ? classes.isCellClickable : (isSticky ? classes.isSticky : '')}
Review Comment:
Reload status doesn't use the generic table and creates a table of it's own
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "himanish-star (via GitHub)" <gi...@apache.org>.
himanish-star commented on code in PR #15400:
URL: https://github.com/apache/pinot/pull/15400#discussion_r2024443959
##########
pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx:
##########
@@ -0,0 +1,128 @@
+/**
+ * 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 {
+ Button,
+ DialogContent,
+ Grid
+} from "@material-ui/core";
+import Dialog from "../../CustomDialog";
+import React, {useState} from "react";
+import moment from "moment/moment";
+import {RebalanceServerSection} from "./RebalanceServer/RebalanceServerSection";
+import CustomCodemirror from "../../CustomCodemirror";
+import './RebalanceServer/RebalanceServerResponses/CustomCodeMirror.css';
+import {RebalanceServerResponseCard} from "./RebalanceServer/RebalanceServerResponses/RebalanceServerResponseCard";
+import CustomizedTables from "../../Table";
+
+export type RebalanceTableSegmentJobs = {
+ [key: string]: {
+ jobId: string,
+ messageCount: number,
+ submissionTimeMs: number,
+ jobType: string,
+ tableName: string,
+ REBALANCE_PROGRESS_STATS: string,
+ REBALANCE_CONTEXT: string;
+ }
+}
+
+type RebalanceServerStatusOpProps = {
+ rebalanceServerStatus: RebalanceTableSegmentJobs;
+ hideModal: () => void;
+};
+
+export const RebalanceServerStatusOp = (
+ { rebalanceServerStatus, hideModal } : RebalanceServerStatusOpProps
+) => {
+ const [jobSelected, setJobSelected] = useState<string | null>(null);
+
+ const BackAction = () => {
+ return (
+ <Button
+ style={{ textTransform: 'none' }}
+ variant='outlined'
+ color='primary'
+ onClick={() => setJobSelected(null)}
+ >
+ Back
+ </Button>
+ );
+ }
+ return (
+ <Dialog
+ open={true}
+ handleClose={hideModal}
+ title="Rebalance Table Status"
+ showOkBtn={false}
+ size='lg'
+ moreActions={jobSelected ? <BackAction /> : null}
+ >
+ <DialogContent>
+ {
+ !jobSelected ?
+ <CustomizedTables
+ title='Job Status'
+ isCellClickable
+ makeOnlyFirstCellClickable
+ cellClickCallback={(cell: string) => {
+ setJobSelected(cell);
+ }}
+ data={{
+ records: Object.keys(rebalanceServerStatus).map(jobId => {
+ const progressStats = JSON.parse(rebalanceServerStatus[jobId].REBALANCE_PROGRESS_STATS);
+ return [
+ rebalanceServerStatus[jobId].jobId,
+ rebalanceServerStatus[jobId].tableName,
+ progressStats.status,
+ moment(+rebalanceServerStatus[jobId].submissionTimeMs).format("MMMM Do YYYY, HH:mm:ss")
+ ];
Review Comment:
Sure
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Feature: New UI to monitor Rebalance Server Status [pinot]
Posted by "himanish-star (via GitHub)" <gi...@apache.org>.
himanish-star commented on code in PR #15400:
URL: https://github.com/apache/pinot/pull/15400#discussion_r2024545990
##########
pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx:
##########
@@ -0,0 +1,128 @@
+/**
+ * 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 {
+ Button,
+ DialogContent,
+ Grid
+} from "@material-ui/core";
+import Dialog from "../../CustomDialog";
+import React, {useState} from "react";
+import moment from "moment/moment";
+import {RebalanceServerSection} from "./RebalanceServer/RebalanceServerSection";
+import CustomCodemirror from "../../CustomCodemirror";
+import './RebalanceServer/RebalanceServerResponses/CustomCodeMirror.css';
+import {RebalanceServerResponseCard} from "./RebalanceServer/RebalanceServerResponses/RebalanceServerResponseCard";
+import CustomizedTables from "../../Table";
+
+export type RebalanceTableSegmentJobs = {
+ [key: string]: {
+ jobId: string,
+ messageCount: number,
+ submissionTimeMs: number,
+ jobType: string,
+ tableName: string,
+ REBALANCE_PROGRESS_STATS: string,
+ REBALANCE_CONTEXT: string;
+ }
+}
+
+type RebalanceServerStatusOpProps = {
+ rebalanceServerStatus: RebalanceTableSegmentJobs;
+ hideModal: () => void;
+};
+
+export const RebalanceServerStatusOp = (
+ { rebalanceServerStatus, hideModal } : RebalanceServerStatusOpProps
+) => {
+ const [jobSelected, setJobSelected] = useState<string | null>(null);
+
+ const BackAction = () => {
+ return (
+ <Button
+ style={{ textTransform: 'none' }}
+ variant='outlined'
+ color='primary'
+ onClick={() => setJobSelected(null)}
+ >
+ Back
+ </Button>
+ );
+ }
+ return (
+ <Dialog
+ open={true}
+ handleClose={hideModal}
+ title="Rebalance Table Status"
+ showOkBtn={false}
+ size='lg'
+ moreActions={jobSelected ? <BackAction /> : null}
+ >
+ <DialogContent>
+ {
+ !jobSelected ?
+ <CustomizedTables
+ title='Job Status'
+ isCellClickable
+ makeOnlyFirstCellClickable
+ cellClickCallback={(cell: string) => {
+ setJobSelected(cell);
+ }}
+ data={{
+ records: Object.keys(rebalanceServerStatus).map(jobId => {
+ const progressStats = JSON.parse(rebalanceServerStatus[jobId].REBALANCE_PROGRESS_STATS);
+ return [
+ rebalanceServerStatus[jobId].jobId,
+ rebalanceServerStatus[jobId].tableName,
+ progressStats.status,
+ moment(+rebalanceServerStatus[jobId].submissionTimeMs).format("MMMM Do YYYY, HH:mm:ss")
+ ];
Review Comment:
Moved this to `UTIL`
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org