walterddr commented on code in PR #9521:
URL: https://github.com/apache/pinot/pull/9521#discussion_r1355399536
##########
pinot-controller/src/main/resources/app/pages/TenantDetails.tsx:
##########
@@ -319,19 +325,62 @@ const TenantPageDetails = ({ match }:
RouteComponentProps<Props>) => {
const reloadSegments = async () => {
const result = await PinotMethodUtils.reloadAllSegmentsOp(tableName,
tableType);
- syncResponse(result);
+
+ let reloadJobId = null;
+
+ try {
+ // extract reloadJobId from response
+ const statusResponseObj = JSON.parse(result.status.replace("Segment
reload details: ", ""))
+ reloadJobId = get(statusResponseObj, `${tableName}.reloadJobId`, null)
+ } catch {
+ reloadJobId = null;
+ }
+
+ const handleCopyReloadJobId = () => {
+ if(!reloadJobId) {
+ return;
+ }
+ navigator.clipboard.writeText(reloadJobId);
+ }
+
+ const customMessage = (
+ <Box>
+ <Typography variant='inherit'>{result.status}</Typography>
+ <Button
+ className={classes.copyIdButton}
+ variant="outlined"
+ color="inherit"
+ size="small"
+ onClick={handleCopyReloadJobId}
+ >
+ Copy Id
+ </Button>
+ </Box>
+ )
+
+ syncResponse(result, reloadJobId && customMessage);
};
const handleReloadStatus = async () => {
- const result = await PinotMethodUtils.reloadStatusOp(tableName, tableType);
- if(result.error){
- setShowReloadStatusModal(false);
- dispatch({type: 'error', message: result.error, show: true});
+ try{
+ setShowReloadStatusModal(true);
+ const [reloadStatusData, tableJobsData] = await Promise.all([
+ PinotMethodUtils.reloadStatusOp(tableName, tableType),
Review Comment:
instead of hitting a reloadStatusOp entirely --> suggest using one of the
segments
--
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]