mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-25 06:58:39 +00:00
bug5627: made all fields of AwsShardImpl final and initialize all in constructor
This commit is contained in:
+2
-3
@@ -352,10 +352,9 @@ implements AwsApplicationReplicaSet<ShardingKey, MetricsT, ProcessT> {
|
||||
}
|
||||
AwsShardImpl<ShardingKey> shard = new AwsShardImpl<ShardingKey>(getName(),
|
||||
Util.asList(Util.map(keys, s -> (ShardingKey) s)), e.getKey(), shardName,
|
||||
e.getKey().getLoadBalancer(), pathRules);
|
||||
shardMap.put(shard, shard.getKeys());
|
||||
shard.setAutoscalingGroup(
|
||||
e.getKey().getLoadBalancer(), pathRules,
|
||||
getShardAutoscalinggroup(e.getKey(), autoScalingGroups, launchConfigurations));
|
||||
shardMap.put(shard, shard.getKeys());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
-21
@@ -11,30 +11,26 @@ import software.amazon.awssdk.services.elasticloadbalancingv2.model.Rule;
|
||||
public class AwsShardImpl<ShardingKey> implements AwsShard<ShardingKey> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
final private Iterable<ShardingKey> keys;
|
||||
final private TargetGroup<ShardingKey> targetGroup;
|
||||
final private String shardName;
|
||||
final private String name;
|
||||
private AwsAutoScalingGroup autoScalingGroup;
|
||||
private ShardName shardNameDTO;
|
||||
private ApplicationLoadBalancer<ShardingKey> loadBalancer;
|
||||
private Iterable<Rule> rules;
|
||||
private final Iterable<ShardingKey> keys;
|
||||
private final TargetGroup<ShardingKey> targetGroup;
|
||||
private final String shardName;
|
||||
private final String name;
|
||||
private final AwsAutoScalingGroup autoScalingGroup;
|
||||
private final ShardName shardNameDTO;
|
||||
private final ApplicationLoadBalancer<ShardingKey> loadBalancer;
|
||||
private final Iterable<Rule> rules;
|
||||
|
||||
public AwsShardImpl(String shardname, Iterable<ShardingKey> keys, TargetGroup<ShardingKey> targetgroup,
|
||||
ShardName shardnameDTO, ApplicationLoadBalancer<ShardingKey> loadbalancer, Iterable<Rule> rules) {
|
||||
ShardName shardnameDTO, ApplicationLoadBalancer<ShardingKey> loadbalancer, Iterable<Rule> rules,
|
||||
AwsAutoScalingGroup asg) {
|
||||
this.keys = keys;
|
||||
this.targetGroup = targetgroup;
|
||||
this.shardName = shardname;
|
||||
this.setShardNameDTO(shardnameDTO);
|
||||
this.shardNameDTO = shardnameDTO;
|
||||
this.name = shardnameDTO.getName();
|
||||
this.loadBalancer = loadbalancer;
|
||||
this.rules =rules;
|
||||
}
|
||||
|
||||
public void setAutoscalingGroup(AwsAutoScalingGroup asg) {
|
||||
if (autoScalingGroup == null) {
|
||||
autoScalingGroup = asg;
|
||||
}
|
||||
this.autoScalingGroup = asg;
|
||||
this.rules = rules;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,10 +62,6 @@ public class AwsShardImpl<ShardingKey> implements AwsShard<ShardingKey> {
|
||||
return shardNameDTO;
|
||||
}
|
||||
|
||||
public void setShardNameDTO(ShardName shardNameDTO) {
|
||||
this.shardNameDTO = shardNameDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationLoadBalancer<ShardingKey> getLoadbalancer() {
|
||||
return loadBalancer;
|
||||
|
||||
Reference in New Issue
Block a user