From ebc66df27d612ffa2040e620437c6793397750ff Mon Sep 17 00:00:00 2001 From: fjy Date: Mon, 20 Jan 2014 16:58:53 -0800 Subject: [PATCH] use terminateWithIds in terminate --- .../scaling/EC2AutoScalingStrategy.java | 27 ++++--------------- 1 file changed, 5 insertions(+), 22 deletions(-) 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(); } } )