capistrant commented on code in PR #19253:
URL: https://github.com/apache/druid/pull/19253#discussion_r3114394621
##########
web-console/src/views/services-view/services-view.tsx:
##########
@@ -220,6 +243,100 @@ function aggregateLoadQueueInfos(loadQueueInfos:
LoadQueueInfo[]): LoadQueueInfo
};
}
+interface DetailCellProps {
+ original: ServiceResultRow;
+ workerInfoLookup: Record<string, WorkerInfo>;
+}
+
+function DetailCell({ original, workerInfoLookup }: DetailCellProps) {
+ const { service_type, service, is_leader } = original;
+ const loadQueueInfoContext = useContext(LoadQueueInfoContext);
+ const cloneStatusContext = useContext(CloneStatusContext);
+ const serverModeInfo = useContext(ServerModeContext);
+
+ switch (service_type) {
+ case 'middle_manager':
+ case 'indexer': {
+ const workerInfo = workerInfoLookup[service];
+ if (!workerInfo) return null;
+
+ if (workerInfo.worker.version === '') return <>Disabled</>;
+
+ const details: string[] = [];
+ if (workerInfo.lastCompletedTaskTime) {
+ details.push(`Last completed task:
${formatDate(workerInfo.lastCompletedTaskTime)}`);
+ }
+ if (workerInfo.blacklistedUntil) {
+ details.push(`Blacklisted until:
${formatDate(workerInfo.blacklistedUntil)}`);
+ }
+ return <>{details.join(' ') || null}</>;
+ }
+
+ case 'coordinator':
+ case 'overlord':
+ return <>{is_leader === 1 ? 'Leader' : ''}</>;
+
+ case 'historical': {
+ const loadQueueInfo = loadQueueInfoContext[service];
+ const cloneInfo = cloneStatusContext[service];
+
+ const parts: string[] = [];
+ if (serverModeInfo.decommissioningNodes.has(service)) {
+ parts.push('DECOMMISSIONING');
+ }
+ if (serverModeInfo.turboLoadingNodes.has(service)) {
+ parts.push('TURBO SEGMENT LOADING');
+ }
+ if (loadQueueInfo) {
+ parts.push(formatLoadQueueInfo(loadQueueInfo));
+ }
+ if (cloneInfo) {
+ if (cloneInfo.state === 'SOURCE_SERVER_MISSING') {
+ parts.push(`Clone of ${cloneInfo.sourceServer} (source missing)`);
+ } else if (cloneInfo.segmentLoadsRemaining > 0 ||
cloneInfo.segmentDropsRemaining > 0) {
+ const details: string[] = [];
+ if (cloneInfo.segmentLoadsRemaining > 0) {
+ details.push(
+ `${pluralIfNeeded(
+ cloneInfo.segmentLoadsRemaining,
+ 'segment',
+ )} to load (${formatBytesCompact(cloneInfo.bytesToLoad)})`,
+ );
+ }
+ if (cloneInfo.segmentDropsRemaining > 0) {
+ details.push(`${pluralIfNeeded(cloneInfo.segmentDropsRemaining,
'segment')} to drop`);
+ }
+ parts.push(`Cloning from ${cloneInfo.sourceServer}:
${details.join(', ')}`);
+ } else {
+ parts.push(`Clone of ${cloneInfo.sourceServer} (synced)`);
+ }
+ }
+ return <>{parts.join('; ') || null}</>;
+ }
+
+ default:
+ return null;
+ }
+}
+
+interface AggregatedDetailCellProps {
+ subRows: { _original: ServiceResultRow }[];
+}
+
+function AggregatedDetailCell({ subRows }: AggregatedDetailCellProps) {
Review Comment:
ok added aggregation support for turbo and decom as well as cloning. I split
cloning agg into 3 groups.
cloning, cloned, and clone error (right now clone error is just pinned on
having an invalid source server defined)
--
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]