@Beta @ThreadSafe public class GroupPlacementStrategy extends AbstractDockerPlacementStrategy implements org.apache.brooklyn.util.core.mutex.WithMutexes
strategy that requires entities with
the same parent to use the same host and entities with a different
parent but in the same app use different hosts.
Can be configured to require exclusive use of the host with the
exclusive (docker.constraint.exclusive)
option set to true; normally false.| Modifier and Type | Field and Description |
|---|---|
static org.apache.brooklyn.config.ConfigKey<Map<String,com.google.common.util.concurrent.Monitor>> |
MONITOR_MAP |
static org.apache.brooklyn.config.ConfigKey<Boolean> |
REQUIRE_EXCLUSIVE |
static org.apache.brooklyn.config.ConfigKey<org.apache.brooklyn.util.time.Duration> |
STRATEGY_TIMEOUT |
DOCKER_INFRASTRUCTURE| Constructor and Description |
|---|
GroupPlacementStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
acquireMutex(String mutexId,
String description) |
protected com.google.common.util.concurrent.Monitor |
createMonitor(String mutexId)
Create a new
Monitor and optionally the map
for an application. |
List<DockerHostLocation> |
filterLocations(List<DockerHostLocation> locations,
org.apache.brooklyn.api.entity.Entity entity)
Filters a list of
locations to determine if the given Entity can be
deployed into a new container there. |
boolean |
hasMutex(String mutexId) |
protected com.google.common.util.concurrent.Monitor |
lookupMonitor(String mutexId)
Look up the
Monitor for an application. |
void |
releaseMutex(String mutexId) |
boolean |
tryAcquireMutex(String mutexId,
String description) |
getDockerInfrastructure, getShortName, toStringpublic static final org.apache.brooklyn.config.ConfigKey<Boolean> REQUIRE_EXCLUSIVE
public static final org.apache.brooklyn.config.ConfigKey<org.apache.brooklyn.util.time.Duration> STRATEGY_TIMEOUT
public List<DockerHostLocation> filterLocations(List<DockerHostLocation> locations, org.apache.brooklyn.api.entity.Entity entity)
DockerAwarePlacementStrategylocations to determine if the given Entity can be
deployed into a new container there.filterLocations in interface DockerAwarePlacementStrategyprotected com.google.common.util.concurrent.Monitor lookupMonitor(String mutexId)
Monitor for an application.null if the monitor has not been created yetprotected com.google.common.util.concurrent.Monitor createMonitor(String mutexId)
Monitor and optionally the map
for an application. Uses existing monitor if it already exists.map.public boolean hasMutex(String mutexId)
hasMutex in interface org.apache.brooklyn.util.core.mutex.WithMutexespublic void acquireMutex(String mutexId, String description) throws InterruptedException
acquireMutex in interface org.apache.brooklyn.util.core.mutex.WithMutexesInterruptedExceptionpublic boolean tryAcquireMutex(String mutexId, String description)
tryAcquireMutex in interface org.apache.brooklyn.util.core.mutex.WithMutexespublic void releaseMutex(String mutexId)
releaseMutex in interface org.apache.brooklyn.util.core.mutex.WithMutexesCopyright © 2012–2016 The Apache Software Foundation. All rights reserved.