Skip to content

Commit 5fa46ac

Browse files
prakhar10mosabua
authored andcommitted
Add UNKNOWN state explicitly in switch case and add javadoc
1 parent bd31abe commit 5fa46ac

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

gateway-ha/src/main/java/io/trino/gateway/ha/clustermonitor/TrinoStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* We should use PENDING when Trino clusters are still spinning up
1919
* HEALTHY is when health checks report clusters as up
2020
* UNHEALTHY is when health checks report clusters as down
21-
* UNKNOWN is when the health checks are not able to determine the status
21+
* UNKNOWN is the initial default state and also used when the health checks are not able to determine the status
2222
*/
2323
public enum TrinoStatus
2424
{

webapp/src/components/cluster.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,13 @@ export function Cluster() {
7676
case 'PENDING':
7777
statusColor = 'yellow';
7878
break;
79+
case 'UNKNOWN':
80+
statusColor = 'white';
81+
break;
7982
default:
83+
//This should never happen, but just in case defaulting to UNKNOWN state setup as a safety net
8084
statusColor = 'white';
85+
break;
8186
}
8287
return <Tag color={statusColor}>{text}</Tag>;
8388
};

0 commit comments

Comments
 (0)