<commit_before>// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.admin;

import com.yahoo.collections.CollectionUtil;
import com.yahoo.cloud.config.ZookeepersConfig;

import java.util.ArrayList;
import java.util.List;

/**
 * @author <NAME>
 */
public class ZooKeepersConfigProvider implements ZookeepersConfig.Producer {

    public static final int zkPort = 2181;

    private final List<Configserver> configServers;

    public ZooKeepersConfigProvider(List<Configserver> configServers) {
        if (configServers == null) {
            configServers = new ArrayList<>();
        }
        this.configServers = configServers;
    }

    // format for each element: hostname:port
    public List<String> getZooKeepers() {
        List<String> servers = new ArrayList<>();
        for (Configserver server : configServers) {
            servers.add(server.getHostName() + ":" + zkPort);
        }
        return servers;
    }

    // format: hostname1:port2,hostname2:port2,...
    public String getZooKeepersConnectionSpec() {
        return CollectionUtil.mkString(getZooKeepers(), ",");
    }

    @Override
    public void getConfig(ZookeepersConfig.Builder builder) {
        builder.zookeeperserverlist(getZooKeepersConnectionSpec());
    }
}<commit_msg>Rename variable<commit_after>// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.admin;

import com.yahoo.collections.CollectionUtil;
import com.yahoo.cloud.config.ZookeepersConfig;

import java.util.ArrayList;
import java.util.List;

/**
 * @author <NAME>
 */
public class ZooKeepersConfigProvider implements ZookeepersConfig.Producer {

    public static final int zooKeeperClientPort = 2181;

    private final List<Configserver> configServers;

    public ZooKeepersConfigProvider(List<Configserver> configServers) {
        if (configServers == null) {
            configServers = new ArrayList<>();
        }
        this.configServers = configServers;
    }

    // format for each element: hostname:port
    public List<String> getZooKeepers() {
        List<String> servers = new ArrayList<>();
        for (Configserver server : configServers) {
            servers.add(server.getHostName() + ":" + zooKeeperClientPort);
        }
        return servers;
    }

    // format: hostname1:port2,hostname2:port2,...
    public String getZooKeepersConnectionSpec() {
        return CollectionUtil.mkString(getZooKeepers(), ",");
    }

    @Override
    public void getConfig(ZookeepersConfig.Builder builder) {
        builder.zookeeperserverlist(getZooKeepersConnectionSpec());
    }
}
{'fraction_non_alphanumeric': 0.10145985401459855, 'fraction_numerical': 0.0072992700729927005, 'mean_word_length': 3.350793650793651, 'pattern_counts': {'":': 2, '<': 17, '<?xml version=': 0, '>': 17, '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': '21136', 'n_tokens_mistral': 815, 'n_tokens_neox': 775, 'n_words': 181}