diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/scaling/EC2AutoScalingStrategy.java b/indexing-service/src/main/java/io/druid/indexing/overlord/scaling/EC2AutoScalingStrategy.java index ec875d0ad09..9081e7323d1 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/scaling/EC2AutoScalingStrategy.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/scaling/EC2AutoScalingStrategy.java @@ -155,32 +155,15 @@ public class EC2AutoScalingStrategy implements AutoScalingStrategy } try { - log.info("Terminating instances[%s]", instances); - amazonEC2Client.terminateInstances( - new TerminateInstancesRequest( - Lists.transform( - instances, - new Function() - { - @Override - public String apply(Instance input) - { - return input.getInstanceId(); - } - } - ) - ) - ); - - return new AutoScalingData( + return terminateWithIds( Lists.transform( - ips, - new Function() + instances, + new Function() { @Override - public String apply(@Nullable String input) + public String apply(Instance input) { - return String.format("%s:%s", input, config.getWorkerPort()); + return input.getInstanceId(); } } )