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);
}
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;
}
Aggregations