Commit a968b4be by Ryan Baxter Committed by GitHub

Merge pull request #2112 from gzurowski/remove-lombok-from-turbine

Remove Lombok from spring-cloud-netflix-turbine module
parents 65902d11 0dea44ac
...@@ -90,13 +90,6 @@ ...@@ -90,13 +90,6 @@
<artifactId>turbine-core</artifactId> <artifactId>turbine-core</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<!-- Only needed at compile time -->
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
......
...@@ -21,6 +21,8 @@ import java.util.Collection; ...@@ -21,6 +21,8 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.cloud.client.ServiceInstance; import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient; import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.expression.Expression; import org.springframework.expression.Expression;
...@@ -30,8 +32,6 @@ import org.springframework.expression.spel.support.StandardEvaluationContext; ...@@ -30,8 +32,6 @@ import org.springframework.expression.spel.support.StandardEvaluationContext;
import com.netflix.turbine.discovery.Instance; import com.netflix.turbine.discovery.Instance;
import com.netflix.turbine.discovery.InstanceDiscovery; import com.netflix.turbine.discovery.InstanceDiscovery;
import lombok.extern.apachecommons.CommonsLog;
/** /**
* Class that encapsulates an {@link InstanceDiscovery} * Class that encapsulates an {@link InstanceDiscovery}
* implementation that uses Spring Cloud Commons (see https://github.com/spring-cloud/spring-cloud-commons) * implementation that uses Spring Cloud Commons (see https://github.com/spring-cloud/spring-cloud-commons)
...@@ -45,9 +45,10 @@ import lombok.extern.apachecommons.CommonsLog; ...@@ -45,9 +45,10 @@ import lombok.extern.apachecommons.CommonsLog;
* *
* @author Spencer Gibb * @author Spencer Gibb
*/ */
@CommonsLog
public class CommonsInstanceDiscovery implements InstanceDiscovery { public class CommonsInstanceDiscovery implements InstanceDiscovery {
private static final Log log = LogFactory.getLog(CommonsInstanceDiscovery.class);
private static final String DEFAULT_CLUSTER_NAME_EXPRESSION = "serviceId"; private static final String DEFAULT_CLUSTER_NAME_EXPRESSION = "serviceId";
protected static final String PORT_KEY = "port"; protected static final String PORT_KEY = "port";
protected static final String SECURE_PORT_KEY = "securePort"; protected static final String SECURE_PORT_KEY = "securePort";
......
...@@ -27,8 +27,8 @@ import com.netflix.appinfo.InstanceInfo.InstanceStatus; ...@@ -27,8 +27,8 @@ import com.netflix.appinfo.InstanceInfo.InstanceStatus;
import com.netflix.discovery.EurekaClient; import com.netflix.discovery.EurekaClient;
import com.netflix.discovery.shared.Application; import com.netflix.discovery.shared.Application;
import com.netflix.turbine.discovery.Instance; import com.netflix.turbine.discovery.Instance;
import org.apache.commons.logging.Log;
import lombok.extern.apachecommons.CommonsLog; import org.apache.commons.logging.LogFactory;
/** /**
* Class that encapsulates an {@link com.netflix.turbine.discovery.InstanceDiscovery} * Class that encapsulates an {@link com.netflix.turbine.discovery.InstanceDiscovery}
...@@ -43,9 +43,10 @@ import lombok.extern.apachecommons.CommonsLog; ...@@ -43,9 +43,10 @@ import lombok.extern.apachecommons.CommonsLog;
* *
* @author Spencer Gibb * @author Spencer Gibb
*/ */
@CommonsLog
public class EurekaInstanceDiscovery extends CommonsInstanceDiscovery { public class EurekaInstanceDiscovery extends CommonsInstanceDiscovery {
private static final Log log = LogFactory.getLog(EurekaInstanceDiscovery.class);
private static final String EUREKA_DEFAULT_CLUSTER_NAME_EXPRESSION = "appName"; private static final String EUREKA_DEFAULT_CLUSTER_NAME_EXPRESSION = "appName";
private static final String ASG_KEY = "asg"; private static final String ASG_KEY = "asg";
......
...@@ -31,16 +31,18 @@ import com.netflix.turbine.monitor.cluster.AggregateClusterMonitor; ...@@ -31,16 +31,18 @@ import com.netflix.turbine.monitor.cluster.AggregateClusterMonitor;
import com.netflix.turbine.monitor.cluster.ClusterMonitor; import com.netflix.turbine.monitor.cluster.ClusterMonitor;
import com.netflix.turbine.monitor.cluster.ClusterMonitorFactory; import com.netflix.turbine.monitor.cluster.ClusterMonitorFactory;
import lombok.extern.apachecommons.CommonsLog; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static com.netflix.turbine.monitor.cluster.AggregateClusterMonitor.AggregatorClusterMonitorConsole; import static com.netflix.turbine.monitor.cluster.AggregateClusterMonitor.AggregatorClusterMonitorConsole;
/** /**
* @author Spencer Gibb * @author Spencer Gibb
*/ */
@CommonsLog
public class SpringAggregatorFactory implements ClusterMonitorFactory<AggDataFromCluster> { public class SpringAggregatorFactory implements ClusterMonitorFactory<AggDataFromCluster> {
private static final Log log = LogFactory.getLog(SpringAggregatorFactory.class);
private static final DynamicStringProperty aggClusters = DynamicPropertyFactory private static final DynamicStringProperty aggClusters = DynamicPropertyFactory
.getInstance().getStringProperty("turbine.aggregator.clusterConfig", null); .getInstance().getStringProperty("turbine.aggregator.clusterConfig", null);
......
...@@ -18,16 +18,15 @@ package org.springframework.cloud.netflix.turbine; ...@@ -18,16 +18,15 @@ package org.springframework.cloud.netflix.turbine;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Objects;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import lombok.Data;
/** /**
* @author Spencer Gibb * @author Spencer Gibb
* @author Gregor Zurowski
*/ */
@Data
@ConfigurationProperties("turbine") @ConfigurationProperties("turbine")
public class TurbineProperties { public class TurbineProperties {
...@@ -48,4 +47,53 @@ public class TurbineProperties { ...@@ -48,4 +47,53 @@ public class TurbineProperties {
} }
return null; return null;
} }
public String getClusterNameExpression() {
return clusterNameExpression;
}
public void setClusterNameExpression(String clusterNameExpression) {
this.clusterNameExpression = clusterNameExpression;
}
public String getAppConfig() {
return appConfig;
}
public void setAppConfig(String appConfig) {
this.appConfig = appConfig;
}
public boolean isCombineHostPort() {
return combineHostPort;
}
public void setCombineHostPort(boolean combineHostPort) {
this.combineHostPort = combineHostPort;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TurbineProperties that = (TurbineProperties) o;
return Objects.equals(clusterNameExpression, that.clusterNameExpression) &&
Objects.equals(appConfig, that.appConfig) &&
Objects.equals(combineHostPort, that.combineHostPort);
}
@Override
public int hashCode() {
return Objects.hash(clusterNameExpression, appConfig, combineHostPort);
}
@Override
public String toString() {
return new StringBuilder("TurbineProperties{")
.append("clusterNameExpression='").append(clusterNameExpression).append("', ")
.append("appConfig='").append(appConfig).append("', ")
.append("combineHostPort=").append(combineHostPort).append("}")
.toString();
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment