<commit_before>package com.hpe.caf.autoscale.scaler.marathon;


import com.hpe.caf.api.HealthResult;
import com.hpe.caf.api.HealthStatus;
import com.hpe.caf.api.autoscale.InstanceInfo;
import com.hpe.caf.api.autoscale.ScalerException;
import com.hpe.caf.api.autoscale.ServiceHost;
import com.hpe.caf.api.autoscale.ServiceScaler;
import mesosphere.marathon.client.Marathon;
import mesosphere.marathon.client.model.v2.App;
import mesosphere.marathon.client.model.v2.GetAppResponse;
import mesosphere.marathon.client.utils.MarathonException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URL;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Objects;
import java.util.stream.Collectors;


/**
 * A MarathonServiceScaler uses a Marathon Java client library to make calls to a
 * Marathon server to trigger scaling of a service, and return information on the
 * number of instances of a configured task.
 */
public class MarathonServiceScaler extends ServiceScaler
{
    private Marathon marathon;
    private final int maximumInstances;
    private final URL url;
    private static final Logger LOG = LoggerFactory.getLogger(MarathonServiceScaler.class);


    public MarathonServiceScaler(final Marathon marathon, final int maxInstances, final URL url)
    {<commit_msg>Update to support latest caf-api 9.0 refactor<commit_after>package com.hpe.caf.autoscale.scaler.marathon;


import com.hpe.caf.api.HealthResult;
import com.hpe.caf.api.HealthStatus;
import com.hpe.caf.api.autoscale.InstanceInfo;
import com.hpe.caf.api.autoscale.ScalerException;
import com.hpe.caf.api.autoscale.ServiceHost;
import com.hpe.caf.api.autoscale.ServiceScaler;
import mesosphere.marathon.client.Marathon;
import mesosphere.marathon.client.model.v2.App;
import mesosphere.marathon.client.model.v2.GetAppResponse;
import mesosphere.marathon.client.utils.MarathonException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URL;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Objects;
import java.util.stream.Collectors;


/**
 * A MarathonServiceScaler uses a Marathon Java client library to make calls to a
 * Marathon server to trigger scaling of a service, and return information on the
 * number of instances of a configured task.
 */
public class MarathonServiceScaler implements ServiceScaler
{
    private Marathon marathon;
    private final int maximumInstances;
    private final URL url;
    private static final Logger LOG = LoggerFactory.getLogger(MarathonServiceScaler.class);


    public MarathonServiceScaler(final Marathon marathon, final int maxInstances, final URL url)
    {
{'fraction_non_alphanumeric': 0.0848229933403435, 'fraction_numerical': 0.0035050823694356818, 'mean_word_length': 5.2178649237472765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4156989', 'n_tokens_mistral': 901, 'n_tokens_neox': 865, 'n_words': 220}