Search in sources :

Example 6 with HostSelector

use of com.spotify.helios.common.descriptors.HostSelector in project helios by spotify.

the class HostMatcherTest method group.

private static DeploymentGroup group(String... selectorStrings) {
    final List<HostSelector> selectors = new ArrayList<>();
    for (final String selectorString : selectorStrings) {
        final HostSelector selector = HostSelector.parse(selectorString);
        if (selector == null) {
            throw new IllegalArgumentException("bad selector: " + selectorString);
        }
        selectors.add(selector);
    }
    return DeploymentGroup.newBuilder().setHostSelectors(selectors).build();
}
Also used : HostSelector(com.spotify.helios.common.descriptors.HostSelector) ArrayList(java.util.ArrayList)

Aggregations

HostSelector (com.spotify.helios.common.descriptors.HostSelector)6 DeploymentGroup (com.spotify.helios.common.descriptors.DeploymentGroup)2 JobId (com.spotify.helios.common.descriptors.JobId)2 List (java.util.List)2 ExceptionMetered (com.codahale.metrics.annotation.ExceptionMetered)1 Timed (com.codahale.metrics.annotation.Timed)1 Optional (com.google.common.base.Optional)1 Strings.isNullOrEmpty (com.google.common.base.Strings.isNullOrEmpty)1 Maps (com.google.common.collect.Maps)1 Deployment (com.spotify.helios.common.descriptors.Deployment)1 HostStatus (com.spotify.helios.common.descriptors.HostStatus)1 EMPTY_TOKEN (com.spotify.helios.common.descriptors.Job.EMPTY_TOKEN)1 CreateDeploymentGroupResponse (com.spotify.helios.common.protocol.CreateDeploymentGroupResponse)1 DeploymentGroupStatusResponse (com.spotify.helios.common.protocol.DeploymentGroupStatusResponse)1 HostDeregisterResponse (com.spotify.helios.common.protocol.HostDeregisterResponse)1 HostRegisterResponse (com.spotify.helios.common.protocol.HostRegisterResponse)1 JobDeployResponse (com.spotify.helios.common.protocol.JobDeployResponse)1 JobUndeployResponse (com.spotify.helios.common.protocol.JobUndeployResponse)1 FORBIDDEN (com.spotify.helios.common.protocol.JobUndeployResponse.Status.FORBIDDEN)1 HOST_NOT_FOUND (com.spotify.helios.common.protocol.JobUndeployResponse.Status.HOST_NOT_FOUND)1