Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions pinot-controller/src/main/resources/app/pages/TaskDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import React, { useEffect, useState } from 'react';
import { get, each } from 'lodash';
import moment from 'moment';
import { Grid, makeStyles } from '@material-ui/core';
import PinotMethodUtils from '../utils/PinotMethodUtils';
import CustomizedTables from '../components/Table';
Expand Down Expand Up @@ -104,9 +103,6 @@ const TaskDetail = (props) => {
<Grid item xs={12}>
<strong>Start Time:</strong> {get(taskDebugData, 'startTime', '')}
</Grid>
<Grid item xs={12}>
<strong>Elapsed Time:</strong> {get(taskDebugData, 'startTime') ? PinotMethodUtils.getElapsedTime(moment(get(taskDebugData, 'startTime'), 'YYYY-MM-DD hh:mm:ss')) : ''}
</Grid>
<Grid item xs={12}>
<strong>Finish Time:</strong> {get(taskDebugData, 'subtaskInfos.0.finishTime', '')}
</Grid>
Expand Down
13 changes: 10 additions & 3 deletions pinot-controller/src/main/resources/app/pages/TaskQueueTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/

import React, { useEffect, useState, useContext } from 'react';
import { get } from 'lodash';
import { get, keys, last } from 'lodash';
import moment from 'moment';
import { UnControlled as CodeMirror } from 'react-codemirror2';
import { Grid, makeStyles } from '@material-ui/core';
import { Grid, makeStyles, Box } from '@material-ui/core';
import { NotificationContext } from '../components/Notification/NotificationContext';
import SimpleAccordion from '../components/SimpleAccordion';
import CustomButton from '../components/CustomButton';
Expand Down Expand Up @@ -83,6 +83,7 @@ const TaskQueueTable = (props) => {
const [fetching, setFetching] = useState(true);
const [jobDetail, setJobDetail] = useState({});
const [tableDetail, setTableDetail] = useState({});
const [mostRecentErrorRunMessage, setMostRecentErrorRunMessage] = useState('');
const scheduleAdhocModal = useScheduleAdhocModal();
const minionMetadata = useMinionMetadata({ taskType, tableName });
const taskListing = useTaskListing({ taskType, tableName });
Expand All @@ -91,6 +92,10 @@ const TaskQueueTable = (props) => {
setFetching(true);
const detail = await PinotMethodUtils.getScheduleJobDetail(tableName, taskType);
const tableDetailRes = await PinotMethodUtils.getTableDetails(tableName);
const taskGeneratorDebugData = await PinotMethodUtils.getTaskGeneratorDebugData(tableName, taskType);
const mostRecentErrorRunMessagesTS = get(taskGeneratorDebugData, 'data.0.mostRecentErrorRunMessages', {});
const mostRecentErrorRunMessagesTSLastTime = last(keys(mostRecentErrorRunMessagesTS).sort());
setMostRecentErrorRunMessage(get(mostRecentErrorRunMessagesTS, mostRecentErrorRunMessagesTSLastTime, ''));
setTableDetail(tableDetailRes);
setJobDetail(detail);
setFetching(false);
Expand Down Expand Up @@ -197,7 +202,9 @@ const TaskQueueTable = (props) => {
headerTitle="Scheduling Errors"
showSearchBox={false}
>

<Box p={3} style={{ overflow: 'auto' }}>
{mostRecentErrorRunMessage}
</Box>
</SimpleAccordion>
</div>
</Grid>
Expand Down
3 changes: 3 additions & 0 deletions pinot-controller/src/main/resources/app/requests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ export const getTasks = (tableName: string, taskType: string): Promise<AxiosResp
export const getTaskDebug = (taskName: string): Promise<AxiosResponse<OperationResponse>> =>
baseApi.get(`/tasks/task/${taskName}/debug?verbosity=1`, { headers: { ...headers, Accept: 'application/json' } });

export const getTaskGeneratorDebug = (taskName: string, taskType: string): Promise<AxiosResponse<OperationResponse>> =>
baseApi.get(`/tasks/generator/${taskName}/${taskType}/debug`, { headers: { ...headers, Accept: 'application/json' } });

export const getTaskTypeDebug = (taskType: string): Promise<AxiosResponse<OperationResponse>> =>
baseApi.get(`/tasks/${taskType}/debug?verbosity=1`, { headers: { ...headers, Accept: 'application/json' } });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
getMinionMeta,
getTasks,
getTaskDebug,
getTaskGeneratorDebug,
updateInstanceTags,
getClusterConfig,
getQueryTables,
Expand Down Expand Up @@ -797,7 +798,7 @@ const getElapsedTime = (startTime) => {

const getTasksList = async (tableName, taskType) => {
const finalResponse = {
columns: ['Task ID', 'Status', 'Start Time', 'Elapsed Time', 'Finish Time', 'Num of Sub Tasks'],
columns: ['Task ID', 'Status', 'Start Time', 'Finish Time', 'Num of Sub Tasks'],
records: []
}
await new Promise((resolve, reject) => {
Expand All @@ -810,7 +811,6 @@ const getTasksList = async (tableName, taskType) => {
taskID,
status,
get(debugData, 'data.subtaskInfos.0.startTime'),
startTime ? getElapsedTime(startTime) : '',
get(debugData, 'data.subtaskInfos.0.finishTime', ''),
get(debugData, 'data.subtaskCount.total', 0)
]);
Expand All @@ -830,6 +830,11 @@ const getTaskDebugData = async (taskName) => {
return debugRes;
};

const getTaskGeneratorDebugData = async (taskName, taskType) => {
const debugRes = await getTaskGeneratorDebug(taskName, taskType);
return debugRes;
};

const reloadSegmentOp = (tableName, segmentName) => {
return reloadSegment(tableName, segmentName).then((response)=>{
return response.data;
Expand Down Expand Up @@ -1102,6 +1107,7 @@ export default {
getElapsedTime,
getTasksList,
getTaskDebugData,
getTaskGeneratorDebugData,
deleteSegmentOp,
reloadSegmentOp,
reloadStatusOp,
Expand Down