Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package io.trino.gateway.ha.module;

import com.google.common.collect.ImmutableList;
import com.google.inject.Provides;
import com.google.inject.Singleton;
import io.dropwizard.core.setup.Environment;
Expand All @@ -26,13 +27,11 @@
import io.trino.gateway.ha.router.BackendStateManager;
import io.trino.gateway.ha.router.RoutingManager;

import java.util.ArrayList;
import java.util.List;

public class ClusterStateListenerModule
extends AppModule<HaGatewayConfiguration, Environment>
{
List<TrinoClusterStatsObserver> observers;
MonitorConfiguration monitorConfig;

public ClusterStateListenerModule(HaGatewayConfiguration config, Environment env)
Expand All @@ -51,11 +50,10 @@ public List<TrinoClusterStatsObserver> getClusterStatsObservers(
RoutingManager mgr,
BackendStateManager backendStateManager)
{
observers = new ArrayList<>();
observers.add(new HealthCheckObserver(mgr));
observers.add(new ClusterStatsObserver(backendStateManager));

return observers;
return ImmutableList.<TrinoClusterStatsObserver>builder()
.add(new HealthCheckObserver(mgr))
.add(new ClusterStatsObserver(backendStateManager))
.build();
}

@Provides
Expand Down