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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import io.dropwizard.lifecycle.Managed;
import io.trino.gateway.ha.config.MonitorConfiguration;
import io.trino.gateway.ha.config.ProxyBackendConfiguration;
import io.trino.gateway.ha.router.BackendStateManager;
import io.trino.gateway.ha.router.GatewayBackendManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -39,7 +38,6 @@ public class ActiveClusterMonitor

private final List<TrinoClusterStatsObserver> clusterStatsObservers;
private final GatewayBackendManager gatewayBackendManager;
private final BackendStateManager backendStateManager;
private final int connectionTimeout;
private final int taskDelayMin;
private final ClusterStatsMonitor clusterStatsMonitor;
Expand All @@ -52,14 +50,12 @@ public ActiveClusterMonitor(
List<TrinoClusterStatsObserver> clusterStatsObservers,
GatewayBackendManager gatewayBackendManager,
MonitorConfiguration monitorConfiguration,
BackendStateManager backendStateManager,
ClusterStatsMonitor clusterStatsMonitor)
{
this.clusterStatsObservers = clusterStatsObservers;
this.gatewayBackendManager = gatewayBackendManager;
this.connectionTimeout = monitorConfiguration.getConnectionTimeout();
this.taskDelayMin = monitorConfiguration.getTaskDelayMin();
this.backendStateManager = backendStateManager;
this.clusterStatsMonitor = clusterStatsMonitor;
log.info("Running cluster monitor with connection timeout of {} and task delay of {}",
connectionTimeout, taskDelayMin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ public ClusterStats monitor(ProxyBackendConfiguration backend)
}

try {
HashMap<String, Object> result = null;
result = new ObjectMapper().readValue(response, HashMap.class);
HashMap<String, Object> result = new ObjectMapper().readValue(response, HashMap.class);

clusterStats.setNumWorkerNodes((int) result.get("activeWorkers"));
clusterStats.setQueuedQueryCount((int) result.get("queuedQueries"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ public TrinoQueueLengthRoutingTable(GatewayBackendManager gatewayBackendManager,
*/
private int getWeightForMaxQueueCluster(LinkedHashMap<String, Integer> sortedByQueueLength)
{
int queueSum = 0;
int numBuckets = 1;
int equalDistribution = 0;
int calculatedWtMaxQueue = 0;
int queueSum;
int numBuckets;
int equalDistribution;
int calculatedWtMaxQueue;

numBuckets = sortedByQueueLength.size();
queueSum = sortedByQueueLength.values().stream().mapToInt(Integer::intValue).sum();
Expand Down Expand Up @@ -133,12 +133,8 @@ private void computeWeightsBasedOnQueueLength(ConcurrentHashMap<String,
{
synchronized (lockObject) {
int sum = 0;
int queueSum = 0;
int weight;
int numBuckets = 1;
int equalDistribution = 0;
int smallestQueueLn = 0;
int lastButOneQueueLn = 0;
int maxQueueLn = 0;
int calculatedWtMaxQueue = 0;

Expand Down Expand Up @@ -171,7 +167,6 @@ else if (queueLengthMap.get(routingGroup).size() == 1) {
(e1, e2) -> e1, LinkedHashMap::new));

numBuckets = sortedByQueueLength.size();
queueSum = sortedByQueueLength.values().stream().mapToInt(Integer::intValue).sum();

Object[] queueLengths = sortedByQueueLength.values().toArray();
Object[] clusterNames = sortedByQueueLength.keySet().toArray();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class LbFormAuthManager
*/
private final LbKeyProvider lbKeyProvider;
Map<String, UserConfiguration> presetUsers;
private LdapConfiguration ldapConfiguration;
private final LbLdapClient lbLdapClient;

public LbFormAuthManager(FormAuthConfiguration configuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ private void createResourceGroup()
resourceGroup.setJmxExport(true);
resourceGroup.setSoftMemoryLimit("80%");

ResourceGroupsDetail newResourceGroup = resourceGroupManager.createResourceGroup(resourceGroup,
specificDb);
resourceGroupManager.createResourceGroup(resourceGroup, specificDb);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ private void registerBackEndsWithUserQueue(String groupName, int numBackends,
int mockRunningLength = 0;
String backend;

Map<String, Integer> queueLengths = new HashMap<>();
Map<String, Integer> runningLengths = new HashMap<>();
Table<String, String, Integer> userClusterQueue = HashBasedTable.create();

Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@
<failOnWarning>false</failOnWarning>
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne</arg>
<arg>-Xplugin:ErrorProne \
-Xep:UnusedVariable:ERROR</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
Expand Down