Search in sources :

Example 1 with ChildScalingRequirements

use of io.fabric8.api.ChildScalingRequirements in project fabric8 by jboss-fuse.

the class ChildAutoScaler method chooseRootContainer.

protected String chooseRootContainer(AutoScaleRequest request, List<String> containerIds) {
    ChildScalingRequirements scalingRequirements = getChildScalingRequirements(request);
    if (scalingRequirements != null) {
        List<String> rootContainerPatterns = scalingRequirements.getRootContainerPatterns();
        if (rootContainerPatterns != null && !rootContainerPatterns.isEmpty()) {
            Filter<String> filter = Filters.createStringFilters(rootContainerPatterns);
            List<String> matchingRootContainers = Filters.filter(containerIds, filter);
            return Filters.matchRandomElement(matchingRootContainers);
        }
    }
    return Filters.matchRandomElement(containerIds);
}
Also used : ChildScalingRequirements(io.fabric8.api.ChildScalingRequirements)

Example 2 with ChildScalingRequirements

use of io.fabric8.api.ChildScalingRequirements in project fabric8 by jboss-fuse.

the class ChildAutoScaler method getChildScalingRequirements.

protected ChildScalingRequirements getChildScalingRequirements(AutoScaleRequest request) {
    ChildScalingRequirements scalingRequirements = null;
    ProfileRequirements profileRequirements = request.getProfileRequirements();
    if (profileRequirements != null) {
        scalingRequirements = profileRequirements.getChildScalingRequirements();
    }
    return scalingRequirements;
}
Also used : ProfileRequirements(io.fabric8.api.ProfileRequirements) ChildScalingRequirements(io.fabric8.api.ChildScalingRequirements)

Aggregations

ChildScalingRequirements (io.fabric8.api.ChildScalingRequirements)2 ProfileRequirements (io.fabric8.api.ProfileRequirements)1