Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;

/**
* @author <a href="http://tfox.org">Tim Fox</a>
Expand All @@ -27,6 +28,8 @@ public class DefaultDeploymentManager implements DeploymentManager {

public static final Logger log = LoggerFactory.getLogger(DefaultDeploymentManager.class);

private static final AtomicLong nextId = new AtomicLong();

private final VertxImpl vertx;
private final Map<String, DeploymentContext> deploying = new HashMap<>();
private final Map<String, DeploymentContext> deployments = new ConcurrentHashMap<>();
Expand All @@ -36,7 +39,11 @@ public DefaultDeploymentManager(VertxImpl vertx) {
}

private String generateDeploymentID() {
return UUID.randomUUID().toString();
if (vertx.isClustered() && vertx.haManager()!=null) {
// in this case we need a globally unique id
return UUID.randomUUID().toString();
}
return Long.valueOf(nextId.incrementAndGet()).toString();
}

public Future<Void> undeploy(String deploymentID) {
Expand Down
Loading