Skip to content

Commit bd31abe

Browse files
prakhar10mosabua
authored andcommitted
Make UNKNOWN healthcheck state default in ClusterStats builder
1 parent 0d65d55 commit bd31abe

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static final class Builder
4141
private int runningQueryCount;
4242
private int queuedQueryCount;
4343
private int numWorkerNodes;
44-
private TrinoStatus trinoStatus;
44+
private TrinoStatus trinoStatus = TrinoStatus.UNKNOWN;
4545
private String proxyTo;
4646
private String externalUrl;
4747
private String routingGroup;

gateway-ha/src/main/java/io/trino/gateway/ha/resource/GatewayWebAppResource.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import com.google.common.base.Strings;
1717
import com.google.inject.Inject;
1818
import io.trino.gateway.ha.clustermonitor.ClusterStats;
19-
import io.trino.gateway.ha.clustermonitor.TrinoStatus;
2019
import io.trino.gateway.ha.config.ProxyBackendConfiguration;
2120
import io.trino.gateway.ha.domain.Result;
2221
import io.trino.gateway.ha.domain.TableData;
@@ -98,12 +97,7 @@ public Response getAllBackends()
9897
backendResponse.setName(b.getName());
9998
backendResponse.setProxyTo(b.getProxyTo());
10099
backendResponse.setActive(b.isActive());
101-
if (Objects.isNull(backendState.trinoStatus())) {
102-
backendResponse.setStatus(TrinoStatus.UNKNOWN.toString());
103-
}
104-
else {
105-
backendResponse.setStatus(backendState.trinoStatus().toString());
106-
}
100+
backendResponse.setStatus(backendState.trinoStatus().toString());
107101
backendResponse.setRoutingGroup(b.getRoutingGroup());
108102
backendResponse.setExternalUrl(b.getExternalUrl());
109103
return backendResponse;

0 commit comments

Comments
 (0)