You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by an...@apache.org on 2017/09/06 10:07:53 UTC
jclouds-labs git commit: remove overrides from AzureComputeService
for destroyNode and destroyNodesMatching
Repository: jclouds-labs
Updated Branches:
refs/heads/master 85eb1fedc -> 948fa2b37
remove overrides from AzureComputeService for destroyNode and destroyNodesMatching
- uses https://github.com/jclouds/jclouds/pull/1135
Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/948fa2b3
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs/tree/948fa2b3
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs/diff/948fa2b3
Branch: refs/heads/master
Commit: 948fa2b37989499cfa71394ba570fd889fa377d1
Parents: 85eb1fe
Author: Andrea Turli <an...@gmail.com>
Authored: Wed Sep 6 11:46:10 2017 +0200
Committer: Andrea Turli <an...@gmail.com>
Committed: Wed Sep 6 12:07:17 2017 +0200
----------------------------------------------------------------------
.../arm/compute/AzureComputeService.java | 36 +++-----------------
1 file changed, 5 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/948fa2b3/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/AzureComputeService.java
----------------------------------------------------------------------
diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/AzureComputeService.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/AzureComputeService.java
index e82110a..e676460 100644
--- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/AzureComputeService.java
+++ b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/AzureComputeService.java
@@ -16,13 +16,6 @@
*/
package org.jclouds.azurecompute.arm.compute;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Sets.newHashSet;
-import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_RUNNING;
-import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_SUSPENDED;
-import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_TERMINATED;
-import static org.jclouds.compute.predicates.NodePredicates.all;
-
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -69,6 +62,10 @@ import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.util.concurrent.ListeningExecutorService;
+import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_RUNNING;
+import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_SUSPENDED;
+import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_TERMINATED;
+
@Singleton
public class AzureComputeService extends BaseComputeService {
private final CleanupResources cleanupResources;
@@ -127,28 +124,5 @@ public class AzureComputeService extends BaseComputeService {
cleanupResources.deleteResourceGroupIfEmpty(resourceGroup);
}
}
-
- @Override
- public void destroyNode(String id) {
- // Azure ARM does not return TERMINATED nodes, so in practice no node will never reach the TERMINATED
- // state, and the deleted nodes will never be returned.
- // In order to be able to clean up the resources associated to the deleted nodes, we have to retrieve
- // the details of the nodes before deleting them.
- NodeMetadata nodeMetadataBeforeDelete = getNodeMetadata(id);
- super.destroyNode(id);
- //Node metadata is null after deletion but we still need to clean up incidental resources
- cleanUpIncidentalResourcesOfDeadNodes(ImmutableSet.of(nodeMetadataBeforeDelete));
- }
-
- @Override
- public Set<? extends NodeMetadata> destroyNodesMatching(Predicate<? super NodeMetadata> filter) {
- // Azure ARM does not return TERMINATED nodes, so in practice no node will never reach the TERMINATED
- // state, and the deleted nodes will never be returned.
- // In order to be able to clean up the resources associated to the deleted nodes, we have to retrieve
- // the details of the nodes before deleting them.
- Set<? extends NodeMetadata> nodes = newHashSet(filter(listNodesDetailsMatching(all()), filter));
- super.destroyNodesMatching(filter); // This returns an empty list (a list of null elements) in Azure ARM, as the api does not return deleted nodes
- cleanUpIncidentalResourcesOfDeadNodes(nodes);
- return nodes;
- }
+
}