Skip to content

Commit

Permalink
Remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Dec 31, 2023
1 parent e4eb375 commit 3fee1b3
Show file tree
Hide file tree
Showing 38 changed files with 18 additions and 1,543 deletions.
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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*/
package io.trino.gateway.ha.config;

import java.util.Objects;

public class AuthenticationConfiguration
{
private String defaultType;
Expand Down Expand Up @@ -59,58 +57,4 @@ public void setForm(FormAuthConfiguration form)
{
this.form = form;
}

public boolean equals(final Object o)
{
if (o == this) {
return true;
}
if (!(o instanceof AuthenticationConfiguration other)) {
return false;
}
if (!other.canEqual(this)) {
return false;
}
final Object defaultType = this.getDefaultType();
final Object otherDefaultType = other.getDefaultType();
if (!Objects.equals(defaultType, otherDefaultType)) {
return false;
}
final Object oauth = this.getOauth();
final Object otherOauth = other.getOauth();
if (!Objects.equals(oauth, otherOauth)) {
return false;
}
final Object form = this.getForm();
final Object otherForm = other.getForm();
return Objects.equals(form, otherForm);
}

protected boolean canEqual(final Object other)
{
return other instanceof AuthenticationConfiguration;
}

public int hashCode()
{
final int prime = 59;
int result = 1;
final Object defaultType = this.getDefaultType();
result = result * prime + (defaultType == null ? 43 : defaultType.hashCode());
final Object oauth = this.getOauth();
result = result * prime + (oauth == null ? 43 : oauth.hashCode());
final Object form = this.getForm();
result = result * prime + (form == null ? 43 : form.hashCode());
return result;
}

@Override
public String toString()
{
return "AuthenticationConfiguration{" +
"defaultType='" + defaultType + '\'' +
", oauth=" + oauth +
", form=" + form +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*/
package io.trino.gateway.ha.config;

import java.util.Objects;

public class AuthorizationConfiguration
{
private String admin;
Expand Down Expand Up @@ -71,66 +69,4 @@ public void setLdapConfigPath(String ldapConfigPath)
{
this.ldapConfigPath = ldapConfigPath;
}

public boolean equals(final Object o)
{
if (o == this) {
return true;
}
if (!(o instanceof AuthorizationConfiguration other)) {
return false;
}
if (!other.canEqual(this)) {
return false;
}
final Object admin = this.getAdmin();
final Object otherAdmin = other.getAdmin();
if (!Objects.equals(admin, otherAdmin)) {
return false;
}
final Object user = this.getUser();
final Object otherUser = other.getUser();
if (!Objects.equals(user, otherUser)) {
return false;
}
final Object api = this.getApi();
final Object otherApi = other.getApi();
if (!Objects.equals(api, otherApi)) {
return false;
}
final Object ldapConfigPath = this.getLdapConfigPath();
final Object otherLdapConfigPath = other.getLdapConfigPath();
return Objects.equals(ldapConfigPath, otherLdapConfigPath);
}

protected boolean canEqual(final Object other)
{
return other instanceof AuthorizationConfiguration;
}

public int hashCode()
{
final int prime = 59;
int result = 1;
final Object admin = this.getAdmin();
result = result * prime + (admin == null ? 43 : admin.hashCode());
final Object user = this.getUser();
result = result * prime + (user == null ? 43 : user.hashCode());
final Object api = this.getApi();
result = result * prime + (api == null ? 43 : api.hashCode());
final Object ldapConfigPath = this.getLdapConfigPath();
result = result * prime + (ldapConfigPath == null ? 43 : ldapConfigPath.hashCode());
return result;
}

@Override
public String toString()
{
return "AuthorizationConfiguration{" +
"admin='" + admin + '\'' +
", user='" + user + '\'' +
", api='" + api + '\'' +
", ldapConfigPath='" + ldapConfigPath + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*/
package io.trino.gateway.ha.config;

import java.util.Objects;

public class BackendStateConfiguration
{
private String username;
Expand Down Expand Up @@ -52,58 +50,4 @@ public void setSsl(Boolean ssl)
{
this.ssl = ssl;
}

public boolean equals(final Object o)
{
if (o == this) {
return true;
}
if (!(o instanceof BackendStateConfiguration other)) {
return false;
}
if (!other.canEqual(this)) {
return false;
}
final Object username = this.getUsername();
final Object otherUsername = other.getUsername();
if (!Objects.equals(username, otherUsername)) {
return false;
}
final Object password = this.getPassword();
final Object otherPassword = other.getPassword();
if (!Objects.equals(password, otherPassword)) {
return false;
}
final Object ssl = this.getSsl();
final Object otherSsl = other.getSsl();
return Objects.equals(ssl, otherSsl);
}

protected boolean canEqual(final Object other)
{
return other instanceof BackendStateConfiguration;
}

public int hashCode()
{
final int prime = 59;
int result = 1;
final Object username = this.getUsername();
result = result * prime + (username == null ? 43 : username.hashCode());
final Object password = this.getPassword();
result = result * prime + (password == null ? 43 : password.hashCode());
final Object ssl = this.getSsl();
result = result * prime + (ssl == null ? 43 : ssl.hashCode());
return result;
}

@Override
public String toString()
{
return "BackendStateConfiguration{" +
"username='" + username + '\'' +
", password='" + password + '\'' +
", ssl=" + ssl +
'}';
}
}
Loading

0 comments on commit 3fee1b3

Please sign in to comment.