<commit_before>// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.http.client.config;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;

/**
 * Parameters given to a {@link com.yahoo.vespa.http.client.SessionFactory}
 * when creating {@link com.yahoo.vespa.http.client.Session}s. The parameters
 * contained in this class are related to the connections from the node running
 * the Session to the Vespa clusters.
 * This class is immutable
 * and has no public constructor - to instantiate one, use a {@link Builder}.
 *
 * @author <NAME>
 */
public final class ConnectionParams {

    /**
     * Builder for {@link ConnectionParams}.
     */
    public static final class Builder {
        private SSLContext sslContext = null;
        private HostnameVerifier hostnameVerifier = SSLConnectionSocketFactory.getDefaultHostnameVerifier();
        private long connectionTimeout = TimeUnit.SECONDS.toMillis(60);
        private final Multimap<String, String> headers = ArrayListMultimap.create();
        private final Map<String, HeaderProvider> headerProviders = new HashMap<>();
        private int numPersistentConnectionsPerEndpoint = 4;
        private String proxyHost = null;
        private int proxyPort = 8080;
        private boolean useCompression = false;
        private int maxRetries = 100;
        private long minTimeBetweenRetriesMs = 700;
        private boolean dryRun = false;
        private int traceLevel = 0;<commit_msg>Only command line has a default of 4, programatic usage has a default of 1.<commit_after>// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.http.client.config;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;

/**
 * Parameters given to a {@link com.yahoo.vespa.http.client.SessionFactory}
 * when creating {@link com.yahoo.vespa.http.client.Session}s. The parameters
 * contained in this class are related to the connections from the node running
 * the Session to the Vespa clusters.
 * This class is immutable
 * and has no public constructor - to instantiate one, use a {@link Builder}.
 *
 * @author <NAME>
 */
public final class ConnectionParams {

    /**
     * Builder for {@link ConnectionParams}.
     */
    public static final class Builder {
        private SSLContext sslContext = null;
        private HostnameVerifier hostnameVerifier = SSLConnectionSocketFactory.getDefaultHostnameVerifier();
        private long connectionTimeout = TimeUnit.SECONDS.toMillis(60);
        private final Multimap<String, String> headers = ArrayListMultimap.create();
        private final Map<String, HeaderProvider> headerProviders = new HashMap<>();
        private int numPersistentConnectionsPerEndpoint = 1;
        private String proxyHost = null;
        private int proxyPort = 8080;
        private boolean useCompression = false;
        private int maxRetries = 100;
        private long minTimeBetweenRetriesMs = 700;
        private boolean dryRun = false;
        private int traceLevel = 0;
{'fraction_non_alphanumeric': 0.08223350253807106, 'fraction_numerical': 0.01065989847715736, 'mean_word_length': 3.853448275862069, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '263725', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1023, 'n_words': 343}